(** Indexed memory loads. *)

Lemma indexed_memory_access_correct:
forall (P: regset -> Prop) (mk_instr: ireg -> int -> instruction)
(mk_immed: int -> int) (base: ireg) n k (rs: regset) m m',
(forall (r1: ireg) (rs1: regset) n1 k,
Val.add rs1#r1 (Vint n1) = Val.add rs#base (Vint n) ->
(forall (r: preg), if_preg r = true -> r <> IR14 -> rs1 r = rs r) ->
exists rs',
exec_straight ge fn (mk_instr r1 n1 :: k) rs1 m k rs' m' /\ P rs') ->
exists rs',
exec_straight ge fn
(indexed_memory_access mk_instr mk_immed base n k) rs m
k rs' m'
/\ P rs'.