Ltac loadind_correct_solve :=
  match goal with
  | H: Error _ = OK _ |- _ => discriminate H
  | H: OK _ = OK _ |- _ => inv H
  | H: match ?x with _ => _ end = OK _ |- _ => destruct x eqn:?; loadind_correct_solve
  | _ => idtac
  end.

(* Specifications: *)
Lemma transl_addressing_mode_32_correct: forall addr args am (rs: regset) v, transl_addressing addr args = OK am -> eval_addressing32 ge (rs RSP) addr (List.map rs (List.map preg_of args)) = Some v -> Val.lessdef v (eval_addrmode32 ge am rs).
Lemma transl_addressing_mode_64_correct: forall addr args am (rs: regset) v, transl_addressing addr args = OK am -> eval_addressing64 ge (rs RSP) addr (List.map rs (List.map preg_of args)) = Some v -> Val.lessdef v (eval_addrmode64 ge am rs).
Lemma transl_addressing_mode_correct: forall addr args am (rs: regset) v, transl_addressing addr args = OK am -> eval_addressing ge (rs RSP) addr (List.map rs (List.map preg_of args)) = Some v -> Val.lessdef v (eval_addrmode ge am rs).
Lemma normalize_addrmode_32_correct: forall am rs, eval_addrmode32 ge (normalize_addrmode_32 am) rs = eval_addrmode32 ge am rs.
Lemma normalize_addrmode_64_correct: forall am rs, eval_addrmode64 ge am rs = match normalize_addrmode_64 am with | (am', None) => eval_addrmode64 ge am' rs | (am', Some delta) => Val.addl (eval_addrmode64 ge am' rs) (Vlong delta) end.
Lemma testcond_for_signed_comparison_32_correct: forall c v1 v2 rs m b, Val.cmp_bool c v1 v2 = Some b -> eval_testcond (testcond_for_signed_comparison c) (nextinstr (compare_ints v1 v2 rs m)) = Some b.
Lemma testcond_for_unsigned_comparison_32_correct: forall c v1 v2 rs m b, Val.cmpu_bool (Mem.valid_pointer m) c v1 v2 = Some b -> eval_testcond (testcond_for_unsigned_comparison c) (nextinstr (compare_ints v1 v2 rs m)) = Some b.
Lemma int64_sub_overflow: forall x y, Int.xor (Int.repr (Int64.unsigned (Int64.sub_overflow x y Int64.zero))) (Int.repr (Int64.unsigned (Int64.negative (Int64.sub x y)))) = (if Int64.lt x y then Int.one else Int.zero).
Lemma testcond_for_signed_comparison_64_correct: forall c v1 v2 rs m b, Val.cmpl_bool c v1 v2 = Some b -> eval_testcond (testcond_for_signed_comparison c) (nextinstr (compare_longs v1 v2 rs m)) = Some b.
Lemma testcond_for_unsigned_comparison_64_correct: forall c v1 v2 rs m b, Val.cmplu_bool (Mem.valid_pointer m) c v1 v2 = Some b -> eval_testcond (testcond_for_unsigned_comparison c) (nextinstr (compare_longs v1 v2 rs m)) = Some b.