#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int __u32;

/* Variables and functions */
int get_pixel_depth(unsigned int fmt) {
  int depth = 0;
  switch (fmt) {
  case ((__u32)('N') | ((__u32)('V') << 8) | ((__u32)('1') << 16) |
        ((__u32)('2') << 24)):
  case ((__u32)('N') | ((__u32)('V') << 8) | ((__u32)('2') << 16) |
        ((__u32)('1') << 24)):
  case ((__u32)('Y') | ((__u32)('U') << 8) | ((__u32)('1') << 16) |
        ((__u32)('2') << 24)):
  case ((__u32)('Y') | ((__u32)('V') << 8) | ((__u32)('1') << 16) |
        ((__u32)('2') << 24)):
    depth = 12;
    break;
  case ((__u32)('R') | ((__u32)('G') << 8) | ((__u32)('B') << 16) |
        ((__u32)('P') << 24)):
  case ((__u32)('Y') | ((__u32)('U') << 8) | ((__u32)('Y') << 16) |
        ((__u32)('V') << 24)):
  case ((__u32)('Y') | ((__u32)('V') << 8) | ((__u32)('Y') << 16) |
        ((__u32)('U') << 24)):
  case ((__u32)('U') | ((__u32)('Y') << 8) | ((__u32)('V') << 16) |
        ((__u32)('Y') << 24)):
  case ((__u32)('V') | ((__u32)('Y') << 8) | ((__u32)('U') << 16) |
        ((__u32)('Y') << 24)):
  case ((__u32)('N') | ((__u32)('V') << 8) | ((__u32)('1') << 16) |
        ((__u32)('6') << 24)):
  case ((__u32)('N') | ((__u32)('V') << 8) | ((__u32)('6') << 16) |
        ((__u32)('1') << 24)):
  case ((__u32)('4') | ((__u32)('2') << 8) | ((__u32)('2') << 16) |
        ((__u32)('P') << 24)):
    depth = 16;
    break;
  case ((__u32)('R') | ((__u32)('G') << 8) | ((__u32)('B') << 16) |
        ((__u32)('4') << 24)):
    depth = 32;
    break;
  }
  return depth;
}


