#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.");
    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
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11c1 <bibl_reporterr+0xb1>
mov    -0x10(%rbp),%rax
lea    0xeb0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11d6 <bibl_reporterr+0xc6>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11d6 <bibl_reporterr+0xc6>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11d6 <bibl_reporterr+0xc6>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11d6 <bibl_reporterr+0xc6>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
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    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x3,%ebx
cmp    $0x3,%ebx
ja     1147 <bibl_reporterr+0x37>
movslq %ebx,%rax
lea    0xf1a(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    114e <bibl_reporterr+0x3e>
lea    0xeec(%rip),%rsi
mov    (%r14),%edi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xef6(%rip),%rsi
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 = [28 x i8] c"Cannot identify error code.\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 @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 @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %21
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %21
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %21
15: ; preds = %1
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %21
18: ; preds = %1
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
br label %21
21: ; preds = %18, %15, %12, %9, %6
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, 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 = [28 x i8] c"Cannot identify error code.\00"
@.str.6 = [2 x i8] c"\0A\00"
@reltable.bibl_reporterr = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.bibl_reporterr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.bibl_reporterr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.bibl_reporterr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.bibl_reporterr to i64)) to i32)]
define void @bibl_reporterr(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = add i32 %0, 3
%5 = icmp ult i32 %4, 4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.bibl_reporterr to i8*), i64 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), %1 ]
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* %11)
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret void
}