#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*/ *SSL_CTX_new(int /*<<< orphan*/ const *);
int /*<<< orphan*/ SSL_CTX_set_options(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ SSL_OP_ALL;
int /*<<< orphan*/ *SSLv23_client_method();
int /*<<< orphan*/ zfatal(char *);
SSL_CTX *zopenssl_SSL_CTX_create_client(void) {
  const SSL_METHOD *method = SSLv23_client_method();
  SSL_CTX *ctx = SSL_CTX_new(method);
  if (!ctx) {
    zfatal("FATAL SSL_CTX_new");
  }
  SSL_CTX_set_options(ctx, SSL_OP_ALL);
  return ctx;
}


x86 assembly (clang, -O0):
<zopenssl_SSL_CTX_create_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <SSLv23_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    1177 <zopenssl_SSL_CTX_create_client+0x37>
lea    0xe8e(%rip),%rdi
call   1040 <zfatal@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e66(%rip),%rax
mov    (%rax),%esi
call   1030 <SSL_CTX_set_options@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopenssl_SSL_CTX_create_client>:
push   %rbx
xor    %eax,%eax
call   1050 <SSLv23_client_method@plt>
mov    %rax,%rdi
call   1060 <SSL_CTX_new@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1164 <zopenssl_SSL_CTX_create_client+0x24>
lea    0xea1(%rip),%rdi
call   1040 <zfatal@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <SSL_CTX_set_options@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"FATAL SSL_CTX_new\00"
@SSL_OP_ALL = global i32 0
define i32* @zopenssl_SSL_CTX_create_client() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @SSLv23_client_method()
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32* @SSL_CTX_new(i32* %4)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @zfatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i32*, i32** %2
%12 = load i32, i32* @SSL_OP_ALL
%13 = call i32 @SSL_CTX_set_options(i32* %11, i32 %12)
%14 = load i32*, i32** %2
ret i32* %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"FATAL SSL_CTX_new\00"
@SSL_OP_ALL = global i32 0
define i32* @zopenssl_SSL_CTX_create_client() {
%1 = tail call i32* (...) @SSLv23_client_method()
%2 = tail call i32* @SSL_CTX_new(i32* %1)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @zfatal(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* @SSL_OP_ALL
%8 = tail call i32 @SSL_CTX_set_options(i32* %2, i32 %7)
ret i32* %2
}