#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*/ isalpha(char);
int /*<<< orphan*/ isdigit(char);
int token_categorize(int type, char symbol) {
  switch (type) {
  case (0x1000 | 4):
    if (isdigit(symbol))
      break;
    if (symbol == 'f')
      type = (0x1000 | 6);
    else if (symbol == '%')
      type = (0x1000 | 2);
    else if (symbol == '.')
      type = (0x2000 | 3);
    else
      type = 0x4000;
    break;
  case (0x2000 | 3):
    if (!isdigit(symbol))
      type = 0x4000;
    break;
  case (0x4000 | 5):
  case (0x1000 | 6):
  case (0x1000 | 2):
    type = 0x4000;
    break;
  case 0x4000:
    break;
  case -1:
    if (isdigit(symbol))
      type = (0x1000 | 4);
    else if (symbol == '.')
      type = (0x2000 | 3);
    else if (isalpha(symbol))
      type = 0x4000;
    else
      type = (0x4000 | 5);
  }
  return type;
}


x86 assembly (clang, -O0):
<token_categorize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xffffffff,%eax
je     125e <token_categorize+0x13e>
jmp    1145 <token_categorize+0x25>
mov    -0xc(%rbp),%eax
sub    $0x1002,%eax
je     124d <token_categorize+0x12d>
jmp    1158 <token_categorize+0x38>
mov    -0xc(%rbp),%eax
sub    $0x1004,%eax
je     11b7 <token_categorize+0x97>
jmp    116b <token_categorize+0x4b>
mov    -0xc(%rbp),%eax
sub    $0x1006,%eax
je     124d <token_categorize+0x12d>
jmp    117e <token_categorize+0x5e>
mov    -0xc(%rbp),%eax
sub    $0x2003,%eax
je     122f <token_categorize+0x10f>
jmp    1191 <token_categorize+0x71>
mov    -0xc(%rbp),%eax
sub    $0x4000,%eax
je     1259 <token_categorize+0x139>
jmp    11a4 <token_categorize+0x84>
mov    -0xc(%rbp),%eax
sub    $0x4005,%eax
je     124d <token_categorize+0x12d>
jmp    12c9 <token_categorize+0x1a9>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     11ce <token_categorize+0xae>
jmp    12c9 <token_categorize+0x1a9>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jne    11e7 <token_categorize+0xc7>
movl   $0x1006,-0x4(%rbp)
jmp    122a <token_categorize+0x10a>
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    1200 <token_categorize+0xe0>
movl   $0x1002,-0x4(%rbp)
jmp    1225 <token_categorize+0x105>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    1219 <token_categorize+0xf9>
movl   $0x2003,-0x4(%rbp)
jmp    1220 <token_categorize+0x100>
movl   $0x4000,-0x4(%rbp)
jmp    1225 <token_categorize+0x105>
jmp    122a <token_categorize+0x10a>
jmp    12c9 <token_categorize+0x1a9>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1248 <token_categorize+0x128>
movl   $0x4000,-0x4(%rbp)
jmp    12c9 <token_categorize+0x1a9>
movl   $0x4000,-0x4(%rbp)
jmp    12c9 <token_categorize+0x1a9>
jmp    12c9 <token_categorize+0x1a9>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     127c <token_categorize+0x15c>
movl   $0x1004,-0x4(%rbp)
jmp    12c4 <token_categorize+0x1a4>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    1295 <token_categorize+0x175>
movl   $0x2003,-0x4(%rbp)
jmp    12bf <token_categorize+0x19f>
movsbl -0x5(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%eax
je     12b3 <token_categorize+0x193>
movl   $0x4000,-0x4(%rbp)
jmp    12ba <token_categorize+0x19a>
movl   $0x4005,-0x4(%rbp)
jmp    12bf <token_categorize+0x19f>
jmp    12c4 <token_categorize+0x1a4>
jmp    12c9 <token_categorize+0x1a9>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_categorize>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%eax
cmp    $0x1005,%edi
jg     117b <token_categorize+0x5b>
cmp    $0xffffffff,%eax
je     1197 <token_categorize+0x77>
cmp    $0x1002,%eax
je     1190 <token_categorize+0x70>
cmp    $0x1004,%eax
jne    11e5 <token_categorize+0xc5>
movsbl %bl,%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
mov    $0x1004,%eax
test   %ecx,%ecx
jne    11e5 <token_categorize+0xc5>
cmp    $0x66,%bl
je     11ec <token_categorize+0xcc>
cmp    $0x2e,%bl
je     11f3 <token_categorize+0xd3>
cmp    $0x25,%bl
jne    1190 <token_categorize+0x70>
mov    $0x1002,%eax
jmp    11e5 <token_categorize+0xc5>
cmp    $0x1006,%eax
je     1190 <token_categorize+0x70>
cmp    $0x2003,%eax
je     11ce <token_categorize+0xae>
cmp    $0x4005,%eax
jne    11e5 <token_categorize+0xc5>
mov    $0x4000,%eax
jmp    11e5 <token_categorize+0xc5>
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
mov    $0x1004,%eax
test   %ecx,%ecx
jne    11e5 <token_categorize+0xc5>
mov    $0x2003,%eax
cmp    $0x2e,%bl
je     11e5 <token_categorize+0xc5>
mov    %ebp,%edi
call   1040 <isalpha@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,4),%eax
or     $0x4000,%eax
jmp    11e5 <token_categorize+0xc5>
movsbl %bl,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
mov    $0x4000,%ecx
mov    $0x2003,%eax
cmove  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1006,%eax
jmp    11e5 <token_categorize+0xc5>
mov    $0x2003,%eax
jmp    11e5 <token_categorize+0xc5>

