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

/* Variables and functions */
int ERR_TXT_STRING;
int /*<<< orphan*/ ERR_error_string(unsigned long, int /*<<< orphan*/ *);
unsigned long ERR_get_error_line_data(char const **, int *, char const **,
                                      int *);
int /*<<< orphan*/ printf(char *, char *, int, char const *, int, int,
                          char const *, unsigned long, int /*<<< orphan*/);
void showErrQueue(char *file, int line) {
  unsigned long e;
  const char *f;
  int l;
  const char *data;
  int flags;
  while ((e = ERR_get_error_line_data(&f, &l, &data, &flags))) {
    printf("%s:%d \"%s:%d\"(%d: %s) (%lu) %s\n", file, line, f, l, flags,
           flags & ERR_TXT_STRING ? data : "", e, ERR_error_string(e, NULL));
  }
}


x86 assembly (clang, -O0):
<showErrQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   1050 <ERR_get_error_line_data@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     120f <showErrQueue+0xdf>
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    0x2e67(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11a9 <showErrQueue+0x79>
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
jmp    11b9 <showErrQueue+0x89>
lea    0xe6f(%rip),%rax
mov    %rax,-0x60(%rbp)
jmp    11b9 <showErrQueue+0x89>
mov    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <ERR_error_string@plt>
mov    -0x58(%rbp),%rsi
mov    -0x4c(%rbp),%edx
mov    -0x48(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    -0x38(%rbp),%r9d
mov    -0x70(%rbp),%r11
mov    -0x68(%rbp),%r10
lea    0xe08(%rip),%rdi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
jmp    1142 <showErrQueue+0x12>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showErrQueue>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,0x14(%rsp)
mov    %rdi,%rbx
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <ERR_get_error_line_data@plt>
test   %rax,%rax
je     11ee <showErrQueue+0xbe>
mov    %rax,%r14
jmp    11cd <showErrQueue+0x9d>
nopl   0x0(%rax)
mov    0x20(%rsp),%r13
mov    0x10(%rsp),%r15d
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <ERR_error_string@plt>
sub    $0x8,%rsp
lea    0xe71(%rip),%rdi
mov    %rbx,%rsi
mov    0x1c(%rsp),%edx
mov    %r13,%rcx
mov    %r15d,%r8d
mov    %r12d,%r9d
push   %rax
push   %r14
push   %rbp
call   1030 <printf@plt>
add    $0x20,%rsp
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <ERR_get_error_line_data@plt>
mov    %rax,%r14
test   %rax,%rax
je     11ee <showErrQueue+0xbe>
mov    0xc(%rsp),%r12d
mov    0x2e1f(%rip),%rax
mov    (%rax),%eax
lea    0xe3d(%rip),%rbp
and    %r12d,%eax
je     1170 <showErrQueue+0x40>
mov    0x18(%rsp),%rbp
jmp    1170 <showErrQueue+0x40>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"%s:%d \22%s:%d\22(%d: %s) (%lu) %s\0A\00"
@ERR_TXT_STRING = global i32 0
@.str.1 = [1 x i8] zeroinitializer
define void @showErrQueue(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %10
10: ; preds = %26, %2
%11 = call i64 @ERR_get_error_line_data(i8** %6, i32* %7, i8** %8, i32* %9)
store i64 %11, i64* %5
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %32
13: ; preds = %10
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = load i32, i32* %9
%19 = load i32, i32* %9
%20 = load i32, i32* @ERR_TXT_STRING
%21 = and i32 %19, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %13
%24 = load i8*, i8** %8
br label %26
25: ; preds = %13
br label %26
26: ; preds = %25, %23
%27 = phi i8* [ %24, %23 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %25 ]
%28 = load i64, i64* %5
%29 = load i64, i64* %5
%30 = call i32 @ERR_error_string(i64 %29, i32* null)
%31 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16, i32 %17, i32 %18, i8* %27, i64 %28, i32 %30)
br label %10
32: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"%s:%d \22%s:%d\22(%d: %s) (%lu) %s\0A\00"
@ERR_TXT_STRING = global i32 0
@.str.1 = [1 x i8] zeroinitializer
define void @showErrQueue(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = bitcast i8** %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i8** %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = call i64 @ERR_get_error_line_data(i8** %3, i32* %4, i8** %5, i32* %6)
%12 = icmp eq i64 %11, 0
br i1 %12, label %27, label %13
13: ; preds = %2, %13
%14 = phi i64 [ %25, %13 ], [ %11, %2 ]
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = load i32, i32* @ERR_TXT_STRING
%19 = and i32 %18, %17
%20 = icmp eq i32 %19, 0
%21 = load i8*, i8** %5
%22 = select i1 %20, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %21
%23 = call i32 @ERR_error_string(i64 %14, i32* null)
%24 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %15, i32 %16, i32 %17, i8* %22, i64 %14, i32 %23)
%25 = call i64 @ERR_get_error_line_data(i8** %3, i32* %4, i8** %5, i32* %6)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %13
27: ; preds = %13, %2
ret void
}