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

/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(char *);
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ *TLSv1_2_client_method();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char *);
char *stderr;
SSL_CTX *InitCTX(void) {
  SSL_METHOD *method;
  SSL_CTX *ctx;
  OpenSSL_add_all_algorithms();
  SSL_load_error_strings();
  method = TLSv1_2_client_method();
  ctx = SSL_CTX_new(method);
  if (ctx == NULL) {
    ERR_print_errors_fp(stderr);
    printf("Eroor: %s\n", stderr);
    abort();
  }
  return ctx;
}


x86 assembly (clang, -O0):
<InitCTX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1070 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1080 <TLSv1_2_client_method@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <SSL_CTX_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11d5 <InitCTX+0x65>
mov    0x2e30(%rip),%rax
mov    (%rax),%rdi
call   1090 <ERR_print_errors_fp@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%rsi
lea    0xe37(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitCTX>:
push   %rbx
xor    %eax,%eax
call   1050 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
call   1070 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1080 <TLSv1_2_client_method@plt>
mov    %rax,%rdi
call   1060 <SSL_CTX_new@plt>
test   %rax,%rax
je     1195 <InitCTX+0x25>
pop    %rbx
ret
mov    0x2e44(%rip),%rbx
mov    (%rbx),%rdi
call   1090 <ERR_print_errors_fp@plt>
mov    (%rbx),%rsi
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i8* null
@.str = [11 x i8] c"Eroor: %s\0A\00"
define i32* @InitCTX() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32 (...) @OpenSSL_add_all_algorithms()
%4 = call i32 (...) @SSL_load_error_strings()
%5 = call i32* (...) @TLSv1_2_client_method()
store i32* %5, i32** %1
%6 = load i32*, i32** %1
%7 = call i32* @SSL_CTX_new(i32* %6)
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %0
%11 = load i8*, i8** @stderr
%12 = call i32 @ERR_print_errors_fp(i8* %11)
%13 = load i8*, i8** @stderr
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %0
%17 = load i32*, i32** %2
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i8* null
@.str = [11 x i8] c"Eroor: %s\0A\00"
define i32* @InitCTX() {
%1 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%2 = tail call i32 (...) @SSL_load_error_strings()
%3 = tail call i32* (...) @TLSv1_2_client_method()
%4 = tail call i32* @SSL_CTX_new(i32* %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i8*, i8** @stderr
%8 = tail call i32 @ERR_print_errors_fp(i8* %7)
%9 = load i8*, i8** @stderr
%10 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32* %4
}