Hint Resolve listrep_valid_pointer : valid_pointer.
Definition reverse_spec :=
DECLARE _reverse
WITH sigma : list int, p: val
PRE  [ _p OF (tptr t_struct_list) ]
PROP ()
LOCAL (temp _p p)
SEP (listrep sigma p)
POST [ (tptr t_struct_list) ]
EX q:val,
PROP () LOCAL (temp ret_temp q)
SEP (listrep (rev sigma) q).
Definition last_foo_spec :=
DECLARE _last_foo
WITH sigma : list int, p: val, sigma': list int, x: int
PRE  [ _p OF (tptr t_struct_list) ]
PROP (sigma = sigma' ++ x :: nil)
LOCAL (temp _p p)
SEP (listrep sigma p)
POST [ tuint ]
PROP () LOCAL (temp ret_temp (Vint x))
SEP (TT).
Definition Gprog : funspecs :=
ltac:(with_library prog [ reverse_spec; last_foo_spec ]).

(* Specifications: *)
Lemma body_last_foo: semax_body Vprog Gprog
f_last_foo last_foo_spec.