Section InternalCall.
(****************The following three conditions are new******************)
(****************The following three conditions are new******************)
(* In the third clause, we now step from  m' to m, and also from f' to f and from tm' to tm******************)

Lemma MS_structured_match_callstack_alloc_variables:
forall tm1 sp tm2 m1 vars e m2 cenv mu cs fn lenv te,
Mem.alloc tm1 0 (fn_stackspace fn) = (tm2, sp) ->
fn_stackspace fn <= Int.max_unsigned ->
alloc_variables empty_env m1 vars e m2 ->
list_norepet (map fst vars) ->
cenv_compat cenv vars (fn_stackspace fn) ->
cenv_separated cenv vars ->
(forall id ofs, cenv!id = Some ofs -> In id (map fst vars)) ->
REACH_closed m1 (vis mu) -> sm_valid mu m1 tm1 -> SM_wd mu ->
Mem.inject (as_inj mu) m1 tm1 ->
structured_match_callstack mu m1 tm1 cs (Mem.nextblock m1) (Mem.nextblock tm1) ->
match_temps (restrict (as_inj mu) (vis mu)) lenv te ->
exists mu',
structured_match_callstack mu' m2 tm2 (Frame cenv fn e lenv te sp (Mem.nextblock m1) (Mem.nextblock m2) :: cs)
(Mem.nextblock m2) (Mem.nextblock tm2)
/\ Mem.inject (as_inj mu') m2 tm2
/\ intern_incr mu mu'
/\ sm_inject_separated mu mu' m1 tm1
/\ sm_locally_allocated mu mu' m1 tm1 m2 tm2
/\ SM_wd mu' /\ sm_valid mu' m2 tm2
/\ REACH_closed m2 (vis mu').