#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[%s:%d]: no more memory\n", file, line);
    break;
  case 30:
    fprintf(stderr, "ERROR: maximum atoms reached. Recompile\n");
    break;
  case 20:
    fprintf(stderr, "ERROR: maximum operator schemata reached. Recompile\n");
    break;
  case 40:
    fprintf(stderr, "ERROR: no search algorithm specified\n");
    break;
  case 60:
    fprintf(
        stderr,
        "ERROR: schedule option. Format is [<direction>,<heuristic>,<time>]\n");
    break;
  case 70:
    fprintf(stderr, "ERROR: either bad search direction or heuristic.\n");
    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    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
test   %eax,%eax
je     127e <_fatal+0x13e>
jmp    1169 <_fatal+0x29>
mov    -0x20(%rbp),%eax
sub    $0xa,%eax
je     11cf <_fatal+0x8f>
jmp    117a <_fatal+0x3a>
mov    -0x20(%rbp),%eax
sub    $0x14,%eax
je     120e <_fatal+0xce>
jmp    118b <_fatal+0x4b>
mov    -0x20(%rbp),%eax
sub    $0x1e,%eax
je     11f2 <_fatal+0xb2>
jmp    119c <_fatal+0x5c>
mov    -0x20(%rbp),%eax
sub    $0x28,%eax
je     122a <_fatal+0xea>
jmp    11ad <_fatal+0x6d>
mov    -0x20(%rbp),%eax
sub    $0x3c,%eax
je     1246 <_fatal+0x106>
jmp    11be <_fatal+0x7e>
mov    -0x20(%rbp),%eax
sub    $0x46,%eax
je     1262 <_fatal+0x122>
jmp    1283 <_fatal+0x143>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1283 <_fatal+0x143>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1283 <_fatal+0x143>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1283 <_fatal+0x143>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
lea    0xe42(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1283 <_fatal+0x143>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1283 <_fatal+0x143>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1283 <_fatal+0x143>
jmp    1283 <_fatal+0x143>
mov    0x2d56(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%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
lea    -0xa(%rbx),%eax
cmp    $0x1e,%eax
ja     1174 <_fatal+0x34>
lea    0xeae(%rip),%rsi
movslq (%rsi,%rax,4),%rax
add    %rsi,%rax
jmp    *%rax
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xf11(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    11dd <_fatal+0x9d>
cmp    $0x3c,%ebx
je     11c6 <_fatal+0x86>
cmp    $0x46,%ebx
jne    11dd <_fatal+0x9d>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xfd4(%rip),%rsi
jmp    11d6 <_fatal+0x96>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
lea    0xf23(%rip),%rsi
jmp    11d6 <_fatal+0x96>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
jmp    11d6 <_fatal+0x96>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
lea    0xf34(%rip),%rsi
jmp    11d6 <_fatal+0x96>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xf48(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
lea    0xfa7(%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 = [30 x i8] c"ERROR[%s:%d]: no more memory\0A\00"
@.str.1 = [41 x i8] c"ERROR: maximum atoms reached. Recompile\0A\00"
@.str.2 = [53 x i8] c"ERROR: maximum operator schemata reached. Recompile\0A\00"
@.str.3 = [38 x i8] c"ERROR: no search algorithm specified\0A\00"
@.str.4 = [68 x i8] c"ERROR: schedule option. Format is [<direction>,<heuristic>,<time>]\0A\00"
@.str.5 = [50 x i8] c"ERROR: either bad search direction or heuristic.\0A\00"
@.str.6 = [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 %31 [
i32 10, label %10
i32 30, label %15
i32 20, label %18
i32 40, label %21
i32 60, label %24
i32 70, label %27
i32 0, label %30
]
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 ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
br label %31
15: ; preds = %4
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %31
18: ; preds = %4
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
br label %31
21: ; preds = %4
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %31
24: ; preds = %4
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
br label %31
27: ; preds = %4
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %31
30: ; preds = %4
br label %31
31: ; preds = %4, %30, %27, %24, %21, %18, %15, %10
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%34 = call i32 (...) @printStatistics()
%35 = call i32 (...) @flushAllRegisters()
%36 = load i32, i32* %5
%37 = call i32 @exit(i32 %36)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"ERROR[%s:%d]: no more memory\0A\00"
@.str.1 = [41 x i8] c"ERROR: maximum atoms reached. Recompile\0A\00"
@.str.2 = [53 x i8] c"ERROR: maximum operator schemata reached. Recompile\0A\00"
@.str.3 = [38 x i8] c"ERROR: no search algorithm specified\0A\00"
@.str.4 = [68 x i8] c"ERROR: schedule option. Format is [<direction>,<heuristic>,<time>]\0A\00"
@.str.5 = [50 x i8] c"ERROR: either bad search direction or heuristic.\0A\00"
@.str.6 = [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 %23 [
i32 10, label %5
i32 30, label %8
i32 20, label %11
i32 40, label %14
i32 60, label %17
i32 70, label %20
]
5: ; preds = %4
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
br label %23
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %23
11: ; preds = %4
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
br label %23
14: ; preds = %4
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %23
17: ; preds = %4
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
br label %23
20: ; preds = %4
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %23
23: ; preds = %4, %20, %17, %14, %11, %8, %5
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%26 = tail call i32 (...) @printStatistics()
%27 = tail call i32 (...) @flushAllRegisters()
%28 = tail call i32 @exit(i32 %0)
unreachable
}