Definition force_ptr (v: val) : val :=
              match v with Vptr l ofs => v | _ => Vundef  end.Definition always {A B: Type} (b: B) (a: A) := b.Definition offset_val (ofs: Z) (v: val) : val :=
  match v with
  | Vptr b z => Vptr b (Ptrofs.add z (Ptrofs.repr ofs))
  | _ => Vundef
 end.Definition range_s32 (i: Z) : bool := 
   andb (Z.leb Int.min_signed i) (Z.leb i Int.max_signed).Definition range_s64 (i: Z) : bool := 
   andb (Z.leb Int64.min_signed i) (Z.leb i Int64.max_signed).Definition is_long (v: val) :=
 match v with Vlong i => True | _ => False end.Definition is_float (v: val) :=
 match v with Vfloat i => True | _ => False end.Definition is_single (v: val) :=
 match v with Vsingle i => True | _ => False end.Definition is_pointer_or_null (v: val) :=
 match v with
 | Vint i => if Archi.ptr64 then False else  i = Int.zero
 | Vlong i => if Archi.ptr64 then i=Int64.zero else False
 | Vptr _ _ => True
 | _ => False
 end.Definition is_pointer_or_integer (v: val) :=
 match v with
 | Vint i => if Archi.ptr64 then False else True
 | Vlong i => if Archi.ptr64 then True else False
 | Vptr _ _ => True
 | _ => False
 end.Definition isptr v :=
   match v with | Vptr _ _ => True | _ => False end.

(* Specifications: *)
Lemma int_eq_e: forall i j, Int.eq i j = true -> i=j.
Lemma two_p_neg: forall n, n<0 -> two_p n = 0.
Lemma testbit_signed_neg: forall i j n, - two_p n <= Int.signed i < 0 -> 0 <= n <= j -> j < Int.zwordsize -> Int.testbit i j = true.
Lemma sign_ext_inrange: forall n i, - two_p (n-1) <= Int.signed i <= two_p (n-1) - 1 -> Int.sign_ext n i = i.
Lemma zero_ext_inrange: forall n i, Int.unsigned i <= two_p n - 1 -> Int.zero_ext n i = i.