remember (b || c). destruct b0; auto. symmetry in Heqb0. rewrite orb_true_iff in Heqb0.
intuition; subst; auto. destruct b; auto. symmetry in Heqb0; rewrite orb_false_iff in Heqb0.
intuition; subst; auto.
Qed.

Lemma andb_if : forall {D} b c (d:D) (e:D), (if (b && c) then d else e) = if b then (if c then d else e) else e.
Program Definition valid_pointer' (p: val) (d: Z) : mpred :=
match p with
| Vint i => if Archi.ptr64 then FF else prop (i = Int.zero)
| Vlong i => if Archi.ptr64 then prop (i=Int64.zero) else FF
| Vptr b ofs =>
fun m =>
match m @ (b, Ptrofs.unsigned ofs + d) with
| YES _ _ _ pp => True
| NO sh _ => nonidentity sh
| _ => False
end
| _ => FF
end.