Fixpoint hPosLoop3 (n:nat) (xlist: list int) (old: list val): list val :=
match n with
O => old
| S m => let j:= Z.of_nat m in
let s := hPosLoop3 m xlist old in
let five := Znth (5*j) xlist in
let six := Znth (6+j) xlist in
UpdateOut (UpdateOut s (4*j) five) (16+4*j) six
end.
Opaque Z.mul. Opaque Z.add.

(* Specifications: *)
Lemma hposLoop3_length xlist old: forall n, (16+4*Z.of_nat n<Zlength old) ->
Zlength (hPosLoop3 n xlist old) = Zlength old.
Lemma hposLoop2_Zlength16 C N l (L:Zlength l = 16): forall n,
5 * Z.of_nat n < 16-> 6+ Z.of_nat n < 16 -> Zlength (hPosLoop2 (S n) l C N) = 16.