#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*/ WriteFatal(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void exits(char *s, int e) {
  char str[256], st2[256];
  strcpy(str, "\n\n");
  if (e == 0)
    strcat(str, "Out of memory: ");
  if (e == 1)
    strcat(str, "Unknown error: ");
  if (e == 2)
    strcat(str, "File doesn't exist: ");
  if (e == 3)
    strcat(str, "Can't open file: ");
  if (e == 4)
    strcat(str, "Too many options: ");
  sprintf(st2, "%s %s !\n\n", str, s);
  WriteFatal(st2);
  exit(-1);
}


x86 assembly (clang, -O0):
<exits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xef1(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1192 <exits+0x42>
lea    -0x110(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1050 <strcat@plt>
cmpl   $0x1,-0xc(%rbp)
jne    11af <exits+0x5f>
lea    -0x110(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1050 <strcat@plt>
cmpl   $0x2,-0xc(%rbp)
jne    11cc <exits+0x7c>
lea    -0x110(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1050 <strcat@plt>
cmpl   $0x3,-0xc(%rbp)
jne    11e9 <exits+0x99>
lea    -0x110(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1050 <strcat@plt>
cmpl   $0x4,-0xc(%rbp)
jne    1206 <exits+0xb6>
lea    -0x110(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe3b(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <WriteFatal@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<exits>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xefc(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
cmp    $0x4,%ebp
ja     118b <exits+0x3b>
movslq %ebp,%rax
lea    0xee8(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %rsp,%rdi
call   1050 <strcat@plt>
lea    0xec8(%rip),%rsi
lea    0x100(%rsp),%rbp
mov    %rsp,%rdx
mov    %rbp,%rdi
mov    %rbx,%rcx
call   1060 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <WriteFatal@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [16 x i8] c"Out of memory: \00"
@.str.2 = [16 x i8] c"Unknown error: \00"
@.str.3 = [21 x i8] c"File doesn't exist: \00"
@.str.4 = [18 x i8] c"Can't open file: \00"
@.str.5 = [19 x i8] c"Too many options: \00"
@.str.6 = [10 x i8] c"%s %s !\0A\0A\00"
define void @exits(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%25 = call i32 @strcat(i8* %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %4
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%31 = call i32 @strcat(i8* %30, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %32
32: ; preds = %29, %26
%33 = load i32, i32* %4
%34 = icmp eq i32 %33, 4
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%37 = call i32 @strcat(i8* %36, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
br label %38
38: ; preds = %35, %32
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%41 = load i8*, i8** %3
%42 = call i32 @sprintf(i8* %39, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %40, i8* %41)
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%44 = call i32 @WriteFatal(i8* %43)
%45 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [16 x i8] c"Out of memory: \00"
@.str.2 = [16 x i8] c"Unknown error: \00"
@.str.3 = [21 x i8] c"File doesn't exist: \00"
@.str.4 = [18 x i8] c"Can't open file: \00"
@.str.5 = [19 x i8] c"Too many options: \00"
@.str.6 = [10 x i8] c"%s %s !\0A\0A\00"
@reltable.exits = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.exits to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.exits to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.exits to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.exits to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.5 to i64), i64 ptrtoint ([5 x i32]* @reltable.exits to i64)) to i32)]
define void @exits(i8* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ult i32 %1, 5
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = sext i32 %1 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.exits to i8*), i64 %11)
%13 = call i32 @strcat(i8* %5, i8* %12)
br label %14
14: ; preds = %2, %9
%15 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %5, i8* %0)
%16 = call i32 @WriteFatal(i8* %6)
%17 = call i32 @exit(i32 -1)
unreachable
}