#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 */

/* Type definitions */
typedef int /*<<< orphan*/ ctr;
typedef int /*<<< orphan*/ EVP_MD_CTX;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int /*<<< orphan*/ EVP_DigestFinal(int /*<<< orphan*/ *, unsigned char *,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_DigestInit_ex(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_DigestUpdate(int /*<<< orphan*/ *, unsigned char const *,
                                    size_t);
int EVP_MAX_MD_SIZE;
int /*<<< orphan*/ EVP_MD_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *EVP_MD_CTX_new();
size_t EVP_MD_size(int /*<<< orphan*/ const *);
int /*<<< orphan*/ OPENSSL_cleanse(unsigned char *, size_t);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, size_t);
int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, const unsigned char *Z,
                   size_t Zlen, const unsigned char *sinfo, size_t sinfolen,
                   const EVP_MD *md) {
  EVP_MD_CTX *mctx = NULL;
  int rv = 0;
  unsigned int i;
  size_t mdlen;
  unsigned char ctr[4];
  if (sinfolen > (1 << 30) || outlen > (1 << 30) || Zlen > (1 << 30))
    return 0;
  mctx = EVP_MD_CTX_new();
  if (mctx == NULL)
    return 0;
  mdlen = EVP_MD_size(md);
  for (i = 1;; i++) {
    unsigned char mtmp[EVP_MAX_MD_SIZE];
    if (!EVP_DigestInit_ex(mctx, md, NULL))
      goto err;
    ctr[3] = i & 0xFF;
    ctr[2] = (i >> 8) & 0xFF;
    ctr[1] = (i >> 16) & 0xFF;
    ctr[0] = (i >> 24) & 0xFF;
    if (!EVP_DigestUpdate(mctx, Z, Zlen))
      goto err;
    if (!EVP_DigestUpdate(mctx, ctr, sizeof(ctr)))
      goto err;
    if (!EVP_DigestUpdate(mctx, sinfo, sinfolen))
      goto err;
    if (outlen >= mdlen) {
      if (!EVP_DigestFinal(mctx, out, NULL))
        goto err;
      outlen -= mdlen;
      if (outlen == 0)
        break;
      out += mdlen;
    } else {
      if (!EVP_DigestFinal(mctx, mtmp, NULL))
        goto err;
      memcpy(out, mtmp, outlen);
      OPENSSL_cleanse(mtmp, mdlen);
      break;
    }
  }
  rv = 1;
err:
  EVP_MD_CTX_free(mctx);
  return rv;
}


