#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 EOF;
int GetCharCode(int c) {
  if (c == '\r' || c == '\n')
    return 0;
  if (c == ' ' || c == '\t')
    return 1;
  if (c == '/')
    return 2;
  if (c == '*')
    return 3;
  if (c == '\"')
    return 4;
  if (c == '\'')
    return 5;
  if (c == '\\')
    return 6;
  if (c == EOF)
    return 8;
  return 7;
}


x86 assembly (clang, -O0):
<GetCharCode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xd,-0x8(%rbp)
je     111b <GetCharCode+0x1b>
cmpl   $0xa,-0x8(%rbp)
jne    1127 <GetCharCode+0x27>
movl   $0x0,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
cmpl   $0x20,-0x8(%rbp)
je     113b <GetCharCode+0x3b>
cmpl   $0x9,-0x8(%rbp)
jne    1147 <GetCharCode+0x47>
movl   $0x1,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
cmpl   $0x2f,-0x8(%rbp)
jne    115d <GetCharCode+0x5d>
movl   $0x2,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
cmpl   $0x2a,-0x8(%rbp)
jne    1173 <GetCharCode+0x73>
movl   $0x3,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
cmpl   $0x22,-0x8(%rbp)
jne    1189 <GetCharCode+0x89>
movl   $0x4,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
cmpl   $0x27,-0x8(%rbp)
jne    119f <GetCharCode+0x9f>
movl   $0x5,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
cmpl   $0x5c,-0x8(%rbp)
jne    11b5 <GetCharCode+0xb5>
movl   $0x6,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
mov    -0x8(%rbp),%eax
mov    0x2e29(%rip),%rcx
cmp    (%rcx),%eax
jne    11d3 <GetCharCode+0xd3>
movl   $0x8,-0x4(%rbp)
jmp    11da <GetCharCode+0xda>
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCharCode>:
lea    -0x9(%rdi),%ecx
cmp    $0x53,%ecx
ja     1120 <GetCharCode+0x20>
xor    %eax,%eax
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%eax
ret
mov    0x2ec1(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
add    $0x7,%eax
ret
mov    $0x4,%eax
ret
mov    $0x5,%eax
ret
mov    $0x3,%eax
ret
mov    $0x2,%eax
ret
mov    $0x6,%eax
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @GetCharCode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 13
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %43
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 32
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 9
br i1 %15, label %16, label %17
16: ; preds = %13, %10
store i32 1, i32* %2
br label %43
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 47
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 2, i32* %2
br label %43
21: ; preds = %17
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 42
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 3, i32* %2
br label %43
25: ; preds = %21
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 34
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 4, i32* %2
br label %43
29: ; preds = %25
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 39
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 5, i32* %2
br label %43
33: ; preds = %29
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 92
br i1 %35, label %36, label %37
36: ; preds = %33
store i32 6, i32* %2
br label %43
37: ; preds = %33
%38 = load i32, i32* %3
%39 = load i32, i32* @EOF
%40 = icmp eq i32 %38, %39
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 8, i32* %2
br label %43
42: ; preds = %37
store i32 7, i32* %2
br label %43
43: ; preds = %42, %41, %36, %32, %28, %24, %20, %16, %9
%44 = load i32, i32* %2
ret i32 %44
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @GetCharCode(i32 %0) {
switch i32 %0, label %7 [
i32 13, label %12
i32 10, label %12
i32 32, label %11
i32 9, label %11
i32 47, label %2
i32 42, label %3
i32 34, label %4
i32 39, label %5
i32 92, label %6
]
2: ; preds = %1
br label %12
3: ; preds = %1
br label %12
4: ; preds = %1
br label %12
5: ; preds = %1
br label %12
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %8, %0
%10 = select i1 %9, i32 8, i32 7
br label %12
11: ; preds = %1, %1
br label %12
12: ; preds = %1, %1, %11, %7, %6, %5, %4, %3, %2
%13 = phi i32 [ 2, %2 ], [ 3, %3 ], [ 4, %4 ], [ 5, %5 ], [ 6, %6 ], [ 0, %1 ], [ 0, %1 ], [ %10, %7 ], [ 1, %11 ]
ret i32 %13
}