#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 */

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void cmodel_to_text(char *string, int cmodel) {
  switch (cmodel) {
  case 9:
    strcpy(string, "RGB-8 Bit");
    break;
  case 10:
    strcpy(string, "RGBA-8 Bit");
    break;
  case 11:
    strcpy(string, "RGB-16 Bit");
    break;
  case 12:
    strcpy(string, "RGBA-16 Bit");
    break;
  case 13:
    strcpy(string, "YUV-8 Bit");
    break;
  case 14:
    strcpy(string, "YUVA-8 Bit");
    break;
  case 15:
    strcpy(string, "YUV-16 Bit");
    break;
  case 16:
    strcpy(string, "YUVA-16 Bit");
    break;
  case 29:
    strcpy(string, "RGB-FLOAT");
    break;
  case 30:
    strcpy(string, "RGBA-FLOAT");
    break;
  default:
    strcpy(string, "RGB-8 Bit");
    break;
  }
}


x86 assembly (clang, -O0):
<cmodel_to_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffff7,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x15,%eax
ja     121a <cmodel_to_text+0x10a>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xf05(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xefa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xef0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xee6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xec8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    122a <cmodel_to_text+0x11a>
mov    -0x8(%rbp),%rdi
lea    0xe33(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmodel_to_text>:
add    $0xfffffff6,%esi
cmp    $0x14,%esi
ja     112e <cmodel_to_text+0x1e>
movslq %esi,%rax
lea    0xf4e(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    1030 <strcpy@plt>
lea    0xecb(%rip),%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"RGB-8 Bit\00"
@.str.1 = [11 x i8] c"RGBA-8 Bit\00"
@.str.2 = [11 x i8] c"RGB-16 Bit\00"
@.str.3 = [12 x i8] c"RGBA-16 Bit\00"
@.str.4 = [10 x i8] c"YUV-8 Bit\00"
@.str.5 = [11 x i8] c"YUVA-8 Bit\00"
@.str.6 = [11 x i8] c"YUV-16 Bit\00"
@.str.7 = [12 x i8] c"YUVA-16 Bit\00"
@.str.8 = [10 x i8] c"RGB-FLOAT\00"
@.str.9 = [11 x i8] c"RGBA-FLOAT\00"
define void @cmodel_to_text(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %36 [
i32 9, label %6
i32 10, label %9
i32 11, label %12
i32 12, label %15
i32 13, label %18
i32 14, label %21
i32 15, label %24
i32 16, label %27
i32 29, label %30
i32 30, label %33
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %39
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %39
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %39
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %39
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %39
21: ; preds = %2
%22 = load i8*, i8** %3
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %39
24: ; preds = %2
%25 = load i8*, i8** %3
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %39
27: ; preds = %2
%28 = load i8*, i8** %3
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %39
30: ; preds = %2
%31 = load i8*, i8** %3
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %39
33: ; preds = %2
%34 = load i8*, i8** %3
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %39
36: ; preds = %2
%37 = load i8*, i8** %3
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %39
39: ; preds = %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"RGB-8 Bit\00"
@.str.1 = [11 x i8] c"RGBA-8 Bit\00"
@.str.2 = [11 x i8] c"RGB-16 Bit\00"
@.str.3 = [12 x i8] c"RGBA-16 Bit\00"
@.str.4 = [10 x i8] c"YUV-8 Bit\00"
@.str.5 = [11 x i8] c"YUVA-8 Bit\00"
@.str.6 = [11 x i8] c"YUV-16 Bit\00"
@.str.7 = [12 x i8] c"YUVA-16 Bit\00"
@.str.8 = [10 x i8] c"RGB-FLOAT\00"
@.str.9 = [11 x i8] c"RGBA-FLOAT\00"
@reltable.cmodel_to_text = [21 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.1 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.2 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.3 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.4 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.5 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.6 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.7 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.8 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.9 to i64), i64 ptrtoint ([21 x i32]* @reltable.cmodel_to_text to i64)) to i32)]
define void @cmodel_to_text(i8* %0, i32 %1) {
%3 = add i32 %1, -10
%4 = icmp ult i32 %3, 21
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([21 x i32]* @reltable.cmodel_to_text to i8*), i64 %7)
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ], [ %8, %5 ]
%11 = tail call i32 @strcpy(i8* %0, i8* %10)
ret void
}