#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 type(char c) {
  if ((isalpha(c)) || (c == '_'))
    return 1;
  else if ((isdigit(c)))
    return 2;
  else if (c == (','))
    return 3;
  else if (c == (';'))
    return 4;
  else if (c == ('='))
    return 5;
  else if (c == ('<'))
    return 6;
  else if (c == ('>'))
    return 7;
  else if (c == ('"'))
    return 8;
  else if (c == ('\0'))
    return 9;
  else
    return 10;
}


x86 assembly (clang, -O0):
<type>:
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
jne    114e <type+0x2e>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    115a <type+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1179 <type+0x59>
movl   $0x2,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jne    1192 <type+0x72>
movl   $0x3,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%eax
cmp    $0x3b,%eax
jne    11ab <type+0x8b>
movl   $0x4,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%eax
cmp    $0x3d,%eax
jne    11c4 <type+0xa4>
movl   $0x5,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%eax
cmp    $0x3c,%eax
jne    11dd <type+0xbd>
movl   $0x6,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%eax
cmp    $0x3e,%eax
jne    11f6 <type+0xd6>
movl   $0x7,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%eax
cmp    $0x22,%eax
jne    120f <type+0xef>
movl   $0x8,-0x4(%rbp)
jmp    122f <type+0x10f>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1228 <type+0x108>
movl   $0x9,-0x4(%rbp)
jmp    122f <type+0x10f>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    $0x5f,%bl
je     114f <type+0x2f>
test   %rcx,%rcx
jne    114f <type+0x2f>
movsbl %bl,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
je     1151 <type+0x31>
pop    %rbx
ret
cmp    $0x3e,%bl
ja     1175 <type+0x55>
mov    $0x3,%eax
movzbl %bl,%ecx
lea    0xe9b(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x9,%eax
pop    %rbx
ret
mov    $0xa,%eax
pop    %rbx
ret
mov    $0x8,%eax
pop    %rbx
ret
mov    $0x4,%eax
pop    %rbx
ret
mov    $0x6,%eax
pop    %rbx
ret
mov    $0x5,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @type(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 %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 95
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %53
12: ; preds = %7
%13 = load i8, i8* %3
%14 = call i64 @isdigit(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 2, i32* %2
br label %53
17: ; preds = %12
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 44
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 3, i32* %2
br label %53
22: ; preds = %17
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 59
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 4, i32* %2
br label %53
27: ; preds = %22
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 61
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 5, i32* %2
br label %53
32: ; preds = %27
%33 = load i8, i8* %3
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 60
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 6, i32* %2
br label %53
37: ; preds = %32
%38 = load i8, i8* %3
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 62
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 7, i32* %2
br label %53
42: ; preds = %37
%43 = load i8, i8* %3
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 34
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 8, i32* %2
br label %53
47: ; preds = %42
%48 = load i8, i8* %3
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 9, i32* %2
br label %53
52: ; preds = %47
store i32 10, i32* %2
br label %53
53: ; preds = %52, %51, %46, %41, %36, %31, %26, %21, %16, %11
%54 = load i32, i32* %2
ret i32 %54
}

LLVM IR (-O2):
define i32 @type(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
br i1 %5, label %17, label %6
6: ; preds = %1
%7 = tail call i64 @isdigit(i8 signext %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
switch i8 %0, label %16 [
i8 44, label %17
i8 59, label %10
i8 61, label %11
i8 60, label %12
i8 62, label %13
i8 34, label %14
i8 0, label %15
]
10: ; preds = %9
br label %17
11: ; preds = %9
br label %17
12: ; preds = %9
br label %17
13: ; preds = %9
br label %17
14: ; preds = %9
br label %17
15: ; preds = %9
br label %17
16: ; preds = %9
br label %17
17: ; preds = %9, %6, %1, %16, %15, %14, %13, %12, %11, %10
%18 = phi i32 [ 4, %10 ], [ 5, %11 ], [ 6, %12 ], [ 7, %13 ], [ 8, %14 ], [ 9, %15 ], [ 10, %16 ], [ 1, %1 ], [ 2, %6 ], [ 3, %9 ]
ret i32 %18
}