(* *********************************************************************)
(*                                                                     *)
(*              The Compcert verified compiler                         *)
(*                                                                     *)
(*                 Xavier Leroy, INRIA Paris                           *)
(*                                                                     *)
(*  Copyright Institut National de Recherche en Informatique et en     *)
(*  Automatique.  All rights reserved.  This file is distributed       *)
(*  under the terms of the INRIA Non-Commercial License Agreement.     *)
(*                                                                     *)
(* *********************************************************************)

(** Correctness proof for operator strength reduction. *)

Require Import Coqlib Compopts.
Require Import Integers Floats Values Memory Globalenvs Events.
Require Import Op Registers RTL ValueDomain.
Require Import ConstpropOp.

Section STRENGTH_REDUCTION.

Variable bc: block_classification.
Variable ge: genv.
Hypothesis GENV: genv_match bc ge.
Variable sp: block.
Hypothesis STACK: bc sp = BCstack.
Variable ae: AE.t.
Variable e: regset.
Variable m: mem.
Hypothesis MATCH: ematch bc e ae.

Lemma match_G:
  forall r id ofs,
  AE.get r ae = Ptr(Gl id ofs) -> Val.lessdef e#r (Genv.symbol_address ge id ofs).
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  intros. apply vmatch_ptr_gl with bc; auto. rewrite <- H. apply MATCH.
Qed.

Lemma match_S:
  forall r ofs,
  AE.get r ae = Ptr(Stk ofs) -> Val.lessdef e#r (Vptr sp ofs).
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  intros. apply vmatch_ptr_stk with bc; auto. rewrite <- H. apply MATCH.
Qed.

Ltac InvApproxRegs :=
  match goal with
  | [ H: _ :: _ = _ :: _ |- _ ] =>
        injection H; clear H; intros; InvApproxRegs
  | [ H: ?v = AE.get ?r ae |- _ ] =>
        generalize (MATCH r); rewrite <- H; clear H; intro; InvApproxRegs
  | _ => idtac
  end.

Ltac SimplVM :=
  match goal with
  | [ H: vmatch _ ?v (I ?n) |- _ ] =>
      let E := fresh in
      assert (E: v = Vint n) by (inversion H; auto);
      rewrite E in *; clear H; SimplVM
  | [ H: vmatch _ ?v (L ?n) |- _ ] =>
      let E := fresh in
      assert (E: v = Vlong n) by (inversion H; auto);
      rewrite E in *; clear H; SimplVM
  | [ H: vmatch _ ?v (F ?n) |- _ ] =>
      let E := fresh in
      assert (E: v = Vfloat n) by (inversion H; auto);
      rewrite E in *; clear H; SimplVM
  | [ H: vmatch _ ?v (FS ?n) |- _ ] =>
      let E := fresh in
      assert (E: v = Vsingle n) by (inversion H; auto);
      rewrite E in *; clear H; SimplVM
  | [ H: vmatch _ ?v (Ptr(Gl ?id ?ofs)) |- _ ] =>
      let E := fresh in
      assert (E: Val.lessdef v (Genv.symbol_address ge id ofs)) by (eapply vmatch_ptr_gl; eauto);
      clear H; SimplVM
  | [ H: vmatch _ ?v (Ptr(Stk ?ofs)) |- _ ] =>
      let E := fresh in
      assert (E: Val.lessdef v (Vptr sp ofs)) by (eapply vmatch_ptr_stk; eauto);
      clear H; SimplVM
  | _ => idtac
  end.

Lemma eval_Olea_ptr:
  forall a el,
  eval_operation ge (Vptr sp Ptrofs.zero) (Olea_ptr a) el m = eval_addressing ge (Vptr sp Ptrofs.zero) a el.
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  unfold Olea_ptr, eval_addressing; intros. destruct Archi.ptr64; auto.
Qed.

Lemma const_for_result_correct:
  forall a op v,
  const_for_result a = Some op ->
  vmatch bc v a ->
  exists v', eval_operation ge (Vptr sp Ptrofs.zero) op nil m = Some v' /\ Val.lessdef v v'.
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  unfold const_for_result. generalize Archi.ptr64; intros ptr64; intros.
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef v v')) *)
  destruct a; inv H; SimplVM.
- (* integer *)
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Ointconst n) (@nil val) m) (@Some val v')) (Val.lessdef (Vint n) v')) *)
  exists (Vint n); auto.
- (* long *)
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef (Vlong n) v')) *)
  destruct ptr64; inv H2. exists (Vlong n); auto.
- (* float *)
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef (Vsingle f) v')) *)
  destruct (Compopts.generate_float_constants tt); inv H2. exists (Vfloat f); auto.
- (* single *)
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef (Vsingle f) v')) *)
  destruct (Compopts.generate_float_constants tt); inv H2. exists (Vsingle f); auto.
- (* pointer *)
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef v v')) *)
  destruct p; try discriminate; SimplVM.
  + (* global *)
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef v v')) *)
    destruct (symbol_is_external id).
  * revert H2; predSpec Ptrofs.eq Ptrofs.eq_spec ofs Ptrofs.zero; intros EQ; inv EQ.
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oindirectsymbol id) (@nil val) m) (@Some val v')) (Val.lessdef v v')) *)
    exists (Genv.symbol_address ge id Ptrofs.zero); auto.
  * inv H2. exists (Genv.symbol_address ge id ofs); split.
(* Goal: @eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Olea_ptr (Ainstack ofs)) (@nil val) m) (@Some val (Vptr sp ofs)) *)
(* Goal: Val.lessdef v (Vptr sp ofs) *)
    rewrite eval_Olea_ptr. apply eval_addressing_Aglobal.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
    auto.
  + (* stack *)
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef v v')) *)
    inv H2. exists (Vptr sp ofs); split.
(* Goal: @eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Olea_ptr (Ainstack ofs)) (@nil val) m) (@Some val (Vptr sp ofs)) *)
(* Goal: Val.lessdef v (Vptr sp ofs) *)
    rewrite eval_Olea_ptr. rewrite eval_addressing_Ainstack.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
    simpl. rewrite Ptrofs.add_zero_l; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
    auto.
Qed.

Lemma cond_strength_reduction_correct:
  forall cond args vl,
  vl = map (fun r => AE.get r ae) args ->
  let (cond', args') := cond_strength_reduction cond args vl in
  eval_condition cond' e##args' m = eval_condition cond e##args m.
