Local Open Scope logic.
Fixpoint argtypes (al: list (ident * type)) : list type :=
match al with (_,t)::al' => t :: argtypes al' | nil => nil end.
Definition maybe_retval (Q: environ -> mpred) retty ret :=
match ret with
| Some id => fun rho => Q (get_result1 id rho)
| None =>
match retty with
| Tvoid => (fun rho => Q (globals_only rho))
| _ => fun rho => EX v: val, Q (make_args (ret_temp::nil) (v::nil) rho)
end
end.
Definition removeopt_localdef (ret: option ident) (l: list localdef) : list localdef :=
match ret with
| Some id => remove_localdef_temp id l
| None => l
end.

Lemma semax_call': forall Espec {cs: compspecs} Delta fs A Pre Post NEPre NEPost ts x ret argsig retsig cc a bl P Q R,
Cop.classify_fun (typeof a) = Cop.fun_case_f (type_of_params argsig) retsig cc ->
match retsig, ret with
| Tvoid, None => True
| Tvoid, Some _ => False
| _, _ => True
end ->
forall (Hret: tc_fn_return Delta ret retsig)
(Hsub: funspec_sub fs (mk_funspec (argsig,retsig) cc A Pre Post NEPre NEPost))
@semax cs Espec Delta (TC && |> PQR) c PostCond.