#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 /*<<< orphan*/ list;

/* Variables and functions */
int rand();
const char *compliment() {
  char *list[] = {"Good Job!",
                  "You are great!",
                  "You're a genius!",
                  "Do it again!",
                  "You're awesome!",
                  "Keep up the good work!",
                  "You'll learn this in no time!",
                  "Memorizing master!",
                  "You're a star!",
                  "Bringing down the house!",
                  "Memorizer style!",
                  "Beethoven must have written a symphony about you!",
                  "Wow!",
                  "Keep climbing the mountain, three steps at a time!",
                  "Fabulous",
                  "Marvelous",
                  "I stand in awe at your mental prowess",
                  "Good like Superman",
                  "Rockin' it",
                  "More magical than Harry Potter"};
  int listLen = sizeof(list) / sizeof(list[0]);
  int select = rand() % listLen;
  return list[select];
}


x86 assembly (clang, -O0):
<compliment>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    -0xa0(%rbp),%rdi
lea    0x2c47(%rip),%rsi
mov    $0xa0,%edx
call   1030 <memcpy@plt>
movl   $0x14,-0xa4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0xa4(%rbp)
mov    %edx,-0xa8(%rbp)
movslq -0xa8(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compliment>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
lea    0x1069(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Good Job!\00"
@.str.1 = [15 x i8] c"You are great!\00"
@.str.2 = [17 x i8] c"You're a genius!\00"
@.str.3 = [13 x i8] c"Do it again!\00"
@.str.4 = [16 x i8] c"You're awesome!\00"
@.str.5 = [23 x i8] c"Keep up the good work!\00"
@.str.6 = [30 x i8] c"You'll learn this in no time!\00"
@.str.7 = [19 x i8] c"Memorizing master!\00"
@.str.8 = [15 x i8] c"You're a star!\00"
@.str.9 = [25 x i8] c"Bringing down the house!\00"
@.str.10 = [17 x i8] c"Memorizer style!\00"
@.str.11 = [50 x i8] c"Beethoven must have written a symphony about you!\00"
@.str.12 = [5 x i8] c"Wow!\00"
@.str.13 = [51 x i8] c"Keep climbing the mountain, three steps at a time!\00"
@.str.14 = [9 x i8] c"Fabulous\00"
@.str.15 = [10 x i8] c"Marvelous\00"
@.str.16 = [38 x i8] c"I stand in awe at your mental prowess\00"
@.str.17 = [19 x i8] c"Good like Superman\00"
@.str.18 = [11 x i8] c"Rockin' it\00"
@.str.19 = [31 x i8] c"More magical than Harry Potter\00"
@__const.compliment.list = [20 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.19, i32 0, i32 0)]
define i8* @compliment() {
%1 = alloca [20 x i8*]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [20 x i8*]* %1 to i8*
store i32 20, i32* %2
%5 = call i32 (...) @rand()
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [20 x i8*], [20 x i8*]* %1, i64 0, i64 %9
%11 = load i8*, i8** %10
ret i8* %11
}

LLVM IR (-O2):
@.str = [10 x i8] c"Good Job!\00"
@.str.1 = [15 x i8] c"You are great!\00"
@.str.2 = [17 x i8] c"You're a genius!\00"
@.str.3 = [13 x i8] c"Do it again!\00"
@.str.4 = [16 x i8] c"You're awesome!\00"
@.str.5 = [23 x i8] c"Keep up the good work!\00"
@.str.6 = [30 x i8] c"You'll learn this in no time!\00"
@.str.7 = [19 x i8] c"Memorizing master!\00"
@.str.8 = [15 x i8] c"You're a star!\00"
@.str.9 = [25 x i8] c"Bringing down the house!\00"
@.str.10 = [17 x i8] c"Memorizer style!\00"
@.str.11 = [50 x i8] c"Beethoven must have written a symphony about you!\00"
@.str.12 = [5 x i8] c"Wow!\00"
@.str.13 = [51 x i8] c"Keep climbing the mountain, three steps at a time!\00"
@.str.14 = [9 x i8] c"Fabulous\00"
@.str.15 = [10 x i8] c"Marvelous\00"
@.str.16 = [38 x i8] c"I stand in awe at your mental prowess\00"
@.str.17 = [19 x i8] c"Good like Superman\00"
@.str.18 = [11 x i8] c"Rockin' it\00"
@.str.19 = [31 x i8] c"More magical than Harry Potter\00"
@reltable.compliment = [20 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.1 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.2 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.3 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.4 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.5 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.6 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.7 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.8 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([25 x i8]* @.str.9 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.10 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([50 x i8]* @.str.11 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([51 x i8]* @.str.13 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.14 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.15 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([38 x i8]* @.str.16 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.17 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.18 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.19 to i64), i64 ptrtoint ([20 x i32]* @reltable.compliment to i64)) to i32)]
define i8* @compliment() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = sext i32 %2 to i64
%4 = shl i64 %3, 2
%5 = call i8* @llvm.load.relative.i64(i8* bitcast ([20 x i32]* @reltable.compliment to i8*), i64 %4)
ret i8* %5
}