Variable cenv : compilenv.
Variable f : Csharpminor.function.
Variable mu : SM_Injection.
Variable m tm : mem.
Variable cs : callstack.
Variable e : Csharpminor.env.
Variable lenv : temp_env.
Variable k : Csharpminor.cont.
Variable tk : cont.

(* Specifications: *)
Theorem MS_structured_match_callstack_function_entry:
forall fn cenv tf m' tm' sp cs args targs,
build_compilenv fn = (cenv, tf.(fn_stackspace)) ->
tf.(fn_stackspace) <= Int.max_unsigned ->
list_norepet (map fst (Csharpminor.fn_vars fn)) ->
list_norepet (Csharpminor.fn_params fn) ->
list_disjoint (Csharpminor.fn_params fn) (Csharpminor.fn_temps fn) ->
alloc_variables Csharpminor.empty_env m (Csharpminor.fn_vars fn) e m' ->
bind_parameters (Csharpminor.fn_params fn) args (create_undef_temps fn.(fn_temps)) = Some lenv ->
val_list_inject (restrict (as_inj mu) (vis mu)) args targs ->
Mem.alloc tm 0 tf.(fn_stackspace) = (tm', sp) ->
structured_match_callstack mu m tm cs (Mem.nextblock m) (Mem.nextblock tm) ->
REACH_closed m (vis mu) -> sm_valid mu m tm -> SM_wd mu ->
Mem.inject (as_inj mu) m tm ->
let te := set_locals (Csharpminor.fn_temps fn) (set_params targs (Csharpminor.fn_params fn)) in
exists mu',
structured_match_callstack mu' m' tm'
(Frame cenv tf e lenv te sp (Mem.nextblock m) (Mem.nextblock m') :: cs)
(Mem.nextblock m') (Mem.nextblock tm')
/\ Mem.inject (as_inj mu') m' tm'
/\ intern_incr mu mu'
/\ sm_inject_separated mu mu' m tm
/\ sm_locally_allocated mu mu' m tm m' tm'
/\ SM_wd mu' /\ sm_valid mu' m' tm'
/\ REACH_closed m' (vis mu').
Lemma MS_step_case_InternalCall: forall
(MCS : structured_match_callstack mu m tm cs (Mem.nextblock m)
(Mem.nextblock tm))
(PRE: REACH_closed m (vis mu) /\
meminj_preserves_globals ge (as_inj mu) /\
(forall b, isGlobalBlock ge b = true -> frgnBlocksSrc mu b = true) /\
sm_valid mu m tm /\ SM_wd mu /\
Mem.inject (as_inj mu) m tm)
vargs targs x m1
(Param1: list_norepet (map fst (Csharpminor.fn_vars f)))
(Param2 : list_norepet (Csharpminor.fn_params f))
(Param3 : list_disjoint (Csharpminor.fn_params f) (fn_temps f))
(AlocVars : alloc_variables empty_env m (Csharpminor.fn_vars f) e m1)
(BindParams: bind_parameters (Csharpminor.fn_params f) vargs
(create_undef_temps (fn_temps f)) = Some lenv)
(MK : match_cont k tk cenv nil cs)
(ISCC : Csharpminor.is_call_cont k)
(ARGSINJ : val_list_inject (restrict (as_inj mu) (vis mu)) vargs targs)
(EQ : transl_function f = OK x),
exists (c2' : CMin_core) m2' mu',
corestep_plus CMin_core_sem tge (CMin_Callstate (AST.Internal x) targs tk) tm c2' m2'
/\ intern_incr mu mu' /\
sm_inject_separated mu mu' m tm /\
sm_locally_allocated mu mu' m tm m1 m2' /\ SM_wd mu' /\
sm_valid mu' m1 m2' /\
Match_cores (CSharpMin_State f (Csharpminor.fn_body f) k e lenv) mu'
(CSharpMin_State f (Csharpminor.fn_body f) k e lenv) m1 c2' m2'.