int token_precedence(long token) {
  switch (token) {
  case 0x23:
  case 0x24:
    return 0;
  case 0x16:
  case 0x10:
    return 3;
  case 0x19:
  case 0x1A:
  case 0x1B:
  case 0x1C:
  case 0x1D:
  case 0x1E:
  case 0x18:
    return 5;
  case 0x0B:
  case 0x0C:
    return 5;
  case 0x0D:
  case 0x0E:
    return 6;
  case 0x0F:
  case 0x15:
    return 7;
  case 0x2C:
  case 0x2B:
  case 0x2A:
  case 0x2D:
    return 8;
  case 0x17:
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<token_precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff5,%rax
mov    %rax,-0x18(%rbp)
sub    $0x22,%rax
ja     118b <token_precedence+0x8b>
mov    -0x18(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1192 <token_precedence+0x92>
movl   $0x3,-0x4(%rbp)
jmp    1192 <token_precedence+0x92>
movl   $0x5,-0x4(%rbp)
jmp    1192 <token_precedence+0x92>
movl   $0x5,-0x4(%rbp)
jmp    1192 <token_precedence+0x92>
movl   $0x6,-0x4(%rbp)
jmp    1192 <token_precedence+0x92>
movl   $0x7,-0x4(%rbp)
jmp    1192 <token_precedence+0x92>
movl   $0x8,-0x4(%rbp)
jmp    1192 <token_precedence+0x92>
jmp    118b <token_precedence+0x8b>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_precedence>:
lea    -0xb(%rdi),%rcx
mov    $0x4,%eax
cmp    $0x22,%rcx
ja     111a <token_precedence+0x1a>
lea    0xeea(%rip),%rax
mov    -0x2c(%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @token_precedence(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %13 [
i64 35, label %5
i64 36, label %5
i64 22, label %6
i64 16, label %6
i64 25, label %7
i64 26, label %7
i64 27, label %7
i64 28, label %7
i64 29, label %7
i64 30, label %7
i64 24, label %7
i64 11, label %8
i64 12, label %8
i64 13, label %9
i64 14, label %9
i64 15, label %10
i64 21, label %10
i64 44, label %11
i64 43, label %11
i64 42, label %11
i64 45, label %11
i64 23, label %12
]
5: ; preds = %1, %1
store i32 0, i32* %2
br label %14
6: ; preds = %1, %1
store i32 3, i32* %2
br label %14
7: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 5, i32* %2
br label %14
8: ; preds = %1, %1
store i32 5, i32* %2
br label %14
9: ; preds = %1, %1
store i32 6, i32* %2
br label %14
10: ; preds = %1, %1
store i32 7, i32* %2
br label %14
11: ; preds = %1, %1, %1, %1
store i32 8, i32* %2
br label %14
12: ; preds = %1
br label %13
13: ; preds = %1, %12
store i32 4, i32* %2
br label %14
14: ; preds = %13, %11, %10, %9, %8, %7, %6, %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@switch.table.token_precedence = [35 x i32] [i32 5, i32 5, i32 6, i32 6, i32 7, i32 3, i32 4, i32 4, i32 4, i32 4, i32 7, i32 3, i32 4, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 4, i32 4, i32 4, i32 4, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4, i32 4, i32 8, i32 8, i32 8, i32 8]
define i32 @token_precedence(i64 %0) {
%2 = add i64 %0, -11
%3 = icmp ult i64 %2, 35
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds [35 x i32], [35 x i32]* @switch.table.token_precedence, i64 0, i64 %2
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 4, %1 ]
ret i32 %8
}