int main() {
  int n, num;
  char movie_list[][100] = {"DON", "Om Shanti Om", "3 Idiots",
                            "Mera Naam Joker", "Ready"};
  char text[100];
  n = 5;
  num = select_movie(movie_list, n);
  strcpy(text, movie_list[num]);
  printf("\n\n\n\t\t\tBOLLYWOOD\n\n");
  printf("*********************************************************************"
         "********");
  printf("\n\n\t\tRules : \n\n\t1. You need to guess the movie by entering the "
         "letter and filling the missing letters."
         "\n\n\t2. You have only 9 chances.");
  printf("\n\n*****************************************************************"
         "************\n\n");
  bollywood_game(text);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x200(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x1f4,%edx
call   1070 <memcpy@plt>
movl   $0x5,-0x8(%rbp)
lea    -0x200(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1050 <select_movie@plt>
mov    %eax,-0xc(%rbp)
lea    -0x270(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    -0x200(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
lea    0x103a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x103e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x107e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x10f4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x270(%rbp),%rdi
mov    $0x0,%al
call   1060 <bollywood_game@plt>
xor    %eax,%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x270,%rsp
lea    0xe91(%rip),%rsi
lea    0x70(%rsp),%rbx
mov    $0x1f4,%edx
mov    %rbx,%rdi
call   1080 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <select_movie@plt>
cltq
imul   $0x64,%rax,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x70,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x1116(%rip),%rdi
call   1040 <puts@plt>
lea    0x1038(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1078(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10ff(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <bollywood_game@plt>
xor    %eax,%eax
add    $0x270,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.movie_list = [5 x [100 x i8]] [[100 x i8] c"DON\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"Om Shanti Om\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"3 Idiots\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"Mera Naam Joker\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"Ready\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [18 x i8] c"\0A\0A\0A\09\09\09BOLLYWOOD\0A\0A\00"
@.str.1 = [78 x i8] c"*****************************************************************************\00"
@.str.2 = [132 x i8] c"\0A\0A\09\09Rules : \0A\0A\091. You need to guess the movie by entering the letter and filling the missing letters.\0A\0A\092. You have only 9 chances.\00"
@.str.3 = [82 x i8] c"\0A\0A*****************************************************************************\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x [100 x i8]]
%5 = alloca [100 x i8]
store i32 0, i32* %1
%6 = bitcast [5 x [100 x i8]]* %4 to i8*
store i32 5, i32* %2
%7 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %4, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 ([100 x i8]*, i32, ...) bitcast (i32 (...)* @select_movie to i32 ([100 x i8]*, i32, ...)*)([100 x i8]* %7, i32 %8)
store i32 %9, i32* %3
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %4, i64 0, i64 %12
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%15 = call i8* @strcpy(i8* %10, i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.3, i64 0, i64 0))
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @bollywood_game to i32 (i8*, ...)*)(i8* %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.movie_list = [5 x [100 x i8]] [[100 x i8] c"DON\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"Om Shanti Om\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"3 Idiots\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"Mera Naam Joker\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"Ready\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str.1 = [78 x i8] c"*****************************************************************************\00"
@.str.2 = [132 x i8] c"\0A\0A\09\09Rules : \0A\0A\091. You need to guess the movie by entering the letter and filling the missing letters.\0A\0A\092. You have only 9 chances.\00"
@str = [17 x i8] c"\0A\0A\0A\09\09\09BOLLYWOOD\0A\00"
@str.4 = [81 x i8] c"\0A\0A*****************************************************************************\0A\00"
define i32 @main() {
%1 = alloca [5 x [100 x i8]]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %1, i64 0, i64 0
%6 = call i32 ([100 x i8]*, i32, ...) bitcast (i32 (...)* @select_movie to i32 ([100 x i8]*, i32, ...)*)([100 x i8]* %5, i32 5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %1, i64 0, i64 %7, i64 0
%9 = call i8* @strcpy(i8* %4, i8* %8)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @bollywood_game to i32 (i8*, ...)*)(i8* %4)
ret i32 0
}