#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*/ FILE;

/* Variables and functions */
char *ERR_error_string(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ ERR_get_error();
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/ *);
char *ERR_reason_error_string(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void print_ssl_error_2(char *message, char *content, FILE *out) {
  fprintf(out, message, content);
  fprintf(out, "Error: %s\n", ERR_reason_error_string(ERR_get_error()));
  fprintf(out, "%s\n", ERR_error_string(ERR_get_error(), NULL));
  ERR_print_errors_fp(out);
}


x86 assembly (clang, -O0):
<print_ssl_error_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1060 <ERR_get_error@plt>
mov    %eax,%edi
call   1030 <ERR_reason_error_string@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rdx
lea    0xe67(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <ERR_get_error@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <ERR_error_string@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rdx
lea    0xe41(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <ERR_print_errors_fp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ssl_error_2>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1060 <ERR_get_error@plt>
mov    %eax,%edi
call   1030 <ERR_reason_error_string@plt>
lea    0xe89(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1060 <ERR_get_error@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <ERR_error_string@plt>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <ERR_print_errors_fp@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @print_ssl_error_2(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @fprintf(i32* %7, i8* %8, i8* %9)
%11 = load i32*, i32** %6
%12 = call i32 (...) @ERR_get_error()
%13 = call i8* @ERR_reason_error_string(i32 %12)
%14 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32*, i32** %6
%16 = call i32 (...) @ERR_get_error()
%17 = call i8* @ERR_error_string(i32 %16, i32* null)
%18 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = load i32*, i32** %6
%20 = call i32 @ERR_print_errors_fp(i32* %19)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @print_ssl_error_2(i8* nocapture %0, i8* %1, i32* %2) {
%4 = tail call i32 @fprintf(i32* %2, i8* %0, i8* %1)
%5 = tail call i32 (...) @ERR_get_error()
%6 = tail call i8* @ERR_reason_error_string(i32 %5)
%7 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 (...) @ERR_get_error()
%9 = tail call i8* @ERR_error_string(i32 %8, i32* null)
%10 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = tail call i32 @ERR_print_errors_fp(i32* %2)
ret void
}