int MethodBitsPerPixel(unsigned int method) {
  switch (method) {
  case 1:
  case 26:
  case 37: {
    return 8;
  }
  case 2:
  case 27:
  case 38: {
    return 8;
  }
  case 3:
  case 28:
  case 39: {
    return 8;
  }
  case 4:
  case 29:
  case 40: {
    return 16;
  }
  case 5:
  case 30:
  case 41: {
    return 16;
  }
  case 6:
  case 31:
  case 42: {
    return 16;
  }
  case 7:
  case 32:
  case 43: {
    return 16;
  }
  case 8:
  case 33:
  case 44: {
    return 24;
  }
  case 9:
  case 34:
  case 45: {
    return 24;
  }
  case 10:
  case 35:
  case 46: {
    return 24;
  }
  case 67:
  case 63:
  case 64: {
    return 24;
  }
  default: {
    return 0;
  }
  }
}


x86 assembly (clang, -O0):
<MethodBitsPerPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x42,%eax
ja     11b4 <MethodBitsPerPixel+0xb4>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x8,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x8,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x8,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x10,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x10,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x10,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x10,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x18,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x18,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x18,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x18,-0x4(%rbp)
jmp    11bb <MethodBitsPerPixel+0xbb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MethodBitsPerPixel>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x42,%edi
ja     1117 <MethodBitsPerPixel+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @MethodBitsPerPixel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 1, label %5
i32 26, label %5
i32 37, label %5
i32 2, label %6
i32 27, label %6
i32 38, label %6
i32 3, label %7
i32 28, label %7
i32 39, label %7
i32 4, label %8
i32 29, label %8
i32 40, label %8
i32 5, label %9
i32 30, label %9
i32 41, label %9
i32 6, label %10
i32 31, label %10
i32 42, label %10
i32 7, label %11
i32 32, label %11
i32 43, label %11
i32 8, label %12
i32 33, label %12
i32 44, label %12
i32 9, label %13
i32 34, label %13
i32 45, label %13
i32 10, label %14
i32 35, label %14
i32 46, label %14
i32 67, label %15
i32 63, label %15
i32 64, label %15
]
5: ; preds = %1, %1, %1
store i32 8, i32* %2
br label %17
6: ; preds = %1, %1, %1
store i32 8, i32* %2
br label %17
7: ; preds = %1, %1, %1
store i32 8, i32* %2
br label %17
8: ; preds = %1, %1, %1
store i32 16, i32* %2
br label %17
9: ; preds = %1, %1, %1
store i32 16, i32* %2
br label %17
10: ; preds = %1, %1, %1
store i32 16, i32* %2
br label %17
11: ; preds = %1, %1, %1
store i32 16, i32* %2
br label %17
12: ; preds = %1, %1, %1
store i32 24, i32* %2
br label %17
13: ; preds = %1, %1, %1
store i32 24, i32* %2
br label %17
14: ; preds = %1, %1, %1
store i32 24, i32* %2
br label %17
15: ; preds = %1, %1, %1
store i32 24, 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):
@switch.table.MethodBitsPerPixel = [67 x i32] [i32 8, i32 8, i32 8, i32 16, i32 16, i32 16, i32 16, i32 24, i32 24, i32 24, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 8, i32 8, i32 8, i32 16, i32 16, i32 16, i32 16, i32 24, i32 24, i32 24, i32 0, i32 8, i32 8, i32 8, i32 16, i32 16, i32 16, i32 16, i32 24, i32 24, i32 24, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 24, i32 24, i32 0, i32 0, i32 24]
define i32 @MethodBitsPerPixel(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 67
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [67 x i32], [67 x i32]* @switch.table.MethodBitsPerPixel, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}