Definition tc_fn_return (Delta: tycontext) (ret: option ident) (t: type) :=
match ret with
| None => True
| Some i => match (temp_types Delta) ! i with Some t' => t=t' | _ => False end
end.

Lemma semax_call_aux:
forall (Delta : tycontext)
(A : TypeTree)
(P Q Q' : forall ts, dependent_type_functor_rec ts (AssertTT A) mpred)
(NEP: super_non_expansive P) (NEQ': super_non_expansive Q')
(ts: list Type) (x : dependent_type_functor_rec ts A mpred)
(F : environ -> pred rmap)
(F0 : assert) (ret : option ident) (fsig0 : funsig) cc (a : expr)
(bl : list expr) (R : ret_assert) (psi : genv) (vx:env) (tx:Clight.temp_env) (k : cont) (rho : environ)
(ora : OK_ty) (jm : juicy_mem) (b : block) (id : ident)
(Hora : juicy_mem_op (ext_compat ora) jm),
Cop.classify_fun (typeof a) =
Cop.fun_case_f (type_of_params (fst fsig0)) (snd fsig0) cc ->
tc_fn_return Delta ret (snd fsig0) ->
(|>tc_expr Delta a rho) (m_phi jm) ->
(|>tc_exprlist Delta (snd (split (fst fsig0))) bl rho) (m_phi jm) ->
guard_environ Delta (current_function k) rho ->
(snd fsig0 =Tvoid -> ret=None) ->
closed_wrt_modvars (Scall ret a bl) F0 ->
RA_normal R = (fun rho0 : environ => EX old:val, substopt ret old F rho0 * maybe_retval (Q ts x) (snd fsig0) ret rho0) ->
genv_cenv psi = cenv_cs ->
rho = construct_rho (filter_genv psi) vx tx ->
eval_expr a rho = Vptr b Ptrofs.zero ->
(funassert Delta rho) (m_phi jm) ->
(rguard Espec psi Delta (frame_ret_assert R F0) k) (level (m_phi jm)) ->
(believe Espec Delta psi Delta) (level (m_phi jm)) ->
(glob_specs Delta)!id = Some (mk_funspec fsig0 cc A P Q' NEP NEQ') ->
Genv.find_symbol psi id = Some b ->
(forall vl : environ, (!|>(Q' ts x vl <=> Q ts x vl)) (m_phi jm)) ->
(|>(F0 rho * F rho *
P ts x (make_args (map (@fst  _ _) (fst fsig0))
(eval_exprlist (snd (split (fst fsig0))) bl rho) rho)
)) (m_phi jm) ->
jsafeN (@OK_spec Espec) psi (level (m_phi jm)) ora
(State (vx) (tx) (Kseq (Scall ret a bl) :: k)) jm.