long get_token(char c) {
  switch (c) {
  case '+':
    return 0x0B;
  case '-':
    return 0x0C;
  case '*':
    return 0x0D;
  case '/':
    return 0x0E;
  case '%':
    return 0x0F;
  case '=':
    return 0x10;
  case '\n':
    return 0x0A;
  case '"':
    return 0x22;
  case '#':
    return 0x21;
  case '{':
    return 0x23;
  case '}':
    return 0x24;
  case '!':
    return 0x18;
  case '>':
    return 0x1D;
  case '<':
    return 0x1E;
  case ',':
    return 0x29;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_token>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x73,%eax
ja     11f7 <get_token+0xf7>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0xb,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0xc,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0xd,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0xe,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0xf,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x10,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0xa,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x22,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x21,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x23,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x24,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x18,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x1d,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x1e,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x29,-0x8(%rbp)
jmp    11ff <get_token+0xff>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_token>:
add    $0xfffffff6,%edi
cmp    $0x73,%edi
ja     1123 <get_token+0x23>
mov    $0xb,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0xa,%eax
ret
xor    %eax,%eax
ret
mov    $0x18,%eax
ret
mov    $0x22,%eax
ret
mov    $0x21,%eax
ret
mov    $0xf,%eax
ret
mov    $0xd,%eax
ret
mov    $0x29,%eax
ret
mov    $0xe,%eax
ret
mov    $0x1e,%eax
ret
mov    $0x10,%eax
ret
mov    $0x1d,%eax
ret
mov    $0x23,%eax
ret
mov    $0x24,%eax
ret
mov    $0xc,%eax
ret

LLVM IR (-O0):
define i64 @get_token(i8 signext %0) {
%2 = alloca i64
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %21 [
i32 43, label %6
i32 45, label %7
i32 42, label %8
i32 47, label %9
i32 37, label %10
i32 61, label %11
i32 10, label %12
i32 34, label %13
i32 35, label %14
i32 123, label %15
i32 125, label %16
i32 33, label %17
i32 62, label %18
i32 60, label %19
i32 44, label %20
]
6: ; preds = %1
store i64 11, i64* %2
br label %22
7: ; preds = %1
store i64 12, i64* %2
br label %22
8: ; preds = %1
store i64 13, i64* %2
br label %22
9: ; preds = %1
store i64 14, i64* %2
br label %22
10: ; preds = %1
store i64 15, i64* %2
br label %22
11: ; preds = %1
store i64 16, i64* %2
br label %22
12: ; preds = %1
store i64 10, i64* %2
br label %22
13: ; preds = %1
store i64 34, i64* %2
br label %22
14: ; preds = %1
store i64 33, i64* %2
br label %22
15: ; preds = %1
store i64 35, i64* %2
br label %22
16: ; preds = %1
store i64 36, i64* %2
br label %22
17: ; preds = %1
store i64 24, i64* %2
br label %22
18: ; preds = %1
store i64 29, i64* %2
br label %22
19: ; preds = %1
store i64 30, i64* %2
br label %22
20: ; preds = %1
store i64 41, i64* %2
br label %22
21: ; preds = %1
store i64 0, i64* %2
br label %22
22: ; preds = %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @get_token(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %17 [
i32 43, label %18
i32 45, label %3
i32 42, label %4
i32 47, label %5
i32 37, label %6
i32 61, label %7
i32 10, label %8
i32 34, label %9
i32 35, label %10
i32 123, label %11
i32 125, label %12
i32 33, label %13
i32 62, label %14
i32 60, label %15
i32 44, label %16
]
3: ; preds = %1
br label %18
4: ; preds = %1
br label %18
5: ; preds = %1
br label %18
6: ; preds = %1
br label %18
7: ; preds = %1
br label %18
8: ; preds = %1
br label %18
9: ; preds = %1
br label %18
10: ; preds = %1
br label %18
11: ; preds = %1
br label %18
12: ; preds = %1
br label %18
13: ; preds = %1
br label %18
14: ; preds = %1
br label %18
15: ; preds = %1
br label %18
16: ; preds = %1
br label %18
17: ; preds = %1
br label %18
18: ; preds = %1, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%19 = phi i64 [ 0, %17 ], [ 41, %16 ], [ 30, %15 ], [ 29, %14 ], [ 24, %13 ], [ 36, %12 ], [ 35, %11 ], [ 33, %10 ], [ 34, %9 ], [ 10, %8 ], [ 16, %7 ], [ 15, %6 ], [ 14, %5 ], [ 13, %4 ], [ 12, %3 ], [ 11, %1 ]
ret i64 %19
}