int hash(int n) {
  switch (n) {
  case 10:
    return 0;
  case 100:
    return 1;
  case 32:
    return 2;
  case 45:
    return 3;
  case 58:
    return 4;
  case 126:
    return 5;
  case 3:
    return 6;
  case 29:
    return 7;
  case 200:
    return 8;
  case 400:
    return 9;
  case 0:
    return 10;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1240 <hash+0x140>
jmp    111a <hash+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1210 <hash+0x110>
jmp    112b <hash+0x2b>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     11c8 <hash+0xc8>
jmp    113c <hash+0x3c>
mov    -0xc(%rbp),%eax
sub    $0x1d,%eax
je     121c <hash+0x11c>
jmp    114d <hash+0x4d>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     11e0 <hash+0xe0>
jmp    115e <hash+0x5e>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     11ec <hash+0xec>
jmp    116f <hash+0x6f>
mov    -0xc(%rbp),%eax
sub    $0x3a,%eax
je     11f8 <hash+0xf8>
jmp    1180 <hash+0x80>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
je     11d4 <hash+0xd4>
jmp    1191 <hash+0x91>
mov    -0xc(%rbp),%eax
sub    $0x7e,%eax
je     1204 <hash+0x104>
jmp    11a2 <hash+0xa2>
mov    -0xc(%rbp),%eax
sub    $0xc8,%eax
je     1228 <hash+0x128>
jmp    11b5 <hash+0xb5>
mov    -0xc(%rbp),%eax
sub    $0x190,%eax
je     1234 <hash+0x134>
jmp    124c <hash+0x14c>
movl   $0x0,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x1,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x2,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x3,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x4,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x5,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x6,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x7,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x8,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0x9,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0xa,-0x4(%rbp)
jmp    1253 <hash+0x153>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
cmp    $0x63,%edi
jg     1124 <hash+0x24>
cmp    $0x3a,%edi
ja     117c <hash+0x7c>
xor    %eax,%eax
mov    %edi,%ecx
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xa,%eax
ret
cmp    $0xc7,%edi
jg     113c <hash+0x3c>
cmp    $0x64,%edi
je     1170 <hash+0x70>
cmp    $0x7e,%edi
jne    117c <hash+0x7c>
mov    $0x5,%eax
ret
cmp    $0xc8,%edi
je     1176 <hash+0x76>
cmp    $0x190,%edi
jne    117c <hash+0x7c>
mov    $0x9,%eax
ret
mov    $0x6,%eax
ret
mov    $0x7,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
mov    $0x1,%eax
ret
mov    $0x8,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 10, label %5
i32 100, label %6
i32 32, label %7
i32 45, label %8
i32 58, label %9
i32 126, label %10
i32 3, label %11
i32 29, label %12
i32 200, label %13
i32 400, label %14
i32 0, label %15
]
5: ; preds = %1
store i32 0, i32* %2
br label %17
6: ; preds = %1
store i32 1, i32* %2
br label %17
7: ; preds = %1
store i32 2, i32* %2
br label %17
8: ; preds = %1
store i32 3, i32* %2
br label %17
9: ; preds = %1
store i32 4, i32* %2
br label %17
10: ; preds = %1
store i32 5, i32* %2
br label %17
11: ; preds = %1
store i32 6, i32* %2
br label %17
12: ; preds = %1
store i32 7, i32* %2
br label %17
13: ; preds = %1
store i32 8, i32* %2
br label %17
14: ; preds = %1
store i32 9, i32* %2
br label %17
15: ; preds = %1
store i32 10, i32* %2
br label %17
16: ; preds = %1
store i32 -1, 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 @hash(i32 %0) {
switch i32 %0, label %12 [
i32 10, label %13
i32 100, label %2
i32 32, label %3
i32 45, label %4
i32 58, label %5
i32 126, label %6
i32 3, label %7
i32 29, label %8
i32 200, label %9
i32 400, label %10
i32 0, label %11
]
2: ; preds = %1
br label %13
3: ; preds = %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
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 [ -1, %12 ], [ 10, %11 ], [ 9, %10 ], [ 8, %9 ], [ 7, %8 ], [ 6, %7 ], [ 5, %6 ], [ 4, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %2 ], [ 0, %1 ]
ret i32 %14
}