Hint Rewrite @Zlength_flip_ends using (autorewrite with sublist; omega) : sublist.

(* Specifications: *)
Lemma flip_fact_1: forall A size (contents: list A) j,
Zlength contents = size ->
0 <= j ->
size - j - 1 <= j <= size - j ->
flip_ends j (size - j) contents = rev contents.
Lemma flip_fact_3:
forall A (al: list A) j size,
size = Zlength al ->
0 <= j < size - j - 1 ->
sublist 0 j (flip_ends j (size - j) al) ++
sublist (size - j - 1) (size - j) al ++
sublist (j + 1) size
(sublist 0 (size - j - 1) (flip_ends j (size - j) al) ++
sublist j (j + 1) (flip_ends j (size - j) al) ++
sublist (size - j) size (flip_ends j (size - j) al)) =
flip_ends (j + 1) (size - (j + 1)) al.
Lemma flip_ends_map:
forall A B (F: A -> B) lo hi (al: list A),
flip_ends lo hi (map F al) = map F (flip_ends lo hi al).
Lemma flip_fact_2:
forall {A}{d: Inhabitant A} (al: list A) size j,
Zlength al = size ->
j < size - j - 1 ->
0 <= j ->
Znth (size - j - 1) al =
Znth (size - j - 1) (flip_ends j (size - j) al).
Lemma body_reverse: semax_body Vprog Gprog f_reverse reverse_spec.
Definition four_contents := [Int.repr 1; Int.repr 2; Int.repr 3; Int.repr 4].
Lemma body_main:  semax_body Vprog Gprog f_main main_spec.
Existing Instance NullExtension.Espec.
Lemma prog_correct:
semax_prog prog Vprog Gprog.