int foo(signed char x) {
  int y = 0;
  switch (x) {
  case 0:
    y = 1;
    break;
  case 1:
    y = 7;
    break;
  case 2:
    y = 2;
    break;
  case 3:
    y = 19;
    break;
  case 4:
    y = 5;
    break;
  case 5:
    y = 17;
    break;
  case 6:
    y = 31;
    break;
  case 7:
    y = 8;
    break;
  case 8:
    y = 28;
    break;
  case 9:
    y = 16;
    break;
  case 10:
    y = 31;
    break;
  case 11:
    y = 12;
    break;
  case 12:
    y = 15;
    break;
  case 13:
    y = 111;
    break;
  case 14:
    y = 17;
    break;
  case 15:
    y = 10;
    break;
  case 16:
    y = 31;
    break;
  case 17:
    y = 7;
    break;
  case 18:
    y = 2;
    break;
  case 19:
    y = 19;
    break;
  case 20:
    y = 5;
    break;
  case 21:
    y = 107;
    break;
  case 22:
    y = 31;
    break;
  case 23:
    y = 8;
    break;
  case 24:
    y = 28;
    break;
  case 25:
    y = 106;
    break;
  case 26:
    y = 31;
    break;
  case 27:
    y = 102;
    break;
  case 28:
    y = 105;
    break;
  case 29:
    y = 111;
    break;
  case 30:
    y = 17;
    break;
  case 31:
    y = 10;
    break;
  case 32:
    y = 31;
    break;
  case 98:
    y = 18;
    break;
  case -62:
    y = 19;
    break;
  }
  return y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x3e,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xa0,%eax
ja     12dc <foo+0x1dc>
mov    -0x10(%rbp),%rax
lea    0xecc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x7,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x2,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x13,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x5,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x11,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x8,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1c,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x10,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0xc,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0xf,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x6f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x11,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0xa,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x7,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x2,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x13,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x5,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x6b,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x8,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1c,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x6a,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x66,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x69,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x6f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x11,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0xa,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x1f,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x12,-0x8(%rbp)
jmp    12dc <foo+0x1dc>
movl   $0x13,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
lea    0x3e(%rdi),%ecx
cmp    $0xa0,%ecx
ja     112e <foo+0x2e>
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1f,%eax
ret
mov    $0x11,%eax
ret
mov    $0x13,%eax
ret
mov    $0x7,%eax
ret
mov    %edi,%eax
ret
mov    $0x5,%eax
ret
mov    $0x8,%eax
ret
mov    $0x1c,%eax
ret
mov    $0x6f,%eax
ret
mov    $0xa,%eax
ret
mov    $0x1,%eax
ret
mov    $0x10,%eax
ret
mov    $0xc,%eax
ret
mov    $0xf,%eax
ret
mov    $0x2,%eax
ret
mov    $0x6b,%eax
ret
mov    $0x6a,%eax
ret
mov    $0x66,%eax
ret
mov    $0x69,%eax
ret
mov    $0x12,%eax
ret

LLVM IR (-O0):
define i32 @foo(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %41 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
i32 10, label %16
i32 11, label %17
i32 12, label %18
i32 13, label %19
i32 14, label %20
i32 15, label %21
i32 16, label %22
i32 17, label %23
i32 18, label %24
i32 19, label %25
i32 20, label %26
i32 21, label %27
i32 22, label %28
i32 23, label %29
i32 24, label %30
i32 25, label %31
i32 26, label %32
i32 27, label %33
i32 28, label %34
i32 29, label %35
i32 30, label %36
i32 31, label %37
i32 32, label %38
i32 98, label %39
i32 -62, label %40
]
6: ; preds = %1
store i32 1, i32* %3
br label %41
7: ; preds = %1
store i32 7, i32* %3
br label %41
8: ; preds = %1
store i32 2, i32* %3
br label %41
9: ; preds = %1
store i32 19, i32* %3
br label %41
10: ; preds = %1
store i32 5, i32* %3
br label %41
11: ; preds = %1
store i32 17, i32* %3
br label %41
12: ; preds = %1
store i32 31, i32* %3
br label %41
13: ; preds = %1
store i32 8, i32* %3
br label %41
14: ; preds = %1
store i32 28, i32* %3
br label %41
15: ; preds = %1
store i32 16, i32* %3
br label %41
16: ; preds = %1
store i32 31, i32* %3
br label %41
17: ; preds = %1
store i32 12, i32* %3
br label %41
18: ; preds = %1
store i32 15, i32* %3
br label %41
19: ; preds = %1
store i32 111, i32* %3
br label %41
20: ; preds = %1
store i32 17, i32* %3
br label %41
21: ; preds = %1
store i32 10, i32* %3
br label %41
22: ; preds = %1
store i32 31, i32* %3
br label %41
23: ; preds = %1
store i32 7, i32* %3
br label %41
24: ; preds = %1
store i32 2, i32* %3
br label %41
25: ; preds = %1
store i32 19, i32* %3
br label %41
26: ; preds = %1
store i32 5, i32* %3
br label %41
27: ; preds = %1
store i32 107, i32* %3
br label %41
28: ; preds = %1
store i32 31, i32* %3
br label %41
29: ; preds = %1
store i32 8, i32* %3
br label %41
30: ; preds = %1
store i32 28, i32* %3
br label %41
31: ; preds = %1
store i32 106, i32* %3
br label %41
32: ; preds = %1
store i32 31, i32* %3
br label %41
33: ; preds = %1
store i32 102, i32* %3
br label %41
34: ; preds = %1
store i32 105, i32* %3
br label %41
35: ; preds = %1
store i32 111, i32* %3
br label %41
36: ; preds = %1
store i32 17, i32* %3
br label %41
37: ; preds = %1
store i32 10, i32* %3
br label %41
38: ; preds = %1
store i32 31, i32* %3
br label %41
39: ; preds = %1
store i32 18, i32* %3
br label %41
40: ; preds = %1
store i32 19, i32* %3
br label %41
41: ; preds = %1, %40, %39, %38, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @foo(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %38 [
i32 0, label %3
i32 1, label %4
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %8
i32 6, label %9
i32 7, label %10
i32 8, label %11
i32 9, label %12
i32 10, label %13
i32 11, label %14
i32 12, label %15
i32 13, label %16
i32 14, label %17
i32 15, label %18
i32 16, label %19
i32 17, label %20
i32 18, label %21
i32 19, label %22
i32 20, label %23
i32 21, label %24
i32 22, label %25
i32 23, label %26
i32 24, label %27
i32 25, label %28
i32 26, label %29
i32 27, label %30
i32 28, label %31
i32 29, label %32
i32 30, label %33
i32 31, label %34
i32 32, label %35
i32 98, label %36
i32 -62, label %37
]
3: ; preds = %1
br label %38
4: ; preds = %1
br label %38
5: ; preds = %1
br label %38
6: ; preds = %1
br label %38
7: ; preds = %1
br label %38
8: ; preds = %1
br label %38
9: ; preds = %1
br label %38
10: ; preds = %1
br label %38
11: ; preds = %1
br label %38
12: ; preds = %1
br label %38
13: ; preds = %1
br label %38
14: ; preds = %1
br label %38
15: ; preds = %1
br label %38
16: ; preds = %1
br label %38
17: ; preds = %1
br label %38
18: ; preds = %1
br label %38
19: ; preds = %1
br label %38
20: ; preds = %1
br label %38
21: ; preds = %1
br label %38
22: ; preds = %1
br label %38
23: ; preds = %1
br label %38
24: ; preds = %1
br label %38
25: ; preds = %1
br label %38
26: ; preds = %1
br label %38
27: ; preds = %1
br label %38
28: ; preds = %1
br label %38
29: ; preds = %1
br label %38
30: ; preds = %1
br label %38
31: ; preds = %1
br label %38
32: ; preds = %1
br label %38
33: ; preds = %1
br label %38
34: ; preds = %1
br label %38
35: ; preds = %1
br label %38
36: ; preds = %1
br label %38
37: ; preds = %1
br label %38
38: ; preds = %1, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%39 = phi i32 [ 0, %1 ], [ 19, %37 ], [ 18, %36 ], [ 31, %35 ], [ 10, %34 ], [ 17, %33 ], [ 111, %32 ], [ 105, %31 ], [ 102, %30 ], [ 31, %29 ], [ 106, %28 ], [ 28, %27 ], [ 8, %26 ], [ 31, %25 ], [ 107, %24 ], [ 5, %23 ], [ %2, %22 ], [ 2, %21 ], [ 7, %20 ], [ 31, %19 ], [ 10, %18 ], [ 17, %17 ], [ 111, %16 ], [ 15, %15 ], [ 12, %14 ], [ 31, %13 ], [ 16, %12 ], [ 28, %11 ], [ 8, %10 ], [ 31, %9 ], [ 17, %8 ], [ 5, %7 ], [ 19, %6 ], [ %2, %5 ], [ 7, %4 ], [ 1, %3 ]
ret i32 %39
}