(** Auxiliary for the compilation of [switch] statements. *)

Definition tr_jumptable (nexits: list node) (tbl: list nat) (ttbl: list node) : Prop :=
  forall v act,
  list_nth_z tbl v = Some act ->
  exists n, list_nth_z ttbl v = Some n /\ nth_error nexits act = Some n.

Lemma alloc_optreg_map_ok: forall map optid s1 r s2 i, map_valid map s1 -> alloc_optreg map optid s1 = OK r s2 i -> reg_map_ok map r optid.