#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_CTX;

/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ SSL_CTX_use_PrivateKey_file(int /*<<< orphan*/ *, char *,
                                       int /*<<< orphan*/);
scalar_t__ SSL_CTX_use_certificate_file(int /*<<< orphan*/ *, char *,
                                        int /*<<< orphan*/);
int /*<<< orphan*/ SSL_FILETYPE_PEM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void configure_context(SSL_CTX *ctx) {
  if (SSL_CTX_use_certificate_file(ctx, "certs/server.cert.signed.pem",
                                   SSL_FILETYPE_PEM) < 0) {
    ERR_print_errors_fp(stderr);
    exit(EXIT_FAILURE);
  }
  printf("Loaded server certificate: certs/server.cert.signed.pem\n");
  if (SSL_CTX_use_PrivateKey_file(ctx, "private/server.key.pem",
                                  SSL_FILETYPE_PEM) < 0) {
    ERR_print_errors_fp(stderr);
    exit(EXIT_FAILURE);
  }
  printf("Loaded server private key: private/server.key.pem\n");
}


x86 assembly (clang, -O0):
<configure_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
lea    0xe90(%rip),%rsi
call   1040 <SSL_CTX_use_certificate_file@plt>
cmp    $0x0,%rax
jge    119b <configure_context+0x4b>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1070 <ERR_print_errors_fp@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e36(%rip),%rax
mov    (%rax),%edx
lea    0xe9b(%rip),%rsi
call   1050 <SSL_CTX_use_PrivateKey_file@plt>
cmp    $0x0,%rax
jge    11e6 <configure_context+0x96>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
call   1070 <ERR_print_errors_fp@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_context>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e8a(%rip),%r14
mov    (%r14),%edx
lea    0xeb3(%rip),%rsi
call   1040 <SSL_CTX_use_certificate_file@plt>
test   %rax,%rax
js     11a8 <configure_context+0x58>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%edx
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <SSL_CTX_use_PrivateKey_file@plt>
test   %rax,%rax
js     11a8 <configure_context+0x58>
lea    0xe9c(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1070 <ERR_print_errors_fp@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"certs/server.cert.signed.pem\00"
@SSL_FILETYPE_PEM = global i32 0
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [57 x i8] c"Loaded server certificate: certs/server.cert.signed.pem\0A\00"
@.str.2 = [23 x i8] c"private/server.key.pem\00"
@.str.3 = [51 x i8] c"Loaded server private key: private/server.key.pem\0A\00"
define void @configure_context(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SSL_FILETYPE_PEM
%5 = call i64 @SSL_CTX_use_certificate_file(i32* %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @ERR_print_errors_fp(i32 %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32*, i32** %2
%15 = load i32, i32* @SSL_FILETYPE_PEM
%16 = call i64 @SSL_CTX_use_PrivateKey_file(i32* %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = call i32 @ERR_print_errors_fp(i32 %19)
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %12
%24 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"certs/server.cert.signed.pem\00"
@SSL_FILETYPE_PEM = global i32 0
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.2 = [23 x i8] c"private/server.key.pem\00"
@str = [56 x i8] c"Loaded server certificate: certs/server.cert.signed.pem\00"
@str.4 = [50 x i8] c"Loaded server private key: private/server.key.pem\00"
define void @configure_context(i32* %0) {
%2 = load i32, i32* @SSL_FILETYPE_PEM
%3 = tail call i64 @SSL_CTX_use_certificate_file(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @ERR_print_errors_fp(i32 %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @SSL_FILETYPE_PEM
%13 = tail call i64 @SSL_CTX_use_PrivateKey_file(i32* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = tail call i32 @ERR_print_errors_fp(i32 %16)
%18 = load i32, i32* @EXIT_FAILURE
%19 = tail call i32 @exit(i32 %18)
unreachable
20: ; preds = %10
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.4, i64 0, i64 0))
ret void
}