getmove(board) int board[];
{
  int Move;
  do {
    do {
      move(9, 40);
      printw("Your move: ");
      refresh();
    } while (scanf("%d", &Move) != 1);
  } while (board[Move]);
  board[Move] = 4;
  draw(board);
}


x86 assembly (clang, -O0):
<getmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
jmp    1161 <getmove+0x11>
mov    $0x9,%edi
mov    $0x28,%esi
mov    $0x0,%al
call   1070 <move@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
lea    0xe7e(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1161 <getmove+0x11>
jmp    11a7 <getmove+0x57>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    115c <getmove+0xc>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x4,(%rax,%rcx,4)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <draw@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmove>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xe9e(%rip),%r15
lea    0xea3(%rip),%r12
lea    0x4(%rsp),%rbx
xchg   %ax,%ax
mov    $0x9,%edi
mov    $0x28,%esi
xor    %eax,%eax
call   1070 <move@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1170 <getmove+0x20>
movslq 0x4(%rsp),%rax
cmpl   $0x0,(%r14,%rax,4)
jne    1170 <getmove+0x20>
movl   $0x4,(%r14,%rax,4)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <draw@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Your move: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getmove(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
br label %5
5: ; preds = %14, %1
br label %6
6: ; preds = %10, %5
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 9, i32 40)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @refresh()
br label %10
10: ; preds = %6
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = icmp ne i32 %11, 1
br i1 %12, label %6, label %13
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %5, label %21
21: ; preds = %14
%22 = load i32*, i32** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
store i32 4, i32* %25
%26 = load i32*, i32** %3
%27 = call i32 (i32*, ...) bitcast (i32 (...)* @draw to i32 (i32*, ...)*)(i32* %26)
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@.str = [12 x i8] c"Your move: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getmove(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %10, %1
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 9, i32 40)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @refresh()
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = icmp eq i32 %8, 1
br i1 %9, label %11, label %10
10: ; preds = %4, %11
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %10
17: ; preds = %11
%18 = sext i32 %12 to i64
%19 = getelementptr inbounds i32, i32* %0, i64 %18
store i32 4, i32* %19
%20 = call i32 (i32*, ...) bitcast (i32 (...)* @draw to i32 (i32*, ...)*)(i32* %0)
ret i32 undef
}