#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*/ exit(int);
int /*<<< orphan*/ flushAllRegisters();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printStatistics();
int /*<<< orphan*/ stderr;
void _fatal(register int returnCode, register char *s, register char *file,
            register int line) {
  switch (returnCode) {
  case 10:
    fprintf(stderr, "ERROR: error in %s:%d: no more memory\n", file, line);
    break;
  case 30:
    fprintf(stderr, "ERROR: error in %s:%d: MAXATOMS reached. Recompile\n",
            file, line);
    break;
  case 20:
    break;
  case 40:
    fprintf(stderr, "ERROR: error in %s:%d: No search algotihm specified\n",
            file, line);
    break;
  case 00:
    break;
  }
  fprintf(stderr, "ERROR: fatal error.\n");
  printStatistics();
  flushAllRegisters();
  exit(returnCode);
}


x86 assembly (clang, -O0):
<_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x28,%rax
ja     11ee <_fatal+0xae>
mov    -0x28(%rbp),%rax
lea    0xe8e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xf12(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ee <_fatal+0xae>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xf16(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ee <_fatal+0xae>
jmp    11ee <_fatal+0xae>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xf22(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11ee <_fatal+0xae>
jmp    11ee <_fatal+0xae>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
lea    0xf36(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <printStatistics@plt>
mov    $0x0,%al
call   1040 <flushAllRegisters@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<_fatal>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
je     115b <_fatal+0x1b>
cmp    $0x28,%ebx
je     1164 <_fatal+0x24>
cmp    $0x1e,%ebx
jne    117b <_fatal+0x3b>
lea    0xece(%rip),%rsi
jmp    116b <_fatal+0x2b>
lea    0xe9e(%rip),%rsi
jmp    116b <_fatal+0x2b>
lea    0xef0(%rip),%rsi
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xf05(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <printStatistics@plt>
xor    %eax,%eax
call   1040 <flushAllRegisters@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"ERROR: error in %s:%d: no more memory\0A\00"
@.str.1 = [52 x i8] c"ERROR: error in %s:%d: MAXATOMS reached. Recompile\0A\00"
@.str.2 = [53 x i8] c"ERROR: error in %s:%d: No search algotihm specified\0A\00"
@.str.3 = [21 x i8] c"ERROR: fatal error.\0A\00"
define void @_fatal(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
switch i32 %9, label %27 [
i32 10, label %10
i32 30, label %15
i32 20, label %20
i32 40, label %21
i32 0, label %26
]
10: ; preds = %4
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
br label %27
15: ; preds = %4
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %17, i32 %18)
br label %27
20: ; preds = %4
br label %27
21: ; preds = %4
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %7
%24 = load i32, i32* %8
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i8* %23, i32 %24)
br label %27
26: ; preds = %4
br label %27
27: ; preds = %4, %26, %21, %20, %15, %10
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%30 = call i32 (...) @printStatistics()
%31 = call i32 (...) @flushAllRegisters()
%32 = load i32, i32* %5
%33 = call i32 @exit(i32 %32)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"ERROR: error in %s:%d: no more memory\0A\00"
@.str.1 = [52 x i8] c"ERROR: error in %s:%d: MAXATOMS reached. Recompile\0A\00"
@.str.2 = [53 x i8] c"ERROR: error in %s:%d: No search algotihm specified\0A\00"
@.str.3 = [21 x i8] c"ERROR: fatal error.\0A\00"
define void @_fatal(i32 %0, i8* nocapture readnone %1, i8* %2, i32 %3) {
switch i32 %0, label %11 [
i32 10, label %7
i32 30, label %5
i32 40, label %6
]
5: ; preds = %4
br label %7
6: ; preds = %4
br label %7
7: ; preds = %4, %5, %6
%8 = phi i8* [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), %4 ]
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* %8, i8* %2, i32 %3)
br label %11
11: ; preds = %7, %4
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 (...) @printStatistics()
%15 = tail call i32 (...) @flushAllRegisters()
%16 = tail call i32 @exit(i32 %0)
unreachable
}