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

/* Variables and functions */
int /*<<< orphan*/ CRYPTO_cleanup_all_ex_data();
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ EVP_cleanup();
int /*<<< orphan*/ EVP_sha512();
unsigned char *HMAC(int /*<<< orphan*/, char *, int, unsigned char *, int,
                    int /*<<< orphan*/ *, unsigned int *);
int /*<<< orphan*/ OPENSSL_config(int /*<<< orphan*/ *);
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ PKCS5_PBKDF2_HMAC(char *, int, char *, int, int,
                                     int /*<<< orphan*/, int, char *);
char *base64(unsigned char *, int);
int ntohl(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(int argc, char **argv) {
  char derived_key[64] = {0};
  char hexResult[2 * 64 + 1] = {0};
  unsigned int md_len = 0;
  unsigned char data[] = {149, 177, 79,  110, 101, 83,  104, 97,  108, 108,
                          80,  97,  115, 115, 32,  118, 50,  46,  48,  164,
                          115, 97,  108, 116, 170, 103, 111, 111, 103, 108,
                          101, 46,  99,  111, 109, 1,   0};
  int i;
  ERR_load_crypto_strings();
  OpenSSL_add_all_algorithms();
  OPENSSL_config(NULL);
  PKCS5_PBKDF2_HMAC("password", 8, "salt", 4, 256, EVP_sha512(), 64,
                    derived_key);
  for (i = 0; i < 64; i++) {
    sprintf(hexResult + (i * 2), "%02x", 255 & derived_key[i]);
  };
  printf("dk:\n");
  for (i = 0; i < 64 / 4; i++) {
    printf("[%d] %d\n", i, ntohl(*(int *)(derived_key + 4 * i)));
  }
  unsigned char *digest =
      HMAC(EVP_sha512(), derived_key, 64, data, sizeof(data), NULL, &md_len);
  printf("md_len: %d\n", md_len);
  for (i = 0; i < md_len; i++) {
    sprintf(hexResult + (i * 2), "%02x", 255 & digest[i]);
  };
  digest[md_len] = 0;
  printf("digest raw: %s\n", digest);
  printf("digest:\n");
  for (i = 0; i < md_len / 4; i++) {
    printf("[%d] %d\n", i, ntohl(*(int *)(digest + i * 4)));
  }
  printf("digest %s\n", hexResult);
  printf("digest base64 %s\n", base64(digest, 64));
  EVP_cleanup();
  CRYPTO_cleanup_all_ex_data();
  ERR_free_strings();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1080 <memset@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x81,%edx
call   1080 <memset@plt>
movl   $0x0,-0xe4(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xdbc(%rip),%rsi
mov    $0x25,%edx
call   10c0 <memcpy@plt>
mov    $0x0,%al
call   10f0 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   10a0 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <OPENSSL_config@plt>
mov    $0x0,%al
call   1060 <EVP_sha512@plt>
mov    %eax,%r9d
lea    -0x50(%rbp),%rax
lea    0xdab(%rip),%rdi
mov    $0x8,%esi
lea    0xda8(%rip),%rdx
mov    $0x4,%ecx
mov    $0x100,%r8d
movl   $0x40,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <PKCS5_PBKDF2_HMAC@plt>
movl   $0x0,-0x114(%rbp)
cmpl   $0x40,-0x114(%rbp)
jge    1300 <main+0x110>
lea    -0xe0(%rbp),%rdi
mov    -0x114(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
movslq -0x114(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%edx
and    $0xff,%edx
lea    0xd4c(%rip),%rsi
call   1100 <sprintf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    12ac <main+0xbc>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x114(%rbp)
cmpl   $0x10,-0x114(%rbp)
jge    136f <main+0x17f>
mov    -0x114(%rbp),%eax
mov    %eax,-0x124(%rbp)
mov    -0x114(%rbp),%eax
shl    $0x2,%eax
cltq
mov    -0x50(%rbp,%rax,1),%edi
call   1110 <ntohl@plt>
mov    -0x124(%rbp),%esi
mov    %eax,%edx
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1318 <main+0x128>
mov    $0x0,%al
call   1060 <EVP_sha512@plt>
mov    %eax,%edi
lea    -0x50(%rbp),%rsi
lea    -0x110(%rbp),%rcx
mov    $0x40,%edx
mov    $0x25,%r8d
xor    %eax,%eax
mov    %eax,%r9d
lea    -0xe4(%rbp),%rax
mov    %rax,(%rsp)
call   10e0 <HMAC@plt>
mov    %rax,-0x120(%rbp)
mov    -0xe4(%rbp),%esi
lea    0xc8f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0xe4(%rbp),%eax
jae    1427 <main+0x237>
lea    -0xe0(%rbp),%rdi
mov    -0x114(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
mov    -0x120(%rbp),%rax
movslq -0x114(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
and    $0xff,%edx
lea    0xc25(%rip),%rsi
call   1100 <sprintf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    13c8 <main+0x1d8>
mov    -0x120(%rbp),%rax
mov    -0xe4(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x120(%rbp),%rsi
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xc0e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
mov    -0xe4(%rbp),%ecx
shr    $0x2,%ecx
cmp    %ecx,%eax
jae    14cd <main+0x2dd>
mov    -0x114(%rbp),%eax
mov    %eax,-0x128(%rbp)
mov    -0x120(%rbp),%rax
mov    -0x114(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%edi
call   1110 <ntohl@plt>
mov    -0x128(%rbp),%esi
mov    %eax,%edx
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1465 <main+0x275>
lea    -0xe0(%rbp),%rsi
lea    0xb90(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x120(%rbp),%rdi
mov    $0x40,%esi
call   1090 <base64@plt>
mov    %rax,%rsi
lea    0xb79(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x0,%al
call   10b0 <EVP_cleanup@plt>
mov    $0x0,%al
call   1040 <CRYPTO_cleanup_all_ex_data@plt>
mov    $0x0,%al
call   10d0 <ERR_free_strings@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x110,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movb   $0x0,0x100(%rsp)
movl   $0x0,0xc(%rsp)
movabs $0x16d6f632e656c,%rax
mov    %rax,0x6d(%rsp)
movaps 0xda3(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xd87(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
xor    %r15d,%r15d
xor    %eax,%eax
call   10e0 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   10a0 <OpenSSL_add_all_algorithms@plt>
xor    %edi,%edi
call   1030 <OPENSSL_config@plt>
xor    %eax,%eax
call   1070 <EVP_sha512@plt>
lea    0x10(%rsp),%rbx
lea    0xd7c(%rip),%rdi
lea    0xd7e(%rip),%rdx
mov    $0x8,%esi
mov    $0x4,%ecx
mov    $0x100,%r8d
mov    %eax,%r9d
push   %rbx
push   $0x40
call   1060 <PKCS5_PBKDF2_HMAC@plt>
add    $0x10,%rsp
lea    0x80(%rsp),%rbx
lea    0xd55(%rip),%r14
xchg   %ax,%ax
movzbl 0x10(%rsp,%r15,1),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   10f0 <sprintf@plt>
add    $0x1,%r15
add    $0x2,%rbx
cmp    $0x40,%r15
jne    12e0 <main+0x100>
lea    0xd74(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%edi
call   1100 <ntohl@plt>
lea    0xd1d(%rip),%rbx
xor    %r12d,%r12d
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x14(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x1c(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x20(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x24(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x28(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x2c(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x30(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x34(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x38(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x3c(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x40(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x44(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x48(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x4c(%rsp),%edi
call   1100 <ntohl@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
call   1070 <EVP_sha512@plt>
sub    $0x8,%rsp
lea    0x14(%rsp),%rbx
lea    0x18(%rsp),%rsi
lea    0x58(%rsp),%rcx
mov    %eax,%edi
mov    $0x40,%edx
mov    $0x25,%r8d
xor    %r9d,%r9d
push   %rbx
call   10d0 <HMAC@plt>
add    $0x10,%rsp
mov    %rax,%r15
mov    0xc(%rsp),%esi
lea    0xb4d(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
cmpl   $0x0,0xc(%rsp)
je     1542 <main+0x362>
lea    0x80(%rsp),%r13
xor    %ebx,%ebx
lea    0xb20(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r15,%rbx,1),%edx
mov    %r13,%rdi
mov    %r14,%rsi
call   10f0 <sprintf@plt>
add    $0x1,%rbx
mov    0xc(%rsp),%r12d
add    $0x2,%r13
cmp    %r12,%rbx
jb     1520 <main+0x340>
movb   $0x0,(%r15,%r12,1)
lea    0xaff(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xb1f(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x4,0xc(%rsp)
jb     15a8 <main+0x3c8>
lea    0xac6(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15,%rbx,4),%edi
call   1100 <ntohl@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbx
mov    0xc(%rsp),%eax
shr    $0x2,%rax
cmp    %rax,%rbx
jb     1580 <main+0x3a0>
lea    0xaae(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    $0x40,%esi
call   1090 <base64@plt>
lea    0xa96(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
call   10b0 <EVP_cleanup@plt>
xor    %eax,%eax
call   1050 <CRYPTO_cleanup_all_ex_data@plt>
xor    %eax,%eax
call   10c0 <ERR_free_strings@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.data = [37 x i8] c"\95\B1OneShallPass v2.0\A4salt\AAgoogle.com\01\00"
@.str = [9 x i8] c"password\00"
@.str.1 = [5 x i8] c"salt\00"
@.str.2 = [5 x i8] c"%02x\00"
@.str.3 = [5 x i8] c"dk:\0A\00"
@.str.4 = [9 x i8] c"[%d] %d\0A\00"
@.str.5 = [12 x i8] c"md_len: %d\0A\00"
@.str.6 = [16 x i8] c"digest raw: %s\0A\00"
@.str.7 = [9 x i8] c"digest:\0A\00"
@.str.8 = [11 x i8] c"digest %s\0A\00"
@.str.9 = [18 x i8] c"digest base64 %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [64 x i8]
%7 = alloca [129 x i8]
%8 = alloca i32
%9 = alloca [37 x i8]
%10 = alloca i32
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [64 x i8]* %6 to i8*
%13 = bitcast [129 x i8]* %7 to i8*
store i32 0, i32* %8
%14 = bitcast [37 x i8]* %9 to i8*
%15 = call i32 (...) @ERR_load_crypto_strings()
%16 = call i32 (...) @OpenSSL_add_all_algorithms()
%17 = call i32 @OPENSSL_config(i32* null)
%18 = call i32 (...) @EVP_sha512()
%19 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%20 = call i32 @PKCS5_PBKDF2_HMAC(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 256, i32 %18, i32 64, i8* %19)
store i32 0, i32* %10
br label %21
21: ; preds = %37, %2
%22 = load i32, i32* %10
%23 = icmp slt i32 %22, 64
br i1 %23, label %24, label %40
24: ; preds = %21
%25 = getelementptr inbounds [129 x i8], [129 x i8]* %7, i64 0, i64 0
%26 = load i32, i32* %10
%27 = mul nsw i32 %26, 2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = and i32 255, %34
%36 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %24
%38 = load i32, i32* %10
%39 = add nsw i32 %38, 1
store i32 %39, i32* %10
br label %21
40: ; preds = %21
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %10
br label %42
42: ; preds = %56, %40
%43 = load i32, i32* %10
%44 = icmp slt i32 %43, 16
br i1 %44, label %45, label %59
45: ; preds = %42
%46 = load i32, i32* %10
%47 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%48 = load i32, i32* %10
%49 = mul nsw i32 4, %48
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %47, i64 %50
%52 = bitcast i8* %51 to i32*
%53 = load i32, i32* %52
%54 = call i32 @ntohl(i32 %53)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %46, i32 %54)
br label %56
56: ; preds = %45
%57 = load i32, i32* %10
%58 = add nsw i32 %57, 1
store i32 %58, i32* %10
br label %42
59: ; preds = %42
%60 = call i32 (...) @EVP_sha512()
%61 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%62 = getelementptr inbounds [37 x i8], [37 x i8]* %9, i64 0, i64 0
%63 = call i8* @HMAC(i32 %60, i8* %61, i32 64, i8* %62, i32 37, i32* null, i32* %8)
store i8* %63, i8** %11
%64 = load i32, i32* %8
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %64)
store i32 0, i32* %10
br label %66
66: ; preds = %84, %59
%67 = load i32, i32* %10
%68 = load i32, i32* %8
%69 = icmp ult i32 %67, %68
br i1 %69, label %70, label %87
70: ; preds = %66
%71 = getelementptr inbounds [129 x i8], [129 x i8]* %7, i64 0, i64 0
%72 = load i32, i32* %10
%73 = mul nsw i32 %72, 2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %71, i64 %74
%76 = load i8*, i8** %11
%77 = load i32, i32* %10
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %76, i64 %78
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = and i32 255, %81
%83 = call i32 @sprintf(i8* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %82)
br label %84
84: ; preds = %70
%85 = load i32, i32* %10
%86 = add nsw i32 %85, 1
store i32 %86, i32* %10
br label %66
87: ; preds = %66
%88 = load i8*, i8** %11
%89 = load i32, i32* %8
%90 = zext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %88, i64 %90
store i8 0, i8* %91
%92 = load i8*, i8** %11
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %92)
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %10
br label %95
95: ; preds = %111, %87
%96 = load i32, i32* %10
%97 = load i32, i32* %8
%98 = udiv i32 %97, 4
%99 = icmp ult i32 %96, %98
br i1 %99, label %100, label %114
100: ; preds = %95
%101 = load i32, i32* %10
%102 = load i8*, i8** %11
%103 = load i32, i32* %10
%104 = mul nsw i32 %103, 4
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %102, i64 %105
%107 = bitcast i8* %106 to i32*
%108 = load i32, i32* %107
%109 = call i32 @ntohl(i32 %108)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %101, i32 %109)
br label %111
111: ; preds = %100
%112 = load i32, i32* %10
%113 = add nsw i32 %112, 1
store i32 %113, i32* %10
br label %95
114: ; preds = %95
%115 = getelementptr inbounds [129 x i8], [129 x i8]* %7, i64 0, i64 0
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %115)
%117 = load i8*, i8** %11
%118 = call i8* @base64(i8* %117, i32 64)
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %118)
%120 = call i32 (...) @EVP_cleanup()
%121 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%122 = call i32 (...) @ERR_free_strings()
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [37 x i8] c"\95\B1OneShallPass v2.0\A4salt\AAgoogle.com\01\00"
@.str = [9 x i8] c"password\00"
@.str.1 = [5 x i8] c"salt\00"
@.str.2 = [5 x i8] c"%02x\00"
@.str.4 = [9 x i8] c"[%d] %d\0A\00"
@.str.5 = [12 x i8] c"md_len: %d\0A\00"
@.str.6 = [16 x i8] c"digest raw: %s\0A\00"
@.str.8 = [11 x i8] c"digest %s\0A\00"
@.str.9 = [18 x i8] c"digest base64 %s\0A\00"
@str = [4 x i8] c"dk:\00"
@str.10 = [8 x i8] c"digest:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [64 x i8]
%4 = alloca [129 x i8]
%5 = alloca i32
%6 = alloca [37 x i8]
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [129 x i8], [129 x i8]* %4, i64 0, i64 0
%9 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%10 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 0
%11 = tail call i32 (...) @ERR_load_crypto_strings()
%12 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%13 = tail call i32 @OPENSSL_config(i32* null)
%14 = tail call i32 (...) @EVP_sha512()
%15 = call i32 @PKCS5_PBKDF2_HMAC(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 256, i32 %14, i32 64, i8* %7)
br label %16
16: ; preds = %2, %16
%17 = phi i64 [ 0, %2 ], [ %24, %16 ]
%18 = shl nuw nsw i64 %17, 1
%19 = getelementptr inbounds [129 x i8], [129 x i8]* %4, i64 0, i64 %18
%20 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 %17
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = call i32 @sprintf(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = add nuw nsw i64 %17, 1
%25 = icmp eq i64 %24, 64
br i1 %25, label %26, label %16
26: ; preds = %16
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%28 = bitcast [64 x i8]* %3 to i32*
%29 = load i32, i32* %28
%30 = call i32 @ntohl(i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 %30)
%32 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 4
%33 = bitcast i8* %32 to i32*
%34 = load i32, i32* %33
%35 = call i32 @ntohl(i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %35)
%37 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 8
%38 = bitcast i8* %37 to i32*
%39 = load i32, i32* %38
%40 = call i32 @ntohl(i32 %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 %40)
%42 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 12
%43 = bitcast i8* %42 to i32*
%44 = load i32, i32* %43
%45 = call i32 @ntohl(i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 %45)
%47 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 16
%48 = bitcast i8* %47 to i32*
%49 = load i32, i32* %48
%50 = call i32 @ntohl(i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 4, i32 %50)
%52 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 20
%53 = bitcast i8* %52 to i32*
%54 = load i32, i32* %53
%55 = call i32 @ntohl(i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 5, i32 %55)
%57 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 24
%58 = bitcast i8* %57 to i32*
%59 = load i32, i32* %58
%60 = call i32 @ntohl(i32 %59)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 6, i32 %60)
%62 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 28
%63 = bitcast i8* %62 to i32*
%64 = load i32, i32* %63
%65 = call i32 @ntohl(i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 7, i32 %65)
%67 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 32
%68 = bitcast i8* %67 to i32*
%69 = load i32, i32* %68
%70 = call i32 @ntohl(i32 %69)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 8, i32 %70)
%72 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 36
%73 = bitcast i8* %72 to i32*
%74 = load i32, i32* %73
%75 = call i32 @ntohl(i32 %74)
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 9, i32 %75)
%77 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 40
%78 = bitcast i8* %77 to i32*
%79 = load i32, i32* %78
%80 = call i32 @ntohl(i32 %79)
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 10, i32 %80)
%82 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 44
%83 = bitcast i8* %82 to i32*
%84 = load i32, i32* %83
%85 = call i32 @ntohl(i32 %84)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 11, i32 %85)
%87 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 48
%88 = bitcast i8* %87 to i32*
%89 = load i32, i32* %88
%90 = call i32 @ntohl(i32 %89)
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 12, i32 %90)
%92 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 52
%93 = bitcast i8* %92 to i32*
%94 = load i32, i32* %93
%95 = call i32 @ntohl(i32 %94)
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 13, i32 %95)
%97 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 56
%98 = bitcast i8* %97 to i32*
%99 = load i32, i32* %98
%100 = call i32 @ntohl(i32 %99)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 14, i32 %100)
%102 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 60
%103 = bitcast i8* %102 to i32*
%104 = load i32, i32* %103
%105 = call i32 @ntohl(i32 %104)
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 15, i32 %105)
%107 = call i32 (...) @EVP_sha512()
%108 = call i8* @HMAC(i32 %107, i8* %7, i32 64, i8* %10, i32 37, i32* null, i32* %5)
%109 = load i32, i32* %5
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %109)
%111 = load i32, i32* %5
%112 = icmp eq i32 %111, 0
br i1 %112, label %127, label %113
113: ; preds = %26, %113
%114 = phi i64 [ %121, %113 ], [ 0, %26 ]
%115 = shl nuw nsw i64 %114, 1
%116 = getelementptr inbounds [129 x i8], [129 x i8]* %4, i64 0, i64 %115
%117 = getelementptr inbounds i8, i8* %108, i64 %114
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = call i32 @sprintf(i8* %116, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %119)
%121 = add nuw nsw i64 %114, 1
%122 = load i32, i32* %5
%123 = zext i32 %122 to i64
%124 = icmp ult i64 %121, %123
br i1 %124, label %113, label %125
125: ; preds = %113
%126 = zext i32 %122 to i64
br label %127
127: ; preds = %26, %125
%128 = phi i64 [ %126, %125 ], [ 0, %26 ]
%129 = getelementptr inbounds i8, i8* %108, i64 %128
store i8 0, i8* %129
%130 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %108)
%131 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0))
%132 = load i32, i32* %5
%133 = icmp ult i32 %132, 4
br i1 %133, label %148, label %134
134: ; preds = %127, %134
%135 = phi i64 [ %143, %134 ], [ 0, %127 ]
%136 = shl nsw i64 %135, 2
%137 = getelementptr inbounds i8, i8* %108, i64 %136
%138 = bitcast i8* %137 to i32*
%139 = load i32, i32* %138
%140 = call i32 @ntohl(i32 %139)
%141 = trunc i64 %135 to i32
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %141, i32 %140)
%143 = add nuw nsw i64 %135, 1
%144 = load i32, i32* %5
%145 = lshr i32 %144, 2
%146 = zext i32 %145 to i64
%147 = icmp ult i64 %143, %146
br i1 %147, label %134, label %148
148: ; preds = %134, %127
%149 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %8)
%150 = call i8* @base64(i8* %108, i32 64)
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* %150)
%152 = call i32 (...) @EVP_cleanup()
%153 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%154 = call i32 (...) @ERR_free_strings()
ret i32 0
}