#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*/ Manual();
int /*<<< orphan*/ SinglePlayer();
int /*<<< orphan*/ TwoPlayer();
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int play_input;
  char charr;
  srand((unsigned int)time(NULL));
  printf("%14s", "Welcome To Fekr o Bekr Game\n");
  printf("** Please Enter The 'Number' Of Your Intrested Item **\n\n\n");
  printf("Game Menu:\n");
  printf("1. Single Player Mode\n");
  printf("2. Two Player Mode\n");
  printf("3. Manual\n");
  printf("4. Exit\n");
  scanf("%d", &play_input);
  switch (play_input) {
  case 1:
    SinglePlayer();
  case 2:
    TwoPlayer();
  case 3:
    Manual();
    charr = getchar();
    main();
  case 4: {
    printf("Hope We See You Later Bro!\n");
    return (0);
  }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    -0x20(%rbp),%eax
lea    0xe54(%rip),%rdi
lea    0xe52(%rip),%rsi
mov    %al,-0x19(%rbp)
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     1297 <main+0x107>
mov    -0x18(%rbp),%rax
lea    0xdab(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1080 <SinglePlayer@plt>
mov    $0x0,%al
call   10b0 <TwoPlayer@plt>
mov    $0x0,%al
call   1040 <Manual@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x9(%rbp)
call   1090 <main@plt>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xe5a(%rip),%rdi
lea    0xe58(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe1f(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10b0 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1266 <main+0xc6>
lea    0xdd0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1090 <SinglePlayer@plt>
xor    %eax,%eax
call   10c0 <TwoPlayer@plt>
xor    %eax,%eax
call   1050 <Manual@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
call   10a0 <main@plt>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%14s\00"
@.str.1 = [29 x i8] c"Welcome To Fekr o Bekr Game\0A\00"
@.str.2 = [58 x i8] c"** Please Enter The 'Number' Of Your Intrested Item **\0A\0A\0A\00"
@.str.3 = [12 x i8] c"Game Menu:\0A\00"
@.str.4 = [23 x i8] c"1. Single Player Mode\0A\00"
@.str.5 = [20 x i8] c"2. Two Player Mode\0A\00"
@.str.6 = [11 x i8] c"3. Manual\0A\00"
@.str.7 = [9 x i8] c"4. Exit\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [28 x i8] c"Hope We See You Later Bro!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
switch i32 %15, label %26 [
i32 1, label %16
i32 2, label %18
i32 3, label %20
i32 4, label %24
]
16: ; preds = %0
%17 = call i32 (...) @SinglePlayer()
br label %18
18: ; preds = %0, %16
%19 = call i32 (...) @TwoPlayer()
br label %20
20: ; preds = %0, %18
%21 = call i32 (...) @Manual()
%22 = call signext i8 (...) @getchar()
store i8 %22, i8* %3
%23 = call i32 @main()
br label %24
24: ; preds = %0, %20
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %1
br label %26
26: ; preds = %24, %0
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"%14s\00"
@.str.1 = [29 x i8] c"Welcome To Fekr o Bekr Game\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@str = [57 x i8] c"** Please Enter The 'Number' Of Your Intrested Item **\0A\0A\00"
@str.10 = [11 x i8] c"Game Menu:\00"
@str.11 = [22 x i8] c"1. Single Player Mode\00"
@str.12 = [19 x i8] c"2. Two Player Mode\00"
@str.13 = [10 x i8] c"3. Manual\00"
@str.14 = [8 x i8] c"4. Exit\00"
@str.15 = [27 x i8] c"Hope We See You Later Bro!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.12, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.13, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.14, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
switch i32 %14, label %25 [
i32 1, label %15
i32 2, label %17
i32 3, label %19
i32 4, label %23
]
15: ; preds = %0
%16 = call i32 (...) @SinglePlayer()
br label %17
17: ; preds = %0, %15
%18 = call i32 (...) @TwoPlayer()
br label %19
19: ; preds = %0, %17
%20 = call i32 (...) @Manual()
%21 = call signext i8 (...) @getchar()
%22 = call i32 @main()
br label %23
23: ; preds = %0, %19
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.15, i64 0, i64 0))
br label %25
25: ; preds = %0, %23
ret i32 0
}