#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 rand();
char *ccode2(void) {
  int cca[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5,
               6, 7, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5,
               0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 0, 1, 0};
  switch (cca[rand() % 45]) {
  case 0:
    return "(2)ru(0)";
    break;
  case 1:
    return "(2)cn(0)";
    break;
  case 2:
    return "(2)ca(0)";
    break;
  case 3:
    return "(2)tw(0)";
    break;
  case 4:
    return "(2)bg(0)";
    break;
  case 5:
    return "(2)uk(0)";
    break;
  case 6:
    return "(2)in(0)";
    break;
  case 7:
    return "(2)mx(0)";
    break;
  case 8:
    return "(2)de(0)";
    break;
  }
}


x86 assembly (clang, -O0):
<ccode2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    0xefe(%rip),%rsi
lea    -0xc0(%rbp),%rdi
mov    $0xb4,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffffb60b60b7,%rcx,%rcx
shr    $0x20,%rcx
mov    %ecx,%edx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0x5,%edx
add    %ecx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,8),%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
mov    -0xc0(%rbp,%rax,4),%eax
mov    %rax,-0xc8(%rbp)
sub    $0x8,%rax
ja     122e <ccode2+0x10e>
mov    -0xc8(%rbp),%rax
lea    0xe66(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf3a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf2c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf25(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf1e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf17(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf10(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf09(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122e <ccode2+0x10e>
lea    0xf02(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccode2>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
lea    0xebe(%rip),%rcx
mov    (%rcx,%rax,4),%eax
add    $0xffffffff,%eax
cmp    $0x7,%eax
ja     115f <ccode2+0x4f>
cltq
lea    0xf5e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret
lea    0xf6e(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@__const.ccode2.cca = [45 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 0, i32 1, i32 2, i32 3, i32 4, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 0, i32 1, i32 0]
@.str = [9 x i8] c"(2)ru(0)\00"
@.str.1 = [9 x i8] c"(2)cn(0)\00"
@.str.2 = [9 x i8] c"(2)ca(0)\00"
@.str.3 = [9 x i8] c"(2)tw(0)\00"
@.str.4 = [9 x i8] c"(2)bg(0)\00"
@.str.5 = [9 x i8] c"(2)uk(0)\00"
@.str.6 = [9 x i8] c"(2)in(0)\00"
@.str.7 = [9 x i8] c"(2)mx(0)\00"
@.str.8 = [9 x i8] c"(2)de(0)\00"
define i8* @ccode2() {
%1 = alloca i8*
%2 = alloca [45 x i32]
%3 = bitcast [45 x i32]* %2 to i8*
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 45
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [45 x i32], [45 x i32]* %2, i64 0, i64 %6
%8 = load i32, i32* %7
switch i32 %8, label %18 [
i32 0, label %9
i32 1, label %10
i32 2, label %11
i32 3, label %12
i32 4, label %13
i32 5, label %14
i32 6, label %15
i32 7, label %16
i32 8, label %17
]
9: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
br label %18
10: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %18
11: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %18
12: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %1
br label %18
13: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %1
br label %18
14: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8** %1
br label %18
15: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %1
br label %18
16: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8** %1
br label %18
17: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8** %1
br label %18
18: ; preds = %9, %10, %11, %12, %13, %14, %15, %16, %17, %0
%19 = load i8*, i8** %1
ret i8* %19
}

LLVM IR (-O2):
@__const.ccode2.cca = [45 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 0, i32 1, i32 2, i32 3, i32 4, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 0, i32 1, i32 0]
@.str = [9 x i8] c"(2)ru(0)\00"
@.str.1 = [9 x i8] c"(2)cn(0)\00"
@.str.2 = [9 x i8] c"(2)ca(0)\00"
@.str.3 = [9 x i8] c"(2)tw(0)\00"
@.str.4 = [9 x i8] c"(2)bg(0)\00"
@.str.5 = [9 x i8] c"(2)uk(0)\00"
@.str.6 = [9 x i8] c"(2)in(0)\00"
@.str.7 = [9 x i8] c"(2)mx(0)\00"
@.str.8 = [9 x i8] c"(2)de(0)\00"
@reltable.ccode2 = [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.8 to i64), i64 ptrtoint ([8 x i32]* @reltable.ccode2 to i64)) to i32)]
define i8* @ccode2() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 45
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [45 x i32], [45 x i32]* @__const.ccode2.cca, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = add i32 %5, -1
%7 = icmp ult i32 %6, 8
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.ccode2 to i8*), i64 %10)
br label %12
12: ; preds = %8, %0
%13 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %0 ], [ %11, %8 ]
ret i8* %13
}