#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 uint8_t;

/* Variables and functions */
const char *h264_sps_get_profile_txt(uint8_t i_profile) {
  return i_profile == 44    ? "CAVLC 4:4:4 Intra"
         : i_profile == 66  ? "Baseline"
         : i_profile == 77  ? "Main"
         : i_profile == 88  ? "Extended"
         : i_profile == 100 ? "High"
         : i_profile == 110 ? "High 10"
         : i_profile == 122 ? "High 4:2:2"
         : i_profile == 144 ? "High 4:4:4 Predictive"
                            : "Reserved";
}


x86 assembly (clang, -O0):
<h264_sps_get_profile_txt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2c,-0x4(%rbp)
jne    1121 <h264_sps_get_profile_txt+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    120c <h264_sps_get_profile_txt+0x10c>
cmpl   $0x42,-0x4(%rbp)
jne    113b <h264_sps_get_profile_txt+0x3b>
lea    0xee0(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1204 <h264_sps_get_profile_txt+0x104>
cmpl   $0x4d,-0x4(%rbp)
jne    1155 <h264_sps_get_profile_txt+0x55>
lea    0xecf(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11fc <h264_sps_get_profile_txt+0xfc>
cmpl   $0x58,-0x4(%rbp)
jne    116f <h264_sps_get_profile_txt+0x6f>
lea    0xeba(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    11f4 <h264_sps_get_profile_txt+0xf4>
cmpl   $0x64,-0x4(%rbp)
jne    1189 <h264_sps_get_profile_txt+0x89>
lea    0xea9(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    11ec <h264_sps_get_profile_txt+0xec>
cmpl   $0x6e,-0x4(%rbp)
jne    11a3 <h264_sps_get_profile_txt+0xa3>
lea    0xe94(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    11e4 <h264_sps_get_profile_txt+0xe4>
cmpl   $0x7a,-0x4(%rbp)
jne    11bd <h264_sps_get_profile_txt+0xbd>
lea    0xe82(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    11dc <h264_sps_get_profile_txt+0xdc>
mov    -0x4(%rbp),%edx
lea    0xe90(%rip),%rax
lea    0xe73(%rip),%rcx
cmp    $0x90,%edx
cmove  %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264_sps_get_profile_txt>:
lea    -0x42(%rdi),%eax
cmp    $0x38,%eax
ja     1120 <h264_sps_get_profile_txt+0x20>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfd7(%rip),%rax
ret
cmp    $0x2c,%edi
jne    112d <h264_sps_get_profile_txt+0x2d>
lea    0xfb8(%rip),%rax
ret
cmp    $0x90,%edi
lea    0xfeb(%rip),%rcx
lea    0xffa(%rip),%rax
cmove  %rcx,%rax
ret
lea    0xfb2(%rip),%rax
ret
lea    0xfaf(%rip),%rax
ret
lea    0xfb0(%rip),%rax
ret
lea    0xfad(%rip),%rax
ret
lea    0xfad(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"CAVLC 4:4:4 Intra\00"
@.str.1 = [9 x i8] c"Baseline\00"
@.str.2 = [5 x i8] c"Main\00"
@.str.3 = [9 x i8] c"Extended\00"
@.str.4 = [5 x i8] c"High\00"
@.str.5 = [8 x i8] c"High 10\00"
@.str.6 = [11 x i8] c"High 4:2:2\00"
@.str.7 = [22 x i8] c"High 4:4:4 Predictive\00"
@.str.8 = [9 x i8] c"Reserved\00"
define i8* @h264_sps_get_profile_txt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 44
br i1 %4, label %5, label %6
5: ; preds = %1
br label %47
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 66
br i1 %8, label %9, label %10
9: ; preds = %6
br label %45
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 77
br i1 %12, label %13, label %14
13: ; preds = %10
br label %43
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 88
br i1 %16, label %17, label %18
17: ; preds = %14
br label %41
18: ; preds = %14
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 100
br i1 %20, label %21, label %22
21: ; preds = %18
br label %39
22: ; preds = %18
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 110
br i1 %24, label %25, label %26
25: ; preds = %22
br label %37
26: ; preds = %22
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 122
br i1 %28, label %29, label %30
29: ; preds = %26
br label %35
30: ; preds = %26
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 144
%33 = zext i1 %32 to i64
%34 = select i1 %32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0)
br label %35
35: ; preds = %30, %29
%36 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %29 ], [ %34, %30 ]
br label %37
37: ; preds = %35, %25
%38 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %25 ], [ %36, %35 ]
br label %39
39: ; preds = %37, %21
%40 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %21 ], [ %38, %37 ]
br label %41
41: ; preds = %39, %17
%42 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %17 ], [ %40, %39 ]
br label %43
43: ; preds = %41, %13
%44 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %13 ], [ %42, %41 ]
br label %45
45: ; preds = %43, %9
%46 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %9 ], [ %44, %43 ]
br label %47
47: ; preds = %45, %5
%48 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %5 ], [ %46, %45 ]
ret i8* %48
}

LLVM IR (-O2):
@.str = [18 x i8] c"CAVLC 4:4:4 Intra\00"
@.str.1 = [9 x i8] c"Baseline\00"
@.str.2 = [5 x i8] c"Main\00"
@.str.3 = [9 x i8] c"Extended\00"
@.str.4 = [5 x i8] c"High\00"
@.str.5 = [8 x i8] c"High 10\00"
@.str.6 = [11 x i8] c"High 4:2:2\00"
@.str.7 = [22 x i8] c"High 4:4:4 Predictive\00"
@.str.8 = [9 x i8] c"Reserved\00"
define i8* @h264_sps_get_profile_txt(i32 %0) {
switch i32 %0, label %2 [
i32 44, label %11
i32 66, label %5
i32 77, label %6
i32 88, label %7
i32 100, label %8
i32 110, label %9
i32 122, label %10
]
2: ; preds = %1
%3 = icmp eq i32 %0, 144
%4 = select i1 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0)
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %2
%12 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %1 ], [ %4, %2 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %8 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %9 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %10 ]
ret i8* %12
}