Proof.
(* Goal: forall (cond : condition) (args : list positive) (vl : list AVal.t) (_ : @eq (list AVal.t) vl (@map positive AVal.t (fun r : positive => AE.get r ae) args)), let (cond', args') := cond_strength_reduction cond args vl in @eq (option bool) (eval_condition cond' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (eval_condition cond (@map positive val (fun r : positive => Regmap.get val r e) args) m) *)
  intros until vl. unfold cond_strength_reduction.
(* Goal: forall _ : @eq (list AVal.t) vl (@map positive AVal.t (fun r : positive => AE.get r ae) args), let (cond', args') := match cond_strength_reduction_match cond args vl with | cond_strength_reduction_case1 c r1 r2 n1 v2 => @pair condition (list reg) (Ccompimm (swap_comparison c) n1) (@cons reg r2 (@nil reg)) | cond_strength_reduction_case2 c r1 r2 v1 n2 => @pair condition (list reg) (Ccompimm c n2) (@cons reg r1 (@nil reg)) | cond_strength_reduction_case3 c r1 r2 n1 v2 => @pair condition (list reg) (Ccompuimm (swap_comparison c) n1) (@cons reg r2 (@nil reg)) | cond_strength_reduction_case4 c r1 r2 v1 n2 => @pair condition (list reg) (Ccompuimm c n2) (@cons reg r1 (@nil reg)) | cond_strength_reduction_case5 c r1 r2 n1 v2 => @pair condition (list reg) (Ccomplimm (swap_comparison c) n1) (@cons reg r2 (@nil reg)) | cond_strength_reduction_case6 c r1 r2 v1 n2 => @pair condition (list reg) (Ccomplimm c n2) (@cons reg r1 (@nil reg)) | cond_strength_reduction_case7 c r1 r2 n1 v2 => @pair condition (list reg) (Ccompluimm (swap_comparison c) n1) (@cons reg r2 (@nil reg)) | cond_strength_reduction_case8 c r1 r2 v1 n2 => @pair condition (list reg) (Ccompluimm c n2) (@cons reg r1 (@nil reg)) | cond_strength_reduction_default cond args vl => @pair condition (list reg) cond args end in @eq (option bool) (eval_condition cond' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (eval_condition cond (@map positive val (fun r : positive => Regmap.get val r e) args) m) *)
  case (cond_strength_reduction_match cond args vl); simpl; intros; InvApproxRegs; SimplVM.
- apply Val.swap_cmp_bool.
- auto.
- apply Val.swap_cmpu_bool.
- auto.
- apply Val.swap_cmpl_bool.
- auto.
- apply Val.swap_cmplu_bool.
- auto.
- auto.
Qed.

Lemma addr_strength_reduction_32_generic_correct:
  forall addr args vl res,
  vl = map (fun r => AE.get r ae) args ->
  eval_addressing32 ge (Vptr sp Ptrofs.zero) addr e##args = Some res ->
  let (addr', args') := addr_strength_reduction_32_generic addr args vl in
  exists res', eval_addressing32 ge (Vptr sp Ptrofs.zero) addr' e##args' = Some res' /\ Val.lessdef res res'.
Proof.
Local Opaque Val.add.
  assert (A: forall x y, Int.repr (Int.signed x + y) = Int.add x (Int.repr y)).
  { intros; apply Int.eqm_samerepr; auto using Int.eqm_signed_unsigned with ints. }
  assert (B: forall x y z, Int.repr (Int.signed x * y + z) = Int.add (Int.mul x (Int.repr y)) (Int.repr z)).
  { intros; apply Int.eqm_samerepr; apply Int.eqm_add; auto with ints.
    unfold Int.mul; auto using Int.eqm_signed_unsigned with ints. }
  intros until res; intros VL EA.
  unfold addr_strength_reduction_32_generic; destruct (addr_strength_reduction_32_generic_match addr args vl);
  simpl in *; InvApproxRegs; SimplVM; try (inv EA).
- econstructor; split; eauto. rewrite A, Val.add_assoc, Val.add_permut. auto.
- econstructor; split; eauto. rewrite A, Val.add_assoc. auto.
- Local Transparent Val.add.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. simpl. rewrite B. auto.
- econstructor; split; eauto. rewrite A, Val.add_permut. auto.
- exists res; auto.
Qed.

Lemma addr_strength_reduction_32_correct:
  forall addr args vl res,
  vl = map (fun r => AE.get r ae) args ->
  eval_addressing32 ge (Vptr sp Ptrofs.zero) addr e##args = Some res ->
  let (addr', args') := addr_strength_reduction_32 addr args vl in
  exists res', eval_addressing32 ge (Vptr sp Ptrofs.zero) addr' e##args' = Some res' /\ Val.lessdef res res'.
Proof.
  intros until res; intros VL EA. unfold addr_strength_reduction_32.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct Archi.ptr64 eqn:SF. apply addr_strength_reduction_32_generic_correct; auto.
  assert (A: forall n, Ptrofs.of_int (Int.repr n) = Ptrofs.repr n) by auto with ptrofs.
  assert (B: forall symb ofs n,
             Genv.symbol_address ge symb (Ptrofs.add ofs (Ptrofs.repr n)) =
             Val.add (Genv.symbol_address ge symb ofs) (Vint (Int.repr n))).
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  { intros. rewrite <- A. apply Genv.shift_symbol_address_32; auto. }
Local Opaque Val.add.
  destruct (addr_strength_reduction_32_match addr args vl);
  simpl in *; InvApproxRegs; SimplVM; FuncInv; subst; rewrite ?SF.
- econstructor; split; eauto. rewrite B. apply Val.add_lessdef; auto.
- econstructor; split; eauto. rewrite Ptrofs.add_zero_l.
Local Transparent Val.add.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv H0; auto. rewrite H2. simpl; rewrite SF, A. auto.
- econstructor; split; eauto.
  unfold Ptrofs.add at 2. rewrite B.
  fold (Ptrofs.add n1 (Ptrofs.of_int n2)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Genv.shift_symbol_address_32 by auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite ! Val.add_assoc. apply Val.add_lessdef; auto.
- econstructor; split; eauto.
  unfold Ptrofs.add at 2. rewrite B.
  fold (Ptrofs.add n2 (Ptrofs.of_int n1)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Genv.shift_symbol_address_32 by auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite ! Val.add_assoc. rewrite Val.add_permut. apply Val.add_lessdef; auto.
- econstructor; split; eauto. rewrite Ptrofs.add_zero_l. rewrite Val.add_assoc.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  eapply Val.lessdef_trans. apply Val.add_lessdef; eauto.
(* Goal: @eq val (Val.andl (Vlong i0) (Vlong (Int64.sub n Int64.one))) (Vlong (Int64.modu i0 n)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) Omodlu (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r1 (@cons reg r2 (@nil reg)))) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. rewrite SF. rewrite Ptrofs.add_assoc. apply Val.lessdef_same; do 3 f_equal. auto with ptrofs.
- econstructor; split; eauto. rewrite Ptrofs.add_zero_l. rewrite Val.add_assoc, Val.add_permut.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  eapply Val.lessdef_trans. apply Val.add_lessdef; eauto.
  simpl. rewrite SF. rewrite <- (Ptrofs.add_commut n2). rewrite Ptrofs.add_assoc.
  apply Val.lessdef_same; do 3 f_equal. auto with ptrofs.
- econstructor; split; eauto. rewrite B. rewrite ! Val.add_assoc. rewrite (Val.add_commut (Vint (Int.repr ofs))).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply Val.add_lessdef; auto.
- econstructor; split; eauto. rewrite B. rewrite (Val.add_commut e#r1). rewrite ! Val.add_assoc.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite (Val.add_commut (Vint (Int.repr ofs))). apply Val.add_lessdef; auto.
- econstructor; split; eauto. rewrite B. rewrite Genv.shift_symbol_address_32 by auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite ! Val.add_assoc. apply Val.add_lessdef; auto.
- econstructor; split; eauto. rewrite B. rewrite ! Val.add_assoc.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite (Val.add_commut (Vint (Int.repr ofs))). apply Val.add_lessdef; auto.
- econstructor; split; eauto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Genv.shift_symbol_address_32 by auto. auto.
- econstructor; split; eauto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Genv.shift_symbol_address_32 by auto. auto.
- apply addr_strength_reduction_32_generic_correct; auto.
Qed.

Lemma addr_strength_reduction_64_generic_correct:
  forall addr args vl res,
  vl = map (fun r => AE.get r ae) args ->
  eval_addressing64 ge (Vptr sp Ptrofs.zero) addr e##args = Some res ->
  let (addr', args') := addr_strength_reduction_64_generic addr args vl in
  exists res', eval_addressing64 ge (Vptr sp Ptrofs.zero) addr' e##args' = Some res' /\ Val.lessdef res res'.
Proof.
Local Opaque Val.addl.
  assert (A: forall x y, Int64.repr (Int64.signed x + y) = Int64.add x (Int64.repr y)).
  { intros; apply Int64.eqm_samerepr; auto using Int64.eqm_signed_unsigned with ints. }
  assert (B: forall x y z, Int64.repr (Int64.signed x * y + z) = Int64.add (Int64.mul x (Int64.repr y)) (Int64.repr z)).
  { intros; apply Int64.eqm_samerepr; apply Int64.eqm_add; auto with ints.
    unfold Int64.mul; auto using Int64.eqm_signed_unsigned with ints. }
  intros until res; intros VL EA.
  unfold addr_strength_reduction_64_generic; destruct (addr_strength_reduction_64_generic_match addr args vl);
  simpl in *; InvApproxRegs; SimplVM; try (inv EA).
- econstructor; split; eauto. rewrite A, Val.addl_assoc, Val.addl_permut. auto.
- econstructor; split; eauto. rewrite A, Val.addl_assoc. auto.
- Local Transparent Val.addl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. simpl. rewrite B. auto.
- econstructor; split; eauto. rewrite A, Val.addl_permut. auto.
- exists res; auto.
Qed.

Lemma addr_strength_reduction_64_correct:
  forall addr args vl res,
  vl = map (fun r => AE.get r ae) args ->
  eval_addressing64 ge (Vptr sp Ptrofs.zero) addr e##args = Some res ->
  let (addr', args') := addr_strength_reduction_64 addr args vl in
  exists res', eval_addressing64 ge (Vptr sp Ptrofs.zero) addr' e##args' = Some res' /\ Val.lessdef res res'.
Proof.
  intros until res; intros VL EA. unfold addr_strength_reduction_64.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (negb Archi.ptr64) eqn:SF. apply addr_strength_reduction_64_generic_correct; auto.
  rewrite negb_false_iff in SF.
(* Goal: @eq Ptrofs.int (Ptrofs.of_int64 (Int64.neg n2)) (Ptrofs.neg (Ptrofs.of_int64 n2)) *)
(* Goal: @eq val (Vlong (Int64.add i (Int64.neg n2))) (Vlong (Int64.sub i n2)) *)
(* Goal: let (op', args') := make_mullimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mullimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_modluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n1 r2 v2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n2 r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shllimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := let (addr', args') := addr_strength_reduction_64 addr args0 vl0 in @pair operation (list reg) (Oleal addr') args' in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  assert (A: forall n, Ptrofs.of_int64 (Int64.repr n) = Ptrofs.repr n) by auto with ptrofs.
  assert (B: forall symb ofs n,
             Genv.symbol_address ge symb (Ptrofs.add ofs (Ptrofs.repr n)) =
             Val.addl (Genv.symbol_address ge symb ofs) (Vlong (Int64.repr n))).
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  { intros. rewrite <- A. apply Genv.shift_symbol_address_64; auto. }
Local Opaque Val.addl.
  destruct (addr_strength_reduction_64_match addr args vl);
  simpl in *; InvApproxRegs; SimplVM; FuncInv; subst; rewrite ?SF.
- econstructor; split; eauto. rewrite B. apply Val.addl_lessdef; auto.
- econstructor; split; eauto. rewrite Ptrofs.add_zero_l.
Local Transparent Val.addl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv H0; auto. rewrite H2. simpl; rewrite SF, A. auto.
- econstructor; split; eauto.
  unfold Ptrofs.add at 2. rewrite B.
  fold (Ptrofs.add n1 (Ptrofs.of_int64 n2)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Genv.shift_symbol_address_64 by auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite ! Val.addl_assoc. apply Val.addl_lessdef; auto.
- econstructor; split; eauto.
  unfold Ptrofs.add at 2. rewrite B.
  fold (Ptrofs.add n2 (Ptrofs.of_int64 n1)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Genv.shift_symbol_address_64 by auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite ! Val.addl_assoc. rewrite Val.addl_permut. apply Val.addl_lessdef; auto.
- econstructor; split; eauto. rewrite Ptrofs.add_zero_l. rewrite Val.addl_assoc.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  eapply Val.lessdef_trans. apply Val.addl_lessdef; eauto.
(* Goal: @eq val (Val.andl (Vlong i0) (Vlong (Int64.sub n Int64.one))) (Vlong (Int64.modu i0 n)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) Omodlu (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r1 (@cons reg r2 (@nil reg)))) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. rewrite SF. rewrite Ptrofs.add_assoc. apply Val.lessdef_same; do 3 f_equal. auto with ptrofs.
- econstructor; split; eauto. rewrite Ptrofs.add_zero_l. rewrite Val.addl_assoc, Val.addl_permut.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  eapply Val.lessdef_trans. apply Val.addl_lessdef; eauto.
  simpl. rewrite SF. rewrite <- (Ptrofs.add_commut n2). rewrite Ptrofs.add_assoc.
  apply Val.lessdef_same; do 3 f_equal. auto with ptrofs.
- econstructor; split; eauto. rewrite B. rewrite Genv.shift_symbol_address_64 by auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite ! Val.addl_assoc. apply Val.addl_lessdef; auto.
- apply addr_strength_reduction_64_generic_correct; auto.
Qed.

Lemma addr_strength_reduction_correct:
  forall addr args vl res,
  vl = map (fun r => AE.get r ae) args ->
  eval_addressing ge (Vptr sp Ptrofs.zero) addr e##args = Some res ->
  let (addr', args') := addr_strength_reduction addr args vl in
  exists res', eval_addressing ge (Vptr sp Ptrofs.zero) addr' e##args' = Some res' /\ Val.lessdef res res'.
Proof.
(* Goal: forall (addr : addressing) (args : list positive) (vl : list AVal.t) (res : val) (_ : @eq (list AVal.t) vl (@map positive AVal.t (fun r : positive => AE.get r ae) args)) (_ : @eq (option val) (@eval_addressing fundef unit ge (Vptr sp Ptrofs.zero) addr (@map positive val (fun r : positive => Regmap.get val r e) args)) (@Some val res)), let (addr', args') := addr_strength_reduction addr args vl in @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef res res')) *)
  intros until res. unfold addr_strength_reduction.
  set (aa := if Archi.ptr64
         then addr_strength_reduction_64 addr args vl
         else addr_strength_reduction_32 addr args vl).
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  intros.
(* Goal: let (addr', args') := if addressing_valid (@fst addressing (list reg) aa) then aa else @pair addressing (list reg) addr args in @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef res res')) *)
  destruct (addressing_valid (fst aa)).
- unfold aa, eval_addressing in *. destruct Archi.ptr64.
+ apply addr_strength_reduction_64_correct; auto.
+ apply addr_strength_reduction_32_correct; auto.
- exists res; auto.
Qed.

Lemma make_cmp_base_correct:
  forall c args vl,
  vl = map (fun r => AE.get r ae) args ->
  let (op', args') := make_cmp_base c args vl in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op' e##args' m = Some v
         /\ Val.lessdef (Val.of_optbool (eval_condition c e##args m)) v.
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  intros. unfold make_cmp_base.
  generalize (cond_strength_reduction_correct c args vl H).
  destruct (cond_strength_reduction c args vl) as [c' args']. intros EQ.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl; eauto. rewrite EQ. auto.
Qed.

Lemma make_cmp_correct:
  forall c args vl,
  vl = map (fun r => AE.get r ae) args ->
  let (op', args') := make_cmp c args vl in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op' e##args' m = Some v
         /\ Val.lessdef (Val.of_optbool (eval_condition c e##args m)) v.
Proof.
  intros c args vl.
  assert (Y: forall r, vincl (AE.get r ae) (Uns Ptop 1) = true ->
             e#r = Vundef \/ e#r = Vint Int.zero \/ e#r = Vint Int.one).
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  { intros. apply vmatch_Uns_1 with bc Ptop. eapply vmatch_ge. eapply vincl_ge; eauto. apply MATCH. }
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  unfold make_cmp. case (make_cmp_match c args vl); intros.
- unfold make_cmp_imm_eq.
  destruct (Int.eq_dec n Int.one && vincl v1 (Uns Ptop 1)) eqn:E1.
+ simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
+ destruct (Int.eq_dec n Int.zero && vincl v1 (Uns Ptop 1)) eqn:E0.
* simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Val.xor e#r1 (Vint Int.one)); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
* apply make_cmp_base_correct; auto.
- unfold make_cmp_imm_ne.
  destruct (Int.eq_dec n Int.zero && vincl v1 (Uns Ptop 1)) eqn:E0.
+ simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
+ destruct (Int.eq_dec n Int.one && vincl v1 (Uns Ptop 1)) eqn:E1.
* simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Val.xor e#r1 (Vint Int.one)); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
* apply make_cmp_base_correct; auto.
- unfold make_cmp_imm_eq.
  destruct (Int.eq_dec n Int.one && vincl v1 (Uns Ptop 1)) eqn:E1.
+ simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
+ destruct (Int.eq_dec n Int.zero && vincl v1 (Uns Ptop 1)) eqn:E0.
* simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Val.xor e#r1 (Vint Int.one)); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
* apply make_cmp_base_correct; auto.
- unfold make_cmp_imm_ne.
  destruct (Int.eq_dec n Int.zero && vincl v1 (Uns Ptop 1)) eqn:E0.
+ simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
+ destruct (Int.eq_dec n Int.one && vincl v1 (Uns Ptop 1)) eqn:E1.
* simpl in H; inv H. InvBooleans. subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Val.xor e#r1 (Vint Int.one)); split; auto. simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit Y; eauto. intros [A | [A | A]]; rewrite A; simpl; auto.
* apply make_cmp_base_correct; auto.
- apply make_cmp_base_correct; auto.
Qed.

Lemma make_addimm_correct:
  forall n r,
  let (op, args) := make_addimm n r in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.add e#r (Vint n)) v.
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  intros. unfold make_addimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst. exists (e#r); split; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (e#r); simpl; auto; rewrite ?Int.add_zero, ?Ptrofs.add_zero; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Val.add e#r (Vint n)); split; auto. simpl. rewrite Int.repr_signed; auto.
Qed.

Lemma make_shlimm_correct:
  forall n r1 r2,
  e#r2 = Vint n ->
  let (op, args) := make_shlimm n r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.shl e#r1 (Vint n)) v.
Proof.
  intros; unfold make_shlimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto. rewrite Int.shl_zero. auto.
  destruct (Int.ltu n Int.iwordsize).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. rewrite H; auto.
Qed.

Lemma make_shrimm_correct:
  forall n r1 r2,
  e#r2 = Vint n ->
  let (op, args) := make_shrimm n r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.shr e#r1 (Vint n)) v.
Proof.
  intros; unfold make_shrimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto. rewrite Int.shr_zero. auto.
  destruct (Int.ltu n Int.iwordsize).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. rewrite H; auto.
Qed.

Lemma make_shruimm_correct:
  forall n r1 r2,
  e#r2 = Vint n ->
  let (op, args) := make_shruimm n r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.shru e#r1 (Vint n)) v.
Proof.
  intros; unfold make_shruimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto. rewrite Int.shru_zero. auto.
  destruct (Int.ltu n Int.iwordsize).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. rewrite H; auto.
Qed.

Lemma make_mulimm_correct:
  forall n r1,
  let (op, args) := make_mulimm n r1 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.mul e#r1 (Vint n)) v.
Proof.
  intros; unfold make_mulimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Vint Int.zero); split; auto. destruct (e#r1); simpl; auto. rewrite Int.mul_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.one; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto. rewrite Int.mul_one; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  destruct (Int.is_power2 n) eqn:?; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite (Val.mul_pow2 e#r1 _ _ Heqo). econstructor; split. simpl; eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_divimm_correct:
  forall n r1 r2 v,
  Val.divs e#r1 e#r2 = Some v ->
  e#r2 = Vint n ->
  let (op, args) := make_divimm n r1 r2 in
  exists w, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some w /\ Val.lessdef v w.
Proof.
(* Goal: forall (n : Int.int) (r1 r2 : positive) (v : val) (_ : @eq (option val) (Val.divs (Regmap.get val r1 e) (Regmap.get val r2 e)) (@Some val v)) (_ : @eq val (Regmap.get val r2 e) (Vint n)), let (op, args) := make_divimm n r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
  intros; unfold make_divimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.one; intros. subst. rewrite H0 in H.
  destruct (e#r1) eqn:?;
    try (rewrite Val.divs_one in H; exists (Vint i); split; simpl; try rewrite Heqv0; auto);
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
    inv H; auto.
(* Goal: let (op, args) := match Int.is_power2 n with | Some l => @pair operation (list reg) (Oandimm (Int.sub n Int.one)) (@cons reg r1 (@nil reg)) | None => @pair operation (list reg) Omodu (@cons reg r1 (@cons reg r2 (@nil reg))) end in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (Int.is_power2 n) eqn:?.
(* Goal: let (op, args) := if Int.ltu i (Int.repr (Zpos (xI (xI (xI (xI xH)))))) then @pair operation (list reg) (Oshrximm i) (@cons reg r1 (@nil reg)) else @pair operation (list reg) Odiv (@cons reg r1 (@cons reg r2 (@nil reg))) in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) Odiv (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r1 (@cons reg r2 (@nil reg)))) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (Int.ltu i (Int.repr 31)) eqn:?.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; split; auto. simpl. eapply Val.divs_pow2; eauto. congruence.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
Qed.

Lemma make_divuimm_correct:
  forall n r1 r2 v,
  Val.divu e#r1 e#r2 = Some v ->
  e#r2 = Vint n ->
  let (op, args) := make_divuimm n r1 r2 in
  exists w, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some w /\ Val.lessdef v w.
Proof.
  intros; unfold make_divuimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.one; intros. subst. rewrite H0 in H.
  destruct (e#r1) eqn:?;
    try (rewrite Val.divu_one in H; exists (Vint i); split; simpl; try rewrite Heqv0; auto);
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
    inv H; auto.
(* Goal: let (op, args) := match Int.is_power2 n with | Some l => @pair operation (list reg) (Oandimm (Int.sub n Int.one)) (@cons reg r1 (@nil reg)) | None => @pair operation (list reg) Omodu (@cons reg r1 (@cons reg r2 (@nil reg))) end in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (Int.is_power2 n) eqn:?.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl; eauto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite H0 in H. erewrite Val.divu_pow2 by eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
Qed.

Lemma make_moduimm_correct:
  forall n r1 r2 v,
  Val.modu e#r1 e#r2 = Some v ->
  e#r2 = Vint n ->
  let (op, args) := make_moduimm n r1 r2 in
  exists w, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some w /\ Val.lessdef v w.
Proof.
(* Goal: forall (n : Int.int) (r1 r2 : positive) (v : val) (_ : @eq (option val) (Val.modu (Regmap.get val r1 e) (Regmap.get val r2 e)) (@Some val v)) (_ : @eq val (Regmap.get val r2 e) (Vint n)), let (op, args) := make_moduimm n r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
  intros; unfold make_moduimm.
(* Goal: let (op, args) := match Int.is_power2 n with | Some l => @pair operation (list reg) (Oandimm (Int.sub n Int.one)) (@cons reg r1 (@nil reg)) | None => @pair operation (list reg) Omodu (@cons reg r1 (@cons reg r2 (@nil reg))) end in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (Int.is_power2 n) eqn:?.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; split; auto. simpl. decEq. eapply Val.modu_pow2; eauto. congruence.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
Qed.

Lemma make_andimm_correct:
  forall n r x,
  vmatch bc e#r x ->
  let (op, args) := make_andimm n r x in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.and e#r (Vint n)) v.
Proof.
(* Goal: forall (n : Int.int) (r : positive) (x : aval) (_ : vmatch bc (Regmap.get val r e) x), let (op, args) := make_andimm n r x in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.and (Regmap.get val r e) (Vint n)) v)) *)
  intros; unfold make_andimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (Vint Int.zero); split; auto. destruct (e#r); simpl; auto. rewrite Int.and_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.mone; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (e#r); split; auto. destruct (e#r); simpl; auto. rewrite Int.and_mone; auto.
  destruct (match x with Uns _ k => Int.eq (Int.zero_ext k (Int.not n)) Int.zero
                       | _ => false end) eqn:UNS.
(* Goal: @eq (option val) (Val.modu (Regmap.get val r1 e) (Vint n)) (@Some val v) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) Omodu (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r1 (@cons reg r2 (@nil reg)))) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct x; try congruence.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r); split; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv H; auto. simpl. replace (Int.and i n) with i; auto.
(* Goal: @eq Int.int i (Int.and i n) *)
(* Goal: @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oandimm n) (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r (@nil reg))) m) (@Some val v)) (Val.lessdef (Val.and (Regmap.get val r e) (Vint n)) v)) *)
  generalize (Int.eq_spec (Int.zero_ext n0 (Int.not n)) Int.zero); rewrite UNS; intro EQ.
(* Goal: @eq Int.int i (Int.and i n) *)
(* Goal: @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oandimm n) (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r (@nil reg))) m) (@Some val v)) (Val.lessdef (Val.and (Regmap.get val r e) (Vint n)) v)) *)
  Int.bit_solve. destruct (zlt i0 n0).
(* Goal: @eq bool (Int.testbit i i0) (andb (Int.testbit i i0) (Int.testbit n i0)) *)
(* Goal: @eq bool (Int.testbit i i0) (andb (Int.testbit i i0) (Int.testbit n i0)) *)
(* Goal: @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oandimm n) (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r (@nil reg))) m) (@Some val v)) (Val.lessdef (Val.and (Regmap.get val r e) (Vint n)) v)) *)
  replace (Int.testbit n i0) with (negb (Int.testbit Int.zero i0)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Int.bits_zero. simpl. rewrite andb_true_r. auto.
  rewrite <- EQ. rewrite Int.bits_zero_ext by omega. rewrite zlt_true by auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Int.bits_not by auto. apply negb_involutive.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite H6 by auto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_orimm_correct:
  forall n r,
  let (op, args) := make_orimm n r in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.or e#r (Vint n)) v.
Proof.
(* Goal: forall (n : Int.int) (r : reg), let (op, args) := make_orimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.or (Regmap.get val r e) (Vint n)) v)) *)
  intros; unfold make_orimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (e#r); split; auto. destruct (e#r); simpl; auto. rewrite Int.or_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.mone; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (Vint Int.mone); split; auto. destruct (e#r); simpl; auto. rewrite Int.or_mone; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_xorimm_correct:
  forall n r,
  let (op, args) := make_xorimm n r in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.xor e#r (Vint n)) v.
Proof.
(* Goal: forall (n : Int.int) (r : reg), let (op, args) := make_xorimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.xor (Regmap.get val r e) (Vint n)) v)) *)
  intros; unfold make_xorimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (e#r); split; auto. destruct (e#r); simpl; auto. rewrite Int.xor_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.mone; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (Val.notint e#r); split; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_addlimm_correct:
  forall n r,
  let (op, args) := make_addlimm n r in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.addl e#r (Vlong n)) v.
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  intros. unfold make_addlimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst. exists (e#r); split; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (e#r); simpl; auto; rewrite ? Int64.add_zero, ? Ptrofs.add_zero; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Val.addl e#r (Vlong n)); split; auto. simpl. rewrite Int64.repr_signed; auto.
Qed.

Lemma make_shllimm_correct:
  forall n r1 r2,
  e#r2 = Vint n ->
  let (op, args) := make_shllimm n r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.shll e#r1 (Vint n)) v.
Proof.
  intros; unfold make_shllimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  unfold Int64.shl'. rewrite Z.shiftl_0_r, Int64.repr_unsigned. auto.
  destruct (Int.ltu n Int64.iwordsize').
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. rewrite H; auto.
Qed.

Lemma make_shrlimm_correct:
  forall n r1 r2,
  e#r2 = Vint n ->
  let (op, args) := make_shrlimm n r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.shrl e#r1 (Vint n)) v.
Proof.
  intros; unfold make_shrlimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  unfold Int64.shr'. rewrite Z.shiftr_0_r, Int64.repr_signed. auto.
  destruct (Int.ltu n Int64.iwordsize').
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. rewrite H; auto.
Qed.

Lemma make_shrluimm_correct:
  forall n r1 r2,
  e#r2 = Vint n ->
  let (op, args) := make_shrluimm n r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.shrlu e#r1 (Vint n)) v.
Proof.
  intros; unfold make_shrluimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int.eq Int.eq_spec n Int.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  unfold Int64.shru'. rewrite Z.shiftr_0_r, Int64.repr_unsigned. auto.
  destruct (Int.ltu n Int64.iwordsize').
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl. eauto. rewrite H; auto.
Qed.

Lemma make_mullimm_correct:
  forall n r1,
  let (op, args) := make_mullimm n r1 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.mull e#r1 (Vlong n)) v.
Proof.
(* Goal: forall (n : Int64.int) (r1 : reg), let (op, args) := make_mullimm n r1 in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val v)) (Val.lessdef (Val.mull (Regmap.get val r1 e) (Vlong n)) v)) *)
  intros; unfold make_mullimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.zero; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Vlong Int64.zero); split; auto. destruct (e#r1); simpl; auto. rewrite Int64.mul_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.one; intros. subst.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (e#r1); split; auto. destruct (e#r1); simpl; auto. rewrite Int64.mul_one; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  destruct (Int64.is_power2' n) eqn:?; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists (Val.shll e#r1 (Vint i)); split; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (e#r1); simpl; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  erewrite Int64.is_power2'_range by eauto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  erewrite Int64.mul_pow2' by eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_divlimm_correct:
  forall n r1 r2 v,
  Val.divls e#r1 e#r2 = Some v ->
  e#r2 = Vlong n ->
  let (op, args) := make_divlimm n r1 r2 in
  exists w, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some w /\ Val.lessdef v w.
Proof.
  intros; unfold make_divlimm.
  destruct (Int64.is_power2' n) eqn:?. destruct (Int.ltu i (Int.repr 63)) eqn:?.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite H0 in H. econstructor; split. simpl; eauto. eapply Val.divls_pow2; eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
Qed.

Lemma make_divluimm_correct:
  forall n r1 r2 v,
  Val.divlu e#r1 e#r2 = Some v ->
  e#r2 = Vlong n ->
  let (op, args) := make_divluimm n r1 r2 in
  exists w, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some w /\ Val.lessdef v w.
Proof.
  intros; unfold make_divluimm.
  destruct (Int64.is_power2' n) eqn:?.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split. simpl; eauto.
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef v v')) *)
  rewrite H0 in H. destruct (e#r1); inv H. destruct (Int64.eq n Int64.zero); inv H2.
(* Goal: @eq val (Val.andl (Vlong i0) (Vlong (Int64.sub n Int64.one))) (Vlong (Int64.modu i0 n)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) Omodlu (@map positive val (fun r : positive => Regmap.get val r e) (@cons reg r1 (@cons reg r2 (@nil reg)))) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  erewrite Int64.is_power2'_range by eauto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  erewrite Int64.divu_pow2' by eauto.  auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
Qed.

Lemma make_modluimm_correct:
  forall n r1 r2 v,
  Val.modlu e#r1 e#r2 = Some v ->
  e#r2 = Vlong n ->
  let (op, args) := make_modluimm n r1 r2 in
  exists w, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some w /\ Val.lessdef v w.
Proof.
(* Goal: forall (n : Int64.int) (r1 r2 : positive) (v : val) (_ : @eq (option val) (Val.modlu (Regmap.get val r1 e) (Regmap.get val r2 e)) (@Some val v)) (_ : @eq val (Regmap.get val r2 e) (Vlong n)), let (op, args) := make_modluimm n r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
  intros; unfold make_modluimm.
(* Goal: let (op, args) := match Int64.is_power2 n with | Some l => @pair operation (list reg) (Oandlimm (Int64.sub n Int64.one)) (@cons reg r1 (@nil reg)) | None => @pair operation (list reg) Omodlu (@cons reg r1 (@cons reg r2 (@nil reg))) end in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r : positive => Regmap.get val r e) args) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (Int64.is_power2 n) eqn:?.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; split; auto. simpl. decEq.
(* Goal: @ex val (fun v' : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@nil val) m) (@Some val v')) (Val.lessdef v v')) *)
  rewrite H0 in H. destruct (e#r1); inv H. destruct (Int64.eq n Int64.zero); inv H2.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. erewrite Int64.modu_and by eauto. auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
Qed.

Lemma make_andlimm_correct:
  forall n r x,
  let (op, args) := make_andlimm n r x in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.andl e#r (Vlong n)) v.
Proof.
(* Goal: forall (n : Int64.int) (r : reg) (x : aval), let (op, args) := make_andlimm n r x in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.andl (Regmap.get val r e) (Vlong n)) v)) *)
  intros; unfold make_andlimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (Vlong Int64.zero); split; auto. destruct (e#r); simpl; auto. rewrite Int64.and_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.mone; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (e#r); split; auto. destruct (e#r); simpl; auto. rewrite Int64.and_mone; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_orlimm_correct:
  forall n r,
  let (op, args) := make_orlimm n r in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.orl e#r (Vlong n)) v.
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_orlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.orl (Regmap.get val r e) (Vlong n)) v)) *)
  intros; unfold make_orlimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (e#r); split; auto. destruct (e#r); simpl; auto. rewrite Int64.or_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.mone; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (Vlong Int64.mone); split; auto. destruct (e#r); simpl; auto. rewrite Int64.or_mone; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_xorlimm_correct:
  forall n r,
  let (op, args) := make_xorlimm n r in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.xorl e#r (Vlong n)) v.
Proof.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_xorlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.xorl (Regmap.get val r e) (Vlong n)) v)) *)
  intros; unfold make_xorlimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.zero; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (e#r); split; auto. destruct (e#r); simpl; auto. rewrite Int64.xor_zero; auto.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  predSpec Int64.eq Int64.eq_spec n Int64.mone; intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  subst n. exists (Val.notl e#r); split; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; eauto. auto.
Qed.

Lemma make_mulfimm_correct:
  forall n r1 r2,
  e#r2 = Vfloat n ->
  let (op, args) := make_mulfimm n r1 r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.mulf e#r1 e#r2) v.
Proof.
  intros; unfold make_mulfimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  destruct (Float.eq_dec n (Float.of_int (Int.repr 2))); intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split. eauto. rewrite H; subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (e#r1); simpl; auto. rewrite Float.mul2_add; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split; eauto.
Qed.

Lemma make_mulfimm_correct_2:
  forall n r1 r2,
  e#r1 = Vfloat n ->
  let (op, args) := make_mulfimm n r2 r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.mulf e#r1 e#r2) v.
Proof.
  intros; unfold make_mulfimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  destruct (Float.eq_dec n (Float.of_int (Int.repr 2))); intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split. eauto. rewrite H; subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (e#r2); simpl; auto. rewrite Float.mul2_add; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Float.mul_commut; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split; eauto.
Qed.

Lemma make_mulfsimm_correct:
  forall n r1 r2,
  e#r2 = Vsingle n ->
  let (op, args) := make_mulfsimm n r1 r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.mulfs e#r1 e#r2) v.
Proof.
  intros; unfold make_mulfsimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  destruct (Float32.eq_dec n (Float32.of_int (Int.repr 2))); intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split. eauto. rewrite H; subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (e#r1); simpl; auto. rewrite Float32.mul2_add; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split; eauto.
Qed.

Lemma make_mulfsimm_correct_2:
  forall n r1 r2,
  e#r1 = Vsingle n ->
  let (op, args) := make_mulfsimm n r2 r1 r2 in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.mulfs e#r1 e#r2) v.
Proof.
  intros; unfold make_mulfsimm.
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  destruct (Float32.eq_dec n (Float32.of_int (Int.repr 2))); intros.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split. eauto. rewrite H; subst n.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (e#r2); simpl; auto. rewrite Float32.mul2_add; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Float32.mul_commut; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  simpl. econstructor; split; eauto.
Qed.

Lemma make_cast8signed_correct:
  forall r x,
  vmatch bc e#r x ->
  let (op, args) := make_cast8signed r x in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.sign_ext 8 e#r) v.
Proof.
  intros; unfold make_cast8signed. destruct (vincl x (Sgn Ptop 8)) eqn:INCL.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists e#r; split; auto.
  assert (V: vmatch bc e#r (Sgn Ptop 8)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  { eapply vmatch_ge; eauto. apply vincl_ge; auto. }
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv V; simpl; auto. rewrite is_sgn_sign_ext in H4 by auto. rewrite H4; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; simpl; eauto.
Qed.

Lemma make_cast8unsigned_correct:
  forall r x,
  vmatch bc e#r x ->
  let (op, args) := make_cast8unsigned r x in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.zero_ext 8 e#r) v.
Proof.
  intros; unfold make_cast8unsigned. destruct (vincl x (Uns Ptop 8)) eqn:INCL.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists e#r; split; auto.
  assert (V: vmatch bc e#r (Uns Ptop 8)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  { eapply vmatch_ge; eauto. apply vincl_ge; auto. }
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv V; simpl; auto. rewrite is_uns_zero_ext in H4 by auto. rewrite H4; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; simpl; eauto.
Qed.

Lemma make_cast16signed_correct:
  forall r x,
  vmatch bc e#r x ->
  let (op, args) := make_cast16signed r x in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.sign_ext 16 e#r) v.
Proof.
  intros; unfold make_cast16signed. destruct (vincl x (Sgn Ptop 16)) eqn:INCL.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists e#r; split; auto.
  assert (V: vmatch bc e#r (Sgn Ptop 16)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  { eapply vmatch_ge; eauto. apply vincl_ge; auto. }
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv V; simpl; auto. rewrite is_sgn_sign_ext in H4 by auto. rewrite H4; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; simpl; eauto.
Qed.

Lemma make_cast16unsigned_correct:
  forall r x,
  vmatch bc e#r x ->
  let (op, args) := make_cast16unsigned r x in
  exists v, eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v /\ Val.lessdef (Val.zero_ext 16 e#r) v.
Proof.
  intros; unfold make_cast16unsigned. destruct (vincl x (Uns Ptop 16)) eqn:INCL.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists e#r; split; auto.
  assert (V: vmatch bc e#r (Uns Ptop 16)).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  { eapply vmatch_ge; eauto. apply vincl_ge; auto. }
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv V; simpl; auto. rewrite is_uns_zero_ext in H4 by auto. rewrite H4; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  econstructor; split; simpl; eauto.
Qed.

Lemma op_strength_reduction_correct:
  forall op args vl v,
  vl = map (fun r => AE.get r ae) args ->
  eval_operation ge (Vptr sp Ptrofs.zero) op e##args m = Some v ->
  let (op', args') := op_strength_reduction op args vl in
  exists w, eval_operation ge (Vptr sp Ptrofs.zero) op' e##args' m = Some w /\ Val.lessdef v w.
Proof.
  intros until v; unfold op_strength_reduction;
(* Goal: forall (n : Int64.int) (r : reg), let (op, args) := make_addlimm n r in @ex val (fun v : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op (@map positive val (fun r0 : positive => Regmap.get val r0 e) args) m) (@Some val v)) (Val.lessdef (Val.addl (Regmap.get val r e) (Vlong n)) v)) *)
  case (op_strength_reduction_match op args vl); simpl; intros.
(* cast8signed *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_cast8signed_correct; auto.
(* cast8unsigned *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_cast8unsigned_correct; auto.
(* cast16signed *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_cast16signed_correct; auto.
(* cast16unsigned *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_cast16unsigned_correct; auto.
(* sub *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. rewrite Val.sub_add_opp. apply make_addimm_correct; auto.
(* mul *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.mul_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_mulimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_mulimm_correct; auto.
(* divs *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  assert (e#r2 = Vint n2). clear H0. InvApproxRegs; SimplVM; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply make_divimm_correct; auto.
(* divu *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  assert (e#r2 = Vint n2). clear H0. InvApproxRegs; SimplVM; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply make_divuimm_correct; auto.
(* modu *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  assert (e#r2 = Vint n2). clear H0. InvApproxRegs; SimplVM; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply make_moduimm_correct; auto.
(* and *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.and_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_andimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_andimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv H; inv H0. apply make_andimm_correct; auto.
(* or *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.or_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_orimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_orimm_correct; auto.
(* xor *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.xor_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_xorimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_xorimm_correct; auto.
(* shl *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_shlimm_correct; auto.
(* shr *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_shrimm_correct; auto.
(* shru *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_shruimm_correct; auto.
(* lea *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit addr_strength_reduction_32_correct; eauto.
(* Goal: forall _ : let (addr', args') := addr_strength_reduction_32 addr args0 vl0 in @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing32 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), let (op', args') := let (addr', args') := addr_strength_reduction_32 addr args0 vl0 in @pair operation (list reg) (Olea addr') args' in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_addlimm (Int64.neg n2) r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mullimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mullimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_modluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n1 r2 v2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n2 r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shllimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := let (addr', args') := addr_strength_reduction_64 addr args0 vl0 in @pair operation (list reg) (Oleal addr') args' in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (addr_strength_reduction_32 addr args0 vl0) as [addr' args'].
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  auto.
(* subl *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0.
(* Goal: let (op', args') := make_addlimm (Int64.neg n2) r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef (Val.subl (Regmap.get val r1 e) (Vlong n2)) w)) *)
(* Goal: let (op', args') := make_mullimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mullimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_modluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n1 r2 v2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n2 r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shllimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := let (addr', args') := addr_strength_reduction_64 addr args0 vl0 in @pair operation (list reg) (Oleal addr') args' in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  replace (Val.subl e#r1 (Vlong n2)) with (Val.addl e#r1 (Vlong (Int64.neg n2))).
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply make_addlimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  unfold Val.addl, Val.subl. destruct Archi.ptr64 eqn:SF, e#r1; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Int64.sub_add_opp; auto.
(* Goal: @eq Ptrofs.int (Ptrofs.of_int64 (Int64.neg n2)) (Ptrofs.neg (Ptrofs.of_int64 n2)) *)
(* Goal: @eq val (Vlong (Int64.add i (Int64.neg n2))) (Vlong (Int64.sub i n2)) *)
(* Goal: let (op', args') := make_mullimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mullimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_divluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_modluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n1 r2 v2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n2 r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_andlimm n r1 v1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_orlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_xorlimm n2 r1 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shllimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrlimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_shrluimm n2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := let (addr', args') := addr_strength_reduction_64 addr args0 vl0 in @pair operation (list reg) (Oleal addr') args' in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Ptrofs.sub_add_opp. do 2 f_equal. auto with ptrofs.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Int64.sub_add_opp; auto.
(* mull *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.mull_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_mullimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_mullimm_correct; auto.
(* divl *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  assert (e#r2 = Vlong n2). clear H0. InvApproxRegs; SimplVM; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply make_divlimm_correct; auto.
(* divlu *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  assert (e#r2 = Vlong n2). clear H0. InvApproxRegs; SimplVM; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply make_divluimm_correct; auto.
(* modlu *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  assert (e#r2 = Vlong n2). clear H0. InvApproxRegs; SimplVM; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  apply make_modluimm_correct; auto.
(* andl *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.andl_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_andlimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_andlimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv H; inv H0. apply make_andlimm_correct; auto.
(* orl *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.orl_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_orlimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_orlimm_correct; auto.
(* xorl *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  rewrite Val.xorl_commut in H0. InvApproxRegs; SimplVM; inv H0. apply make_xorlimm_correct; auto.
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_xorlimm_correct; auto.
(* shll *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_shllimm_correct; auto.
(* shrl *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_shrlimm_correct; auto.
(* shrlu *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. apply make_shrluimm_correct; auto.
(* leal *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exploit addr_strength_reduction_64_correct; eauto.
(* Goal: forall _ : let (addr', args') := addr_strength_reduction_64 addr args0 vl0 in @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), let (op', args') := let (addr', args') := addr_strength_reduction_64 addr args0 vl0 in @pair operation (list reg) (Oleal addr') args' in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  destruct (addr_strength_reduction_64 addr args0 vl0) as [addr' args'].
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  auto.
(* cond *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  inv H0. apply make_cmp_correct; auto.
(* mulf *)
  InvApproxRegs; SimplVM; inv H0. rewrite <- H2. apply make_mulfimm_correct; auto.
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. fold (Val.mulf (Vfloat n1) e#r2).
  rewrite <- H2. apply make_mulfimm_correct_2; auto.
(* mulfs *)
  InvApproxRegs; SimplVM; inv H0. rewrite <- H2. apply make_mulfsimm_correct; auto.
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  InvApproxRegs; SimplVM; inv H0. fold (Val.mulfs (Vsingle n1) e#r2).
  rewrite <- H2. apply make_mulfsimm_correct_2; auto.
(* default *)
(* Goal: forall _ : @ex val (fun res' : val => Logic.and (@eq (option val) (@eval_addressing64 fundef unit ge (Vptr sp Ptrofs.zero) addr' (@map positive val (fun r : positive => Regmap.get val r e) args')) (@Some val res')) (Val.lessdef v res')), @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) (Oleal addr') (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_cmp c args0 vl0 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n2 r1 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: let (op', args') := make_mulfsimm n1 r2 r1 r2 in @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op' (@map positive val (fun r : positive => Regmap.get val r e) args') m) (@Some val w)) (Val.lessdef v w)) *)
(* Goal: @ex val (fun w : val => Logic.and (@eq (option val) (@eval_operation fundef unit ge (Vptr sp Ptrofs.zero) op0 (@map positive val (fun r : positive => Regmap.get val r e) args0) m) (@Some val w)) (Val.lessdef v w)) *)
  exists v; auto.
Qed.

End STRENGTH_REDUCTION.
