Definition vanalyze (cu: program) (f: function) :=
  ValueAnalysis.analyze (romem_for cu) f.

(* Specifications: *)
Lemma is_dead_sound_1: forall nv, is_dead nv = true -> nv = Nothing.
Lemma is_dead_sound_2: forall nv, is_dead nv = false -> nv <> Nothing.
Lemma is_int_zero_sound: forall nv, is_int_zero nv = true -> nv = I Int.zero.
Lemma find_function_translated: forall ros rs fd trs ne, find_function ge ros rs = Some fd -> eagree rs trs (add_ros_need_all ros ne) -> exists cu tfd, find_function tge ros trs = Some tfd /\ transf_fundef (romem_for cu) fd = OK tfd /\ linkorder cu prog.
Lemma eagree_set_res: forall e1 e2 v1 v2 res ne, Val.lessdef v1 v2 -> eagree e1 e2 (kill_builtin_res res ne) -> eagree (regmap_setres res v1 e1) (regmap_setres res v2 e2) ne.
Lemma transf_volatile_store: forall v1 v2 v1' v2' m tm chunk sp nm t v m', volatile_store_sem chunk ge (v1::v2::nil) m t v m' -> Val.lessdef v1 v1' -> vagree v2 v2' (store_argument chunk) -> magree m tm (nlive ge sp nm) -> v = Vundef /\ exists tm', volatile_store_sem chunk ge (v1'::v2'::nil) tm t Vundef tm' /\ magree m' tm' (nlive ge sp nm).
Theorem step_simulation: forall S1 t S2, step ge S1 t S2 -> forall S1', match_states S1 S1' -> sound_state prog S1 -> exists S2', step tge S1' t S2' /\ match_states S2 S2'.
Lemma transf_initial_states: forall st1, initial_state prog st1 -> exists st2, initial_state tprog st2 /\ match_states st1 st2.
Lemma transf_final_states: forall st1 st2 r, match_states st1 st2 -> final_state st1 r -> final_state st2 r.
Theorem transf_program_correct: forward_simulation (RTL.semantics prog) (RTL.semantics tprog).