Defined.
Definition Int_zero := Int.mkint 0 zero_in_range.
Definition pointer_val_val (pv: pointer_val): val :=
match pv with
| ValidPointer b i => Vptr b i
| NullPointer => Vint Int.zero (* Vint Int_zero *)
end.
Definition reptype': type -> Type :=
type_func (fun _ => Type)
(fun t =>
if (type_is_by_value t)
then match t with
| Tint _ _ _ => int
| Tlong _ _ => Int64.int
| Tfloat _ _ => float
| Tpointer _ _ => pointer_val
| _ => val
end
else unit)
(fun t n a T => list T)
(fun id a T => compact_prod (decay T))
(fun id a T => compact_sum (decay T)).
Notation REPTYPE' t :=
match t return Type with
| Tvoid
| Tfunction _ _ _ => unit
| Tint _ _ a => int
| Tlong _ a => Int64.int
| Tfloat _ a => float
| Tpointer _ a => pointer_val
| Tarray t0 _ _ => list (reptype' t0)
| Tstruct id _ => compact_prod (map (fun it => reptype' (field_type (fst it) (co_members (get_co id)))) (co_members (get_co id)))
| Tunion id _ => compact_sum (map (fun it => reptype' (field_type (fst it) (co_members (get_co id)))) (co_members (get_co id)))
end.

(* Specifications: *)
Lemma reptype'_eq: forall t,
reptype' t = REPTYPE' t.
Lemma repinject_JMeq: forall t v, type_is_by_value t = true -> JMeq (repinject t v) v.
Lemma repinject_unfold_reptype: forall t v,
match t as t' return REPTYPE t' -> Prop with
| Tint _ _ _
| Tfloat _ _
| Tlong _ _
| Tpointer _ _ => fun vv => repinject t v = vv
| _ => fun _ => True
end (unfold_reptype v).
Lemma repinject_valinject:
forall t v,
type_is_by_value t = true -> repinject t (valinject t v) = v.
Lemma valinject_repinject: forall t v,
type_is_by_value t = true ->
(valinject t (repinject t v)) = v.
Lemma repinject_default_val:
forall t, repinject t (default_val t) = Vundef.