LLVM IR (-O0):
define i32 @token_categorize(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
switch i32 %5, label %57 [
i32 4100, label %6
i32 8195, label %30
i32 16389, label %36
i32 4102, label %36
i32 4098, label %36
i32 16384, label %37
i32 -1, label %38
]
6: ; preds = %2
%7 = load i8, i8* %4
%8 = call i32 @isdigit(i8 signext %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %57
11: ; preds = %6
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 102
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 4102, i32* %3
br label %29
16: ; preds = %11
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 37
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 4098, i32* %3
br label %28
21: ; preds = %16
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 46
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 8195, i32* %3
br label %27
26: ; preds = %21
store i32 16384, i32* %3
br label %27
27: ; preds = %26, %25
br label %28
28: ; preds = %27, %20
br label %29
29: ; preds = %28, %15
br label %57
30: ; preds = %2
%31 = load i8, i8* %4
%32 = call i32 @isdigit(i8 signext %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %30
store i32 16384, i32* %3
br label %35
35: ; preds = %34, %30
br label %57
36: ; preds = %2, %2, %2
store i32 16384, i32* %3
br label %57
37: ; preds = %2
br label %57
38: ; preds = %2
%39 = load i8, i8* %4
%40 = call i32 @isdigit(i8 signext %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %38
store i32 4100, i32* %3
br label %56
43: ; preds = %38
%44 = load i8, i8* %4
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 46
br i1 %46, label %47, label %48
47: ; preds = %43
store i32 8195, i32* %3
br label %55
48: ; preds = %43
%49 = load i8, i8* %4
%50 = call i32 @isalpha(i8 signext %49)
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %48
store i32 16384, i32* %3
br label %54
53: ; preds = %48
store i32 16389, i32* %3
br label %54
54: ; preds = %53, %52
br label %55
55: ; preds = %54, %47
br label %56
56: ; preds = %55, %42
br label %57
57: ; preds = %56, %2, %37, %36, %35, %29, %10
%58 = load i32, i32* %3
ret i32 %58
}

LLVM IR (-O2):
define i32 @token_categorize(i32 %0, i8 signext %1) {
switch i32 %0, label %24 [
i32 4100, label %3
i32 8195, label %10
i32 16389, label %14
i32 4102, label %14
i32 4098, label %14
i32 -1, label %15
]
3: ; preds = %2
%4 = tail call i32 @isdigit(i8 signext %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %24
6: ; preds = %3
switch i8 %1, label %9 [
i8 102, label %24
i8 37, label %7
i8 46, label %8
]
7: ; preds = %6
br label %24
8: ; preds = %6
br label %24
9: ; preds = %6
br label %24
10: ; preds = %2
%11 = tail call i32 @isdigit(i8 signext %1)
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i32 16384, i32 8195
br label %24
14: ; preds = %2, %2, %2
br label %24
15: ; preds = %2
%16 = tail call i32 @isdigit(i8 signext %1)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = icmp eq i8 %1, 46
br i1 %19, label %24, label %20
20: ; preds = %18
%21 = tail call i32 @isalpha(i8 signext %1)
%22 = icmp eq i32 %21, 0
%23 = select i1 %22, i32 16389, i32 16384
br label %24
24: ; preds = %10, %20, %18, %15, %6, %8, %9, %7, %3, %2, %14
%25 = phi i32 [ %0, %2 ], [ 16384, %14 ], [ 4100, %3 ], [ 4098, %7 ], [ 8195, %8 ], [ 16384, %9 ], [ 4102, %6 ], [ %13, %10 ], [ 4100, %15 ], [ 8195, %18 ], [ %23, %20 ]
ret i32 %25
}