#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 *);
int myerror(int err) {
  switch (err) {
  case 1:
    printf("Use of = instead of :=\n");
    break;
  case 2:
    printf("= must be followed by number\n");
    break;
  case 3:
    printf("Identifier must be followed by =\n");
    break;
  case 4:
    printf("const, var, proc must be followed by an identifier \n");
    break;
  case 5:
    printf("Semicolon or comma missing\n");
    break;
  case 6:
    printf("Incorrect symbol after procedure declaration\n");
    break;
  case 7:
    printf("Statement Expected\n");
    break;
  case 8:
    printf("Incorrect symbol after statement part in block\n");
    break;
  case 9:
    printf("Period expected\n");
    break;
  case 10:
    printf("Semicolon between statements is missing\n");
    break;
  case 11:
    printf("Undeclared identifier\n");
    break;
  case 12:
    printf("Assignment to constant or procedure not allowed\n");
    break;
  case 13:
    printf("Assignment operator := expected\n");
    break;
  case 14:
    printf("Call must be followed by an Identifier\n");
    break;
  case 15:
    printf("Call of variable or constant is meaningless\n");
    break;
  case 16:
    printf("Then expected\n");
    break;
  case 17:
    printf("Semicolon or end expected\n");
    break;
  case 18:
    printf("do expected\n");
    break;
  case 19:
    printf("Incorrect symbol following statement\n");
    break;
  case 20:
    printf("Relational operator expected\n");
    break;
  case 21:
    printf("Expression must not contain a procedure identifier\n");
    break;
  case 22:
    printf("Right Parenthesis Missing\n");
    break;
  case 23:
    printf("The preceeding factor cannot be followed by this symbol\n");
    break;
  case 24:
    printf("An expression cannot begin with this symbol\n");
    break;
  case 25:
    printf("Expecting comma between declarations\n");
    break;
  case 30:
    printf("number out of bound\n");
    break;
  default:
    printf("Unknown error");
  }
}