x86 assembly (clang, -O0):
<get_pixel_depth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3132564e,%eax
je     1208 <get_pixel_depth+0x108>
jmp    1124 <get_pixel_depth+0x24>
mov    -0xc(%rbp),%eax
sub    $0x3136564e,%eax
je     1214 <get_pixel_depth+0x114>
jmp    1137 <get_pixel_depth+0x37>
mov    -0xc(%rbp),%eax
sub    $0x32315559,%eax
je     1208 <get_pixel_depth+0x108>
jmp    114a <get_pixel_depth+0x4a>
mov    -0xc(%rbp),%eax
sub    $0x3231564e,%eax
je     1208 <get_pixel_depth+0x108>
jmp    115d <get_pixel_depth+0x5d>
mov    -0xc(%rbp),%eax
sub    $0x32315659,%eax
je     1208 <get_pixel_depth+0x108>
jmp    1170 <get_pixel_depth+0x70>
mov    -0xc(%rbp),%eax
sub    $0x34424752,%eax
je     1220 <get_pixel_depth+0x120>
jmp    1183 <get_pixel_depth+0x83>
mov    -0xc(%rbp),%eax
sub    $0x3631564e,%eax
je     1214 <get_pixel_depth+0x114>
jmp    1196 <get_pixel_depth+0x96>
mov    -0xc(%rbp),%eax
sub    $0x50323234,%eax
je     1214 <get_pixel_depth+0x114>
jmp    11a9 <get_pixel_depth+0xa9>
mov    -0xc(%rbp),%eax
sub    $0x50424752,%eax
je     1214 <get_pixel_depth+0x114>
jmp    11bc <get_pixel_depth+0xbc>
mov    -0xc(%rbp),%eax
sub    $0x55595659,%eax
je     1214 <get_pixel_depth+0x114>
jmp    11cf <get_pixel_depth+0xcf>
mov    -0xc(%rbp),%eax
sub    $0x56595559,%eax
je     1214 <get_pixel_depth+0x114>
jmp    11e2 <get_pixel_depth+0xe2>
mov    -0xc(%rbp),%eax
sub    $0x59555956,%eax
je     1214 <get_pixel_depth+0x114>
jmp    11f5 <get_pixel_depth+0xf5>
mov    -0xc(%rbp),%eax
sub    $0x59565955,%eax
je     1214 <get_pixel_depth+0x114>
jmp    1227 <get_pixel_depth+0x127>
movl   $0xc,-0x8(%rbp)
jmp    1227 <get_pixel_depth+0x127>
movl   $0x10,-0x8(%rbp)
jmp    1227 <get_pixel_depth+0x127>
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pixel_depth>:
xor    %eax,%eax
cmp    $0x3631564d,%edi
jle    112c <get_pixel_depth+0x2c>
cmp    $0x55595658,%edi
jle    114e <get_pixel_depth+0x4e>
cmp    $0x59555955,%edi
jg     118c <get_pixel_depth+0x8c>
cmp    $0x55595659,%edi
je     119c <get_pixel_depth+0x9c>
cmp    $0x56595559,%edi
je     119c <get_pixel_depth+0x9c>
jmp    11a1 <get_pixel_depth+0xa1>
cmp    $0x3231564d,%edi
jg     1168 <get_pixel_depth+0x68>
cmp    $0x3132564e,%edi
je     1186 <get_pixel_depth+0x86>
cmp    $0x3136564e,%edi
je     119c <get_pixel_depth+0x9c>
cmp    $0x32315559,%edi
je     1186 <get_pixel_depth+0x86>
jmp    11a1 <get_pixel_depth+0xa1>
cmp    $0x3631564e,%edi
je     119c <get_pixel_depth+0x9c>
cmp    $0x50323234,%edi
je     119c <get_pixel_depth+0x9c>
cmp    $0x50424752,%edi
je     119c <get_pixel_depth+0x9c>
jmp    11a1 <get_pixel_depth+0xa1>
cmp    $0x3231564e,%edi
je     1186 <get_pixel_depth+0x86>
cmp    $0x32315659,%edi
je     1186 <get_pixel_depth+0x86>
cmp    $0x34424752,%edi
jne    11a1 <get_pixel_depth+0xa1>
mov    $0x20,%eax
ret
mov    $0xc,%eax
ret
cmp    $0x59555956,%edi
je     119c <get_pixel_depth+0x9c>
cmp    $0x59565955,%edi
jne    11a1 <get_pixel_depth+0xa1>
mov    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @get_pixel_depth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 842094158, label %5
i32 825382478, label %5
i32 842093913, label %5
i32 842094169, label %5
i32 1346520914, label %6
i32 1448695129, label %6
i32 1431918169, label %6
i32 1498831189, label %6
i32 1498765654, label %6
i32 909203022, label %6
i32 825644622, label %6
i32 1345466932, label %6
i32 876758866, label %7
]
5: ; preds = %1, %1, %1, %1
store i32 12, i32* %3
br label %8
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 16, i32* %3
br label %8
7: ; preds = %1
store i32 32, i32* %3
br label %8
8: ; preds = %1, %7, %6, %5
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_pixel_depth(i32 %0) {
switch i32 %0, label %5 [
i32 842094158, label %2
i32 825382478, label %2
i32 842093913, label %2
i32 842094169, label %2
i32 1346520914, label %3
i32 1448695129, label %3
i32 1431918169, label %3
i32 1498831189, label %3
i32 1498765654, label %3
i32 909203022, label %3
i32 825644622, label %3
i32 1345466932, label %3
i32 876758866, label %4
]
2: ; preds = %1, %1, %1, %1
br label %5
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 0, %1 ], [ 32, %4 ], [ 16, %3 ], [ 12, %2 ]
ret i32 %6
}