#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void bibl_reporterr(int err) {
  fprintf(stderr, "Bibutils: ");
  switch (err) {
  case (0):
    fprintf(stderr, "No error.");
    break;
  case (-1):
    fprintf(stderr, "Bad input.");
    break;
  case (-2):
    fprintf(stderr, "Memory error.");
    break;
  case (-3):
    fprintf(stderr, "Can't open.");
    break;
  default:
    fprintf(stderr, "Cannot identify error code %d.", err);
    break;
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<bibl_reporterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11cb <bibl_reporterr+0xbb>
mov    -0x10(%rbp),%rax
lea    0xeae(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11e5 <bibl_reporterr+0xd5>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11e5 <bibl_reporterr+0xd5>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11e5 <bibl_reporterr+0xd5>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11e5 <bibl_reporterr+0xd5>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bibl_reporterr>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec3(%rip),%r14
mov    (%r14),%edi
lea    0xee9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x3(%rbx),%eax
cmp    $0x3,%eax
ja     1152 <bibl_reporterr+0x42>
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    (%r14),%edi
lea    0xeee(%rip),%rsi
jmp    1189 <bibl_reporterr+0x79>
mov    (%r14),%edi
lea    0xeee(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    1190 <bibl_reporterr+0x80>
mov    (%r14),%edi
lea    0xebf(%rip),%rsi
jmp    1189 <bibl_reporterr+0x79>
mov    (%r14),%edi
lea    0xea8(%rip),%rsi
jmp    1189 <bibl_reporterr+0x79>
mov    (%r14),%edi
lea    0xe92(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Bibutils: \00"
@.str.1 = [10 x i8] c"No error.\00"
@.str.2 = [11 x i8] c"Bad input.\00"
@.str.3 = [14 x i8] c"Memory error.\00"
@.str.4 = [12 x i8] c"Can't open.\00"
@.str.5 = [31 x i8] c"Cannot identify error code %d.\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @bibl_reporterr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
switch i32 %5, label %18 [
i32 0, label %6
i32 -1, label %9
i32 -2, label %12
i32 -3, label %15
]
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %22
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %22
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %22
15: ; preds = %1
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %22
18: ; preds = %1
%19 = load i32, i32* @stderr
%20 = load i32, i32* %2
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %18, %15, %12, %9, %6
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Bibutils: \00"
@.str.1 = [10 x i8] c"No error.\00"
@.str.2 = [11 x i8] c"Bad input.\00"
@.str.3 = [14 x i8] c"Memory error.\00"
@.str.4 = [12 x i8] c"Can't open.\00"
@.str.5 = [31 x i8] c"Cannot identify error code %d.\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @bibl_reporterr(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %16 [
i32 0, label %4
i32 -1, label %7
i32 -2, label %10
i32 -3, label %13
]
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %19
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %19
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %19
13: ; preds = %1
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %19
16: ; preds = %1
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %0)
br label %19
19: ; preds = %16, %13, %10, %7, %4
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret void
}