+ let choices_compare (_,e1,_,_,m1) (_,e2,_,_,m2) = compare (e1,m1) (e2,m2) in
+ let choices_compare_by_passes (p1,_,_,_,_) (p2,_,_,_,_) = compare p1 p2 in
+ let rec uniq =
+ function
+ [] -> []
+ | h::[] -> [h]
+ | (p1,e1,_,_,_)::(p2,e2,d2,o2,m2)::tl when e1 = e2 ->
+ uniq ((p1@p2,e2,d2,o2,m2) :: tl)
+ | h1::tl -> h1 :: uniq tl
+ in
+ List.sort choices_compare_by_passes
+ (uniq (List.stable_sort choices_compare choices))