Definition inttype2init_data (sz: intsize) : (int -> init_data) :=
match sz with
| IBool  =>  Init_int8
| I8  =>  Init_int8
| I16 =>  Init_int16
| I32 =>  Init_int32
end.
Definition notboolsize (sz: intsize) : Prop :=
match sz with IBool => False | _ => True end.

Lemma unpack_globvar_array  {cs: compspecs}:
forall t sz sign (data: list int)  n Delta gz i gv,
(var_types Delta) ! i = None ->
(glob_types Delta) ! i = Some (gvar_info gv) ->
gvar_info gv = tarray t n ->
gvar_volatile gv = false ->
globvar_all_aligned gv = true ->
t = Tint sz sign noattr ->
forall    (NBS: notboolsize sz),
n = Zlength (gvar_init gv) ->
gvar_init gv = map (inttype2init_data sz) data ->
init_data_list_size (gvar_init gv) <= sizeof (gvar_info gv) <= Ptrofs.max_unsigned ->
local (`and (tc_environ Delta) (fun rho =>gz = globals_of_env rho)) && globvar2pred gz(i, gv) |--
`(data_at (readonly2share (gvar_readonly gv))
(tarray (Tint sz sign noattr) n)
(map (Basics.compose Vint (Cop.cast_int_int sz sign)) data)
(gz i)).