#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*/ printf(char *);
int game_print_welcome_msg(int roomNumber) {
  if (roomNumber == 0) {
    printf("\nYou're in the basement.I have to admit, the carpet you're "
           "standing on has some pretty questionable looking stains. You "
           "should probably get out of here.\n");
  } else if (roomNumber == 1) {
    printf("\n\n");
  } else if (roomNumber == 2) {
    printf("\nCongrats you're in a loft. Well done.... Not really. No one is "
           "impressed\n");
  } else if (roomNumber == 3) {
    printf("\nYou're now in an Arena. Don't ask me how you got here. You're "
           "the one that decided to go this way.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<game_print_welcome_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <game_print_welcome_msg+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <game_print_welcome_msg+0x81>
cmpl   $0x1,-0x4(%rbp)
jne    1151 <game_print_welcome_msg+0x41>
lea    0xf53(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <game_print_welcome_msg+0x7c>
cmpl   $0x2,-0x4(%rbp)
jne    116c <game_print_welcome_msg+0x5c>
lea    0xf3b(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <game_print_welcome_msg+0x77>
cmpl   $0x3,-0x4(%rbp)
jne    1182 <game_print_welcome_msg+0x72>
lea    0xf6b(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <game_print_welcome_msg+0x77>
jmp    118c <game_print_welcome_msg+0x7c>
jmp    1191 <game_print_welcome_msg+0x81>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_print_welcome_msg>:
cmp    $0x3,%edi
ja     1130 <game_print_welcome_msg+0x20>
push   %rax
movslq %edi,%rax
lea    0x102c(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [154 x i8] c"\0AYou're in the basement.I have to admit, the carpet you're standing on has some pretty questionable looking stains. You should probably get out of here.\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
@.str.2 = [75 x i8] c"\0ACongrats you're in a loft. Well done.... Not really. No one is impressed\0A\00"
@.str.3 = [101 x i8] c"\0AYou're now in an Arena. Don't ask me how you got here. You're the one that decided to go this way.\0A\00"
define i32 @game_print_welcome_msg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
br label %25
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %24
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
br label %23
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
br label %23
23: ; preds = %22, %15
br label %24
24: ; preds = %23, %10
br label %25
25: ; preds = %24, %5
ret i32 0
}

LLVM IR (-O2):
@str = [100 x i8] c"\0AYou're now in an Arena. Don't ask me how you got here. You're the one that decided to go this way.\00"
@str.4 = [74 x i8] c"\0ACongrats you're in a loft. Well done.... Not really. No one is impressed\00"
@str.5 = [2 x i8] c"\0A\00"
@str.6 = [153 x i8] c"\0AYou're in the basement.I have to admit, the carpet you're standing on has some pretty questionable looking stains. You should probably get out of here.\00"
@reltable.game_print_welcome_msg = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([153 x i8]* @str.6 to i64), i64 ptrtoint ([4 x i32]* @reltable.game_print_welcome_msg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @str.5 to i64), i64 ptrtoint ([4 x i32]* @reltable.game_print_welcome_msg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([74 x i8]* @str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.game_print_welcome_msg to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([100 x i8]* @str to i64), i64 ptrtoint ([4 x i32]* @reltable.game_print_welcome_msg to i64)) to i32)]
define i32 @game_print_welcome_msg(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.game_print_welcome_msg to i8*), i64 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
br label %8
8: ; preds = %1, %3
ret i32 0
}