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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ EVP_sha256();
int /*<<< orphan*/ PKCS5_PBKDF2_HMAC(char *, int, unsigned char *, int, int,
                                     int /*<<< orphan*/, int, unsigned char *);
int atoi(char *);
int base64_encode(unsigned char *, int, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int getopt(int, char **, char *);
char *getpass(char *);
scalar_t__ malloc(int);
char *optarg;
int optind;
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char **argv) {
  int iterations = 12000, saltlen, blen;
  char *salt, *b64;
  unsigned char key[128];
  char *pw1, *pw2, *password;
  char *progname = argv[0];
  int c;
  int prompt;
  prompt = 1;
  while ((c = getopt(argc, argv, "ip:")) != EOF) {
    switch (c) {
    case 'i':
      iterations = atoi(optarg);
      break;
    case 'p':
      pw1 = strdup(optarg);
      pw2 = strdup(optarg);
      prompt = 0;
      break;
    default:
      exit(fprintf(stderr, "Usage: %s [-i iterations] [-p password]\n",
                   progname));
    }
  }
  argc -= optind - 1;
  argv += optind - 1;
  if (argc != 1) {
    exit(
        fprintf(stderr, "Usage: %s [-i iterations] [-p password]\n", progname));
  }
  if (prompt) {
    pw1 = strdup(getpass("Enter password: "));
    pw2 = getpass("Re-enter same password: ");
  }
  if (strcmp(pw1, pw2) != 0) {
    fprintf(stderr, "Passwords don't match!\n");
    return (1);
  }
  password = pw1;
  salt = (char *)malloc(12);
  strncpy(salt, "5w8X87cjDvQM", 12);
  printf("Salt=%s\n", salt);
  saltlen = strlen(salt);
  PKCS5_PBKDF2_HMAC(password, strlen(password), (unsigned char *)salt, saltlen,
                    iterations, EVP_sha256(), 32, key);
  blen = base64_encode(key, 32, &b64);
  if (blen > 0) {
    printf("pbkdf2_%s$%d$%s$%s\n", "sha256", iterations, salt, b64);
    free(b64);
  }
  free(password);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2ee0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xd0(%rbp)
movl   $0x1,-0xd8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdca(%rip),%rdx
call   10d0 <getopt@plt>
mov    %eax,-0xd4(%rbp)
mov    0x2d98(%rip),%rcx
cmp    (%rcx),%eax
je     12fa <main+0x10a>
mov    -0xd4(%rbp),%eax
mov    %eax,-0xdc(%rbp)
sub    $0x69,%eax
je     127e <main+0x8e>
jmp    126a <main+0x7a>
mov    -0xdc(%rbp),%eax
sub    $0x70,%eax
je     1295 <main+0xa5>
jmp    12d0 <main+0xe0>
mov    0x2d73(%rip),%rax
mov    (%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    12f5 <main+0x105>
mov    0x2d5c(%rip),%rax
mov    (%rax),%rdi
call   1100 <strdup@plt>
mov    %rax,-0xb8(%rbp)
mov    0x2d46(%rip),%rax
mov    (%rax),%rdi
call   1100 <strdup@plt>
mov    %rax,-0xc0(%rbp)
movl   $0x0,-0xd8(%rbp)
jmp    12f5 <main+0x105>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edi
mov    -0xd0(%rbp),%rdx
lea    0xd1d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    %eax,%edi
call   10f0 <exit@plt>
jmp    1228 <main+0x38>
mov    0x2cd7(%rip),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    0x2cc3(%rip),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     135b <main+0x16b>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
mov    -0xd0(%rbp),%rdx
lea    0xcb7(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    %eax,%edi
call   10f0 <exit@plt>
cmpl   $0x0,-0xd8(%rbp)
je     1396 <main+0x1a6>
lea    0xcbe(%rip),%rdi
call   10c0 <getpass@plt>
mov    %rax,%rdi
call   1100 <strdup@plt>
mov    %rax,-0xb8(%rbp)
lea    0xcb4(%rip),%rdi
call   10c0 <getpass@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xb8(%rbp),%rdi
mov    -0xc0(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     13d6 <main+0x1e6>
mov    0x2c0e(%rip),%rax
mov    (%rax),%edi
lea    0xc94(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1503 <main+0x313>
mov    -0xb8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    $0xc,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xc72(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncpy@plt>
mov    -0x28(%rbp),%rsi
lea    0xc6a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc8(%rbp),%rax
mov    %rax,-0x100(%rbp)
mov    -0xc8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0xf4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xe4(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xe0(%rbp)
mov    $0x0,%al
call   1110 <EVP_sha256@plt>
mov    -0x100(%rbp),%rdi
mov    -0xf4(%rbp),%esi
mov    -0xf0(%rbp),%rdx
mov    -0xe4(%rbp),%ecx
mov    -0xe0(%rbp),%r8d
mov    %eax,%r9d
lea    -0xb0(%rbp),%rax
movl   $0x20,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <PKCS5_PBKDF2_HMAC@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x20,%esi
lea    -0x30(%rbp),%rdx
call   10b0 <base64_encode@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    14f0 <main+0x300>
mov    -0x14(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xbac(%rip),%rdi
lea    0xbb9(%rip),%rsi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%rbx
mov    %edi,%r15d
mov    (%rsi),%rax
mov    %rax,(%rsp)
lea    0xdeb(%rip),%rdx
call   10d0 <getopt@plt>
mov    0x2dbf(%rip),%rcx
cmp    (%rcx),%eax
jne    1240 <main+0x50>
mov    0x2dac(%rip),%rax
mov    $0x2ee0,%r12d
cmp    (%rax),%r15d
je     12c8 <main+0xd8>
jmp    13fe <main+0x20e>
mov    $0x2ee0,%r12d
mov    $0x1,%ebp
jmp    128f <main+0x9f>
nopl   (%rax)
mov    0x2da1(%rip),%rax
mov    (%rax),%rbp
mov    %rbp,%rdi
call   1100 <strdup@plt>
mov    %rax,%r14
mov    %rbp,%rdi
call   1100 <strdup@plt>
mov    %rax,%r13
xor    %ebp,%ebp
mov    %r15d,%edi
mov    %rbx,%rsi
lea    0xd81(%rip),%rdx
call   10d0 <getopt@plt>
mov    0x2d55(%rip),%rcx
cmp    (%rcx),%eax
je     12b1 <main+0xc1>
cmp    $0x70,%eax
je     1250 <main+0x60>
cmp    $0x69,%eax
jne    13fe <main+0x20e>
mov    0x2d54(%rip),%rax
mov    (%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r12d
jmp    1272 <main+0x82>
mov    0x2d20(%rip),%rax
cmp    (%rax),%r15d
jne    13fe <main+0x20e>
mov    %r14,%rbx
test   %ebp,%ebp
je     12ee <main+0xfe>
lea    0xd5e(%rip),%rdi
call   10c0 <getpass@plt>
mov    %rax,%rdi
call   1100 <strdup@plt>
mov    %rax,%rbx
lea    0xd58(%rip),%rdi
call   10c0 <getpass@plt>
mov    %rax,%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1320 <main+0x130>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
lea    0xd49(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%r15d
jmp    13e9 <main+0x1f9>
mov    $0xc,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
lea    0xd3b(%rip),%rsi
mov    %rax,%rdi
mov    $0xc,%edx
call   1040 <strncpy@plt>
lea    0xd34(%rip),%rdi
xor    %r15d,%r15d
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r12d,%r13d
mov    %eax,%r12d
xor    %eax,%eax
call   1110 <EVP_sha256@plt>
lea    0x10(%rsp),%r10
mov    %rbx,(%rsp)
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %rbp,%rdx
mov    %r14d,%ecx
mov    %r13d,%r8d
mov    %eax,%r9d
push   %r10
mov    %r10,%r14
push   $0x20
call   1050 <PKCS5_PBKDF2_HMAC@plt>
add    $0x10,%rsp
lea    0x8(%rsp),%rdx
mov    %r14,%rdi
mov    $0x20,%esi
call   10b0 <base64_encode@plt>
test   %eax,%eax
jle    13e0 <main+0x1f0>
mov    0x8(%rsp),%r8
lea    0xcc3(%rip),%rdi
lea    0xcd0(%rip),%rsi
mov    %r13d,%edx
mov    %rbp,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %r15d,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bc3(%rip),%rax
mov    (%rax),%edi
lea    0xbf6(%rip),%rsi
mov    (%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %eax,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ip:\00"
@EOF = global i32 0
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [41 x i8] c"Usage: %s [-i iterations] [-p password]\0A\00"
@optind = global i32 0
@.str.2 = [17 x i8] c"Enter password: \00"
@.str.3 = [25 x i8] c"Re-enter same password: \00"
@.str.4 = [24 x i8] c"Passwords don't match!\0A\00"
@.str.5 = [13 x i8] c"5w8X87cjDvQM\00"
@.str.6 = [9 x i8] c"Salt=%s\0A\00"
@.str.7 = [20 x i8] c"pbkdf2_%s$%d$%s$%s\0A\00"
@.str.8 = [7 x i8] c"sha256\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 i8*
%10 = alloca i8*
%11 = alloca [128 x i8]
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 12000, i32* %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
store i8* %20, i8** %15
store i32 1, i32* %17
br label %21
21: ; preds = %42, %2
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call i32 @getopt(i32 %22, i8** %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %24, i32* %16
%25 = load i32, i32* @EOF
%26 = icmp ne i32 %24, %25
br i1 %26, label %27, label %43
27: ; preds = %21
%28 = load i32, i32* %16
switch i32 %28, label %37 [
i32 105, label %29
i32 112, label %32
]
29: ; preds = %27
%30 = load i8*, i8** @optarg
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %6
br label %42
32: ; preds = %27
%33 = load i8*, i8** @optarg
%34 = call i8* @strdup(i8* %33)
store i8* %34, i8** %12
%35 = load i8*, i8** @optarg
%36 = call i8* @strdup(i8* %35)
store i8* %36, i8** %13
store i32 0, i32* %17
br label %42
37: ; preds = %27
%38 = load i32, i32* @stderr
%39 = load i8*, i8** %15
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %39)
%41 = call i32 @exit(i32 %40)
unreachable
42: ; preds = %32, %29
br label %21
43: ; preds = %21
%44 = load i32, i32* @optind
%45 = sub nsw i32 %44, 1
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, %45
store i32 %47, i32* %4
%48 = load i32, i32* @optind
%49 = sub nsw i32 %48, 1
%50 = load i8**, i8*** %5
%51 = sext i32 %49 to i64
%52 = getelementptr inbounds i8*, i8** %50, i64 %51
store i8** %52, i8*** %5
%53 = load i32, i32* %4
%54 = icmp ne i32 %53, 1
br i1 %54, label %55, label %60
55: ; preds = %43
%56 = load i32, i32* @stderr
%57 = load i8*, i8** %15
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %57)
%59 = call i32 @exit(i32 %58)
unreachable
60: ; preds = %43
%61 = load i32, i32* %17
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %67
63: ; preds = %60
%64 = call i8* @getpass(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%65 = call i8* @strdup(i8* %64)
store i8* %65, i8** %12
%66 = call i8* @getpass(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
store i8* %66, i8** %13
br label %67
67: ; preds = %63, %60
%68 = load i8*, i8** %12
%69 = load i8*, i8** %13
%70 = call i64 @strcmp(i8* %68, i8* %69)
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %67
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %108
75: ; preds = %67
%76 = load i8*, i8** %12
store i8* %76, i8** %14
%77 = call i64 @malloc(i32 12)
%78 = inttoptr i64 %77 to i8*
store i8* %78, i8** %9
%79 = load i8*, i8** %9
%80 = call i32 @strncpy(i8* %79, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 12)
%81 = load i8*, i8** %9
%82 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %81)
%83 = load i8*, i8** %9
%84 = call i32 @strlen(i8* %83)
store i32 %84, i32* %7
%85 = load i8*, i8** %14
%86 = load i8*, i8** %14
%87 = call i32 @strlen(i8* %86)
%88 = load i8*, i8** %9
%89 = load i32, i32* %7
%90 = load i32, i32* %6
%91 = call i32 (...) @EVP_sha256()
%92 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%93 = call i32 @PKCS5_PBKDF2_HMAC(i8* %85, i32 %87, i8* %88, i32 %89, i32 %90, i32 %91, i32 32, i8* %92)
%94 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%95 = call i32 @base64_encode(i8* %94, i32 32, i8** %10)
store i32 %95, i32* %8
%96 = load i32, i32* %8
%97 = icmp sgt i32 %96, 0
br i1 %97, label %98, label %105
98: ; preds = %75
%99 = load i32, i32* %6
%100 = load i8*, i8** %9
%101 = load i8*, i8** %10
%102 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %99, i8* %100, i8* %101)
%103 = load i8*, i8** %10
%104 = call i32 @free(i8* %103)
br label %105
105: ; preds = %98, %75
%106 = load i8*, i8** %14
%107 = call i32 @free(i8* %106)
store i32 0, i32* %3
br label %108
108: ; preds = %105, %72
%109 = load i32, i32* %3
ret i32 %109
}

LLVM IR (-O2):
@.str = [4 x i8] c"ip:\00"
@EOF = global i32 0
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [41 x i8] c"Usage: %s [-i iterations] [-p password]\0A\00"
@optind = global i32 0
@.str.2 = [17 x i8] c"Enter password: \00"
@.str.3 = [25 x i8] c"Re-enter same password: \00"
@.str.4 = [24 x i8] c"Passwords don't match!\0A\00"
@.str.5 = [13 x i8] c"5w8X87cjDvQM\00"
@.str.6 = [9 x i8] c"Salt=%s\0A\00"
@.str.7 = [20 x i8] c"pbkdf2_%s$%d$%s$%s\0A\00"
@.str.8 = [7 x i8] c"sha256\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca [128 x i8]
%5 = bitcast i8** %3 to i8*
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %1
%8 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %41, label %11
11: ; preds = %2, %28
%12 = phi i32 [ %33, %28 ], [ %8, %2 ]
%13 = phi i32 [ %32, %28 ], [ 1, %2 ]
%14 = phi i8* [ %31, %28 ], [ undef, %2 ]
%15 = phi i8* [ %30, %28 ], [ undef, %2 ]
%16 = phi i32 [ %29, %28 ], [ 12000, %2 ]
switch i32 %12, label %24 [
i32 105, label %17
i32 112, label %20
]
17: ; preds = %11
%18 = load i8*, i8** @optarg
%19 = tail call i32 @atoi(i8* %18)
br label %28
20: ; preds = %11
%21 = load i8*, i8** @optarg
%22 = tail call i8* @strdup(i8* %21)
%23 = tail call i8* @strdup(i8* %21)
br label %28
24: ; preds = %11
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%27 = tail call i32 @exit(i32 %26)
unreachable
28: ; preds = %20, %17
%29 = phi i32 [ %16, %20 ], [ %19, %17 ]
%30 = phi i8* [ %22, %20 ], [ %15, %17 ]
%31 = phi i8* [ %23, %20 ], [ %14, %17 ]
%32 = phi i32 [ 0, %20 ], [ %13, %17 ]
%33 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%34 = load i32, i32* @EOF
%35 = icmp eq i32 %33, %34
br i1 %35, label %36, label %11
36: ; preds = %28
%37 = load i32, i32* @optind
%38 = add i32 %0, 1
%39 = sub i32 %38, %37
%40 = icmp eq i32 %39, 1
br i1 %40, label %50, label %46
41: ; preds = %2
%42 = load i32, i32* @optind
%43 = add i32 %0, 1
%44 = sub i32 %43, %42
%45 = icmp eq i32 %44, 1
br i1 %45, label %52, label %46
46: ; preds = %41, %36
%47 = load i32, i32* @stderr
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%49 = tail call i32 @exit(i32 %48)
unreachable
50: ; preds = %36
%51 = icmp eq i32 %32, 0
br i1 %51, label %57, label %52
52: ; preds = %41, %50
%53 = phi i32 [ %29, %50 ], [ 12000, %41 ]
%54 = tail call i8* @getpass(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%55 = tail call i8* @strdup(i8* %54)
%56 = tail call i8* @getpass(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %57
57: ; preds = %52, %50
%58 = phi i32 [ %53, %52 ], [ %29, %50 ]
%59 = phi i8* [ %55, %52 ], [ %30, %50 ]
%60 = phi i8* [ %56, %52 ], [ %31, %50 ]
%61 = tail call i64 @strcmp(i8* %59, i8* %60)
%62 = icmp eq i64 %61, 0
br i1 %62, label %66, label %63
63: ; preds = %57
%64 = load i32, i32* @stderr
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %84
66: ; preds = %57
%67 = tail call i64 @malloc(i32 12)
%68 = inttoptr i64 %67 to i8*
%69 = tail call i32 @strncpy(i8* %68, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 12)
%70 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %68)
%71 = tail call i32 @strlen(i8* %68)
%72 = tail call i32 @strlen(i8* %59)
%73 = tail call i32 (...) @EVP_sha256()
%74 = call i32 @PKCS5_PBKDF2_HMAC(i8* %59, i32 %72, i8* %68, i32 %71, i32 %58, i32 %73, i32 32, i8* %6)
%75 = call i32 @base64_encode(i8* %6, i32 32, i8** %3)
%76 = icmp sgt i32 %75, 0
br i1 %76, label %77, label %82
77: ; preds = %66
%78 = load i8*, i8** %3
%79 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %58, i8* %68, i8* %78)
%80 = load i8*, i8** %3
%81 = call i32 @free(i8* %80)
br label %82
82: ; preds = %77, %66
%83 = call i32 @free(i8* %59)
br label %84
84: ; preds = %82, %63
%85 = phi i32 [ 1, %63 ], [ 0, %82 ]
ret i32 %85
}