x86 assembly (clang, -O0):
<ECDH_KDF_X9_62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpq   $0x40000000,-0x38(%rbp)
40
ja     11e0 <ECDH_KDF_X9_62+0x60>
cmpq   $0x40000000,-0x18(%rbp)
40
ja     11e0 <ECDH_KDF_X9_62+0x60>
cmpq   $0x40000000,-0x28(%rbp)
40
jbe    11ec <ECDH_KDF_X9_62+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    1437 <ECDH_KDF_X9_62+0x2b7>
mov    $0x0,%al
call   1090 <EVP_MD_CTX_new@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    120e <ECDH_KDF_X9_62+0x8e>
movl   $0x0,-0x4(%rbp)
jmp    1437 <ECDH_KDF_X9_62+0x2b7>
mov    0x10(%rbp),%rdi
call   1030 <EVP_MD_size@plt>
mov    %rax,-0x50(%rbp)
movl   $0x1,-0x48(%rbp)
mov    0x2dbf(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
mov    0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1060 <EVP_DigestInit_ex@plt>
cmp    $0x0,%eax
jne    1274 <ECDH_KDF_X9_62+0xf4>
movl   $0x5,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
mov    -0x48(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x51(%rbp)
mov    -0x48(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x52(%rbp)
mov    -0x48(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x53(%rbp)
mov    -0x48(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x54(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1080 <EVP_DigestUpdate@plt>
cmp    $0x0,%eax
jne    12cf <ECDH_KDF_X9_62+0x14f>
movl   $0x5,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
mov    -0x40(%rbp),%rdi
lea    -0x54(%rbp),%rsi
mov    $0x4,%edx
call   1080 <EVP_DigestUpdate@plt>
cmp    $0x0,%eax
jne    12f6 <ECDH_KDF_X9_62+0x176>
movl   $0x5,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1080 <EVP_DigestUpdate@plt>
cmp    $0x0,%eax
jne    131c <ECDH_KDF_X9_62+0x19c>
movl   $0x5,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
mov    -0x18(%rbp),%rax
cmp    -0x50(%rbp),%rax
jb     1387 <ECDH_KDF_X9_62+0x207>
mov    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   10a0 <EVP_DigestFinal@plt>
cmp    $0x0,%eax
jne    1350 <ECDH_KDF_X9_62+0x1d0>
movl   $0x5,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
mov    -0x50(%rbp),%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1376 <ECDH_KDF_X9_62+0x1f6>
movl   $0x2,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
mov    -0x50(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    13d7 <ECDH_KDF_X9_62+0x257>
mov    -0x78(%rbp),%rsi
mov    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   10a0 <EVP_DigestFinal@plt>
cmp    $0x0,%eax
jne    13ad <ECDH_KDF_X9_62+0x22d>
movl   $0x5,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
mov    -0x78(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1070 <memcpy@plt>
mov    -0x78(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1050 <OPENSSL_cleanse@plt>
movl   $0x2,-0x6c(%rbp)
jmp    13de <ECDH_KDF_X9_62+0x25e>
movl   $0x0,-0x6c(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,%rsp
mov    -0x6c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
test   %eax,%eax
je     140e <ECDH_KDF_X9_62+0x28e>
jmp    13f8 <ECDH_KDF_X9_62+0x278>
mov    -0x7c(%rbp),%eax
sub    $0x2,%eax
je     1421 <ECDH_KDF_X9_62+0x2a1>
jmp    1409 <ECDH_KDF_X9_62+0x289>
jmp    1428 <ECDH_KDF_X9_62+0x2a8>
jmp    1413 <ECDH_KDF_X9_62+0x293>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1222 <ECDH_KDF_X9_62+0xa2>
movl   $0x1,-0x44(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <EVP_MD_CTX_free@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECDH_KDF_X9_62>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8,-0x58(%rbp)
mov    %rdx,-0x60(%rbp)
xor    %r12d,%r12d
mov    %rcx,-0x68(%rbp)
cmp    $0x40000000,%rcx
ja     1313 <ECDH_KDF_X9_62+0x193>
mov    %rsi,%r14
cmp    $0x40000000,%rsi
ja     1313 <ECDH_KDF_X9_62+0x193>
mov    %r9,%r13
cmp    $0x40000000,%r9
ja     1313 <ECDH_KDF_X9_62+0x193>
mov    %rdi,%r15
xor    %r12d,%r12d
xor    %eax,%eax
call   1090 <EVP_MD_CTX_new@plt>
test   %rax,%rax
je     1313 <ECDH_KDF_X9_62+0x193>
mov    %rax,%rbx
mov    %r13,-0x50(%rbp)
mov    %r15,-0x30(%rbp)
mov    0x10(%rbp),%r15
mov    %r15,%rdi
call   1030 <EVP_MD_size@plt>
mov    %rax,-0x38(%rbp)
mov    %rsp,%r12
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1060 <EVP_DigestInit_ex@plt>
test   %eax,%eax
mov    %rbx,%r15
mov    %r12,-0x48(%rbp)
je     1304 <ECDH_KDF_X9_62+0x184>
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %ebx,%eax
bswap  %eax
mov    %eax,-0x3c(%rbp)
mov    %r15,%rdi
mov    -0x60(%rbp),%rsi
mov    -0x68(%rbp),%rdx
call   1080 <EVP_DigestUpdate@plt>
test   %eax,%eax
je     1304 <ECDH_KDF_X9_62+0x184>
mov    $0x4,%edx
mov    %r15,%rdi
lea    -0x3c(%rbp),%rsi
call   1080 <EVP_DigestUpdate@plt>
test   %eax,%eax
je     1304 <ECDH_KDF_X9_62+0x184>
mov    %r15,%rdi
mov    -0x58(%rbp),%rsi
mov    -0x50(%rbp),%rdx
call   1080 <EVP_DigestUpdate@plt>
test   %eax,%eax
je     1304 <ECDH_KDF_X9_62+0x184>
cmp    -0x38(%rbp),%r14
jb     1325 <ECDH_KDF_X9_62+0x1a5>
mov    %ebx,%r13d
xor    %r12d,%r12d
mov    %r15,%rdi
mov    -0x30(%rbp),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
call   10a0 <EVP_DigestFinal@plt>
test   %eax,%eax
je     1307 <ECDH_KDF_X9_62+0x187>
mov    -0x38(%rbp),%rax
sub    %rax,%r14
je     1354 <ECDH_KDF_X9_62+0x1d4>
add    %rax,%rbx
mov    %rbx,-0x30(%rbp)
mov    -0x48(%rbp),%rsp
mov    %r13d,%ebx
add    $0x1,%ebx
mov    0x2d12(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
xor    %r12d,%r12d
mov    %r15,%rdi
mov    0x10(%rbp),%rsi
xor    %edx,%edx
call   1060 <EVP_DigestInit_ex@plt>
test   %eax,%eax
jne    1240 <ECDH_KDF_X9_62+0xc0>
jmp    1307 <ECDH_KDF_X9_62+0x187>
xor    %r12d,%r12d
mov    -0x48(%rbp),%rsp
mov    %r15,%rdi
call   1040 <EVP_MD_CTX_free@plt>
mov    %r12d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r12d,%r12d
mov    %r15,%rdi
mov    %r13,%rsi
xor    %edx,%edx
call   10a0 <EVP_DigestFinal@plt>
test   %eax,%eax
je     1307 <ECDH_KDF_X9_62+0x187>
mov    -0x30(%rbp),%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1070 <memcpy@plt>
mov    %r13,%rdi
mov    -0x38(%rbp),%rsi
call   1050 <OPENSSL_cleanse@plt>
mov    $0x1,%r12d
jmp    1307 <ECDH_KDF_X9_62+0x187>

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

LLVM IR (-O2):
@EVP_MAX_MD_SIZE = global i32 0
define i32 @ECDH_KDF_X9_62(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32* %6) {
%8 = alloca [4 x i8]
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%10 = icmp ugt i64 %5, 1073741824
%11 = icmp ugt i64 %1, 1073741824
%12 = or i1 %11, %10
%13 = icmp ugt i64 %3, 1073741824
%14 = or i1 %13, %12
br i1 %14, label %78, label %15
15: ; preds = %7
%16 = tail call i32* (...) @EVP_MD_CTX_new()
%17 = icmp eq i32* %16, null
br i1 %17, label %78, label %18
18: ; preds = %15
%19 = tail call i64 @EVP_MD_size(i32* %6)
%20 = load i32, i32* @EVP_MAX_MD_SIZE
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
%23 = alloca i8, i64 %21
%24 = call i32 @EVP_DigestInit_ex(i32* %16, i32* %6, i32* null)
%25 = icmp eq i32 %24, 0
br i1 %25, label %74, label %26
26: ; preds = %18
%27 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 3
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 2
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 1
br label %30
30: ; preds = %26, %65
%31 = phi i8* [ %23, %26 ], [ %71, %65 ]
%32 = phi i8* [ %22, %26 ], [ %70, %65 ]
%33 = phi i8* [ %0, %26 ], [ %66, %65 ]
%34 = phi i64 [ %1, %26 ], [ %57, %65 ]
%35 = phi i32 [ 1, %26 ], [ %67, %65 ]
%36 = trunc i32 %35 to i8
store i8 %36, i8* %27
%37 = lshr i32 %35, 8
%38 = trunc i32 %37 to i8
store i8 %38, i8* %28
%39 = lshr i32 %35, 16
%40 = trunc i32 %39 to i8
store i8 %40, i8* %29
%41 = lshr i32 %35, 24
%42 = trunc i32 %41 to i8
store i8 %42, i8* %9
%43 = call i32 @EVP_DigestUpdate(i32* %16, i8* %2, i64 %3)
%44 = icmp eq i32 %43, 0
br i1 %44, label %74, label %45
45: ; preds = %30
%46 = call i32 @EVP_DigestUpdate(i32* %16, i8* %9, i64 4)
%47 = icmp eq i32 %46, 0
br i1 %47, label %74, label %48
48: ; preds = %45
%49 = call i32 @EVP_DigestUpdate(i32* %16, i8* %4, i64 %5)
%50 = icmp eq i32 %49, 0
br i1 %50, label %74, label %51
51: ; preds = %48
%52 = icmp ult i64 %34, %19
br i1 %52, label %59, label %53
53: ; preds = %51
%54 = call i32 @EVP_DigestFinal(i32* %16, i8* %33, i32* null)
%55 = icmp eq i32 %54, 0
br i1 %55, label %74, label %56
56: ; preds = %53
%57 = sub i64 %34, %19
%58 = icmp eq i64 %57, 0
br i1 %58, label %74, label %65
59: ; preds = %51
%60 = call i32 @EVP_DigestFinal(i32* %16, i8* %31, i32* null)
%61 = icmp eq i32 %60, 0
br i1 %61, label %74, label %62
62: ; preds = %59
%63 = call i32 @memcpy(i8* %33, i8* %31, i64 %34)
%64 = call i32 @OPENSSL_cleanse(i8* %31, i64 %19)
br label %74
65: ; preds = %56
%66 = getelementptr inbounds i8, i8* %33, i64 %19
%67 = add i32 %35, 1
%68 = load i32, i32* @EVP_MAX_MD_SIZE
%69 = zext i32 %68 to i64
%70 = call i8* @llvm.stacksave()
%71 = alloca i8, i64 %69
%72 = call i32 @EVP_DigestInit_ex(i32* %16, i32* %6, i32* null)
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %30
74: ; preds = %56, %65, %30, %45, %48, %53, %62, %59, %18
%75 = phi i8* [ %32, %59 ], [ %22, %18 ], [ %32, %62 ], [ %32, %53 ], [ %32, %48 ], [ %32, %45 ], [ %32, %30 ], [ %70, %65 ], [ %32, %56 ]
%76 = phi i32 [ 0, %59 ], [ 0, %18 ], [ 1, %62 ], [ 0, %53 ], [ 0, %48 ], [ 0, %45 ], [ 0, %30 ], [ 0, %65 ], [ 1, %56 ]
%77 = call i32 @EVP_MD_CTX_free(i32* %16)
br label %78
78: ; preds = %15, %7, %74
%79 = phi i32 [ %76, %74 ], [ 0, %7 ], [ 0, %15 ]
ret i32 %79
}