#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*/ EVP_MD_CTX;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int /*<<< orphan*/ EVP_DigestFinal_ex(int /*<<< orphan*/ *, unsigned char *,
                                      int *);
int /*<<< orphan*/ EVP_DigestInit_ex(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_DigestUpdate(int /*<<< orphan*/ *, char *, int);
int EVP_MAX_MD_SIZE;
int /*<<< orphan*/ *EVP_MD_CTX_create();
int /*<<< orphan*/ EVP_MD_CTX_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_cleanup();
int /*<<< orphan*/ *EVP_get_digestbyname(char *);
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_RDWR;
int /*<<< orphan*/ OpenSSL_add_all_digests();
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int open(char *, int, ...);
int /*<<< orphan*/ printf(char *);
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  const EVP_MD *md = NULL;
  EVP_MD_CTX *mdctx;
  int i = 0;
  int rfd;
  int success = 0;
  char plain[33];
  unsigned char md_value[EVP_MAX_MD_SIZE];
  int md_len;
  OpenSSL_add_all_digests();
  memset(plain, 0, 33);
  memcpy(plain, argv[1], 16);
  md = EVP_get_digestbyname("sha256");
  if (md == NULL) {
    printf("[ERROR] Get digest by name sha256 failed\n");
    exit(1);
  }
  mdctx = EVP_MD_CTX_create();
  rfd = open("/dev/urandom", O_RDONLY);
  if (rfd <= 0) {
    printf("[ERROR] Failed to open random\n");
    exit(1);
  }
  while (!success) {
    if (read(rfd, plain + 16, 16) != 16) {
      printf("[ERROR] Failed to read random\n");
      close(rfd);
      exit(1);
    }
    EVP_DigestInit_ex(mdctx, md, NULL);
    EVP_DigestUpdate(mdctx, plain, 32);
    EVP_DigestFinal_ex(mdctx, md_value, &md_len);
    if (md_value[0] != 0xff) {
      continue;
    }
    if (md_value[1] != 0xff) {
      continue;
    }
    if (md_value[2] != 0xff) {
      continue;
    }
    if (md_value[3] <= 0xef) {
      continue;
    }
    success = 1;
  }
  EVP_MD_CTX_destroy(mdctx);
  printf("[INFO] SUCCESS\n");
  i = open("plain.txt", O_RDWR | O_CREAT, S_IRUSR | S_IRGRP | S_IROTH);
  if (i <= 0) {
    printf("[ERROR] Failed to open output file\n");
    exit(1);
  }
  write(i, plain, 32);
  close(i);
  EVP_cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    0x2d9d(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
mov    $0x0,%al
call   10a0 <OpenSSL_add_all_digests@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x21,%edx
call   1060 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x10,%edx
call   10c0 <memcpy@plt>
lea    0xd74(%rip),%rdi
call   10f0 <EVP_get_digestbyname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12b6 <main+0xb6>
lea    0xd60(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    $0x0,%al
call   1120 <EVP_MD_CTX_create@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d10(%rip),%rax
mov    (%rax),%esi
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1100 <open@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jg     12fb <main+0xfb>
lea    0xd52(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
jmp    1300 <main+0x100>
cmpl   $0x0,-0x2c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1316 <main+0x116>
jmp    13f1 <main+0x1f1>
mov    -0x28(%rbp),%edi
lea    -0x50(%rbp),%rsi
add    $0x10,%rsi
mov    $0x10,%edx
call   1080 <read@plt>
cmp    $0x10,%eax
je     1352 <main+0x152>
lea    0xd22(%rip),%rdi
call   1050 <printf@plt>
mov    -0x28(%rbp),%edi
call   1070 <close@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1090 <EVP_DigestInit_ex@plt>
mov    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
call   10d0 <EVP_DigestUpdate@plt>
mov    -0x70(%rbp),%rsi
mov    -0x20(%rbp),%rdi
lea    -0x64(%rbp),%rdx
call   1030 <EVP_DigestFinal_ex@plt>
mov    -0x70(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xff,%eax
je     139d <main+0x19d>
jmp    1300 <main+0x100>
mov    -0x70(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xff,%eax
je     13b5 <main+0x1b5>
jmp    1300 <main+0x100>
mov    -0x70(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0xff,%eax
je     13cd <main+0x1cd>
jmp    1300 <main+0x100>
mov    -0x70(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0xef,%eax
jg     13e5 <main+0x1e5>
jmp    1300 <main+0x100>
movl   $0x1,-0x2c(%rbp)
jmp    1300 <main+0x100>
mov    -0x20(%rbp),%rdi
call   10e0 <EVP_MD_CTX_destroy@plt>
lea    0xc7b(%rip),%rdi
call   1050 <printf@plt>
mov    0x2bd3(%rip),%rax
mov    (%rax),%esi
mov    0x2be2(%rip),%rax
or     (%rax),%esi
mov    0x2b91(%rip),%rax
mov    (%rax),%edx
mov    0x2b98(%rip),%rax
or     (%rax),%edx
mov    0x2b87(%rip),%rax
or     (%rax),%edx
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1100 <open@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jg     1464 <main+0x264>
lea    0xc41(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x24(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
call   1040 <write@plt>
mov    -0x24(%rbp),%edi
call   1070 <close@plt>
mov    $0x0,%al
call   10b0 <EVP_cleanup@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rsp,%r12
mov    0x2db2(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
xor    %eax,%eax
call   10a0 <OpenSSL_add_all_digests@plt>
lea    -0x60(%rbp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x21,%edx
call   1060 <memset@plt>
mov    0x8(%r14),%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
call   10c0 <memcpy@plt>
lea    0xd9d(%rip),%rdi
call   10f0 <EVP_get_digestbyname@plt>
test   %rax,%rax
je     13c7 <main+0x1c7>
mov    %rax,%r14
mov    %r12,-0x30(%rbp)
xor    %eax,%eax
call   1120 <EVP_MD_CTX_create@plt>
mov    %rax,%rbx
mov    0x2d4f(%rip),%rax
mov    (%rax),%esi
lea    0xd75(%rip),%rdi
xor    %eax,%eax
call   1100 <open@plt>
test   %eax,%eax
jle    13d0 <main+0x1d0>
mov    %eax,%r12d
jmp    12b5 <main+0xb5>
cs nopw 0x0(%rax,%rax,1)
test   %r13d,%r13d
jne    1321 <main+0x121>
mov    %r12d,%edi
lea    -0x50(%rbp),%rsi
mov    $0x10,%edx
call   1080 <read@plt>
cmp    $0x10,%eax
jne    13a9 <main+0x1a9>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1090 <EVP_DigestInit_ex@plt>
mov    %rbx,%rdi
lea    -0x60(%rbp),%rsi
mov    $0x20,%edx
call   10d0 <EVP_DigestUpdate@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
lea    -0x34(%rbp),%rdx
call   1040 <EVP_DigestFinal_ex@plt>
cmpb   $0xff,(%r15)
jne    12b0 <main+0xb0>
cmpb   $0xff,0x1(%r15)
jne    12b0 <main+0xb0>
cmpb   $0xff,0x2(%r15)
jne    12b0 <main+0xb0>
xor    %r13d,%r13d
cmpb   $0xf0,0x3(%r15)
setae  %r13b
jmp    12b0 <main+0xb0>
mov    %rbx,%rdi
call   10e0 <EVP_MD_CTX_destroy@plt>
lea    0xcee(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ca4(%rip),%rax
mov    0x2cb5(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2c62(%rip),%rax
mov    0x2c6b(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2c58(%rip),%rax
or     (%rax),%edx
lea    0xcab(%rip),%rdi
xor    %eax,%eax
call   1100 <open@plt>
test   %eax,%eax
jle    13d9 <main+0x1d9>
mov    %eax,%ebx
lea    -0x60(%rbp),%rsi
mov    %eax,%edi
mov    $0x20,%edx
call   1050 <write@plt>
mov    %ebx,%edi
call   1070 <close@plt>
xor    %eax,%eax
call   10b0 <EVP_cleanup@plt>
mov    -0x30(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xca0(%rip),%rdi
call   1030 <puts@plt>
mov    %r12d,%edi
call   1070 <close@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    0xcbe(%rip),%rdi
jmp    13e0 <main+0x1e0>
lea    0xc97(%rip),%rdi
jmp    13e0 <main+0x1e0>
lea    0xc4d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@EVP_MAX_MD_SIZE = global i32 0
@.str = [7 x i8] c"sha256\00"
@.str.1 = [42 x i8] c"[ERROR] Get digest by name sha256 failed\0A\00"
@.str.2 = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
@.str.3 = [31 x i8] c"[ERROR] Failed to open random\0A\00"
@.str.4 = [31 x i8] c"[ERROR] Failed to read random\0A\00"
@.str.5 = [16 x i8] c"[INFO] SUCCESS\0A\00"
@.str.6 = [10 x i8] c"plain.txt\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str.7 = [36 x i8] c"[ERROR] Failed to open output file\0A\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 [33 x i8]
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32 0, i32* %8
store i32 0, i32* %10
%15 = load i32, i32* @EVP_MAX_MD_SIZE
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %12
%18 = alloca i8, i64 %16
store i64 %16, i64* %13
%19 = call i32 (...) @OpenSSL_add_all_digests()
%20 = getelementptr inbounds [33 x i8], [33 x i8]* %11, i64 0, i64 0
%21 = call i32 @memset(i8* %20, i32 0, i32 33)
%22 = getelementptr inbounds [33 x i8], [33 x i8]* %11, i64 0, i64 0
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @memcpy(i8* %22, i8* %25, i32 16)
%27 = call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32* %27, i32** %6
%28 = load i32*, i32** %6
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %33
30: ; preds = %2
%31 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %2
%34 = call i32* (...) @EVP_MD_CTX_create()
store i32* %34, i32** %7
%35 = load i32, i32* @O_RDONLY
%36 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %35)
store i32 %36, i32* %9
%37 = load i32, i32* %9
%38 = icmp sle i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %33
%40 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %33
br label %43
43: ; preds = %90, %89, %83, %77, %71, %42
%44 = load i32, i32* %10
%45 = icmp ne i32 %44, 0
%46 = xor i1 %45, true
br i1 %46, label %47, label %91
47: ; preds = %43
%48 = load i32, i32* %9
%49 = getelementptr inbounds [33 x i8], [33 x i8]* %11, i64 0, i64 0
%50 = getelementptr inbounds i8, i8* %49, i64 16
%51 = call i32 @read(i32 %48, i8* %50, i32 16)
%52 = icmp ne i32 %51, 16
br i1 %52, label %53, label %58
53: ; preds = %47
%54 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%55 = load i32, i32* %9
%56 = call i32 @close(i32 %55)
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %47
%59 = load i32*, i32** %7
%60 = load i32*, i32** %6
%61 = call i32 @EVP_DigestInit_ex(i32* %59, i32* %60, i32* null)
%62 = load i32*, i32** %7
%63 = getelementptr inbounds [33 x i8], [33 x i8]* %11, i64 0, i64 0
%64 = call i32 @EVP_DigestUpdate(i32* %62, i8* %63, i32 32)
%65 = load i32*, i32** %7
%66 = call i32 @EVP_DigestFinal_ex(i32* %65, i8* %18, i32* %14)
%67 = getelementptr inbounds i8, i8* %18, i64 0
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = icmp ne i32 %69, 255
br i1 %70, label %71, label %72
71: ; preds = %58
br label %43
72: ; preds = %58
%73 = getelementptr inbounds i8, i8* %18, i64 1
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = icmp ne i32 %75, 255
br i1 %76, label %77, label %78
77: ; preds = %72
br label %43
78: ; preds = %72
%79 = getelementptr inbounds i8, i8* %18, i64 2
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = icmp ne i32 %81, 255
br i1 %82, label %83, label %84
83: ; preds = %78
br label %43
84: ; preds = %78
%85 = getelementptr inbounds i8, i8* %18, i64 3
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = icmp sle i32 %87, 239
br i1 %88, label %89, label %90
89: ; preds = %84
br label %43
90: ; preds = %84
store i32 1, i32* %10
br label %43
91: ; preds = %43
%92 = load i32*, i32** %7
%93 = call i32 @EVP_MD_CTX_destroy(i32* %92)
%94 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%95 = load i32, i32* @O_RDWR
%96 = load i32, i32* @O_CREAT
%97 = or i32 %95, %96
%98 = load i32, i32* @S_IRUSR
%99 = load i32, i32* @S_IRGRP
%100 = or i32 %98, %99
%101 = load i32, i32* @S_IROTH
%102 = or i32 %100, %101
%103 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %97, i32 %102)
store i32 %103, i32* %8
%104 = load i32, i32* %8
%105 = icmp sle i32 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %91
%107 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0))
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %91
%110 = load i32, i32* %8
%111 = getelementptr inbounds [33 x i8], [33 x i8]* %11, i64 0, i64 0
%112 = call i32 @write(i32 %110, i8* %111, i32 32)
%113 = load i32, i32* %8
%114 = call i32 @close(i32 %113)
%115 = call i32 (...) @EVP_cleanup()
store i32 0, i32* %3
%116 = load i8*, i8** %12
%117 = load i32, i32* %3
ret i32 %117
}

LLVM IR (-O2):
@EVP_MAX_MD_SIZE = global i32 0
@.str = [7 x i8] c"sha256\00"
@.str.2 = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
@.str.6 = [10 x i8] c"plain.txt\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@str = [15 x i8] c"[INFO] SUCCESS\00"
@str.8 = [35 x i8] c"[ERROR] Failed to open output file\00"
@str.9 = [30 x i8] c"[ERROR] Failed to read random\00"
@str.10 = [30 x i8] c"[ERROR] Failed to open random\00"
@str.11 = [41 x i8] c"[ERROR] Get digest by name sha256 failed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [33 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* @EVP_MAX_MD_SIZE
%7 = zext i32 %6 to i64
%8 = tail call i8* @llvm.stacksave()
%9 = alloca i8, i64 %7
%10 = bitcast i32* %4 to i8*
%11 = tail call i32 (...) @OpenSSL_add_all_digests()
%12 = call i32 @memset(i8* %5, i32 0, i32 33)
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @memcpy(i8* %5, i8* %14, i32 16)
%16 = call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.11, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = call i32* (...) @EVP_MD_CTX_create()
%23 = load i32, i32* @O_RDONLY
%24 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = icmp slt i32 %24, 1
br i1 %25, label %31, label %26
26: ; preds = %21
%27 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 16
%28 = getelementptr inbounds i8, i8* %9, i64 1
%29 = getelementptr inbounds i8, i8* %9, i64 2
%30 = getelementptr inbounds i8, i8* %9, i64 3
br label %34
31: ; preds = %21
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.10, i64 0, i64 0))
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %26, %47
%35 = call i32 @read(i32 %24, i8* %27, i32 16)
%36 = icmp eq i32 %35, 16
br i1 %36, label %41, label %37
37: ; preds = %34
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.9, i64 0, i64 0))
%39 = call i32 @close(i32 %24)
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %34
%42 = call i32 @EVP_DigestInit_ex(i32* %22, i32* %16, i32* null)
%43 = call i32 @EVP_DigestUpdate(i32* %22, i8* %5, i32 32)
%44 = call i32 @EVP_DigestFinal_ex(i32* %22, i8* %9, i32* %4)
%45 = load i8, i8* %9
%46 = icmp eq i8 %45, -1
br i1 %46, label %50, label %47
47: ; preds = %41, %50, %53, %56
%48 = phi i32 [ 0, %41 ], [ 0, %50 ], [ 0, %53 ], [ %59, %56 ]
%49 = icmp eq i32 %48, 0
br i1 %49, label %34, label %60
50: ; preds = %41
%51 = load i8, i8* %28
%52 = icmp eq i8 %51, -1
br i1 %52, label %53, label %47
53: ; preds = %50
%54 = load i8, i8* %29
%55 = icmp eq i8 %54, -1
br i1 %55, label %56, label %47
56: ; preds = %53
%57 = load i8, i8* %30
%58 = icmp ugt i8 %57, -17
%59 = zext i1 %58 to i32
br label %47
60: ; preds = %47
%61 = call i32 @EVP_MD_CTX_destroy(i32* %22)
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%63 = load i32, i32* @O_RDWR
%64 = load i32, i32* @O_CREAT
%65 = or i32 %64, %63
%66 = load i32, i32* @S_IRUSR
%67 = load i32, i32* @S_IRGRP
%68 = or i32 %67, %66
%69 = load i32, i32* @S_IROTH
%70 = or i32 %68, %69
%71 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %65, i32 %70)
%72 = icmp slt i32 %71, 1
br i1 %72, label %73, label %76
73: ; preds = %60
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.8, i64 0, i64 0))
%75 = call i32 @exit(i32 1)
unreachable
76: ; preds = %60
%77 = call i32 @write(i32 %71, i8* %5, i32 32)
%78 = call i32 @close(i32 %71)
%79 = call i32 (...) @EVP_cleanup()
ret i32 0
}