#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 DataManager_GetIntValue(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *checkTheme(int tw_theme) {
  int isVal;
  int isTrue = 0;
  char *tmp_set = (char *)malloc(40);
  switch (tw_theme) {
  case 1:
    strcpy(tmp_set, "[ ] Team Win Theme (Default)");
    break;
  case 2:
    strcpy(tmp_set, "[ ] CyanogenMod Theme");
    break;
  case 3:
    strcpy(tmp_set, "[ ] Red Rum Theme");
    break;
  case 4:
    strcpy(tmp_set, "[ ] Google Theme");
    break;
  case 5:
    strcpy(tmp_set, "[ ] JesusFreke Theme (oldschool)");
    break;
  case 6:
    strcpy(tmp_set, "[ ] HTC Theme");
    break;
  case 7:
    strcpy(tmp_set, "[ ] Fabulous Theme");
    break;
  case 8:
    strcpy(tmp_set, "[ ] Purple Shift");
    break;
  case 9:
    strcpy(tmp_set, "[ ] Greyballer");
    break;
  case 10:
    strcpy(tmp_set, "[ ] Trippy");
    break;
  case 11:
    strcpy(tmp_set, "[ ] Shifty Bastard");
    break;
  case 12:
    strcpy(tmp_set, "[ ] Myn's Warm");
    break;
  }
  isVal = DataManager_GetIntValue("tw_color_theme");
  if (isVal == tw_theme - 1) {
    tmp_set[1] = 'x';
  }
  return tmp_set;
}


x86 assembly (clang, -O0):
<checkTheme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     1270 <checkTheme+0x140>
mov    -0x20(%rbp),%rax
lea    0xe90(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1270 <checkTheme+0x140>
mov    -0x18(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xe9e(%rip),%rdi
call   1050 <DataManager_GetIntValue@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1298 <checkTheme+0x168>
mov    -0x18(%rbp),%rax
movb   $0x78,0x1(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkTheme>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
add    $0xffffffff,%ebp
cmp    $0xb,%ebp
ja     1163 <checkTheme+0x33>
movslq %ebp,%rax
lea    0xfa0(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xf7b(%rip),%rdi
call   1050 <DataManager_GetIntValue@plt>
cmp    %ebp,%eax
jne    1177 <checkTheme+0x47>
movb   $0x78,0x1(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"[ ] Team Win Theme (Default)\00"
@.str.1 = [22 x i8] c"[ ] CyanogenMod Theme\00"
@.str.2 = [18 x i8] c"[ ] Red Rum Theme\00"
@.str.3 = [17 x i8] c"[ ] Google Theme\00"
@.str.4 = [33 x i8] c"[ ] JesusFreke Theme (oldschool)\00"
@.str.5 = [14 x i8] c"[ ] HTC Theme\00"
@.str.6 = [19 x i8] c"[ ] Fabulous Theme\00"
@.str.7 = [17 x i8] c"[ ] Purple Shift\00"
@.str.8 = [15 x i8] c"[ ] Greyballer\00"
@.str.9 = [11 x i8] c"[ ] Trippy\00"
@.str.10 = [19 x i8] c"[ ] Shifty Bastard\00"
@.str.11 = [15 x i8] c"[ ] Myn's Warm\00"
@.str.12 = [15 x i8] c"tw_color_theme\00"
define i8* @checkTheme(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %2
store i32 0, i32* %4
%6 = call i64 @malloc(i32 40)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = load i32, i32* %2
switch i32 %8, label %45 [
i32 1, label %9
i32 2, label %12
i32 3, label %15
i32 4, label %18
i32 5, label %21
i32 6, label %24
i32 7, label %27
i32 8, label %30
i32 9, label %33
i32 10, label %36
i32 11, label %39
i32 12, label %42
]
9: ; preds = %1
%10 = load i8*, i8** %5
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %45
12: ; preds = %1
%13 = load i8*, i8** %5
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %45
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %45
18: ; preds = %1
%19 = load i8*, i8** %5
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %45
21: ; preds = %1
%22 = load i8*, i8** %5
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %45
24: ; preds = %1
%25 = load i8*, i8** %5
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %45
27: ; preds = %1
%28 = load i8*, i8** %5
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %45
30: ; preds = %1
%31 = load i8*, i8** %5
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
br label %45
33: ; preds = %1
%34 = load i8*, i8** %5
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %45
36: ; preds = %1
%37 = load i8*, i8** %5
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %45
39: ; preds = %1
%40 = load i8*, i8** %5
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
br label %45
42: ; preds = %1
%43 = load i8*, i8** %5
%44 = call i32 @strcpy(i8* %43, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0))
br label %45
45: ; preds = %1, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9
%46 = call i32 @DataManager_GetIntValue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
store i32 %46, i32* %3
%47 = load i32, i32* %3
%48 = load i32, i32* %2
%49 = sub nsw i32 %48, 1
%50 = icmp eq i32 %47, %49
br i1 %50, label %51, label %54
51: ; preds = %45
%52 = load i8*, i8** %5
%53 = getelementptr inbounds i8, i8* %52, i64 1
store i8 120, i8* %53
br label %54
54: ; preds = %51, %45
%55 = load i8*, i8** %5
ret i8* %55
}

LLVM IR (-O2):
@.str = [29 x i8] c"[ ] Team Win Theme (Default)\00"
@.str.1 = [22 x i8] c"[ ] CyanogenMod Theme\00"
@.str.2 = [18 x i8] c"[ ] Red Rum Theme\00"
@.str.3 = [17 x i8] c"[ ] Google Theme\00"
@.str.4 = [33 x i8] c"[ ] JesusFreke Theme (oldschool)\00"
@.str.5 = [14 x i8] c"[ ] HTC Theme\00"
@.str.6 = [19 x i8] c"[ ] Fabulous Theme\00"
@.str.7 = [17 x i8] c"[ ] Purple Shift\00"
@.str.8 = [15 x i8] c"[ ] Greyballer\00"
@.str.9 = [11 x i8] c"[ ] Trippy\00"
@.str.10 = [19 x i8] c"[ ] Shifty Bastard\00"
@.str.11 = [15 x i8] c"[ ] Myn's Warm\00"
@.str.12 = [15 x i8] c"tw_color_theme\00"
@reltable.checkTheme = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([29 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([33 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.checkTheme to i64)) to i32)]
define i8* @checkTheme(i32 %0) {
%2 = tail call i64 @malloc(i32 40)
%3 = inttoptr i64 %2 to i8*
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 12
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.checkTheme to i8*), i64 %8)
%10 = tail call i32 @strcpy(i8* %3, i8* %9)
br label %11
11: ; preds = %1, %6
%12 = tail call i32 @DataManager_GetIntValue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
%13 = add nsw i32 %0, -1
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %3, i64 1
store i8 120, i8* %16
br label %17
17: ; preds = %15, %11
ret i8* %3
}