#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*/ menuSelection(int *, char *, char **, int);
int /*<<< orphan*/ multiplayer();
int /*<<< orphan*/ singleplayer();
void chooseMode(void) {
  int menuChoice;
  char *numberOfPlayersOptions[] = {"1. One player (you vs computer)",
                                    "2. Two players (you vs friend)"};
  menuSelection(&menuChoice, "NUMBER OF PLAYERS", numberOfPlayersOptions, 2);
  menuChoice == 1 ? singleplayer() : multiplayer();
}


x86 assembly (clang, -O0):
<chooseMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdx
lea    -0x4(%rbp),%rdi
lea    0xee2(%rip),%rsi
mov    $0x2,%ecx
call   1050 <menuSelection@plt>
cmpl   $0x1,-0x4(%rbp)
jne    117d <chooseMode+0x4d>
mov    $0x0,%al
call   1040 <singleplayer@plt>
jmp    1184 <chooseMode+0x54>
mov    $0x0,%al
call   1030 <multiplayer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chooseMode>:
sub    $0x28,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xef8(%rip),%rsi
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    $0x2,%ecx
call   1050 <menuSelection@plt>
cmpl   $0x1,0xc(%rsp)
jne    116e <chooseMode+0x3e>
xor    %eax,%eax
call   1040 <singleplayer@plt>
add    $0x28,%rsp
ret
xor    %eax,%eax
call   1030 <multiplayer@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"1. One player (you vs computer)\00"
@.str.1 = [31 x i8] c"2. Two players (you vs friend)\00"
@__const.chooseMode.numberOfPlayersOptions = [2 x i8*] [i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [18 x i8] c"NUMBER OF PLAYERS\00"
define void @chooseMode() {
%1 = alloca i32
%2 = alloca [2 x i8*]
%3 = bitcast [2 x i8*]* %2 to i8*
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%5 = call i32 @menuSelection(i32* %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %4, i32 2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @singleplayer()
br label %12
10: ; preds = %0
%11 = call i32 (...) @multiplayer()
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"1. One player (you vs computer)\00"
@.str.1 = [31 x i8] c"2. Two players (you vs friend)\00"
@__const.chooseMode.numberOfPlayersOptions = [2 x i8*] [i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [18 x i8] c"NUMBER OF PLAYERS\00"
define void @chooseMode() {
%1 = alloca i32
%2 = alloca [2 x i8*]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [2 x i8*]* %2 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%6 = call i32 @menuSelection(i32* %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %5, i32 2)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @singleplayer()
br label %13
11: ; preds = %0
%12 = call i32 (...) @multiplayer()
br label %13
13: ; preds = %11, %9
ret void
}