#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_handler(int error) {
  switch (error) {
  case 1:
    printf("Error: \"=\" where \":=\" expected.\n");
    break;
  case 2:
    printf("Error: number expected after \"=\".\n");
    break;
  case 3:
    printf("Error: \"=\" expected after identifier.\n");
    break;
  case 4:
    printf("Error: identifier expected after const, var, or procedure.\n");
    break;
  case 5:
    printf("Error: semicolon or comma expected.\n");
    break;
  case 6:
    printf("Error: Incorrect symbol after procedure declaration.\n");
    break;
  case 7:
    printf("Error: Statement expected.\n");
    break;
  case 8:
    printf("Error: Incorrect symbol after statement part in block.\n");
    break;
  case 9:
    printf("Error: \".\" expected.\n");
    break;
  case 10:
    printf("Error: Semicolon expected between statements.\n");
    break;
  case 11:
    printf("Error: Undeclared identifier.\n");
    break;
  case 12:
    printf("Error: Assignment to constant or procedure is not allowed.\n");
    break;
  case 13:
    printf("Error: Assignment operator expected.\n");
    break;
  case 14:
    printf("Error: \"call\" must be followed by an identifier.\n");
    break;
  case 15:
    printf("Error: call attempted on const or var.\n");
    break;
  case 16:
    printf("Error: \"then\" expected.\n");
    break;
  case 17:
    printf("Error: semicolon or \"end\" expected.\n");
    break;
  case 18:
    printf("Error: \"do\" expected.\n");
    break;
  case 19:
    printf("Error: incorrect symbol following statement.\n");
    break;
  case 20:
    printf("Error: relational operator expected.\n");
    break;
  case 21:
    printf("Error: procedure identifier found in an expression.\n");
    break;
  case 22:
    printf("Error: right parenthesis missing.\n");
    break;
  case 23:
    printf("Error: the preceding factor cannot being with this symbol.\n");
    break;
  case 24:
    printf("Error: an expression cannot begin with this symbol.\n");
    break;
  case 25:
    printf("Error: number greater than max supported found.\n");
    break;
  }
}


