Section CONSTRUCTORS.
Variable ge: genv.
Variable fn: function.
(** Decomposition of integer literals *)
Inductive wf_decomposition: list (Z * Z) -> Prop :=
| wf_decomp_nil:
wf_decomposition nil
| wf_decomp_cons: forall m n p l,
n = Zzero_ext 16 m -> 0 <= p -> wf_decomposition l ->
wf_decomposition ((n, p) :: l).
Fixpoint recompose_int (accu: Z) (l: list (Z * Z)) : Z :=
match l with
| nil => accu
| (n, p) :: l => recompose_int (Zinsert accu n p 16) l
end.

Lemma decompose_int_correct:
forall N n p accu,
0 <= p ->
(forall i, p <= i -> Z.testbit accu i = false) ->
(forall i, 0 <= i < p + Z.of_nat N * 16 ->
Z.testbit (recompose_int accu (decompose_int N n p)) i =
if zlt i p then Z.testbit accu i else Z.testbit n i).