#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(int /*<<< orphan*/);
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/ const *);
int /*<<< orphan*/ SSL_CTX_set_cipher_list(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ SSL_CTX_set_options(int /*<<< orphan*/ *, int);
int SSL_OP_NO_SSLv2;
int SSL_OP_NO_SSLv3;
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ *TLSv1_2_client_method();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ stderr;
SSL_CTX *initCTX(void) {
  SSL_CTX *ctx;
  OpenSSL_add_all_algorithms();
  SSL_load_error_strings();
  const SSL_METHOD *method = TLSv1_2_client_method();
  ctx = SSL_CTX_new(method);
  SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
  SSL_CTX_set_cipher_list(ctx,
                          "HIGH:+MEDIUM:!aNULL:!eNULL:!3DES:!RC4:!RC2!DES");
  if (!ctx) {
    ERR_print_errors_fp(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   1080 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1090 <TLSv1_2_client_method@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <SSL_CTX_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e0f(%rip),%rax
mov    (%rax),%esi
mov    0x2e26(%rip),%rax
or     (%rax),%esi
call   1030 <SSL_CTX_set_options@plt>
mov    -0x8(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   1070 <SSL_CTX_set_cipher_list@plt>
cmpq   $0x0,-0x8(%rbp)
jne    11f9 <initCTX+0x79>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
call   10a0 <ERR_print_errors_fp@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%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   1080 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1090 <TLSv1_2_client_method@plt>
mov    %rax,%rdi
call   1060 <SSL_CTX_new@plt>
mov    %rax,%rbx
mov    0x2e20(%rip),%rax
mov    0x2e39(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rbx,%rdi
call   1030 <SSL_CTX_set_options@plt>
lea    0xe3e(%rip),%rsi
mov    %rbx,%rdi
call   1070 <SSL_CTX_set_cipher_list@plt>
test   %rbx,%rbx
je     11d4 <initCTX+0x54>
mov    %rbx,%rax
pop    %rbx
ret
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
call   10a0 <ERR_print_errors_fp@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@SSL_OP_NO_SSLv2 = global i32 0
@SSL_OP_NO_SSLv3 = global i32 0
@.str = [47 x i8] c"HIGH:+MEDIUM:!aNULL:!eNULL:!3DES:!RC4:!RC2!DES\00"
@stderr = global i32 0
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** %2
%6 = load i32*, i32** %2
%7 = call i32* @SSL_CTX_new(i32* %6)
store i32* %7, i32** %1
%8 = load i32*, i32** %1
%9 = load i32, i32* @SSL_OP_NO_SSLv2
%10 = load i32, i32* @SSL_OP_NO_SSLv3
%11 = or i32 %9, %10
%12 = call i32 @SSL_CTX_set_options(i32* %8, i32 %11)
%13 = load i32*, i32** %1
%14 = call i32 @SSL_CTX_set_cipher_list(i32* %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%15 = load i32*, i32** %1
%16 = icmp ne i32* %15, null
br i1 %16, label %21, label %17
17: ; preds = %0
%18 = load i32, i32* @stderr
%19 = call i32 @ERR_print_errors_fp(i32 %18)
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %0
%22 = load i32*, i32** %1
ret i32* %22
}

LLVM IR (-O2):
@SSL_OP_NO_SSLv2 = global i32 0
@SSL_OP_NO_SSLv3 = global i32 0
@.str = [47 x i8] c"HIGH:+MEDIUM:!aNULL:!eNULL:!3DES:!RC4:!RC2!DES\00"
@stderr = global i32 0
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 = load i32, i32* @SSL_OP_NO_SSLv2
%6 = load i32, i32* @SSL_OP_NO_SSLv3
%7 = or i32 %6, %5
%8 = tail call i32 @SSL_CTX_set_options(i32* %4, i32 %7)
%9 = tail call i32 @SSL_CTX_set_cipher_list(i32* %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32* %4, null
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = tail call i32 @ERR_print_errors_fp(i32 %12)
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %0
ret i32* %4
}