class(c) {
  switch (c) {
  case ')':
    return (1);
  case '(':
    return (2);
  case '\t':
  case ' ':
    return (3);
  case '+':
    return (4);
  case '-':
    return (5);
  case '*':
    return (6);
  case '/':
    return (7);
  case '$':
    return (8);
  case '"':
  case '\'':
    return (9);
  case '=':
    return (10);
  case ',':
    return (11);
  }
  return (0);
}


x86 assembly (clang, -O0):
<class>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff7,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x34,%eax
ja     11b4 <class+0xb4>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x2,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x3,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x4,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x5,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x6,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x7,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x8,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x9,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0xa,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0xb,-0x4(%rbp)
jmp    11bb <class+0xbb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<class>:
add    $0xfffffff7,%edi
cmp    $0x34,%edi
ja     1129 <class+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x3,%eax
ret
mov    $0x9,%eax
ret
xor    %eax,%eax
ret
mov    $0x8,%eax
ret
mov    $0x2,%eax
ret
mov    $0x6,%eax
ret
mov    $0x4,%eax
ret
mov    $0xb,%eax
ret
mov    $0x5,%eax
ret
mov    $0x7,%eax
ret
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @class(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 41, label %5
i32 40, label %6
i32 9, label %7
i32 32, label %7
i32 43, label %8
i32 45, label %9
i32 42, label %10
i32 47, label %11
i32 36, label %12
i32 34, label %13
i32 39, label %13
i32 61, label %14
i32 44, label %15
]
5: ; preds = %1
store i32 1, i32* %2
br label %17
6: ; preds = %1
store i32 2, i32* %2
br label %17
7: ; preds = %1, %1
store i32 3, i32* %2
br label %17
8: ; preds = %1
store i32 4, i32* %2
br label %17
9: ; preds = %1
store i32 5, i32* %2
br label %17
10: ; preds = %1
store i32 6, i32* %2
br label %17
11: ; preds = %1
store i32 7, i32* %2
br label %17
12: ; preds = %1
store i32 8, i32* %2
br label %17
13: ; preds = %1, %1
store i32 9, i32* %2
br label %17
14: ; preds = %1
store i32 10, i32* %2
br label %17
15: ; preds = %1
store i32 11, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @class(i32 %0) {
switch i32 %0, label %12 [
i32 41, label %13
i32 40, label %2
i32 9, label %3
i32 32, label %3
i32 43, label %4
i32 45, label %5
i32 42, label %6
i32 47, label %7
i32 36, label %8
i32 34, label %9
i32 39, label %9
i32 61, label %10
i32 44, label %11
]
2: ; preds = %1
br label %13
3: ; preds = %1, %1
br label %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1, %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%14 = phi i32 [ 0, %12 ], [ 11, %11 ], [ 10, %10 ], [ 9, %9 ], [ 8, %8 ], [ 7, %7 ], [ 6, %6 ], [ 5, %5 ], [ 4, %4 ], [ 3, %3 ], [ 2, %2 ], [ 1, %1 ]
ret i32 %14
}