unsigned int iw_get_profile_by_fmt(int fmt) {
  unsigned int p;
  switch (fmt) {
  case 1:
    p = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0100 |
        0x0200 | 0x0400 | 0x0800 | 0x1000 | 0x8000 | 0x10000;
    break;
  case 3:
    p = 0x0200 | 0x0800 | 0x1000 | 0x8000;
    break;
  case 2:
    p = 0x0002;
    break;
  case 4:
    p = 0x0001 | 0x0002 | 0x0008 | 0x0020 | 0x0040 | 0x0800 | 0x1000;
    break;
  case 5:
    p = 0x0001 | 0x0002 | 0x2000 | 0x4000 | 0x40000;
    break;
  case 6:
    p = 0;
    break;
  case 12:
    p = 0x0040 | 0x8000 | 0x0002 | 0x0008 | 0x0001;
    break;
  case 8:
    p = 0x0040 | 0x8000 | 0x0002 | 0x0008;
    break;
  case 11:
    p = 0x0040 | 0x8000;
    break;
  case 10:
    p = 0x0040 | 0x8000 | 0x0002;
    break;
  case 9:
    p = 0x0008;
    break;
  default:
    p = 0;
  }
  return p;
}


x86 assembly (clang, -O0):
<iw_get_profile_by_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xb,%eax
ja     11b4 <iw_get_profile_by_fmt+0xb4>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x19f7f,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x9a00,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x2,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x186b,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x46003,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x0,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x804b,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x804a,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x8040,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x8042,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x8,-0x8(%rbp)
jmp    11bb <iw_get_profile_by_fmt+0xbb>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iw_get_profile_by_fmt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %16 [
i32 1, label %5
i32 3, label %6
i32 2, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 12, label %11
i32 8, label %12
i32 11, label %13
i32 10, label %14
i32 9, label %15
]
5: ; preds = %1
store i32 106367, i32* %3
br label %17
6: ; preds = %1
store i32 39424, i32* %3
br label %17
7: ; preds = %1
store i32 2, i32* %3
br label %17
8: ; preds = %1
store i32 6251, i32* %3
br label %17
9: ; preds = %1
store i32 286723, i32* %3
br label %17
10: ; preds = %1
store i32 0, i32* %3
br label %17
11: ; preds = %1
store i32 32843, i32* %3
br label %17
12: ; preds = %1
store i32 32842, i32* %3
br label %17
13: ; preds = %1
store i32 32832, i32* %3
br label %17
14: ; preds = %1
store i32 32834, i32* %3
br label %17
15: ; preds = %1
store i32 8, i32* %3
br label %17
16: ; preds = %1
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@switch.table.iw_get_profile_by_fmt = [12 x i32] [i32 106367, i32 2, i32 39424, i32 6251, i32 286723, i32 0, i32 0, i32 32842, i32 8, i32 32834, i32 32832, i32 32843]
define i32 @iw_get_profile_by_fmt(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.iw_get_profile_by_fmt, 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
}