int cmodel_calculate_pixelsize(int colormodel) {
  switch (colormodel) {
  case 22:
    return 1;
    break;
  case 23:
    return 2;
    break;
  case 31:
    return 4;
    break;
  case 0:
    return 1;
    break;
  case 1:
    return 1;
    break;
  case 2:
    return 1;
    break;
  case 3:
    return 2;
    break;
  case 4:
    return 2;
    break;
  case 5:
    return 3;
    break;
  case 6:
    return 4;
    break;
  case 9:
    return 3;
    break;
  case 20:
    return 4;
    break;
  case 21:
    return 4;
    break;
  case 10:
    return 4;
    break;
  case 11:
    return 6;
    break;
  case 12:
    return 8;
    break;
  case 13:
    return 3;
    break;
  case 14:
    return 4;
    break;
  case 15:
    return 6;
    break;
  case 16:
    return 8;
    break;
  case 24:
    return 4;
    break;
  case 25:
    return 3;
    break;
  case 26:
    return 4;
    break;
  case 29:
    return 12;
    break;
  case 30:
    return 16;
    break;
  case 7:
    return 1;
    break;
  case 17:
    return 1;
    break;
  case 27:
    return 1;
    break;
  case 19:
    return 2;
    break;
  case 18:
    return 1;
    break;
  case 28:
    return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmodel_calculate_pixelsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x1f,%rax
ja     12a0 <cmodel_calculate_pixelsize+0x1a0>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x2,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x2,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x2,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x3,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x3,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x6,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x8,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x3,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x6,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x8,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x3,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x4,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0xc,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x10,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x2,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x1,-0x4(%rbp)
jmp    12a7 <cmodel_calculate_pixelsize+0x1a7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmodel_calculate_pixelsize>:
xor    %eax,%eax
cmp    $0x1f,%edi
ja     1114 <cmodel_calculate_pixelsize+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @cmodel_calculate_pixelsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %36 [
i32 22, label %5
i32 23, label %6
i32 31, label %7
i32 0, label %8
i32 1, label %9
i32 2, label %10
i32 3, label %11
i32 4, label %12
i32 5, label %13
i32 6, label %14
i32 9, label %15
i32 20, label %16
i32 21, label %17
i32 10, label %18
i32 11, label %19
i32 12, label %20
i32 13, label %21
i32 14, label %22
i32 15, label %23
i32 16, label %24
i32 24, label %25
i32 25, label %26
i32 26, label %27
i32 29, label %28
i32 30, label %29
i32 7, label %30
i32 17, label %31
i32 27, label %32
i32 19, label %33
i32 18, label %34
i32 28, label %35
]
5: ; preds = %1
store i32 1, i32* %2
br label %37
6: ; preds = %1
store i32 2, i32* %2
br label %37
7: ; preds = %1
store i32 4, i32* %2
br label %37
8: ; preds = %1
store i32 1, i32* %2
br label %37
9: ; preds = %1
store i32 1, i32* %2
br label %37
10: ; preds = %1
store i32 1, i32* %2
br label %37
11: ; preds = %1
store i32 2, i32* %2
br label %37
12: ; preds = %1
store i32 2, i32* %2
br label %37
13: ; preds = %1
store i32 3, i32* %2
br label %37
14: ; preds = %1
store i32 4, i32* %2
br label %37
15: ; preds = %1
store i32 3, i32* %2
br label %37
16: ; preds = %1
store i32 4, i32* %2
br label %37
17: ; preds = %1
store i32 4, i32* %2
br label %37
18: ; preds = %1
store i32 4, i32* %2
br label %37
19: ; preds = %1
store i32 6, i32* %2
br label %37
20: ; preds = %1
store i32 8, i32* %2
br label %37
21: ; preds = %1
store i32 3, i32* %2
br label %37
22: ; preds = %1
store i32 4, i32* %2
br label %37
23: ; preds = %1
store i32 6, i32* %2
br label %37
24: ; preds = %1
store i32 8, i32* %2
br label %37
25: ; preds = %1
store i32 4, i32* %2
br label %37
26: ; preds = %1
store i32 3, i32* %2
br label %37
27: ; preds = %1
store i32 4, i32* %2
br label %37
28: ; preds = %1
store i32 12, i32* %2
br label %37
29: ; preds = %1
store i32 16, i32* %2
br label %37
30: ; preds = %1
store i32 1, i32* %2
br label %37
31: ; preds = %1
store i32 1, i32* %2
br label %37
32: ; preds = %1
store i32 1, i32* %2
br label %37
33: ; preds = %1
store i32 2, i32* %2
br label %37
34: ; preds = %1
store i32 1, i32* %2
br label %37
35: ; preds = %1
store i32 1, i32* %2
br label %37
36: ; preds = %1
store i32 0, i32* %2
br label %37
37: ; preds = %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
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
@switch.table.cmodel_calculate_pixelsize = [32 x i32] [i32 1, i32 1, i32 1, i32 2, i32 2, i32 3, i32 4, i32 1, i32 0, i32 3, i32 4, i32 6, i32 8, i32 3, i32 4, i32 6, i32 8, i32 1, i32 1, i32 2, i32 4, i32 4, i32 1, i32 2, i32 4, i32 3, i32 4, i32 1, i32 1, i32 12, i32 16, i32 4]
define i32 @cmodel_calculate_pixelsize(i32 %0) {
%2 = icmp ult i32 %0, 32
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [32 x i32], [32 x i32]* @switch.table.cmodel_calculate_pixelsize, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}