#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*/ response;
typedef int /*<<< orphan*/ SSL_METHOD;
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
scalar_t__ BIO_do_connect(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_get_ssl(int /*<<< orphan*/ *, int /*<<< orphan*/ **);
int /*<<< orphan*/ *BIO_new_ssl_connect(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_puts(int /*<<< orphan*/ *, char *);
int BIO_read(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ BIO_set_conn_hostname(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ SSL_CTX_load_verify_locations(int /*<<< orphan*/ *, char *,
                                                 char *);
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/ const *);
int /*<<< orphan*/ SSL_MODE_AUTO_RETRY;
long SSL_get_verify_result(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_set_mode(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *TLSv1_2_client_method();
long X509_V_OK;
int /*<<< orphan*/ cleanup(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ report_and_exit(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, ...);
int /*<<< orphan*/ stderr;
void secure_connect(const char *hostname) {
  char name[1024];
  char request[1024];
  char response[1024];
  const SSL_METHOD *method = TLSv1_2_client_method();
  if (NULL == method)
    report_and_exit("TLSv1_2_client_method...");
  SSL_CTX *ctx = SSL_CTX_new(method);
  if (NULL == ctx)
    report_and_exit("SSL_CTX_new...");
  BIO *bio = BIO_new_ssl_connect(ctx);
  if (NULL == bio)
    report_and_exit("BIO_new_ssl_connect...");
  SSL *ssl = NULL;
  sprintf(name, "%s:%s", hostname, "https");
  BIO_get_ssl(bio, &ssl);
  SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
  BIO_set_conn_hostname(bio, name);
  if (BIO_do_connect(bio) <= 0) {
    cleanup(ctx, bio);
    report_and_exit("BIO_do_connect...");
  }
  if (!SSL_CTX_load_verify_locations(ctx, "/etc/ssl/certs/ca-certificates.crt",
                                     "/etc/ssl/certs/"))
    report_and_exit("SSL_CTX_load_verify_locations...");
  long verify_flag = SSL_get_verify_result(ssl);
  if (verify_flag != X509_V_OK)
    fprintf(stderr,
            "##### Certificate verification error (%i) but continuing...\n",
            (int)verify_flag);
  sprintf(request,
          "GET / HTTP/1.1\x0D\x0AHost: %s\x0D\x0A\x43onnection: "
          "Close\x0D\x0A\x0D\x0A",
          hostname);
  BIO_puts(bio, request);
  while (1) {
    memset(response, '\0', sizeof(response));
    int n = BIO_read(bio, response, 1024);
    if (n <= 0)
      break;
    puts(response);
  }
  cleanup(ctx, bio);
}


x86 assembly (clang, -O0):
<secure_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc40,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1110 <TLSv1_2_client_method@plt>
mov    %rax,-0xc18(%rbp)
xor    %eax,%eax
cmp    -0xc18(%rbp),%rax
jne    1248 <secure_connect+0x38>
lea    0xdbd(%rip),%rdi
call   1050 <report_and_exit@plt>
mov    -0xc18(%rbp),%rdi
call   10c0 <SSL_CTX_new@plt>
mov    %rax,-0xc20(%rbp)
xor    %eax,%eax
cmp    -0xc20(%rbp),%rax
jne    1276 <secure_connect+0x66>
lea    0xda8(%rip),%rdi
call   1050 <report_and_exit@plt>
mov    -0xc20(%rbp),%rdi
call   1130 <BIO_new_ssl_connect@plt>
mov    %rax,-0xc28(%rbp)
xor    %eax,%eax
cmp    -0xc28(%rbp),%rax
jne    12a4 <secure_connect+0x94>
lea    0xd89(%rip),%rdi
call   1050 <report_and_exit@plt>
movq   $0x0,-0xc30(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xd7e(%rip),%rsi
lea    0xd7d(%rip),%rcx
mov    $0x0,%al
call   1100 <sprintf@plt>
mov    -0xc28(%rbp),%rdi
lea    -0xc30(%rbp),%rsi
call   1070 <BIO_get_ssl@plt>
mov    -0xc30(%rbp),%rdi
mov    0x2cf0(%rip),%rax
mov    (%rax),%esi
call   1090 <SSL_set_mode@plt>
mov    -0xc28(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   10b0 <BIO_set_conn_hostname@plt>
mov    -0xc28(%rbp),%rdi
call   1030 <BIO_do_connect@plt>
cmp    $0x0,%rax
jg     133f <secure_connect+0x12f>
mov    -0xc20(%rbp),%rdi
mov    -0xc28(%rbp),%rsi
call   10e0 <cleanup@plt>
lea    0xd11(%rip),%rdi
call   1050 <report_and_exit@plt>
mov    -0xc20(%rbp),%rdi
lea    0xd10(%rip),%rsi
lea    0xd2c(%rip),%rdx
call   10d0 <SSL_CTX_load_verify_locations@plt>
cmp    $0x0,%eax
jne    136e <secure_connect+0x15e>
lea    0xd27(%rip),%rdi
call   1050 <report_and_exit@plt>
mov    -0xc30(%rbp),%rdi
call   1120 <SSL_get_verify_result@plt>
mov    %rax,-0xc38(%rbp)
mov    -0xc38(%rbp),%rax
mov    0x2c69(%rip),%rcx
cmp    (%rcx),%rax
je     13b6 <secure_connect+0x1a6>
mov    0x2c31(%rip),%rax
mov    (%rax),%edi
mov    -0xc38(%rbp),%rax
mov    %eax,%edx
lea    0xd00(%rip),%rsi
call   10a0 <fprintf@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1100 <sprintf@plt>
mov    -0xc28(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   10f0 <BIO_puts@plt>
lea    -0xc10(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
mov    -0xc28(%rbp),%rdi
lea    -0xc10(%rbp),%rsi
mov    $0x400,%edx
call   1060 <BIO_read@plt>
mov    %eax,-0xc3c(%rbp)
cmpl   $0x0,-0xc3c(%rbp)
jg     1425 <secure_connect+0x215>
jmp    1436 <secure_connect+0x226>
lea    -0xc10(%rbp),%rdi
call   1040 <puts@plt>
jmp    13e2 <secure_connect+0x1d2>
mov    -0xc20(%rbp),%rdi
mov    -0xc28(%rbp),%rsi
call   10e0 <cleanup@plt>
add    $0xc40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_connect>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc18,%rsp
mov    %rdi,%r15
xor    %eax,%eax
call   1110 <TLSv1_2_client_method@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    123c <secure_connect+0x2c>
lea    0xdc9(%rip),%rdi
call   1050 <report_and_exit@plt>
mov    %rbx,%rdi
call   10c0 <SSL_CTX_new@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1258 <secure_connect+0x48>
lea    0xdc6(%rip),%rdi
call   1050 <report_and_exit@plt>
mov    %r14,%rdi
call   1130 <BIO_new_ssl_connect@plt>
mov    %rax,%r12
test   %rax,%rax
jne    1274 <secure_connect+0x64>
lea    0xdb9(%rip),%rdi
call   1050 <report_and_exit@plt>
movq   $0x0,0x8(%rsp)
lea    0xdbb(%rip),%rsi
lea    0xdba(%rip),%rcx
lea    0x810(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <sprintf@plt>
lea    0x8(%rsp),%rsi
mov    %r12,%rdi
call   1070 <BIO_get_ssl@plt>
mov    0x8(%rsp),%rdi
mov    0x2d27(%rip),%rax
mov    (%rax),%esi
call   1090 <SSL_set_mode@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10b0 <BIO_set_conn_hostname@plt>
mov    %r12,%rdi
call   1030 <BIO_do_connect@plt>
test   %rax,%rax
jg     12ef <secure_connect+0xdf>
mov    %r14,%rdi
mov    %r12,%rsi
call   10e0 <cleanup@plt>
lea    0xd61(%rip),%rdi
call   1050 <report_and_exit@plt>
lea    0xd67(%rip),%rsi
lea    0xd83(%rip),%rdx
mov    %r14,%rdi
call   10d0 <SSL_CTX_load_verify_locations@plt>
test   %eax,%eax
jne    1315 <secure_connect+0x105>
lea    0xd80(%rip),%rdi
call   1050 <report_and_exit@plt>
mov    0x8(%rsp),%rdi
call   1120 <SSL_get_verify_result@plt>
mov    0x2cd2(%rip),%rcx
cmp    (%rcx),%rax
je     1342 <secure_connect+0x132>
mov    0x2c9e(%rip),%rcx
mov    (%rcx),%edi
lea    0xd76(%rip),%rsi
mov    %eax,%edx
call   10a0 <fprintf@plt>
lea    0xda5(%rip),%rsi
lea    0x410(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <sprintf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10f0 <BIO_puts@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1060 <BIO_read@plt>
test   %eax,%eax
jle    13cb <secure_connect+0x1bb>
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1060 <BIO_read@plt>
test   %eax,%eax
jg     13a0 <secure_connect+0x190>
mov    %r14,%rdi
mov    %r12,%rsi
call   10e0 <cleanup@plt>
add    $0xc18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"TLSv1_2_client_method...\00"
@.str.1 = [15 x i8] c"SSL_CTX_new...\00"
@.str.2 = [23 x i8] c"BIO_new_ssl_connect...\00"
@.str.3 = [6 x i8] c"%s:%s\00"
@.str.4 = [6 x i8] c"https\00"
@SSL_MODE_AUTO_RETRY = global i32 0
@.str.5 = [18 x i8] c"BIO_do_connect...\00"
@.str.6 = [35 x i8] c"/etc/ssl/certs/ca-certificates.crt\00"
@.str.7 = [16 x i8] c"/etc/ssl/certs/\00"
@.str.8 = [33 x i8] c"SSL_CTX_load_verify_locations...\00"
@X509_V_OK = global i64 0
@stderr = global i32 0
@.str.9 = [61 x i8] c"##### Certificate verification error (%i) but continuing...\0A\00"
@.str.10 = [48 x i8] c"GET / HTTP/1.1\0D\0AHost: %s\0D\0AConnection: Close\0D\0A\0D\0A\00"
define void @secure_connect(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i32
store i8* %0, i8** %2
%12 = call i32* (...) @TLSv1_2_client_method()
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = icmp eq i32* null, %13
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call i32 @report_and_exit(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %1
%18 = load i32*, i32** %6
%19 = call i32* @SSL_CTX_new(i32* %18)
store i32* %19, i32** %7
%20 = load i32*, i32** %7
%21 = icmp eq i32* null, %20
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 @report_and_exit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
%25 = load i32*, i32** %7
%26 = call i32* @BIO_new_ssl_connect(i32* %25)
store i32* %26, i32** %8
%27 = load i32*, i32** %8
%28 = icmp eq i32* null, %27
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = call i32 @report_and_exit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %24
store i32* null, i32** %9
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%33 = load i8*, i8** %2
%34 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%35 = load i32*, i32** %8
%36 = call i32 @BIO_get_ssl(i32* %35, i32** %9)
%37 = load i32*, i32** %9
%38 = load i32, i32* @SSL_MODE_AUTO_RETRY
%39 = call i32 @SSL_set_mode(i32* %37, i32 %38)
%40 = load i32*, i32** %8
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%42 = call i32 @BIO_set_conn_hostname(i32* %40, i8* %41)
%43 = load i32*, i32** %8
%44 = call i64 @BIO_do_connect(i32* %43)
%45 = icmp sle i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %31
%47 = load i32*, i32** %7
%48 = load i32*, i32** %8
%49 = call i32 @cleanup(i32* %47, i32* %48)
%50 = call i32 @report_and_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %51
51: ; preds = %46, %31
%52 = load i32*, i32** %7
%53 = call i32 @SSL_CTX_load_verify_locations(i32* %52, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%54 = icmp ne i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %51
%56 = call i32 @report_and_exit(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
br label %57
57: ; preds = %55, %51
%58 = load i32*, i32** %9
%59 = call i64 @SSL_get_verify_result(i32* %58)
store i64 %59, i64* %10
%60 = load i64, i64* %10
%61 = load i64, i64* @X509_V_OK
%62 = icmp ne i64 %60, %61
br i1 %62, label %63, label %68
63: ; preds = %57
%64 = load i32, i32* @stderr
%65 = load i64, i64* %10
%66 = trunc i64 %65 to i32
%67 = call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0), i32 %66)
br label %68
68: ; preds = %63, %57
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%70 = load i8*, i8** %2
%71 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %69, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i8* %70)
%72 = load i32*, i32** %8
%73 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%74 = call i32 @BIO_puts(i32* %72, i8* %73)
br label %75
75: ; preds = %68, %84
%76 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%77 = call i32 @memset(i8* %76, i8 signext 0, i32 1024)
%78 = load i32*, i32** %8
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%80 = call i32 @BIO_read(i32* %78, i8* %79, i32 1024)
store i32 %80, i32* %11
%81 = load i32, i32* %11
%82 = icmp sle i32 %81, 0
br i1 %82, label %83, label %84
83: ; preds = %75
br label %87
84: ; preds = %75
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%86 = call i32 @puts(i8* %85)
br label %75
87: ; preds = %83
%88 = load i32*, i32** %7
%89 = load i32*, i32** %8
%90 = call i32 @cleanup(i32* %88, i32* %89)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"TLSv1_2_client_method...\00"
@.str.1 = [15 x i8] c"SSL_CTX_new...\00"
@.str.2 = [23 x i8] c"BIO_new_ssl_connect...\00"
@.str.3 = [6 x i8] c"%s:%s\00"
@.str.4 = [6 x i8] c"https\00"
@SSL_MODE_AUTO_RETRY = global i32 0
@.str.5 = [18 x i8] c"BIO_do_connect...\00"
@.str.6 = [35 x i8] c"/etc/ssl/certs/ca-certificates.crt\00"
@.str.7 = [16 x i8] c"/etc/ssl/certs/\00"
@.str.8 = [33 x i8] c"SSL_CTX_load_verify_locations...\00"
@X509_V_OK = global i64 0
@stderr = global i32 0
@.str.9 = [61 x i8] c"##### Certificate verification error (%i) but continuing...\0A\00"
@.str.10 = [48 x i8] c"GET / HTTP/1.1\0D\0AHost: %s\0D\0AConnection: Close\0D\0A\0D\0A\00"
define void @secure_connect(i8* %0) {
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca i32*
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = tail call i32* (...) @TLSv1_2_client_method()
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = tail call i32 @report_and_exit(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
%14 = tail call i32* @SSL_CTX_new(i32* %9)
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @report_and_exit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = tail call i32* @BIO_new_ssl_connect(i32* %14)
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @report_and_exit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = bitcast i32** %5 to i8*
store i32* null, i32** %5
%25 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 @BIO_get_ssl(i32* %19, i32** %5)
%27 = load i32*, i32** %5
%28 = load i32, i32* @SSL_MODE_AUTO_RETRY
%29 = call i32 @SSL_set_mode(i32* %27, i32 %28)
%30 = call i32 @BIO_set_conn_hostname(i32* %19, i8* %6)
%31 = call i64 @BIO_do_connect(i32* %19)
%32 = icmp slt i64 %31, 1
br i1 %32, label %33, label %36
33: ; preds = %23
%34 = call i32 @cleanup(i32* %14, i32* %19)
%35 = call i32 @report_and_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %36
36: ; preds = %33, %23
%37 = call i32 @SSL_CTX_load_verify_locations(i32* %14, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @report_and_exit(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0))
br label %41
41: ; preds = %39, %36
%42 = load i32*, i32** %5
%43 = call i64 @SSL_get_verify_result(i32* %42)
%44 = load i64, i64* @X509_V_OK
%45 = icmp eq i64 %43, %44
br i1 %45, label %50, label %46
46: ; preds = %41
%47 = load i32, i32* @stderr
%48 = trunc i64 %43 to i32
%49 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %46, %41
%51 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i8* %0)
%52 = call i32 @BIO_puts(i32* %19, i8* %7)
%53 = call i32 @memset(i8* %8, i8 signext 0, i32 1024)
%54 = call i32 @BIO_read(i32* %19, i8* %8, i32 1024)
%55 = icmp slt i32 %54, 1
br i1 %55, label %61, label %56
56: ; preds = %50, %56
%57 = call i32 @puts(i8* %8)
%58 = call i32 @memset(i8* %8, i8 signext 0, i32 1024)
%59 = call i32 @BIO_read(i32* %19, i8* %8, i32 1024)
%60 = icmp slt i32 %59, 1
br i1 %60, label %61, label %56
61: ; preds = %56, %50
%62 = call i32 @cleanup(i32* %14, i32* %19)
ret void
}