#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 */
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
int charToType(char c) {
  if (isalpha(c))
    return 2;
  else if (isdigit(c))
    return 3;
  switch (c) {
  case '_':
    return 1;
  case '.':
    return 4;
  case '\'':
    return 5;
  case '\"':
    return 6;
  case '#':
    return 7;
  case '\n':
    return 8;
  case '<':
    return 9;
  case '=':
    return 10;
  case '!':
    return 11;
  case '>':
    return 12;
  case '+':
    return 13;
  case '-':
    return 14;
  case '*':
    return 15;
  case '/':
    return 16;
  case '%':
    return 17;
  case '[':
    return 18;
  case ']':
    return 19;
  case '(':
    return 20;
  case ')':
    return 21;
  case ':':
    return 22;
  case ',':
    return 23;
  default:
    return 24;
  }
  return -1;
}


x86 assembly (clang, -O0):
<charToType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     114d <charToType+0x2d>
movl   $0x2,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     116c <charToType+0x4c>
movl   $0x3,-0x4(%rbp)
jmp    129e <charToType+0x17e>
jmp    1171 <charToType+0x51>
movsbl -0x5(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x55,%eax
ja     1297 <charToType+0x177>
mov    -0x10(%rbp),%rax
lea    0xe6e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x4,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x5,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x6,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x7,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x8,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x9,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0xa,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0xb,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0xc,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0xd,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0xe,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0xf,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x10,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x11,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x12,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x13,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x14,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x15,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x16,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x17,-0x4(%rbp)
jmp    129e <charToType+0x17e>
movl   $0x18,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToType>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
je     1137 <charToType+0x17>
pop    %rbx
ret
movsbl %bl,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x3,%eax
test   %rcx,%rcx
jne    1135 <charToType+0x15>
add    $0xfffffff6,%ebx
cmp    $0x55,%ebx
ja     1172 <charToType+0x52>
mov    $0x1,%eax
lea    0xe9e(%rip),%rcx
movslq (%rcx,%rbx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x8,%eax
pop    %rbx
ret
mov    $0x18,%eax
pop    %rbx
ret
mov    $0xb,%eax
pop    %rbx
ret
mov    $0x6,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret
mov    $0x11,%eax
pop    %rbx
ret
mov    $0x5,%eax
pop    %rbx
ret
mov    $0x14,%eax
pop    %rbx
ret
mov    $0x15,%eax
pop    %rbx
ret
mov    $0xf,%eax
pop    %rbx
ret
mov    $0xd,%eax
pop    %rbx
ret
mov    $0x17,%eax
pop    %rbx
ret
mov    $0xe,%eax
pop    %rbx
ret
mov    $0x4,%eax
pop    %rbx
ret
mov    $0x10,%eax
pop    %rbx
ret
mov    $0x16,%eax
pop    %rbx
ret
mov    $0x9,%eax
pop    %rbx
ret
mov    $0xa,%eax
pop    %rbx
ret
mov    $0xc,%eax
pop    %rbx
ret
mov    $0x12,%eax
pop    %rbx
ret
mov    $0x13,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @charToType(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 2, i32* %2
br label %39
8: ; preds = %1
%9 = load i8, i8* %3
%10 = call i64 @isdigit(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 3, i32* %2
br label %39
13: ; preds = %8
br label %14
14: ; preds = %13
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
switch i32 %16, label %38 [
i32 95, label %17
i32 46, label %18
i32 39, label %19
i32 34, label %20
i32 35, label %21
i32 10, label %22
i32 60, label %23
i32 61, label %24
i32 33, label %25
i32 62, label %26
i32 43, label %27
i32 45, label %28
i32 42, label %29
i32 47, label %30
i32 37, label %31
i32 91, label %32
i32 93, label %33
i32 40, label %34
i32 41, label %35
i32 58, label %36
i32 44, label %37
]
17: ; preds = %14
store i32 1, i32* %2
br label %39
18: ; preds = %14
store i32 4, i32* %2
br label %39
19: ; preds = %14
store i32 5, i32* %2
br label %39
20: ; preds = %14
store i32 6, i32* %2
br label %39
21: ; preds = %14
store i32 7, i32* %2
br label %39
22: ; preds = %14
store i32 8, i32* %2
br label %39
23: ; preds = %14
store i32 9, i32* %2
br label %39
24: ; preds = %14
store i32 10, i32* %2
br label %39
25: ; preds = %14
store i32 11, i32* %2
br label %39
26: ; preds = %14
store i32 12, i32* %2
br label %39
27: ; preds = %14
store i32 13, i32* %2
br label %39
28: ; preds = %14
store i32 14, i32* %2
br label %39
29: ; preds = %14
store i32 15, i32* %2
br label %39
30: ; preds = %14
store i32 16, i32* %2
br label %39
31: ; preds = %14
store i32 17, i32* %2
br label %39
32: ; preds = %14
store i32 18, i32* %2
br label %39
33: ; preds = %14
store i32 19, i32* %2
br label %39
34: ; preds = %14
store i32 20, i32* %2
br label %39
35: ; preds = %14
store i32 21, i32* %2
br label %39
36: ; preds = %14
store i32 22, i32* %2
br label %39
37: ; preds = %14
store i32 23, i32* %2
br label %39
38: ; preds = %14
store i32 24, i32* %2
br label %39
39: ; preds = %38, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %12, %7
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
define i32 @charToType(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %30
4: ; preds = %1
%5 = tail call i64 @isdigit(i8 signext %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %30
7: ; preds = %4
%8 = sext i8 %0 to i32
switch i32 %8, label %29 [
i32 95, label %30
i32 46, label %9
i32 39, label %10
i32 34, label %11
i32 35, label %12
i32 10, label %13
i32 60, label %14
i32 61, label %15
i32 33, label %16
i32 62, label %17
i32 43, label %18
i32 45, label %19
i32 42, label %20
i32 47, label %21
i32 37, label %22
i32 91, label %23
i32 93, label %24
i32 40, label %25
i32 41, label %26
i32 58, label %27
i32 44, label %28
]
9: ; preds = %7
br label %30
10: ; preds = %7
br label %30
11: ; preds = %7
br label %30
12: ; preds = %7
br label %30
13: ; preds = %7
br label %30
14: ; preds = %7
br label %30
15: ; preds = %7
br label %30
16: ; preds = %7
br label %30
17: ; preds = %7
br label %30
18: ; preds = %7
br label %30
19: ; preds = %7
br label %30
20: ; preds = %7
br label %30
21: ; preds = %7
br label %30
22: ; preds = %7
br label %30
23: ; preds = %7
br label %30
24: ; preds = %7
br label %30
25: ; preds = %7
br label %30
26: ; preds = %7
br label %30
27: ; preds = %7
br label %30
28: ; preds = %7
br label %30
29: ; preds = %7
br label %30
30: ; preds = %7, %4, %1, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9
%31 = phi i32 [ 24, %29 ], [ 23, %28 ], [ 22, %27 ], [ 21, %26 ], [ 20, %25 ], [ 19, %24 ], [ 18, %23 ], [ 17, %22 ], [ 16, %21 ], [ 15, %20 ], [ 14, %19 ], [ 13, %18 ], [ 12, %17 ], [ 11, %16 ], [ 10, %15 ], [ 9, %14 ], [ 8, %13 ], [ 7, %12 ], [ 6, %11 ], [ 5, %10 ], [ 4, %9 ], [ 2, %1 ], [ 3, %4 ], [ 1, %7 ]
ret i32 %31
}