#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 uint32_t;

/* Variables and functions */
int UINT32_C(int);
int /*<<< orphan*/ argon2_select_impl(int /*<<< orphan*/, char *);
int benchmark(void *, size_t, int, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int, size_t);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *,
                          char *);
int /*<<< orphan*/ stderr;
int strtoul(char const *const, char **, int);
int main(int argc, const char *const *argv) {
  uint32_t max_t_cost = 16;
  uint32_t max_m_cost = (1024 * 1024);
  uint32_t max_p = 8;
  uint32_t t_cost, m_cost, p;
  char *end;
  int res;
  if (argc >= 2) {
    max_t_cost = strtoul(argv[1], &end, 10);
    if (end == argv[1]) {
      fprintf(stderr, "ERROR: Invalid number format!\n");
      return 1;
    }
  }
  if (argc >= 3) {
    max_m_cost = strtoul(argv[2], &end, 10);
    if (end == argv[2]) {
      fprintf(stderr, "ERROR: Invalid number format!\n");
      return 1;
    }
  }
  if (argc >= 4) {
    max_p = strtoul(argv[3], &end, 10);
    if (end == argv[3]) {
      fprintf(stderr, "ERROR: Invalid number format!\n");
      return 1;
    }
  }
  argon2_select_impl(stderr, "[libargon2] ");
  size_t memory_size = (size_t)max_m_cost * (size_t)1024;
  void *memory = malloc(memory_size);
  if (memory == NULL) {
    fprintf(stderr, "ERROR: Memory allocation failed!\n");
    return 1;
  }
  memset(memory, 0xAB, memory_size);
  printf("%8s%16s%8s%16s%16s%16s\n", "t_cost", "m_cost", "threads",
         "Argon2d (ms)", "Argon2i (ms)", "Argon2id (ms)");
  for (t_cost = 1; t_cost <= max_t_cost; t_cost *= 2) {
    uint32_t min_m_cost = max_p * UINT32_C(4) * 2;
    for (m_cost = min_m_cost; m_cost <= max_m_cost; m_cost *= 2) {
      for (p = 1; p <= max_p; p *= 2) {
        res = benchmark(memory, memory_size, t_cost, m_cost, p);
        if (res != 0) {
          free(memory);
          return res;
        }
      }
    }
  }
  free(memory);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x10,-0x14(%rbp)
movl   $0x100000,-0x18(%rbp)
movl   $0x8,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1216 <main+0x86>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
jne    1211 <main+0x81>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
lea    0xe00(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x2b9>
jmp    1216 <main+0x86>
cmpl   $0x3,-0x8(%rbp)
jl     1271 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x10(%rcx),%rax
jne    126c <main+0xdc>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
lea    0xda5(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x2b9>
jmp    1271 <main+0xe1>
cmpl   $0x4,-0x8(%rbp)
jl     12cc <main+0x13c>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    -0x30(%rbp),%rsi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x18(%rcx),%rax
jne    12c7 <main+0x137>
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
lea    0xd4a(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x2b9>
jmp    12cc <main+0x13c>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
lea    0xd43(%rip),%rsi
call   1040 <argon2_select_impl@plt>
movslq -0x18(%rbp),%rax
shl    $0xa,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1326 <main+0x196>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
lea    0xd17(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1449 <main+0x2b9>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0xab,%esi
call   1060 <memset@plt>
lea    0xd0f(%rip),%rdi
lea    0xd20(%rip),%rsi
lea    0xd20(%rip),%rdx
lea    0xd20(%rip),%rcx
lea    0xd21(%rip),%r8
lea    0xd27(%rip),%r9
lea    0xd2d(%rip),%rax
mov    %rax,(%rsp)
call   1050 <printf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1439 <main+0x2a9>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    $0x4,%edi
call   10a0 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
imul   %ecx,%eax
shl    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1426 <main+0x296>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1413 <main+0x283>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
call   1090 <benchmark@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1400 <main+0x270>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <main+0x2b9>
jmp    1405 <main+0x275>
mov    -0x28(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13bc <main+0x22c>
jmp    1418 <main+0x288>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13a9 <main+0x219>
jmp    142b <main+0x29b>
mov    -0x20(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1379 <main+0x1e9>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x8,0x14(%rsp)
mov    $0x10,%r14d
mov    $0x100000,%r15d
cmp    $0x2,%edi
jl     1236 <main+0xa6>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0x18(%rsp),%rsi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,%r14d
mov    0x18(%rsp),%rax
cmp    0x8(%rbx),%rax
je     1358 <main+0x1c8>
cmp    $0x3,%ebp
jb     1236 <main+0xa6>
mov    0x10(%rbx),%rdi
lea    0x18(%rsp),%rsi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,%r15d
mov    0x18(%rsp),%rax
cmp    0x10(%rbx),%rax
je     1358 <main+0x1c8>
cmp    $0x4,%ebp
jb     1236 <main+0xa6>
mov    0x18(%rbx),%rdi
lea    0x18(%rsp),%rsi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,0x14(%rsp)
mov    0x18(%rsp),%rax
cmp    0x18(%rbx),%rax
je     1358 <main+0x1c8>
mov    0x2da3(%rip),%rbx
mov    (%rbx),%edi
lea    0xdd9(%rip),%rsi
call   1040 <argon2_select_impl@plt>
movslq %r15d,%rbp
shl    $0xa,%rbp
mov    %rbp,%rdi
call   1080 <malloc@plt>
test   %rax,%rax
je     1340 <main+0x1b0>
mov    %rax,%r13
mov    %rax,%rdi
mov    $0xab,%esi
mov    %rbp,%rdx
call   1060 <memset@plt>
lea    0xe19(%rip),%rax
mov    %rax,(%rsp)
lea    0xdc6(%rip),%rdi
lea    0xdd7(%rip),%rsi
lea    0xdd7(%rip),%rdx
lea    0xdd7(%rip),%rcx
lea    0xdd8(%rip),%r8
lea    0xdde(%rip),%r9
call   1050 <printf@plt>
test   %r14d,%r14d
jle    1375 <main+0x1e5>
mov    $0x1,%ebx
mov    %r14d,0x20(%rsp)
mov    %r15d,0x24(%rsp)
jmp    12e0 <main+0x150>
nopw   0x0(%rax,%rax,1)
add    %ebx,%ebx
mov    0x20(%rsp),%r14d
cmp    %r14d,%ebx
jg     1375 <main+0x1e5>
mov    $0x4,%edi
call   10a0 <UINT32_C@plt>
mov    %eax,%r14d
imul   0x14(%rsp),%r14d
add    %r14d,%r14d
cmp    %r15d,%r14d
jg     12d0 <main+0x140>
cmpl   $0x0,0x14(%rsp)
jle    1331 <main+0x1a1>
mov    $0x1,%r12d
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
call   1090 <benchmark@plt>
test   %eax,%eax
jne    134b <main+0x1bb>
add    %r12d,%r12d
cmp    0x14(%rsp),%r12d
jle    1310 <main+0x180>
add    %r14d,%r14d
mov    0x24(%rsp),%r15d
cmp    %r15d,%r14d
jle    12fb <main+0x16b>
jmp    12d0 <main+0x140>
mov    (%rbx),%edi
lea    0xce3(%rip),%rsi
jmp    1368 <main+0x1d8>
mov    %eax,%r15d
mov    %r13,%rdi
call   1030 <free@plt>
jmp    1380 <main+0x1f0>
mov    0x2c81(%rip),%rax
mov    (%rax),%edi
lea    0xc98(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%r15d
jmp    1380 <main+0x1f0>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %r15d,%r15d
mov    %r15d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR: Invalid number format!\0A\00"
@.str.1 = [13 x i8] c"[libargon2] \00"
@.str.2 = [34 x i8] c"ERROR: Memory allocation failed!\0A\00"
@.str.3 = [24 x i8] c"%8s%16s%8s%16s%16s%16s\0A\00"
@.str.4 = [7 x i8] c"t_cost\00"
@.str.5 = [7 x i8] c"m_cost\00"
@.str.6 = [8 x i8] c"threads\00"
@.str.7 = [13 x i8] c"Argon2d (ms)\00"
@.str.8 = [13 x i8] c"Argon2i (ms)\00"
@.str.9 = [14 x i8] c"Argon2id (ms)\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16, i32* %6
store i32 1048576, i32* %7
store i32 8, i32* %8
%17 = load i32, i32* %4
%18 = icmp sge i32 %17, 2
br i1 %18, label %19, label %33
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strtoul(i8* %22, i8** %12, i32 10)
store i32 %23, i32* %6
%24 = load i8*, i8** %12
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = icmp eq i8* %24, %27
br i1 %28, label %29, label %32
29: ; preds = %19
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %132
32: ; preds = %19
br label %33
33: ; preds = %32, %2
%34 = load i32, i32* %4
%35 = icmp sge i32 %34, 3
br i1 %35, label %36, label %50
36: ; preds = %33
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 @strtoul(i8* %39, i8** %12, i32 10)
store i32 %40, i32* %7
%41 = load i8*, i8** %12
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = icmp eq i8* %41, %44
br i1 %45, label %46, label %49
46: ; preds = %36
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %132
49: ; preds = %36
br label %50
50: ; preds = %49, %33
%51 = load i32, i32* %4
%52 = icmp sge i32 %51, 4
br i1 %52, label %53, label %67
53: ; preds = %50
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 3
%56 = load i8*, i8** %55
%57 = call i32 @strtoul(i8* %56, i8** %12, i32 10)
store i32 %57, i32* %8
%58 = load i8*, i8** %12
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 3
%61 = load i8*, i8** %60
%62 = icmp eq i8* %58, %61
br i1 %62, label %63, label %66
63: ; preds = %53
%64 = load i32, i32* @stderr
%65 = call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %132
66: ; preds = %53
br label %67
67: ; preds = %66, %50
%68 = load i32, i32* @stderr
%69 = call i32 @argon2_select_impl(i32 %68, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%70 = load i32, i32* %7
%71 = sext i32 %70 to i64
%72 = mul i64 %71, 1024
store i64 %72, i64* %14
%73 = load i64, i64* %14
%74 = call i8* @malloc(i64 %73)
store i8* %74, i8** %15
%75 = load i8*, i8** %15
%76 = icmp eq i8* %75, null
br i1 %76, label %77, label %80
77: ; preds = %67
%78 = load i32, i32* @stderr
%79 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %132
80: ; preds = %67
%81 = load i8*, i8** %15
%82 = load i64, i64* %14
%83 = call i32 @memset(i8* %81, i32 171, i64 %82)
%84 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %9
br label %85
85: ; preds = %126, %80
%86 = load i32, i32* %9
%87 = load i32, i32* %6
%88 = icmp sle i32 %86, %87
br i1 %88, label %89, label %129
89: ; preds = %85
%90 = load i32, i32* %8
%91 = call i32 @UINT32_C(i32 4)
%92 = mul nsw i32 %90, %91
%93 = mul nsw i32 %92, 2
store i32 %93, i32* %16
%94 = load i32, i32* %16
store i32 %94, i32* %10
br label %95
95: ; preds = %122, %89
%96 = load i32, i32* %10
%97 = load i32, i32* %7
%98 = icmp sle i32 %96, %97
br i1 %98, label %99, label %125
99: ; preds = %95
store i32 1, i32* %11
br label %100
100: ; preds = %118, %99
%101 = load i32, i32* %11
%102 = load i32, i32* %8
%103 = icmp sle i32 %101, %102
br i1 %103, label %104, label %121
104: ; preds = %100
%105 = load i8*, i8** %15
%106 = load i64, i64* %14
%107 = load i32, i32* %9
%108 = load i32, i32* %10
%109 = load i32, i32* %11
%110 = call i32 @benchmark(i8* %105, i64 %106, i32 %107, i32 %108, i32 %109)
store i32 %110, i32* %13
%111 = load i32, i32* %13
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %117
113: ; preds = %104
%114 = load i8*, i8** %15
%115 = call i32 @free(i8* %114)
%116 = load i32, i32* %13
store i32 %116, i32* %3
br label %132
117: ; preds = %104
br label %118
118: ; preds = %117
%119 = load i32, i32* %11
%120 = mul nsw i32 %119, 2
store i32 %120, i32* %11
br label %100
121: ; preds = %100
br label %122
122: ; preds = %121
%123 = load i32, i32* %10
%124 = mul nsw i32 %123, 2
store i32 %124, i32* %10
br label %95
125: ; preds = %95
br label %126
126: ; preds = %125
%127 = load i32, i32* %9
%128 = mul nsw i32 %127, 2
store i32 %128, i32* %9
br label %85
129: ; preds = %85
%130 = load i8*, i8** %15
%131 = call i32 @free(i8* %130)
store i32 0, i32* %3
br label %132
132: ; preds = %129, %113, %77, %63, %46, %29
%133 = load i32, i32* %3
ret i32 %133
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR: Invalid number format!\0A\00"
@.str.1 = [13 x i8] c"[libargon2] \00"
@.str.2 = [34 x i8] c"ERROR: Memory allocation failed!\0A\00"
@.str.3 = [24 x i8] c"%8s%16s%8s%16s%16s%16s\0A\00"
@.str.4 = [7 x i8] c"t_cost\00"
@.str.5 = [7 x i8] c"m_cost\00"
@.str.6 = [8 x i8] c"threads\00"
@.str.7 = [13 x i8] c"Argon2d (ms)\00"
@.str.8 = [13 x i8] c"Argon2i (ms)\00"
@.str.9 = [14 x i8] c"Argon2id (ms)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %40
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strtoul(i8* %8, i8** %3, i32 10)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %7
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %84
16: ; preds = %6
%17 = icmp ugt i32 %0, 2
br i1 %17, label %18, label %40
18: ; preds = %16
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @strtoul(i8* %20, i8** %3, i32 10)
%22 = load i8*, i8** %3
%23 = load i8*, i8** %19
%24 = icmp eq i8* %22, %23
br i1 %24, label %25, label %28
25: ; preds = %18
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %84
28: ; preds = %18
%29 = icmp ugt i32 %0, 3
br i1 %29, label %30, label %40
30: ; preds = %28
%31 = getelementptr inbounds i8*, i8** %1, i64 3
%32 = load i8*, i8** %31
%33 = call i32 @strtoul(i8* %32, i8** %3, i32 10)
%34 = load i8*, i8** %3
%35 = load i8*, i8** %31
%36 = icmp eq i8* %34, %35
br i1 %36, label %37, label %40
37: ; preds = %30
%38 = load i32, i32* @stderr
%39 = tail call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %84
40: ; preds = %2, %16, %30, %28
%41 = phi i32 [ %21, %30 ], [ %21, %28 ], [ 1048576, %16 ], [ 1048576, %2 ]
%42 = phi i32 [ %9, %30 ], [ %9, %28 ], [ %9, %16 ], [ 16, %2 ]
%43 = phi i32 [ %33, %30 ], [ 8, %28 ], [ 8, %16 ], [ 8, %2 ]
%44 = load i32, i32* @stderr
%45 = tail call i32 @argon2_select_impl(i32 %44, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%46 = sext i32 %41 to i64
%47 = shl nsw i64 %46, 10
%48 = tail call i8* @malloc(i64 %47)
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %53
50: ; preds = %40
%51 = load i32, i32* @stderr
%52 = tail call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
br label %84
53: ; preds = %40
%54 = tail call i32 @memset(i8* %48, i32 171, i64 %47)
%55 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%56 = icmp slt i32 %42, 1
br i1 %56, label %80, label %57
57: ; preds = %53
%58 = icmp slt i32 %43, 1
br label %59
59: ; preds = %57, %77
%60 = phi i32 [ 1, %57 ], [ %78, %77 ]
%61 = tail call i32 @UINT32_C(i32 4)
%62 = mul nsw i32 %61, %43
%63 = shl nsw i32 %62, 1
%64 = icmp sgt i32 %63, %41
br i1 %64, label %77, label %68
65: ; preds = %70, %68
%66 = shl nsw i32 %69, 1
%67 = icmp sgt i32 %66, %41
br i1 %67, label %77, label %68
68: ; preds = %59, %65
%69 = phi i32 [ %66, %65 ], [ %63, %59 ]
br i1 %58, label %65, label %72
70: ; preds = %72
%71 = icmp sgt i32 %76, %43
br i1 %71, label %65, label %72
72: ; preds = %68, %70
%73 = phi i32 [ %76, %70 ], [ 1, %68 ]
%74 = tail call i32 @benchmark(i8* %48, i64 %47, i32 %60, i32 %69, i32 %73)
%75 = icmp eq i32 %74, 0
%76 = shl nsw i32 %73, 1
br i1 %75, label %70, label %82
77: ; preds = %65, %59
%78 = shl nsw i32 %60, 1
%79 = icmp sgt i32 %78, %42
br i1 %79, label %80, label %59
80: ; preds = %77, %53
%81 = tail call i32 @free(i8* %48)
br label %84
82: ; preds = %72
%83 = tail call i32 @free(i8* %48)
br label %84
84: ; preds = %82, %50, %80, %37, %25, %13
%85 = phi i32 [ 1, %13 ], [ 1, %25 ], [ 1, %37 ], [ 1, %50 ], [ 0, %80 ], [ %74, %82 ]
ret i32 %85
}