const char *spell_token_type(int type) {
  switch (type) {
  case (0 | 0):
    return "whitespace";
  case (0 | 1):
    return "command delimiter";
  case (0x1000 | 2):
  case (0x2000 | 3):
  case (0x1000 | 4):
  case (0x1000 | 6):
    return "number";
  case (0x4000 | 5):
    return "character";
  case (0x4000 | 10):
  case (0x4000 | 11):
  case (0x4000 | 12):
    return "command";
  case 0x4000:
    return "arbitrary character sequence";
  default:
    return "unknown (probably bug)";
  }
}


x86 assembly (clang, -O0):
<spell_token_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     11b3 <spell_token_type+0xb3>
jmp    111a <spell_token_type+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     11c3 <spell_token_type+0xc3>
jmp    112b <spell_token_type+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x1002,%eax
je     11d3 <spell_token_type+0xd3>
jmp    113e <spell_token_type+0x3e>
mov    -0x10(%rbp),%eax
sub    $0x1004,%eax
je     11d3 <spell_token_type+0xd3>
jmp    1151 <spell_token_type+0x51>
mov    -0x10(%rbp),%eax
sub    $0x1006,%eax
je     11d3 <spell_token_type+0xd3>
jmp    1164 <spell_token_type+0x64>
mov    -0x10(%rbp),%eax
sub    $0x2003,%eax
je     11d3 <spell_token_type+0xd3>
jmp    1177 <spell_token_type+0x77>
mov    -0x10(%rbp),%eax
sub    $0x4000,%eax
je     1203 <spell_token_type+0x103>
jmp    118a <spell_token_type+0x8a>
mov    -0x10(%rbp),%eax
sub    $0x4005,%eax
je     11e3 <spell_token_type+0xe3>
jmp    119d <spell_token_type+0x9d>
mov    -0x10(%rbp),%eax
add    $0xffffbff6,%eax
sub    $0x3,%eax
jb     11f3 <spell_token_type+0xf3>
jmp    1213 <spell_token_type+0x113>
lea    0xe46(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <spell_token_type+0x11e>
lea    0xe41(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <spell_token_type+0x11e>
lea    0xe43(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <spell_token_type+0x11e>
lea    0xe3a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <spell_token_type+0x11e>
lea    0xe34(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <spell_token_type+0x11e>
lea    0xe2c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <spell_token_type+0x11e>
lea    0xe39(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spell_token_type>:
cmp    $0x2002,%edi
jle    1130 <spell_token_type+0x30>
cmp    $0x4009,%edi
jg     114d <spell_token_type+0x4d>
cmp    $0x2003,%edi
je     1145 <spell_token_type+0x45>
cmp    $0x4000,%edi
je     1171 <spell_token_type+0x71>
cmp    $0x4005,%edi
jne    1181 <spell_token_type+0x81>
lea    0xef5(%rip),%rax
ret
lea    -0x1002(%rdi),%eax
cmp    $0x4,%eax
ja     1160 <spell_token_type+0x60>
mov    $0x15,%ecx
bt     %eax,%ecx
jae    1160 <spell_token_type+0x60>
lea    0xed1(%rip),%rax
ret
add    $0xffffbff6,%edi
cmp    $0x3,%edi
jae    1181 <spell_token_type+0x81>
lea    0xecf(%rip),%rax
ret
test   %edi,%edi
je     1179 <spell_token_type+0x79>
cmp    $0x1,%edi
jne    1181 <spell_token_type+0x81>
lea    0xe9b(%rip),%rax
ret
lea    0xebe(%rip),%rax
ret
lea    0xe80(%rip),%rax
ret
lea    0xecb(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"whitespace\00"
@.str.1 = [18 x i8] c"command delimiter\00"
@.str.2 = [7 x i8] c"number\00"
@.str.3 = [10 x i8] c"character\00"
@.str.4 = [8 x i8] c"command\00"
@.str.5 = [29 x i8] c"arbitrary character sequence\00"
@.str.6 = [23 x i8] c"unknown (probably bug)\00"
define i8* @spell_token_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 0, label %5
i32 1, label %6
i32 4098, label %7
i32 8195, label %7
i32 4100, label %7
i32 4102, label %7
i32 16389, label %8
i32 16394, label %9
i32 16395, label %9
i32 16396, label %9
i32 16384, label %10
]
5: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
6: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1, %1, %1, %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
8: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %12
9: ; preds = %1, %1, %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %12
10: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"whitespace\00"
@.str.1 = [18 x i8] c"command delimiter\00"
@.str.2 = [7 x i8] c"number\00"
@.str.3 = [10 x i8] c"character\00"
@.str.4 = [8 x i8] c"command\00"
@.str.5 = [29 x i8] c"arbitrary character sequence\00"
@.str.6 = [23 x i8] c"unknown (probably bug)\00"
define i8* @spell_token_type(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %8
i32 1, label %2
i32 4098, label %3
i32 8195, label %3
i32 4100, label %3
i32 4102, label %3
i32 16389, label %4
i32 16394, label %5
i32 16395, label %5
i32 16396, label %5
i32 16384, label %6
]
2: ; preds = %1
br label %8
3: ; preds = %1, %1, %1, %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1, %1, %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3, %2
%9 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}