x86 assembly (clang, -O0):
<error_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x18,%eax
ja     12e8 <error_handler+0x1d8>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf19(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xf29(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xf3b(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xf51(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xf7c(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xf90(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xfb5(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xfc0(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xfe7(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0xfec(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x100a(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1018(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1043(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1058(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1079(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1090(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1098(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x10ac(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x10b2(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x10cf(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x10e4(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1108(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x111a(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1145(%rip),%rdi
call   1030 <printf@plt>
jmp    12e8 <error_handler+0x1d8>
lea    0x1169(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_handler>:
add    $0xffffffff,%edi
cmp    $0x18,%edi
ja     112e <error_handler+0x1e>
movslq %edi,%rax
lea    0x12de(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Error: \22=\22 where \22:=\22 expected.\0A\00"
@.str.1 = [35 x i8] c"Error: number expected after \22=\22.\0A\00"
@.str.2 = [39 x i8] c"Error: \22=\22 expected after identifier.\0A\00"
@.str.3 = [60 x i8] c"Error: identifier expected after const, var, or procedure.\0A\00"
@.str.4 = [37 x i8] c"Error: semicolon or comma expected.\0A\00"
@.str.5 = [54 x i8] c"Error: Incorrect symbol after procedure declaration.\0A\00"
@.str.6 = [28 x i8] c"Error: Statement expected.\0A\00"
@.str.7 = [56 x i8] c"Error: Incorrect symbol after statement part in block.\0A\00"
@.str.8 = [22 x i8] c"Error: \22.\22 expected.\0A\00"
@.str.9 = [47 x i8] c"Error: Semicolon expected between statements.\0A\00"
@.str.10 = [31 x i8] c"Error: Undeclared identifier.\0A\00"
@.str.11 = [60 x i8] c"Error: Assignment to constant or procedure is not allowed.\0A\00"
@.str.12 = [38 x i8] c"Error: Assignment operator expected.\0A\00"
@.str.13 = [50 x i8] c"Error: \22call\22 must be followed by an identifier.\0A\00"
@.str.14 = [40 x i8] c"Error: call attempted on const or var.\0A\00"
@.str.15 = [25 x i8] c"Error: \22then\22 expected.\0A\00"
@.str.16 = [37 x i8] c"Error: semicolon or \22end\22 expected.\0A\00"
@.str.17 = [23 x i8] c"Error: \22do\22 expected.\0A\00"
@.str.18 = [46 x i8] c"Error: incorrect symbol following statement.\0A\00"
@.str.19 = [38 x i8] c"Error: relational operator expected.\0A\00"
@.str.20 = [53 x i8] c"Error: procedure identifier found in an expression.\0A\00"
@.str.21 = [35 x i8] c"Error: right parenthesis missing.\0A\00"
@.str.22 = [60 x i8] c"Error: the preceding factor cannot being with this symbol.\0A\00"
@.str.23 = [53 x i8] c"Error: an expression cannot begin with this symbol.\0A\00"
@.str.24 = [49 x i8] c"Error: number greater than max supported found.\0A\00"
define void @error_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %54 [
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
i32 16, label %34
i32 17, label %36
i32 18, label %38
i32 19, label %40
i32 20, label %42
i32 21, label %44
i32 22, label %46
i32 23, label %48
i32 24, label %50
i32 25, label %52
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %54
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %54
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %54
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
br label %54
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
br label %54
14: ; preds = %1
%15 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
br label %54
16: ; preds = %1
%17 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %54
18: ; preds = %1
%19 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0))
br label %54
20: ; preds = %1
%21 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %54
22: ; preds = %1
%23 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
br label %54
24: ; preds = %1
%25 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0))
br label %54
26: ; preds = %1
%27 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.11, i64 0, i64 0))
br label %54
28: ; preds = %1
%29 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0))
br label %54
30: ; preds = %1
%31 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
br label %54
32: ; preds = %1
%33 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.14, i64 0, i64 0))
br label %54
34: ; preds = %1
%35 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0))
br label %54
36: ; preds = %1
%37 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.16, i64 0, i64 0))
br label %54
38: ; preds = %1
%39 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0))
br label %54
40: ; preds = %1
%41 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0))
br label %54
42: ; preds = %1
%43 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.19, i64 0, i64 0))
br label %54
44: ; preds = %1
%45 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.20, i64 0, i64 0))
br label %54
46: ; preds = %1
%47 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0))
br label %54
48: ; preds = %1
%49 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.22, i64 0, i64 0))
br label %54
50: ; preds = %1
%51 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.23, i64 0, i64 0))
br label %54
52: ; preds = %1
%53 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.24, i64 0, i64 0))
br label %54
54: ; preds = %1, %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
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"Error: number greater than max supported found.\00"
@str.25 = [52 x i8] c"Error: an expression cannot begin with this symbol.\00"
@str.26 = [59 x i8] c"Error: the preceding factor cannot being with this symbol.\00"
@str.27 = [34 x i8] c"Error: right parenthesis missing.\00"
@str.28 = [52 x i8] c"Error: procedure identifier found in an expression.\00"
@str.29 = [37 x i8] c"Error: relational operator expected.\00"
@str.30 = [45 x i8] c"Error: incorrect symbol following statement.\00"
@str.31 = [22 x i8] c"Error: \22do\22 expected.\00"
@str.32 = [36 x i8] c"Error: semicolon or \22end\22 expected.\00"
@str.33 = [24 x i8] c"Error: \22then\22 expected.\00"
@str.34 = [39 x i8] c"Error: call attempted on const or var.\00"
@str.35 = [49 x i8] c"Error: \22call\22 must be followed by an identifier.\00"
@str.36 = [37 x i8] c"Error: Assignment operator expected.\00"
@str.37 = [59 x i8] c"Error: Assignment to constant or procedure is not allowed.\00"
@str.38 = [30 x i8] c"Error: Undeclared identifier.\00"
@str.39 = [46 x i8] c"Error: Semicolon expected between statements.\00"
@str.40 = [21 x i8] c"Error: \22.\22 expected.\00"
@str.41 = [55 x i8] c"Error: Incorrect symbol after statement part in block.\00"
@str.42 = [27 x i8] c"Error: Statement expected.\00"
@str.43 = [53 x i8] c"Error: Incorrect symbol after procedure declaration.\00"
@str.44 = [36 x i8] c"Error: semicolon or comma expected.\00"
@str.45 = [59 x i8] c"Error: identifier expected after const, var, or procedure.\00"
@str.46 = [38 x i8] c"Error: \22=\22 expected after identifier.\00"
@str.47 = [34 x i8] c"Error: number expected after \22=\22.\00"
@str.48 = [32 x i8] c"Error: \22=\22 where \22:=\22 expected.\00"
@reltable.error_handler = [25 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([32 x i8]* @str.48 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @str.47 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([38 x i8]* @str.46 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([59 x i8]* @str.45 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @str.44 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([53 x i8]* @str.43 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([27 x i8]* @str.42 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([55 x i8]* @str.41 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @str.40 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([46 x i8]* @str.39 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @str.38 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([59 x i8]* @str.37 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @str.36 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([49 x i8]* @str.35 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([39 x i8]* @str.34 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @str.33 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @str.32 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @str.31 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([45 x i8]* @str.30 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @str.29 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([52 x i8]* @str.28 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @str.27 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([59 x i8]* @str.26 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([52 x i8]* @str.25 to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([48 x i8]* @str to i64), i64 ptrtoint ([25 x i32]* @reltable.error_handler to i64)) to i32)]
define void @error_handler(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 25
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([25 x i32]* @reltable.error_handler to i8*), i64 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %1, %4
ret void
}