(** Preservation of the arguments to an external call. *)
Section EXTERNAL_ARGUMENTS.
Variable j: meminj.
Variable cs: list Linear.stackframe.
Variable cs': list stackframe.
Variable sg: signature.
Variables bound bound': block.
Hypothesis MS: match_stacks j cs cs' sg.
Variable ls: locset.
Variable rs: regset.
Hypothesis AGR: agree_regs j ls rs.
Hypothesis AGCS: agree_callee_save ls (parent_locset cs).
Hypothesis AGARGS: agree_outgoing_arguments sg ls (parent_locset cs).
Variable m': mem.
Hypothesis SEP: m' |= stack_contents j cs cs'.

(* Specifications: *)
Lemma transl_external_argument:
forall l,
In l (regs_of_rpairs (loc_arguments sg)) ->
exists v, extcall_arg rs m' (parent_sp cs') l v /\ Val.inject j (ls l) v.
Lemma transl_external_argument_2:
forall p,
In p (loc_arguments sg) ->
exists v, extcall_arg_pair rs m' (parent_sp cs') p v /\ Val.inject j (Locmap.getpair p ls) v.
Lemma transl_external_arguments_rec:
forall locs,
incl locs (loc_arguments sg) ->
exists vl,
list_forall2 (extcall_arg_pair rs m' (parent_sp cs')) locs vl
/\ Val.inject_list j (map (fun p => Locmap.getpair p ls) locs) vl.
Lemma transl_external_arguments:
exists vl,
extcall_arguments rs m' (parent_sp cs') sg vl
/\ Val.inject_list j (map (fun p => Locmap.getpair p ls) (loc_arguments sg)) vl.