Local Open Scope logic.
Definition final_loop :=
Sfor (Sset _xn (Econst_int (Int.repr 0) tint))
(Ebinop Olt (Etempvar _xn tuint)
(Ebinop Odiv (Econst_int (Int.repr 32) tint)
(Econst_int (Int.repr 4) tint) tint) tint)
(Ssequence
(Sset _ll (Ederef
(Ebinop Oadd
(Efield
(Ederef
(Etempvar _c
(tptr t_struct_SHA256state_st))
t_struct_SHA256state_st) _h
(tarray tuint 8)) (Etempvar _xn tuint)
(tptr tuint)) tuint))
(Ssequence
(Scall None
(Evar ___builtin_write32_reversed
(Tfunction
(Tcons (tptr tuint) (Tcons tuint Tnil))
tvoid cc_default))
[Ecast (Etempvar _md (tptr tuchar))
(tptr tuint); Etempvar _ll tuint])
(Sset _md
(Ebinop Oadd (Etempvar _md (tptr tuchar))
(Econst_int (Int.repr 4) tint)
(tptr tuchar)))))
(Sset _xn
(Ebinop Oadd (Etempvar _xn tuint)
(Econst_int (Int.repr 1) tint) tuint)).
Definition sha_final_epilog :=
(Ssequence
(Scall None
(Evar _sha256_block_data_order (Tfunction
(Tcons(tptr t_struct_SHA256state_st)
(Tcons (tptr tvoid) Tnil))
tvoid cc_default))
((Etempvar _c (tptr t_struct_SHA256state_st)) ::
(Etempvar _p (tptr tuchar)) :: nil))
(Ssequence
(Sassign
(Efield
(Ederef
(Etempvar _c (tptr t_struct_SHA256state_st))
t_struct_SHA256state_st) _num tuint)
(Econst_int (Int.repr 0) tint))
(Ssequence
(Scall None
(Evar _memset (Tfunction
(Tcons (tptr tvoid)
(Tcons tint
(Tcons tuint Tnil)))
(tptr tvoid) cc_default))
((Etempvar _p (tptr tuchar)) ::
(Econst_int (Int.repr 0) tint) ::
(Ebinop Omul (Econst_int (Int.repr 16) tint)
(Econst_int (Int.repr 4) tint) tint) ::
nil))
(Ssequence final_loop (Sreturn None))))).
Definition sha_final_part2 :=
(Ssequence
(Sset _cNh
(Efield
(Ederef (Etempvar _c (tptr t_struct_SHA256state_st))
t_struct_SHA256state_st) _Nh tuint))
(Ssequence
(Ssequence
(Scall None
(Evar ___builtin_write32_reversed
(Tfunction (Tcons (tptr tuint) (Tcons tuint Tnil)) tvoid cc_default))
[Ecast (Etempvar _p (tptr tuchar)) (tptr tuint);
Etempvar _cNh tuint])
(Sset _p
(Ebinop Oadd (Etempvar _p (tptr tuchar))
(Econst_int (Int.repr 4) tint) (tptr tuchar))))
(Ssequence
(Sset _cNl
(Efield
(Ederef (Etempvar _c (tptr t_struct_SHA256state_st))
t_struct_SHA256state_st) _Nl tuint))
(Ssequence
(Ssequence
(Scall None
(Evar ___builtin_write32_reversed
(Tfunction (Tcons (tptr tuint) (Tcons tuint Tnil))
tvoid cc_default))
[Ecast (Etempvar _p (tptr tuchar)) (tptr tuint);
Etempvar _cNl tuint])
(Sset _p
(Ebinop Oadd (Etempvar _p (tptr tuchar))
(Econst_int (Int.repr 4) tint) (tptr tuchar))))
(Ssequence
(Sset _p
(Ebinop Osub (Etempvar _p (tptr tuchar))
(Ebinop Omul (Econst_int (Int.repr 16) tint)
(Econst_int (Int.repr 4) tint) tint) (tptr tuchar)))
sha_final_epilog))))).

Lemma align_compatible_tarray_tuchar:
forall n v, align_compatible (tarray tuchar n) v.