#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*/ printf(char *, ...);
void error(int n, int num, char *str) {
  switch (n) {
  case 1:
    printf("\nInvalid parameters! usage : %s filename.mc\n", str);
    break;
  case 2:
    printf("\nError in line %d : %s file not found or you do not have the "
           "required permissions to open the file!\n",
           num, str);
    break;
  case 3:
    printf("\nError in line %d : %s file could not be created!\n", num, str);
    break;
  case 4:
    printf("\nError in line %d : Syntax error\n", num);
    break;
  case 5:
    printf("\nError in line %d : Semicolon expected\n", num);
    break;
  case 6:
    printf("\nError in line %d : Redeclaration of variable %s\n", num, str);
    break;
  case 7:
    printf("\nError in line %d : Syntax error in variable declaration\n", num);
    break;
  case 8:
    printf(
        "\nError in line %d : There should be an identifier before (, [ or {\n",
        num);
    break;
  case 9:
    printf("\nError in line %d : Unexpected symbol ), ] or }\n", num);
    break;
  case 10:
    printf("\nWarning in line %d : useless type name in empty declaration\n",
           num);
    break;
  case 11:
    printf("\nError in line %d : Heap full!\n", num);
    break;
  case 12:
    printf("\nError in line %d : Syntax error in variable declaration! There "
           "should be a variable between 2 commas\n",
           num);
    break;
  case 13:
    printf("\nError in line %d : Semicolon missing at the end of the "
           "declaration statement!\n",
           num);
    break;
  case 14:
    printf("\nInvalid file type. The file should be with extension .mc\n");
    break;
  case 15:
    printf("\nMissing closing bracket ) or } or ]\n");
    break;
  default:
    printf("\nError in line %d : Unexpected error occurred!\n", num);
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xe,%eax
ja     129c <error+0x18c>
mov    -0x18(%rbp),%rax
lea    0xebe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rsi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xf44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0xf61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0xf6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xf7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0xf97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0xfbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0xfe9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0x1004(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0x102c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0x1036(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0x1087(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
lea    0x10c4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
lea    0x10ec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ad <error+0x19d>
mov    -0x8(%rbp),%esi
lea    0x10fc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
add    $0xffffffff,%edi
cmp    $0xe,%edi
ja     1149 <error+0x29>
lea    0xed1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xefd(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x11f1(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xf0b(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xf62(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xf87(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xf9b(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xfb5(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xfd9(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x1005(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x103b(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x105e(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x108e(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x10a0(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x10f9(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0x1190(%rip),%rdi
jmp    1030 <puts@plt>
lea    0x115f(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0AInvalid parameters! usage : %s filename.mc\0A\00"
@.str.1 = [101 x i8] c"\0AError in line %d : %s file not found or you do not have the required permissions to open the file!\0A\00"
@.str.2 = [51 x i8] c"\0AError in line %d : %s file could not be created!\0A\00"
@.str.3 = [34 x i8] c"\0AError in line %d : Syntax error\0A\00"
@.str.4 = [40 x i8] c"\0AError in line %d : Semicolon expected\0A\00"
@.str.5 = [50 x i8] c"\0AError in line %d : Redeclaration of variable %s\0A\00"
@.str.6 = [58 x i8] c"\0AError in line %d : Syntax error in variable declaration\0A\00"
@.str.7 = [68 x i8] c"\0AError in line %d : There should be an identifier before (, [ or {\0A\00"
@.str.8 = [49 x i8] c"\0AError in line %d : Unexpected symbol ), ] or }\0A\00"
@.str.9 = [62 x i8] c"\0AWarning in line %d : useless type name in empty declaration\0A\00"
@.str.10 = [32 x i8] c"\0AError in line %d : Heap full!\0A\00"
@.str.11 = [103 x i8] c"\0AError in line %d : Syntax error in variable declaration! There should be a variable between 2 commas\0A\00"
@.str.12 = [80 x i8] c"\0AError in line %d : Semicolon missing at the end of the declaration statement!\0A\00"
@.str.13 = [59 x i8] c"\0AInvalid file type. The file should be with extension .mc\0A\00"
@.str.14 = [38 x i8] c"\0AMissing closing bracket ) or } or ]\0A\00"
@.str.15 = [48 x i8] c"\0AError in line %d : Unexpected error occurred!\0A\00"
define void @error(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %54 [
i32 1, label %8
i32 2, label %11
i32 3, label %15
i32 4, label %19
i32 5, label %22
i32 6, label %25
i32 7, label %29
i32 8, label %32
i32 9, label %35
i32 10, label %38
i32 11, label %41
i32 12, label %44
i32 13, label %47
i32 14, label %50
i32 15, label %52
]
8: ; preds = %3
%9 = load i8*, i8** %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %57
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %13)
br label %57
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i8*, i8** %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 %16, i8* %17)
br label %57
19: ; preds = %3
%20 = load i32, i32* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %57
22: ; preds = %3
%23 = load i32, i32* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %57
25: ; preds = %3
%26 = load i32, i32* %5
%27 = load i8*, i8** %6
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 %26, i8* %27)
br label %57
29: ; preds = %3
%30 = load i32, i32* %5
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i32 %30)
br label %57
32: ; preds = %3
%33 = load i32, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0), i32 %33)
br label %57
35: ; preds = %3
%36 = load i32, i32* %5
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 %36)
br label %57
38: ; preds = %3
%39 = load i32, i32* %5
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0), i32 %39)
br label %57
41: ; preds = %3
%42 = load i32, i32* %5
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 %42)
br label %57
44: ; preds = %3
%45 = load i32, i32* %5
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.11, i64 0, i64 0), i32 %45)
br label %57
47: ; preds = %3
%48 = load i32, i32* %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.12, i64 0, i64 0), i32 %48)
br label %57
50: ; preds = %3
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.13, i64 0, i64 0))
br label %57
52: ; preds = %3
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0))
br label %57
54: ; preds = %3
%55 = load i32, i32* %5
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.15, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %54, %52, %50, %47, %44, %41, %38, %35, %32, %29, %25, %22, %19, %15, %11, %8
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0AInvalid parameters! usage : %s filename.mc\0A\00"
@.str.1 = [101 x i8] c"\0AError in line %d : %s file not found or you do not have the required permissions to open the file!\0A\00"
@.str.2 = [51 x i8] c"\0AError in line %d : %s file could not be created!\0A\00"
@.str.3 = [34 x i8] c"\0AError in line %d : Syntax error\0A\00"
@.str.4 = [40 x i8] c"\0AError in line %d : Semicolon expected\0A\00"
@.str.5 = [50 x i8] c"\0AError in line %d : Redeclaration of variable %s\0A\00"
@.str.6 = [58 x i8] c"\0AError in line %d : Syntax error in variable declaration\0A\00"
@.str.7 = [68 x i8] c"\0AError in line %d : There should be an identifier before (, [ or {\0A\00"
@.str.8 = [49 x i8] c"\0AError in line %d : Unexpected symbol ), ] or }\0A\00"
@.str.9 = [62 x i8] c"\0AWarning in line %d : useless type name in empty declaration\0A\00"
@.str.10 = [32 x i8] c"\0AError in line %d : Heap full!\0A\00"
@.str.11 = [103 x i8] c"\0AError in line %d : Syntax error in variable declaration! There should be a variable between 2 commas\0A\00"
@.str.12 = [80 x i8] c"\0AError in line %d : Semicolon missing at the end of the declaration statement!\0A\00"
@.str.15 = [48 x i8] c"\0AError in line %d : Unexpected error occurred!\0A\00"
@str = [37 x i8] c"\0AMissing closing bracket ) or } or ]\00"
@str.16 = [58 x i8] c"\0AInvalid file type. The file should be with extension .mc\00"
define void @error(i32 %0, i32 %1, i8* %2) {
switch i32 %0, label %34 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %14
i32 7, label %16
i32 8, label %18
i32 9, label %20
i32 10, label %22
i32 11, label %24
i32 12, label %26
i32 13, label %28
i32 14, label %30
i32 15, label %32
]
4: ; preds = %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %36
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %2)
br label %36
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 %1, i8* %2)
br label %36
10: ; preds = %3
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %1)
br label %36
12: ; preds = %3
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %1)
br label %36
14: ; preds = %3
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 %1, i8* %2)
br label %36
16: ; preds = %3
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i32 %1)
br label %36
18: ; preds = %3
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0), i32 %1)
br label %36
20: ; preds = %3
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 %1)
br label %36
22: ; preds = %3
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0), i32 %1)
br label %36
24: ; preds = %3
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i32 %1)
br label %36
26: ; preds = %3
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([103 x i8], [103 x i8]* @.str.11, i64 0, i64 0), i32 %1)
br label %36
28: ; preds = %3
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.12, i64 0, i64 0), i32 %1)
br label %36
30: ; preds = %3
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.16, i64 0, i64 0))
br label %36
32: ; preds = %3
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %36
34: ; preds = %3
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.15, i64 0, i64 0), i32 %1)
br label %36
36: ; preds = %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret void
}