#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*/ EXIT_FAILURE;
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *SSLv23_server_method();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void create_context(SSL_CTX **ctx) {
  const SSL_METHOD *method;
  method = SSLv23_server_method();
  *ctx = SSL_CTX_new(method);
  if (!*ctx) {
    perror("Unable to create SSL context");
    ERR_print_errors_fp(stderr);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<create_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <SSLv23_server_method@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <SSL_CTX_new@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11b0 <create_context+0x60>
lea    0xe71(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1070 <ERR_print_errors_fp@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_context>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <SSLv23_server_method@plt>
mov    %rax,%rdi
call   1040 <SSL_CTX_new@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     116d <create_context+0x1d>
pop    %rbx
ret
lea    0xe8c(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1070 <ERR_print_errors_fp@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Unable to create SSL context\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @create_context(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = call i32* (...) @SSLv23_server_method()
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i32* @SSL_CTX_new(i32* %5)
%7 = load i32**, i32*** %2
store i32* %6, i32** %7
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = icmp ne i32* %9, null
br i1 %10, label %17, label %11
11: ; preds = %1
%12 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 @ERR_print_errors_fp(i32 %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Unable to create SSL context\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @create_context(i32** nocapture writeonly %0) {
%2 = tail call i32* (...) @SSLv23_server_method()
%3 = tail call i32* @SSL_CTX_new(i32* %2)
store i32* %3, i32** %0
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @ERR_print_errors_fp(i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}