#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 lexicalError(int n) {
  printf(" *** Lexical Error : ");
  switch (n) {
  case 1:
    printf("an identifier length must be less than 12.\n");
    break;
  case 2:
    printf("next character must be &.\n");
    break;
  case 3:
    printf("next character must be |.\n");
    break;
  case 4:
    printf("invalid character!!!\n");
    break;
  }
}


x86 assembly (clang, -O0):
<lexicalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     118f <lexicalError+0x7f>
mov    -0x10(%rbp),%rax
lea    0xeb9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
jmp    118f <lexicalError+0x7f>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
jmp    118f <lexicalError+0x7f>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
jmp    118f <lexicalError+0x7f>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lexicalError>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     114e <lexicalError+0x2e>
movslq %ebx,%rax
lea    0xf4b(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c" *** Lexical Error : \00"
@.str.1 = [44 x i8] c"an identifier length must be less than 12.\0A\00"
@.str.2 = [27 x i8] c"next character must be &.\0A\00"
@.str.3 = [27 x i8] c"next character must be |.\0A\00"
@.str.4 = [22 x i8] c"invalid character!!!\0A\00"
define void @lexicalError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
switch i32 %4, label %13 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
i32 4, label %11
]
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %13
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %1, %11, %9, %7, %5
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c" *** Lexical Error : \00"
@str = [21 x i8] c"invalid character!!!\00"
@str.5 = [26 x i8] c"next character must be |.\00"
@str.6 = [26 x i8] c"next character must be &.\00"
@str.7 = [43 x i8] c"an identifier length must be less than 12.\00"
@reltable.lexicalError = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([43 x i8]* @str.7 to i64), i64 ptrtoint ([4 x i32]* @reltable.lexicalError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @str.6 to i64), i64 ptrtoint ([4 x i32]* @reltable.lexicalError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @str.5 to i64), i64 ptrtoint ([4 x i32]* @reltable.lexicalError to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @str to i64), i64 ptrtoint ([4 x i32]* @reltable.lexicalError to i64)) to i32)]
define void @lexicalError(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 4
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.lexicalError to i8*), i64 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
br label %10
10: ; preds = %1, %5
ret void
}