Section EXPRESSIONS.
Variable cunit: Cminor.program.
Variable hf: helper_functions.
Hypothesis LINK: linkorder cunit prog.
Hypothesis HF: helper_functions_declared cunit hf.
(** If-conversion *)

Lemma eval_select_safe_exprs:
forall a1 a2 f env ty e e' m m' sp cond vb b id s,
safe_expr (known_id f) a1 = true ->
safe_expr (known_id f) a2 = true ->
option_map (fun sel => Sassign id sel) (sel_select_opt ty cond a1 a2) = Some s ->
Cminor.eval_expr ge sp e m cond vb -> Val.bool_of_val vb b ->
wt_expr env a1 ty ->
wt_expr env a2 ty ->
def_env f e -> wt_env env e ->
Cminor.eval_expr ge sp e m cond vb -> Val.bool_of_val vb b ->
env_lessdef e e' -> Mem.extends m m' ->
exists a' v1 v2 v',
s = Sassign id a'
/\ Cminor.eval_expr ge sp e m a1 v1
/\ Cminor.eval_expr ge sp e m a2 v2
/\ eval_expr tge sp e' m' nil a' v'
/\ Val.lessdef (if b then v1 else v2) v'.