#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 *mp2vseqx_get_profile_txt(uint8_t i_profilelevel) {
  if (i_profilelevel & (1 << 7)) {
    return i_profilelevel == 0x8e || i_profilelevel == 0x8d ||
                   i_profilelevel == 0x8b || i_profilelevel == 0x8a
               ? "Multi-view"
           : i_profilelevel == 0x85 || i_profilelevel == 0x82 ? "4:2:2"
                                                              : "Reserved";
  } else {
    i_profilelevel &= 0x70;
    return i_profilelevel == (5 << 4)   ? "Simple"
           : i_profilelevel == (4 << 4) ? "Main"
           : i_profilelevel == (3 << 4) ? "SNR Scalable"
           : i_profilelevel == (2 << 4) ? "Spatially Scalable"
           : i_profilelevel == (1 << 4) ? "High"
                                        : "Reserved";
  }
}


x86 assembly (clang, -O0):
<mp2vseqx_get_profile_txt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11a4 <mp2vseqx_get_profile_txt+0xa4>
cmpl   $0x8e,-0xc(%rbp)
je     114c <mp2vseqx_get_profile_txt+0x4c>
cmpl   $0x8d,-0xc(%rbp)
je     114c <mp2vseqx_get_profile_txt+0x4c>
cmpl   $0x8b,-0xc(%rbp)
je     114c <mp2vseqx_get_profile_txt+0x4c>
cmpl   $0x8a,-0xc(%rbp)
jne    115c <mp2vseqx_get_profile_txt+0x5c>
lea    0xead(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1197 <mp2vseqx_get_profile_txt+0x97>
mov    $0x1,%al
cmpl   $0x85,-0xc(%rbp)
mov    %al,-0x19(%rbp)
je     117b <mp2vseqx_get_profile_txt+0x7b>
cmpl   $0x82,-0xc(%rbp)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%dl
lea    0xe8c(%rip),%rax
lea    0xe7f(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1251 <mp2vseqx_get_profile_txt+0x151>
mov    -0xc(%rbp),%eax
and    $0x70,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x50,-0xc(%rbp)
jne    11c7 <mp2vseqx_get_profile_txt+0xc7>
lea    0xe5c(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1249 <mp2vseqx_get_profile_txt+0x149>
cmpl   $0x40,-0xc(%rbp)
jne    11e1 <mp2vseqx_get_profile_txt+0xe1>
lea    0xe49(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1241 <mp2vseqx_get_profile_txt+0x141>
cmpl   $0x30,-0xc(%rbp)
jne    11fb <mp2vseqx_get_profile_txt+0xfb>
lea    0xe34(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    1239 <mp2vseqx_get_profile_txt+0x139>
cmpl   $0x20,-0xc(%rbp)
jne    1215 <mp2vseqx_get_profile_txt+0x115>
lea    0xe27(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    1231 <mp2vseqx_get_profile_txt+0x131>
mov    -0xc(%rbp),%edx
lea    0xdf2(%rip),%rax
lea    0xe20(%rip),%rcx
cmp    $0x10,%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,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_get_profile_txt>:
test   $0x80,%dil
jne    1123 <mp2vseqx_get_profile_txt+0x23>
and    $0x70,%edi
lea    -0x20(%rdi),%eax
cmp    $0x40,%eax
jae    115b <mp2vseqx_get_profile_txt+0x5b>
shr    $0x4,%eax
lea    0xf31(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    -0x8a(%rdi),%eax
cmp    $0x5,%eax
jae    1138 <mp2vseqx_get_profile_txt+0x38>
mov    $0x1b,%ecx
bt     %eax,%ecx
jb     1171 <mp2vseqx_get_profile_txt+0x71>
cmp    $0x82,%edi
lea    0xec6(%rip),%rcx
lea    0xec5(%rip),%rax
cmove  %rcx,%rax
cmp    $0x85,%edi
cmove  %rcx,%rax
ret
cmp    $0x10,%edi
lea    0xee1(%rip),%rcx
lea    0xea5(%rip),%rax
cmove  %rcx,%rax
ret
lea    0xe88(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Multi-view\00"
@.str.1 = [6 x i8] c"4:2:2\00"
@.str.2 = [9 x i8] c"Reserved\00"
@.str.3 = [7 x i8] c"Simple\00"
@.str.4 = [5 x i8] c"Main\00"
@.str.5 = [13 x i8] c"SNR Scalable\00"
@.str.6 = [19 x i8] c"Spatially Scalable\00"
@.str.7 = [5 x i8] c"High\00"
define i8* @mp2vseqx_get_profile_txt(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %32
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 142
br i1 %9, label %19, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 141
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 139
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 138
br i1 %18, label %19, label %20
19: ; preds = %16, %13, %10, %7
br label %30
20: ; preds = %16
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 133
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 130
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ true, %20 ], [ %25, %23 ]
%28 = zext i1 %27 to i64
%29 = select i1 %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
br label %30
30: ; preds = %26, %19
%31 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %19 ], [ %29, %26 ]
store i8* %31, i8** %2
br label %63
32: ; preds = %1
%33 = load i32, i32* %3
%34 = and i32 %33, 112
store i32 %34, i32* %3
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 80
br i1 %36, label %37, label %38
37: ; preds = %32
br label %61
38: ; preds = %32
%39 = load i32, i32* %3
%40 = icmp eq i32 %39, 64
br i1 %40, label %41, label %42
41: ; preds = %38
br label %59
42: ; preds = %38
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 48
br i1 %44, label %45, label %46
45: ; preds = %42
br label %57
46: ; preds = %42
%47 = load i32, i32* %3
%48 = icmp eq i32 %47, 32
br i1 %48, label %49, label %50
49: ; preds = %46
br label %55
50: ; preds = %46
%51 = load i32, i32* %3
%52 = icmp eq i32 %51, 16
%53 = zext i1 %52 to i64
%54 = select i1 %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
br label %55
55: ; preds = %50, %49
%56 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %49 ], [ %54, %50 ]
br label %57
57: ; preds = %55, %45
%58 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), %45 ], [ %56, %55 ]
br label %59
59: ; preds = %57, %41
%60 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %41 ], [ %58, %57 ]
br label %61
61: ; preds = %59, %37
%62 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %37 ], [ %60, %59 ]
store i8* %62, i8** %2
br label %63
63: ; preds = %61, %30
%64 = load i8*, i8** %2
ret i8* %64
}

LLVM IR (-O2):
@.str = [11 x i8] c"Multi-view\00"
@.str.1 = [6 x i8] c"4:2:2\00"
@.str.2 = [9 x i8] c"Reserved\00"
@.str.3 = [7 x i8] c"Simple\00"
@.str.4 = [5 x i8] c"Main\00"
@.str.5 = [13 x i8] c"SNR Scalable\00"
@.str.6 = [19 x i8] c"Spatially Scalable\00"
@.str.7 = [5 x i8] c"High\00"
@reltable.mp2vseqx_get_profile_txt = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.6 to i64), i64 ptrtoint ([4 x i32]* @reltable.mp2vseqx_get_profile_txt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.5 to i64), i64 ptrtoint ([4 x i32]* @reltable.mp2vseqx_get_profile_txt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.mp2vseqx_get_profile_txt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.mp2vseqx_get_profile_txt to i64)) to i32)]
define i8* @mp2vseqx_get_profile_txt(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = add i32 %0, -138
%6 = icmp ult i32 %5, 5
br i1 %6, label %19, label %7
7: ; preds = %19, %4
%8 = icmp eq i32 %0, 133
%9 = icmp eq i32 %0, 130
%10 = or i1 %8, %9
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
br label %29
12: ; preds = %1
%13 = and i32 %0, 112
%14 = add nsw i32 %13, -32
%15 = icmp ult i32 %14, 64
br i1 %15, label %24, label %16
16: ; preds = %12
%17 = icmp eq i32 %13, 16
%18 = select i1 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
br label %29
19: ; preds = %4
%20 = trunc i32 %5 to i8
%21 = lshr i8 27, %20
%22 = and i8 %21, 1
%23 = icmp eq i8 %22, 0
br i1 %23, label %7, label %29
24: ; preds = %12
%25 = lshr exact i32 %14, 4
%26 = zext i32 %25 to i64
%27 = shl i64 %26, 2
%28 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.mp2vseqx_get_profile_txt to i8*), i64 %27)
br label %29
29: ; preds = %19, %24, %16, %7
%30 = phi i8* [ %11, %7 ], [ %18, %16 ], [ %28, %24 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %19 ]
ret i8* %30
}