#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*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
void Error(int e, char *s, short i) {
  char str[100];
  switch (e) {
  case 0:
    strcpy(str, "Out of memory");
    break;
  case 1:
    strcpy(str, "Can't open file");
    break;
  case 2:
    strcpy(str, "Illegal extention");
    break;
  case 3:
    strcpy(str, "Too big name");
    break;
  case 4:
    strcpy(str, "Syntax error");
    break;
  case 5:
    strcpy(str, "Quotation is expected");
    break;
  case 6:
    strcpy(str, "Duplicate definition");
    break;
  case 7:
    strcpy(str, "Definition after START:");
    break;
  case 8:
    strcpy(str, "Command before START:");
    break;
  case 9:
    strcpy(str, "Too many vars");
    break;
  case 10:
    strcpy(str, "Unknown name");
    break;
  case 11:
    strcpy(str, "Out of index");
    break;
  case 12:
    strcpy(str, "Register is read only");
    break;
  case 13:
    strcpy(str, "Command after END");
    break;
  case 14:
    strcpy(str, "END is expected");
    break;
  case 15:
    strcpy(str, "Bad file format");
    break;
  case 16:
    strcpy(str, "Too many lines");
    break;
  case 17:
    strcpy(str, "Unknown label");
    break;
  default:
    strcpy(str, "Unknown error");
    break;
  }
  printf("\n");
  if (i > 0)
    printf("(%u) ", i);
  printf("ERROR %i: %s !", e, str);
  if (s != NULL)
    printf("\n\t%s", s);
  printf("\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x88(%rbp)
sub    $0x11,%rax
ja     12ee <Error+0x1be>
mov    -0x88(%rbp),%rax
lea    0xe95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x80(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12fe <Error+0x1ce>
lea    -0x80(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movswl -0x12(%rbp),%eax
cmp    $0x0,%eax
jle    132b <Error+0x1fb>
movswl -0x12(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    -0x80(%rbp),%rdx
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     135d <Error+0x22d>
mov    -0x10(%rbp),%rsi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Error>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
cmp    $0x11,%edi
ja     1177 <Error+0x27>
movslq %ebp,%rax
lea    0xfee(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    117e <Error+0x2e>
lea    0xfb2(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcpy@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %bx,%bx
jle    11a6 <Error+0x56>
movzwl %bx,%esi
lea    0xf9f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf97(%rip),%rdi
mov    %rsp,%rdx
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r14,%r14
je     11cf <Error+0x7f>
lea    0xf8e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf82(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
@.str.1 = [16 x i8] c"Can't open file\00"
@.str.2 = [18 x i8] c"Illegal extention\00"
@.str.3 = [13 x i8] c"Too big name\00"
@.str.4 = [13 x i8] c"Syntax error\00"
@.str.5 = [22 x i8] c"Quotation is expected\00"
@.str.6 = [21 x i8] c"Duplicate definition\00"
@.str.7 = [24 x i8] c"Definition after START:\00"
@.str.8 = [22 x i8] c"Command before START:\00"
@.str.9 = [14 x i8] c"Too many vars\00"
@.str.10 = [13 x i8] c"Unknown name\00"
@.str.11 = [13 x i8] c"Out of index\00"
@.str.12 = [22 x i8] c"Register is read only\00"
@.str.13 = [18 x i8] c"Command after END\00"
@.str.14 = [16 x i8] c"END is expected\00"
@.str.15 = [16 x i8] c"Bad file format\00"
@.str.16 = [15 x i8] c"Too many lines\00"
@.str.17 = [14 x i8] c"Unknown label\00"
@.str.18 = [14 x i8] c"Unknown error\00"
@.str.19 = [2 x i8] c"\0A\00"
@.str.20 = [6 x i8] c"(%u) \00"
@.str.21 = [15 x i8] c"ERROR %i: %s !\00"
@.str.22 = [5 x i8] c"\0A\09%s\00"
@.str.23 = [3 x i8] c"\0A\0A\00"
define void @Error(i32 %0, i8* %1, i16 signext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i16
%7 = alloca [100 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%8 = load i32, i32* %4
switch i32 %8, label %63 [
i32 0, label %9
i32 1, label %12
i32 2, label %15
i32 3, label %18
i32 4, label %21
i32 5, label %24
i32 6, label %27
i32 7, label %30
i32 8, label %33
i32 9, label %36
i32 10, label %39
i32 11, label %42
i32 12, label %45
i32 13, label %48
i32 14, label %51
i32 15, label %54
i32 16, label %57
i32 17, label %60
]
9: ; preds = %3
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %66
12: ; preds = %3
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %66
15: ; preds = %3
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %66
18: ; preds = %3
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %66
21: ; preds = %3
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %66
24: ; preds = %3
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %66
27: ; preds = %3
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %66
30: ; preds = %3
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %66
33: ; preds = %3
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %66
36: ; preds = %3
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %66
39: ; preds = %3
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %66
42: ; preds = %3
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%44 = call i32 @strcpy(i8* %43, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
br label %66
45: ; preds = %3
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
br label %66
48: ; preds = %3
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%50 = call i32 @strcpy(i8* %49, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0))
br label %66
51: ; preds = %3
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%53 = call i32 @strcpy(i8* %52, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
br label %66
54: ; preds = %3
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%56 = call i32 @strcpy(i8* %55, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0))
br label %66
57: ; preds = %3
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%59 = call i32 @strcpy(i8* %58, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0))
br label %66
60: ; preds = %3
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%62 = call i32 @strcpy(i8* %61, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
br label %66
63: ; preds = %3
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%65 = call i32 @strcpy(i8* %64, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0))
br label %66
66: ; preds = %63, %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%68 = load i16, i16* %6
%69 = sext i16 %68 to i32
%70 = icmp sgt i32 %69, 0
br i1 %70, label %71, label %75
71: ; preds = %66
%72 = load i16, i16* %6
%73 = sext i16 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %73)
br label %75
75: ; preds = %71, %66
%76 = load i32, i32* %4
%77 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0), i32 %76, i8* %77)
%79 = load i8*, i8** %5
%80 = icmp ne i8* %79, null
br i1 %80, label %81, label %84
81: ; preds = %75
%82 = load i8*, i8** %5
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0), i8* %82)
br label %84
84: ; preds = %81, %75
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.23, i64 0, i64 0))
%86 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
@.str.1 = [16 x i8] c"Can't open file\00"
@.str.2 = [18 x i8] c"Illegal extention\00"
@.str.3 = [13 x i8] c"Too big name\00"
@.str.4 = [13 x i8] c"Syntax error\00"
@.str.5 = [22 x i8] c"Quotation is expected\00"
@.str.6 = [21 x i8] c"Duplicate definition\00"
@.str.7 = [24 x i8] c"Definition after START:\00"
@.str.8 = [22 x i8] c"Command before START:\00"
@.str.9 = [14 x i8] c"Too many vars\00"
@.str.10 = [13 x i8] c"Unknown name\00"
@.str.11 = [13 x i8] c"Out of index\00"
@.str.12 = [22 x i8] c"Register is read only\00"
@.str.13 = [18 x i8] c"Command after END\00"
@.str.14 = [16 x i8] c"END is expected\00"
@.str.15 = [16 x i8] c"Bad file format\00"
@.str.16 = [15 x i8] c"Too many lines\00"
@.str.17 = [14 x i8] c"Unknown label\00"
@.str.18 = [14 x i8] c"Unknown error\00"
@.str.20 = [6 x i8] c"(%u) \00"
@.str.21 = [15 x i8] c"ERROR %i: %s !\00"
@.str.22 = [5 x i8] c"\0A\09%s\00"
@str = [2 x i8] c"\0A\00"
@reltable.Error = [18 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.1 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.2 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.3 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.4 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.5 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.6 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.7 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.8 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.9 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.10 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.11 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.12 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.13 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.14 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.15 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.16 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.17 to i64), i64 ptrtoint ([18 x i32]* @reltable.Error to i64)) to i32)]
define void @Error(i32 %0, i8* %1, i16 signext %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = icmp ult i32 %0, 18
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = sext i32 %0 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([18 x i32]* @reltable.Error to i8*), i64 %9)
br label %11
11: ; preds = %3, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.18, i64 0, i64 0), %3 ]
%13 = call i32 @strcpy(i8* %5, i8* %12)
%14 = call i32 @putchar(i32 10)
%15 = icmp sgt i16 %2, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = zext i16 %2 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %11
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0), i32 %0, i8* %5)
%21 = icmp eq i8* %1, null
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0), i8* %1)
br label %24
24: ; preds = %22, %19
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
}