#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 /*<<< orphan*/ scanf(char *, int *);
void playerMove(int board[9]) {
  int move = 0;
  do {
  start:
    printf("\nInput move ([0..8]): ");
    scanf("%d", &move);
    if (board[move] != 0) {
      printf("Its Already Occupied !");
      goto start;
    }
    printf("\n");
  } while (move >= 9 || move < 0 && board[move] == 0);
  board[move] = -1;
}


x86 assembly (clang, -O0):
<playerMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1138 <playerMove+0x18>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1177 <playerMove+0x57>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    1138 <playerMove+0x18>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x9,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jge    11b9 <playerMove+0x99>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xe(%rbp)
jge    11b3 <playerMove+0x93>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
sete   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1133 <playerMove+0x13>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playerMove>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xeb1(%rip),%r14
lea    0xec1(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xeb8(%rip),%r13
jmp    1178 <playerMove+0x48>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
cmpl   $0x0,(%rbx,%rax,4)
jne    1170 <playerMove+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq 0xc(%rsp),%rcx
cmp    $0x8,%rcx
jg     1178 <playerMove+0x48>
mov    %ecx,%eax
test   %ecx,%ecx
jns    11b9 <playerMove+0x89>
cmpl   $0x0,(%rbx,%rcx,4)
je     1178 <playerMove+0x48>
cltq
movl   $0xffffffff,(%rbx,%rax,4)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0AInput move ([0..8]): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Its Already Occupied !\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @playerMove(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %33, %1
br label %5
5: ; preds = %14, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %5
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %5
16: ; preds = %5
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %3
%20 = icmp sge i32 %19, 9
br i1 %20, label %33, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = load i32*, i32** %2
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br label %31
31: ; preds = %24, %21
%32 = phi i1 [ false, %21 ], [ %30, %24 ]
br label %33
33: ; preds = %31, %18
%34 = phi i1 [ true, %18 ], [ %32, %31 ]
br i1 %34, label %4, label %35
35: ; preds = %33
%36 = load i32*, i32** %2
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
store i32 -1, i32* %39
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AInput move ([0..8]): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Its Already Occupied !\00"
define void @playerMove(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %34, %1
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %21, label %12
12: ; preds = %4, %12
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %0, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %12
21: ; preds = %12, %4
%22 = call i32 @putchar(i32 10)
%23 = load i32, i32* %2
%24 = icmp sgt i32 %23, 8
br i1 %24, label %34, label %25
25: ; preds = %21
%26 = icmp slt i32 %23, 0
br i1 %26, label %29, label %27
27: ; preds = %25
%28 = zext i32 %23 to i64
br label %37
29: ; preds = %25
%30 = sext i32 %23 to i64
%31 = getelementptr inbounds i32, i32* %0, i64 %30
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %29, %21
br label %4
35: ; preds = %29
%36 = sext i32 %23 to i64
br label %37
37: ; preds = %35, %27
%38 = phi i64 [ %28, %27 ], [ %36, %35 ]
%39 = getelementptr inbounds i32, i32* %0, i64 %38
store i32 -1, i32* %39
ret void
}