#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 type(int c) {
  if (c == EOF)
    return -1;
  if (c >= '0' && c <= '9')
    return (1);
  if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
    return (2);
  if (c == ' ' || c == '\t' || c == '\n')
    return (0);
  if (c == '"')
    return (3);
  if (c == ';')
    return (4);
  return (5);
}


x86 assembly (clang, -O0):
<type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
jne    1125 <type+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    11d6 <type+0xd6>
cmpl   $0x30,-0x8(%rbp)
jl     1145 <type+0x45>
cmpl   $0x39,-0x8(%rbp)
jg     1145 <type+0x45>
movl   $0x1,-0x4(%rbp)
jmp    11d6 <type+0xd6>
cmpl   $0x41,-0x8(%rbp)
jl     1159 <type+0x59>
cmpl   $0x5a,-0x8(%rbp)
jle    116d <type+0x6d>
cmpl   $0x61,-0x8(%rbp)
jl     1179 <type+0x79>
cmpl   $0x7a,-0x8(%rbp)
jg     1179 <type+0x79>
movl   $0x2,-0x4(%rbp)
jmp    11d6 <type+0xd6>
cmpl   $0x20,-0x8(%rbp)
je     1197 <type+0x97>
cmpl   $0x9,-0x8(%rbp)
je     1197 <type+0x97>
cmpl   $0xa,-0x8(%rbp)
jne    11a3 <type+0xa3>
movl   $0x0,-0x4(%rbp)
jmp    11d6 <type+0xd6>
cmpl   $0x22,-0x8(%rbp)
jne    11b9 <type+0xb9>
movl   $0x3,-0x4(%rbp)
jmp    11d6 <type+0xd6>
cmpl   $0x3b,-0x8(%rbp)
jne    11cf <type+0xcf>
movl   $0x4,-0x4(%rbp)
jmp    11d6 <type+0xd6>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type>:
mov    0x2ee1(%rip),%rcx
mov    $0xffffffff,%eax
cmp    %edi,(%rcx)
je     1143 <type+0x43>
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%ecx
jb     1143 <type+0x43>
mov    %edi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
mov    $0x2,%eax
cmp    $0x1a,%ecx
jb     1143 <type+0x43>
cmp    $0x21,%edi
jg     1144 <type+0x44>
xor    %eax,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x2,%ecx
jb     1143 <type+0x43>
cmp    $0x20,%edi
jne    115a <type+0x5a>
ret
cmp    $0x3b,%edi
je     1154 <type+0x54>
cmp    $0x22,%edi
jne    115a <type+0x5a>
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
mov    $0x5,%eax
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @type(i32 %0) {
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %2, %0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
br i1 %6, label %15, label %7
7: ; preds = %4
%8 = and i32 %0, -33
%9 = add i32 %8, -65
%10 = icmp ult i32 %9, 26
br i1 %10, label %15, label %11
11: ; preds = %7
switch i32 %0, label %14 [
i32 32, label %15
i32 10, label %15
i32 9, label %15
i32 34, label %12
i32 59, label %13
]
12: ; preds = %11
br label %15
13: ; preds = %11
br label %15
14: ; preds = %11
br label %15
15: ; preds = %11, %11, %11, %7, %4, %1, %14, %13, %12
%16 = phi i32 [ 3, %12 ], [ 4, %13 ], [ 5, %14 ], [ -1, %1 ], [ 1, %4 ], [ 2, %7 ], [ 0, %11 ], [ 0, %11 ], [ 0, %11 ]
ret i32 %16
}