x86 assembly (clang, -O0):
<myerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1d,%eax
ja     12fe <myerror+0x1ee>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf2d(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xf34(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xf41(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xf52(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xf76(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xf81(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xf9e(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xfa1(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xfc0(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xfc0(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xfd8(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xfde(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0xffe(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x100e(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x1025(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x1041(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x103f(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x1049(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x1045(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x105a(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x1067(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x108a(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x1094(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x10bc(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x10d8(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x10ed(%rip),%rdi
call   1030 <printf@plt>
jmp    130a <myerror+0x1fa>
lea    0x10f1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myerror>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x1d,%edi
ja     1245 <myerror+0x125>
lea    0xecc(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0x128f(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x1266(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x1239(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x11f9(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x11d2(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x1199(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x117a(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x113f(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x1123(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x10ef(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x10cd(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x1091(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x1065(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0x1032(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xffd(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xfe6(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xfc3(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xfae(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xf80(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xf5a(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xf1e(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xefb(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xeba(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xe85(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xe57(%rip),%rdi
jmp    125a <myerror+0x13a>
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
pop    %rcx
ret
lea    0xe2c(%rip),%rdi
call   1030 <puts@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Use of = instead of :=\0A\00"
@.str.1 = [30 x i8] c"= must be followed by number\0A\00"
@.str.2 = [34 x i8] c"Identifier must be followed by =\0A\00"
@.str.3 = [53 x i8] c"const, var, proc must be followed by an identifier \0A\00"
@.str.4 = [28 x i8] c"Semicolon or comma missing\0A\00"
@.str.5 = [46 x i8] c"Incorrect symbol after procedure declaration\0A\00"
@.str.6 = [20 x i8] c"Statement Expected\0A\00"
@.str.7 = [48 x i8] c"Incorrect symbol after statement part in block\0A\00"
@.str.8 = [17 x i8] c"Period expected\0A\00"
@.str.9 = [41 x i8] c"Semicolon between statements is missing\0A\00"
@.str.10 = [23 x i8] c"Undeclared identifier\0A\00"
@.str.11 = [49 x i8] c"Assignment to constant or procedure not allowed\0A\00"
@.str.12 = [33 x i8] c"Assignment operator := expected\0A\00"
@.str.13 = [40 x i8] c"Call must be followed by an Identifier\0A\00"
@.str.14 = [45 x i8] c"Call of variable or constant is meaningless\0A\00"
@.str.15 = [15 x i8] c"Then expected\0A\00"
@.str.16 = [27 x i8] c"Semicolon or end expected\0A\00"
@.str.17 = [13 x i8] c"do expected\0A\00"
@.str.18 = [38 x i8] c"Incorrect symbol following statement\0A\00"
@.str.19 = [30 x i8] c"Relational operator expected\0A\00"
@.str.20 = [52 x i8] c"Expression must not contain a procedure identifier\0A\00"
@.str.21 = [27 x i8] c"Right Parenthesis Missing\0A\00"
@.str.22 = [57 x i8] c"The preceeding factor cannot be followed by this symbol\0A\00"
@.str.23 = [45 x i8] c"An expression cannot begin with this symbol\0A\00"
@.str.24 = [38 x i8] c"Expecting comma between declarations\0A\00"
@.str.25 = [21 x i8] c"number out of bound\0A\00"
@.str.26 = [14 x i8] c"Unknown error\00"
define i32 @myerror(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %57 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
i32 4, label %11
i32 5, label %13
i32 6, label %15
i32 7, label %17
i32 8, label %19
i32 9, label %21
i32 10, label %23
i32 11, label %25
i32 12, label %27
i32 13, label %29
i32 14, label %31
i32 15, label %33
i32 16, label %35
i32 17, label %37
i32 18, label %39
i32 19, label %41
i32 20, label %43
i32 21, label %45
i32 22, label %47
i32 23, label %49
i32 24, label %51
i32 25, label %53
i32 30, label %55
]
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %59
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %59
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
br label %59
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
br label %59
13: ; preds = %1
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %59
15: ; preds = %1
%16 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
br label %59
17: ; preds = %1
%18 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
br label %59
19: ; preds = %1
%20 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
br label %59
21: ; preds = %1
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br label %59
23: ; preds = %1
%24 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
br label %59
25: ; preds = %1
%26 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
br label %59
27: ; preds = %1
%28 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
br label %59
29: ; preds = %1
%30 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
br label %59
31: ; preds = %1
%32 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
br label %59
33: ; preds = %1
%34 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
br label %59
35: ; preds = %1
%36 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
br label %59
37: ; preds = %1
%38 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0))
br label %59
39: ; preds = %1
%40 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.17, i64 0, i64 0))
br label %59
41: ; preds = %1
%42 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0))
br label %59
43: ; preds = %1
%44 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0))
br label %59
45: ; preds = %1
%46 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.20, i64 0, i64 0))
br label %59
47: ; preds = %1
%48 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0))
br label %59
49: ; preds = %1
%50 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.22, i64 0, i64 0))
br label %59
51: ; preds = %1
%52 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.23, i64 0, i64 0))
br label %59
53: ; preds = %1
%54 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.24, i64 0, i64 0))
br label %59
55: ; preds = %1
%56 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0))
br label %59
57: ; preds = %1
%58 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.26, i64 0, i64 0))
br label %59
59: ; preds = %57, %55, %53, %51, %49, %47, %45, %43, %41, %39, %37, %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%60 = load i32, i32* %2
ret i32 %60
}

LLVM IR (-O2):
@.str.26 = [14 x i8] c"Unknown error\00"
@str = [20 x i8] c"number out of bound\00"
@str.27 = [37 x i8] c"Expecting comma between declarations\00"
@str.28 = [44 x i8] c"An expression cannot begin with this symbol\00"
@str.29 = [56 x i8] c"The preceeding factor cannot be followed by this symbol\00"
@str.30 = [26 x i8] c"Right Parenthesis Missing\00"
@str.31 = [51 x i8] c"Expression must not contain a procedure identifier\00"
@str.32 = [29 x i8] c"Relational operator expected\00"
@str.33 = [37 x i8] c"Incorrect symbol following statement\00"
@str.34 = [12 x i8] c"do expected\00"
@str.35 = [26 x i8] c"Semicolon or end expected\00"
@str.36 = [14 x i8] c"Then expected\00"
@str.37 = [44 x i8] c"Call of variable or constant is meaningless\00"
@str.38 = [39 x i8] c"Call must be followed by an Identifier\00"
@str.39 = [32 x i8] c"Assignment operator := expected\00"
@str.40 = [48 x i8] c"Assignment to constant or procedure not allowed\00"
@str.41 = [22 x i8] c"Undeclared identifier\00"
@str.42 = [40 x i8] c"Semicolon between statements is missing\00"
@str.43 = [16 x i8] c"Period expected\00"
@str.44 = [47 x i8] c"Incorrect symbol after statement part in block\00"
@str.45 = [19 x i8] c"Statement Expected\00"
@str.46 = [45 x i8] c"Incorrect symbol after procedure declaration\00"
@str.47 = [27 x i8] c"Semicolon or comma missing\00"
@str.48 = [52 x i8] c"const, var, proc must be followed by an identifier \00"
@str.49 = [33 x i8] c"Identifier must be followed by =\00"
@str.50 = [29 x i8] c"= must be followed by number\00"
@str.51 = [23 x i8] c"Use of = instead of :=\00"
define i32 @myerror(i32 %0) {
switch i32 %0, label %54 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
i32 5, label %10
i32 6, label %12
i32 7, label %14
i32 8, label %16
i32 9, label %18
i32 10, label %20
i32 11, label %22
i32 12, label %24
i32 13, label %26
i32 14, label %28
i32 15, label %30
i32 16, label %32
i32 17, label %34
i32 18, label %36
i32 19, label %38
i32 20, label %40
i32 21, label %42
i32 22, label %44
i32 23, label %46
i32 24, label %48
i32 25, label %50
i32 30, label %52
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.51, i64 0, i64 0))
br label %56
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.50, i64 0, i64 0))
br label %56
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.49, i64 0, i64 0))
br label %56
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.48, i64 0, i64 0))
br label %56
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.47, i64 0, i64 0))
br label %56
12: ; preds = %1
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.46, i64 0, i64 0))
br label %56
14: ; preds = %1
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.45, i64 0, i64 0))
br label %56
16: ; preds = %1
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.44, i64 0, i64 0))
br label %56
18: ; preds = %1
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.43, i64 0, i64 0))
br label %56
20: ; preds = %1
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.42, i64 0, i64 0))
br label %56
22: ; preds = %1
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.41, i64 0, i64 0))
br label %56
24: ; preds = %1
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.40, i64 0, i64 0))
br label %56
26: ; preds = %1
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.39, i64 0, i64 0))
br label %56
28: ; preds = %1
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.38, i64 0, i64 0))
br label %56
30: ; preds = %1
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.37, i64 0, i64 0))
br label %56
32: ; preds = %1
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.36, i64 0, i64 0))
br label %56
34: ; preds = %1
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.35, i64 0, i64 0))
br label %56
36: ; preds = %1
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.34, i64 0, i64 0))
br label %56
38: ; preds = %1
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.33, i64 0, i64 0))
br label %56
40: ; preds = %1
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.32, i64 0, i64 0))
br label %56
42: ; preds = %1
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.31, i64 0, i64 0))
br label %56
44: ; preds = %1
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.30, i64 0, i64 0))
br label %56
46: ; preds = %1
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.29, i64 0, i64 0))
br label %56
48: ; preds = %1
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.28, i64 0, i64 0))
br label %56
50: ; preds = %1
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.27, i64 0, i64 0))
br label %56
52: ; preds = %1
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %56
54: ; preds = %1
%55 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.26, i64 0, i64 0))
br label %56
56: ; preds = %54, %52, %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret i32 undef
}