#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  size_t num;
  int Nh;
  int Nl;
  unsigned long h0;
  unsigned long h1;
  unsigned long h2;
  unsigned long h3;
  unsigned long h4;
  scalar_t__ data;
};
typedef TYPE_1__ SHA_CTX;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_cleanse(unsigned char *, int);
int SHA_CBLOCK;
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sha1_block_data_order(TYPE_1__ *, unsigned char *, int);
int SHA1_Final(unsigned char *md, SHA_CTX *c) {
  unsigned char *p = (unsigned char *)c->data;
  size_t n = c->num;
  p[n] = 0x80;
  n++;
  if (n > (SHA_CBLOCK - 8)) {
    memset(p + n, 0, SHA_CBLOCK - n);
    n = 0;
    sha1_block_data_order(c, p, 1);
  }
  memset(p + n, 0, SHA_CBLOCK - 8 - n);
  p += SHA_CBLOCK - 8;
  (void)(*((p)++) = (unsigned char)(((c->Nh) >> 24) & 0xff),
         *((p)++) = (unsigned char)(((c->Nh) >> 16) & 0xff),
         *((p)++) = (unsigned char)(((c->Nh) >> 8) & 0xff),
         *((p)++) = (unsigned char)(((c->Nh)) & 0xff), c->Nh);
  (void)(*((p)++) = (unsigned char)(((c->Nl) >> 24) & 0xff),
         *((p)++) = (unsigned char)(((c->Nl) >> 16) & 0xff),
         *((p)++) = (unsigned char)(((c->Nl) >> 8) & 0xff),
         *((p)++) = (unsigned char)(((c->Nl)) & 0xff), c->Nl);
  p -= SHA_CBLOCK;
  sha1_block_data_order(c, p, 1);
  c->num = 0;
  OPENSSL_cleanse(p, SHA_CBLOCK);
  do {
    unsigned long ll;
    ll = (c)->h0;
    (void)(*(((md))++) = (unsigned char)(((ll) >> 24) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
           *(((md))++) = (unsigned char)(((ll)) & 0xff), ll);
    ll = (c)->h1;
    (void)(*(((md))++) = (unsigned char)(((ll) >> 24) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
           *(((md))++) = (unsigned char)(((ll)) & 0xff), ll);
    ll = (c)->h2;
    (void)(*(((md))++) = (unsigned char)(((ll) >> 24) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
           *(((md))++) = (unsigned char)(((ll)) & 0xff), ll);
    ll = (c)->h3;
    (void)(*(((md))++) = (unsigned char)(((ll) >> 24) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
           *(((md))++) = (unsigned char)(((ll)) & 0xff), ll);
    ll = (c)->h4;
    (void)(*(((md))++) = (unsigned char)(((ll) >> 24) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
           *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
           *(((md))++) = (unsigned char)(((ll)) & 0xff), ll);
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<SHA1_Final>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x80,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2e6e(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x8,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jbe    11c4 <SHA1_Final+0x94>
mov    -0x18(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    0x2e4e(%rip),%rax
movslq (%rax),%rax
sub    -0x20(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1050 <sha1_block_data_order@plt>
mov    -0x18(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%eax
cltq
sub    -0x20(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%ecx
sub    $0x8,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    0x2cd6(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1050 <sha1_block_data_order@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    0x2c99(%rip),%rax
mov    (%rax),%esi
call   1040 <OPENSSL_cleanse@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA1_Final>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r12
mov    %rdi,%r14
mov    (%rsi),%rbx
mov    0x38(%rsi),%r15
movb   $0x80,(%r15,%rbx,1)
add    $0x1,%rbx
mov    0x2e92(%rip),%r13
movslq 0x0(%r13),%rax
lea    -0x8(%rax),%rdx
cmp    %rdx,%rbx
jbe    118b <SHA1_Final+0x5b>
lea    (%r15,%rbx,1),%rdi
sub    %ebx,%eax
xor    %ebx,%ebx
xor    %esi,%esi
mov    %eax,%edx
call   1030 <memset@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1050 <sha1_block_data_order@plt>
mov    0x0(%r13),%edx
add    $0xfffffff8,%edx
lea    (%r15,%rbx,1),%rdi
sub    %ebx,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movslq 0x0(%r13),%rax
mov    0xb(%r12),%cl
mov    %cl,-0x8(%rax,%r15,1)
mov    0xa(%r12),%cl
mov    %cl,-0x7(%rax,%r15,1)
mov    0x9(%r12),%cl
mov    %cl,-0x6(%rax,%r15,1)
mov    0x8(%r12),%cl
mov    %cl,-0x5(%rax,%r15,1)
mov    0xf(%r12),%cl
mov    %cl,-0x4(%rax,%r15,1)
mov    0xe(%r12),%cl
mov    %cl,-0x3(%rax,%r15,1)
mov    0xd(%r12),%cl
lea    -0x1(%rax,%r15,1),%rbx
mov    %cl,-0x2(%rax,%r15,1)
mov    0xc(%r12),%cl
mov    %cl,-0x1(%rax,%r15,1)
movslq 0x0(%r13),%rax
sub    %rax,%rbx
add    $0x1,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <sha1_block_data_order@plt>
movq   $0x0,(%r12)
mov    0x0(%r13),%esi
mov    %rbx,%rdi
call   1040 <OPENSSL_cleanse@plt>
mov    0x10(%r12),%eax
bswap  %eax
mov    %eax,(%r14)
mov    0x18(%r12),%eax
bswap  %eax
mov    %eax,0x4(%r14)
mov    0x20(%r12),%eax
bswap  %eax
mov    %eax,0x8(%r14)
mov    0x28(%r12),%eax
bswap  %eax
mov    %eax,0xc(%r14)
mov    0x30(%r12),%eax
bswap  %eax
mov    %eax,0x10(%r14)
mov    $0x1,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64, i32, i32, i64, i64, i64, i64, i64, i64 }
@SHA_CBLOCK = global i32 0
define i32 @SHA1_Final(i8* %0, %struct.TYPE_4__* %1) {
%3 = alloca i8*
%4 = alloca %struct.TYPE_4__*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %3
store %struct.TYPE_4__* %1, %struct.TYPE_4__** %4
%8 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 8
%10 = load i64, i64* %9
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 0
%14 = load i64, i64* %13
store i64 %14, i64* %6
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 -128, i8* %17
%18 = load i64, i64* %6
%19 = add i64 %18, 1
store i64 %19, i64* %6
%20 = load i64, i64* %6
%21 = load i32, i32* @SHA_CBLOCK
%22 = sub nsw i32 %21, 8
%23 = sext i32 %22 to i64
%24 = icmp ugt i64 %20, %23
br i1 %24, label %25, label %38
25: ; preds = %2
%26 = load i8*, i8** %5
%27 = load i64, i64* %6
%28 = getelementptr inbounds i8, i8* %26, i64 %27
%29 = load i32, i32* @SHA_CBLOCK
%30 = sext i32 %29 to i64
%31 = load i64, i64* %6
%32 = sub i64 %30, %31
%33 = trunc i64 %32 to i32
%34 = call i32 @memset(i8* %28, i32 0, i32 %33)
store i64 0, i64* %6
%35 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%36 = load i8*, i8** %5
%37 = call i32 @sha1_block_data_order(%struct.TYPE_4__* %35, i8* %36, i32 1)
br label %38
38: ; preds = %25, %2
%39 = load i8*, i8** %5
%40 = load i64, i64* %6
%41 = getelementptr inbounds i8, i8* %39, i64 %40
%42 = load i32, i32* @SHA_CBLOCK
%43 = sub nsw i32 %42, 8
%44 = sext i32 %43 to i64
%45 = load i64, i64* %6
%46 = sub i64 %44, %45
%47 = trunc i64 %46 to i32
%48 = call i32 @memset(i8* %41, i32 0, i32 %47)
%49 = load i32, i32* @SHA_CBLOCK
%50 = sub nsw i32 %49, 8
%51 = load i8*, i8** %5
%52 = sext i32 %50 to i64
%53 = getelementptr inbounds i8, i8* %51, i64 %52
store i8* %53, i8** %5
%54 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%55 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %54, i32 0, i32 1
%56 = load i32, i32* %55
%57 = ashr i32 %56, 24
%58 = and i32 %57, 255
%59 = trunc i32 %58 to i8
%60 = load i8*, i8** %5
%61 = getelementptr inbounds i8, i8* %60, i32 1
store i8* %61, i8** %5
store i8 %59, i8* %60
%62 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%63 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %62, i32 0, i32 1
%64 = load i32, i32* %63
%65 = ashr i32 %64, 16
%66 = and i32 %65, 255
%67 = trunc i32 %66 to i8
%68 = load i8*, i8** %5
%69 = getelementptr inbounds i8, i8* %68, i32 1
store i8* %69, i8** %5
store i8 %67, i8* %68
%70 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%71 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %70, i32 0, i32 1
%72 = load i32, i32* %71
%73 = ashr i32 %72, 8
%74 = and i32 %73, 255
%75 = trunc i32 %74 to i8
%76 = load i8*, i8** %5
%77 = getelementptr inbounds i8, i8* %76, i32 1
store i8* %77, i8** %5
store i8 %75, i8* %76
%78 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%79 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %78, i32 0, i32 1
%80 = load i32, i32* %79
%81 = and i32 %80, 255
%82 = trunc i32 %81 to i8
%83 = load i8*, i8** %5
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %5
store i8 %82, i8* %83
%85 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%86 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %85, i32 0, i32 1
%87 = load i32, i32* %86
%88 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%89 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %88, i32 0, i32 2
%90 = load i32, i32* %89
%91 = ashr i32 %90, 24
%92 = and i32 %91, 255
%93 = trunc i32 %92 to i8
%94 = load i8*, i8** %5
%95 = getelementptr inbounds i8, i8* %94, i32 1
store i8* %95, i8** %5
store i8 %93, i8* %94
%96 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%97 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %96, i32 0, i32 2
%98 = load i32, i32* %97
%99 = ashr i32 %98, 16
%100 = and i32 %99, 255
%101 = trunc i32 %100 to i8
%102 = load i8*, i8** %5
%103 = getelementptr inbounds i8, i8* %102, i32 1
store i8* %103, i8** %5
store i8 %101, i8* %102
%104 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%105 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %104, i32 0, i32 2
%106 = load i32, i32* %105
%107 = ashr i32 %106, 8
%108 = and i32 %107, 255
%109 = trunc i32 %108 to i8
%110 = load i8*, i8** %5
%111 = getelementptr inbounds i8, i8* %110, i32 1
store i8* %111, i8** %5
store i8 %109, i8* %110
%112 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%113 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %112, i32 0, i32 2
%114 = load i32, i32* %113
%115 = and i32 %114, 255
%116 = trunc i32 %115 to i8
%117 = load i8*, i8** %5
%118 = getelementptr inbounds i8, i8* %117, i32 1
store i8* %118, i8** %5
store i8 %116, i8* %117
%119 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%120 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %119, i32 0, i32 2
%121 = load i32, i32* %120
%122 = load i32, i32* @SHA_CBLOCK
%123 = load i8*, i8** %5
%124 = sext i32 %122 to i64
%125 = sub i64 0, %124
%126 = getelementptr inbounds i8, i8* %123, i64 %125
store i8* %126, i8** %5
%127 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%128 = load i8*, i8** %5
%129 = call i32 @sha1_block_data_order(%struct.TYPE_4__* %127, i8* %128, i32 1)
%130 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%131 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %130, i32 0, i32 0
store i64 0, i64* %131
%132 = load i8*, i8** %5
%133 = load i32, i32* @SHA_CBLOCK
%134 = call i32 @OPENSSL_cleanse(i8* %132, i32 %133)
br label %135
135: ; preds = %38
%136 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%137 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %136, i32 0, i32 3
%138 = load i64, i64* %137
store i64 %138, i64* %7
%139 = load i64, i64* %7
%140 = lshr i64 %139, 24
%141 = and i64 %140, 255
%142 = trunc i64 %141 to i8
%143 = load i8*, i8** %3
%144 = getelementptr inbounds i8, i8* %143, i32 1
store i8* %144, i8** %3
store i8 %142, i8* %143
%145 = load i64, i64* %7
%146 = lshr i64 %145, 16
%147 = and i64 %146, 255
%148 = trunc i64 %147 to i8
%149 = load i8*, i8** %3
%150 = getelementptr inbounds i8, i8* %149, i32 1
store i8* %150, i8** %3
store i8 %148, i8* %149
%151 = load i64, i64* %7
%152 = lshr i64 %151, 8
%153 = and i64 %152, 255
%154 = trunc i64 %153 to i8
%155 = load i8*, i8** %3
%156 = getelementptr inbounds i8, i8* %155, i32 1
store i8* %156, i8** %3
store i8 %154, i8* %155
%157 = load i64, i64* %7
%158 = and i64 %157, 255
%159 = trunc i64 %158 to i8
%160 = load i8*, i8** %3
%161 = getelementptr inbounds i8, i8* %160, i32 1
store i8* %161, i8** %3
store i8 %159, i8* %160
%162 = load i64, i64* %7
%163 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%164 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %163, i32 0, i32 4
%165 = load i64, i64* %164
store i64 %165, i64* %7
%166 = load i64, i64* %7
%167 = lshr i64 %166, 24
%168 = and i64 %167, 255
%169 = trunc i64 %168 to i8
%170 = load i8*, i8** %3
%171 = getelementptr inbounds i8, i8* %170, i32 1
store i8* %171, i8** %3
store i8 %169, i8* %170
%172 = load i64, i64* %7
%173 = lshr i64 %172, 16
%174 = and i64 %173, 255
%175 = trunc i64 %174 to i8
%176 = load i8*, i8** %3
%177 = getelementptr inbounds i8, i8* %176, i32 1
store i8* %177, i8** %3
store i8 %175, i8* %176
%178 = load i64, i64* %7
%179 = lshr i64 %178, 8
%180 = and i64 %179, 255
%181 = trunc i64 %180 to i8
%182 = load i8*, i8** %3
%183 = getelementptr inbounds i8, i8* %182, i32 1
store i8* %183, i8** %3
store i8 %181, i8* %182
%184 = load i64, i64* %7
%185 = and i64 %184, 255
%186 = trunc i64 %185 to i8
%187 = load i8*, i8** %3
%188 = getelementptr inbounds i8, i8* %187, i32 1
store i8* %188, i8** %3
store i8 %186, i8* %187
%189 = load i64, i64* %7
%190 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%191 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %190, i32 0, i32 5
%192 = load i64, i64* %191
store i64 %192, i64* %7
%193 = load i64, i64* %7
%194 = lshr i64 %193, 24
%195 = and i64 %194, 255
%196 = trunc i64 %195 to i8
%197 = load i8*, i8** %3
%198 = getelementptr inbounds i8, i8* %197, i32 1
store i8* %198, i8** %3
store i8 %196, i8* %197
%199 = load i64, i64* %7
%200 = lshr i64 %199, 16
%201 = and i64 %200, 255
%202 = trunc i64 %201 to i8
%203 = load i8*, i8** %3
%204 = getelementptr inbounds i8, i8* %203, i32 1
store i8* %204, i8** %3
store i8 %202, i8* %203
%205 = load i64, i64* %7
%206 = lshr i64 %205, 8
%207 = and i64 %206, 255
%208 = trunc i64 %207 to i8
%209 = load i8*, i8** %3
%210 = getelementptr inbounds i8, i8* %209, i32 1
store i8* %210, i8** %3
store i8 %208, i8* %209
%211 = load i64, i64* %7
%212 = and i64 %211, 255
%213 = trunc i64 %212 to i8
%214 = load i8*, i8** %3
%215 = getelementptr inbounds i8, i8* %214, i32 1
store i8* %215, i8** %3
store i8 %213, i8* %214
%216 = load i64, i64* %7
%217 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%218 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %217, i32 0, i32 6
%219 = load i64, i64* %218
store i64 %219, i64* %7
%220 = load i64, i64* %7
%221 = lshr i64 %220, 24
%222 = and i64 %221, 255
%223 = trunc i64 %222 to i8
%224 = load i8*, i8** %3
%225 = getelementptr inbounds i8, i8* %224, i32 1
store i8* %225, i8** %3
store i8 %223, i8* %224
%226 = load i64, i64* %7
%227 = lshr i64 %226, 16
%228 = and i64 %227, 255
%229 = trunc i64 %228 to i8
%230 = load i8*, i8** %3
%231 = getelementptr inbounds i8, i8* %230, i32 1
store i8* %231, i8** %3
store i8 %229, i8* %230
%232 = load i64, i64* %7
%233 = lshr i64 %232, 8
%234 = and i64 %233, 255
%235 = trunc i64 %234 to i8
%236 = load i8*, i8** %3
%237 = getelementptr inbounds i8, i8* %236, i32 1
store i8* %237, i8** %3
store i8 %235, i8* %236
%238 = load i64, i64* %7
%239 = and i64 %238, 255
%240 = trunc i64 %239 to i8
%241 = load i8*, i8** %3
%242 = getelementptr inbounds i8, i8* %241, i32 1
store i8* %242, i8** %3
store i8 %240, i8* %241
%243 = load i64, i64* %7
%244 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%245 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %244, i32 0, i32 7
%246 = load i64, i64* %245
store i64 %246, i64* %7
%247 = load i64, i64* %7
%248 = lshr i64 %247, 24
%249 = and i64 %248, 255
%250 = trunc i64 %249 to i8
%251 = load i8*, i8** %3
%252 = getelementptr inbounds i8, i8* %251, i32 1
store i8* %252, i8** %3
store i8 %250, i8* %251
%253 = load i64, i64* %7
%254 = lshr i64 %253, 16
%255 = and i64 %254, 255
%256 = trunc i64 %255 to i8
%257 = load i8*, i8** %3
%258 = getelementptr inbounds i8, i8* %257, i32 1
store i8* %258, i8** %3
store i8 %256, i8* %257
%259 = load i64, i64* %7
%260 = lshr i64 %259, 8
%261 = and i64 %260, 255
%262 = trunc i64 %261 to i8
%263 = load i8*, i8** %3
%264 = getelementptr inbounds i8, i8* %263, i32 1
store i8* %264, i8** %3
store i8 %262, i8* %263
%265 = load i64, i64* %7
%266 = and i64 %265, 255
%267 = trunc i64 %266 to i8
%268 = load i8*, i8** %3
%269 = getelementptr inbounds i8, i8* %268, i32 1
store i8* %269, i8** %3
store i8 %267, i8* %268
%270 = load i64, i64* %7
br label %271
271: ; preds = %135
ret i32 1
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64, i32, i32, i64, i64, i64, i64, i64, i64 }
@SHA_CBLOCK = global i32 0
define i32 @SHA1_Final(i8* nocapture writeonly %0, %struct.TYPE_4__* %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 8
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 -128, i8* %8
%9 = add i64 %7, 1
%10 = load i32, i32* @SHA_CBLOCK
%11 = add nsw i32 %10, -8
%12 = sext i32 %11 to i64
%13 = icmp ugt i64 %9, %12
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = getelementptr inbounds i8, i8* %5, i64 %9
%16 = trunc i64 %9 to i32
%17 = sub i32 %10, %16
%18 = tail call i32 @memset(i8* %15, i32 0, i32 %17)
%19 = tail call i32 @sha1_block_data_order(%struct.TYPE_4__* %1, i8* %5, i32 1)
%20 = load i32, i32* @SHA_CBLOCK
%21 = add nsw i32 %20, -8
br label %22
22: ; preds = %14, %2
%23 = phi i32 [ %21, %14 ], [ %11, %2 ]
%24 = phi i64 [ 0, %14 ], [ %9, %2 ]
%25 = getelementptr inbounds i8, i8* %5, i64 %24
%26 = trunc i64 %24 to i32
%27 = sub i32 %23, %26
%28 = tail call i32 @memset(i8* %25, i32 0, i32 %27)
%29 = load i32, i32* @SHA_CBLOCK
%30 = add nsw i32 %29, -8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %5, i64 %31
%33 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 1
%34 = load i32, i32* %33
%35 = lshr i32 %34, 24
%36 = trunc i32 %35 to i8
%37 = getelementptr inbounds i8, i8* %32, i64 1
store i8 %36, i8* %32
%38 = load i32, i32* %33
%39 = lshr i32 %38, 16
%40 = trunc i32 %39 to i8
%41 = getelementptr inbounds i8, i8* %37, i64 1
store i8 %40, i8* %37
%42 = load i32, i32* %33
%43 = lshr i32 %42, 8
%44 = trunc i32 %43 to i8
%45 = getelementptr inbounds i8, i8* %41, i64 1
store i8 %44, i8* %41
%46 = load i32, i32* %33
%47 = trunc i32 %46 to i8
%48 = getelementptr inbounds i8, i8* %45, i64 1
store i8 %47, i8* %45
%49 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 2
%50 = load i32, i32* %49
%51 = lshr i32 %50, 24
%52 = trunc i32 %51 to i8
%53 = getelementptr inbounds i8, i8* %48, i64 1
store i8 %52, i8* %48
%54 = load i32, i32* %49
%55 = lshr i32 %54, 16
%56 = trunc i32 %55 to i8
%57 = getelementptr inbounds i8, i8* %53, i64 1
store i8 %56, i8* %53
%58 = load i32, i32* %49
%59 = lshr i32 %58, 8
%60 = trunc i32 %59 to i8
%61 = getelementptr inbounds i8, i8* %57, i64 1
store i8 %60, i8* %57
%62 = load i32, i32* %49
%63 = trunc i32 %62 to i8
%64 = getelementptr inbounds i8, i8* %61, i64 1
store i8 %63, i8* %61
%65 = load i32, i32* @SHA_CBLOCK
%66 = sext i32 %65 to i64
%67 = sub nsw i64 0, %66
%68 = getelementptr inbounds i8, i8* %64, i64 %67
%69 = tail call i32 @sha1_block_data_order(%struct.TYPE_4__* %1, i8* %68, i32 1)
store i64 0, i64* %6
%70 = load i32, i32* @SHA_CBLOCK
%71 = tail call i32 @OPENSSL_cleanse(i8* %68, i32 %70)
%72 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 3
%73 = load i64, i64* %72
%74 = lshr i64 %73, 24
%75 = trunc i64 %74 to i8
%76 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %75, i8* %0
%77 = lshr i64 %73, 16
%78 = trunc i64 %77 to i8
%79 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %78, i8* %76
%80 = lshr i64 %73, 8
%81 = trunc i64 %80 to i8
%82 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %81, i8* %79
%83 = trunc i64 %73 to i8
%84 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %83, i8* %82
%85 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 4
%86 = load i64, i64* %85
%87 = lshr i64 %86, 24
%88 = trunc i64 %87 to i8
%89 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %88, i8* %84
%90 = lshr i64 %86, 16
%91 = trunc i64 %90 to i8
%92 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %91, i8* %89
%93 = lshr i64 %86, 8
%94 = trunc i64 %93 to i8
%95 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %94, i8* %92
%96 = trunc i64 %86 to i8
%97 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %96, i8* %95
%98 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 5
%99 = load i64, i64* %98
%100 = lshr i64 %99, 24
%101 = trunc i64 %100 to i8
%102 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %101, i8* %97
%103 = lshr i64 %99, 16
%104 = trunc i64 %103 to i8
%105 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %104, i8* %102
%106 = lshr i64 %99, 8
%107 = trunc i64 %106 to i8
%108 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %107, i8* %105
%109 = trunc i64 %99 to i8
%110 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %109, i8* %108
%111 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 6
%112 = load i64, i64* %111
%113 = lshr i64 %112, 24
%114 = trunc i64 %113 to i8
%115 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %114, i8* %110
%116 = lshr i64 %112, 16
%117 = trunc i64 %116 to i8
%118 = getelementptr inbounds i8, i8* %0, i64 14
store i8 %117, i8* %115
%119 = lshr i64 %112, 8
%120 = trunc i64 %119 to i8
%121 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %120, i8* %118
%122 = trunc i64 %112 to i8
%123 = getelementptr inbounds i8, i8* %0, i64 16
store i8 %122, i8* %121
%124 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 7
%125 = load i64, i64* %124
%126 = lshr i64 %125, 24
%127 = trunc i64 %126 to i8
%128 = getelementptr inbounds i8, i8* %0, i64 17
store i8 %127, i8* %123
%129 = lshr i64 %125, 16
%130 = trunc i64 %129 to i8
%131 = getelementptr inbounds i8, i8* %0, i64 18
store i8 %130, i8* %128
%132 = lshr i64 %125, 8
%133 = trunc i64 %132 to i8
%134 = getelementptr inbounds i8, i8* %0, i64 19
store i8 %133, i8* %131
%135 = trunc i64 %125 to i8
store i8 %135, i8* %134
ret i32 1
}