#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*/ firstComputer(int);
int /*<<< orphan*/ firstUser(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sticks = 11, choice;
  printf("\nwho plays first ? 1. computer 2. user\n");
  scanf("%d", &choice);
  if (choice == 1)
    firstComputer(sticks);
  else if (choice == 2)
    firstUser(sticks);
  else
    printf("\ninvalid choice\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    1189 <main+0x49>
mov    -0x8(%rbp),%edi
call   1040 <firstComputer@plt>
jmp    11b1 <main+0x71>
cmpl   $0x2,-0xc(%rbp)
jne    11a0 <main+0x60>
mov    -0x8(%rbp),%edi
call   1050 <firstUser@plt>
jmp    11ac <main+0x6c>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    11b1 <main+0x71>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1178 <main+0x38>
cmp    $0x1,%eax
jne    1184 <main+0x44>
mov    $0xb,%edi
call   1040 <firstComputer@plt>
jmp    1190 <main+0x50>
mov    $0xb,%edi
call   1050 <firstUser@plt>
jmp    1190 <main+0x50>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\0Awho plays first ? 1. computer 2. user\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0Ainvalid choice\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 11, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @firstComputer(i32 %9)
br label %20
11: ; preds = %0
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = call i32 @firstUser(i32 %15)
br label %19
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
br label %20
20: ; preds = %19, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [39 x i8] c"\0Awho plays first ? 1. computer 2. user\00"
@str.3 = [16 x i8] c"\0Ainvalid choice\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %0
%7 = call i32 @firstComputer(i32 11)
br label %12
8: ; preds = %0
%9 = call i32 @firstUser(i32 11)
br label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
br label %12
12: ; preds = %8, %10, %6
ret i32 0
}