+ assert (Vptrofs n0 = Vptrofs n) as H by congruence.
rewrite H; rewrite (Vptrofs_inj _ _ H) in *.
rewrite ALLOC0 in ALLOC; inv ALLOC; trivial.
+ inv H5.
rewrite LB0 in LB; inv LB. rewrite <- SZ in SZ0. rewrite (Vptrofs_inj _ _ SZ0); trivial.
+ inv H3; inv H5.
rewrite LB0 in LB; inv LB; trivial.
Qed.
Inductive asm_ev_step ge: state -> mem -> list mem_event -> state -> mem -> Prop :=
| exec_step_internal:
forall b ofs f i rs m1 m rs' m' T,
rs PC = Vptr b ofs ->
Genv.find_funct_ptr ge b = Some (Internal f) ->
find_instr (Ptrofs.unsigned ofs) f.(fn_code) = Some i ->
exec_instr ge f i rs m = Next rs' m' ->
drf_instr ge (fn_code f) i rs m = Some T ->
asm_ev_step ge (State rs m1) m T (State rs' m') m'
| exec_step_builtin:
forall b ofs f ef args res rs m1 m vargs t T1 T2 vres rs' m',
rs PC = Vptr b ofs ->
Genv.find_funct_ptr ge b = Some (Internal f) ->
find_instr (Ptrofs.unsigned ofs) f.(fn_code) = Some (Pbuiltin ef args res) ->
eval_builtin_args_ev _ ge rs (rs RSP) m args vargs T1 ->
builtin_event ef m vargs T2 ->
(*      ev_elim m (T1++T2) m' ->*)
(* Must it be the case that builtins don't produce trace events? *)
external_call ef ge vargs m (*nil*) t vres m' ->
rs' = nextinstr_nf
(set_res res vres
(undef_regs (map preg_of (destroyed_by_builtin ef)) rs)) ->
asm_ev_step ge (State rs m1) m (T1++T2) (State rs' m') m'.

Lemma asm_ev_elim g (Hsafe : safe_genv g): forall c m T c' m'
(Estep: asm_ev_step g c m T c' m'), ev_elim m T m'.