#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 */
scalar_t__ board_count_moves(int /*<<< orphan*/);
scalar_t__ board_get_position(int, int);
char strat_can_play_any_corner(char *, char *);
char strat_can_play_corner_or_center(char *row, char *col) {
  if (board_count_moves(0) == 0) {
    return strat_can_play_any_corner(row, col);
  } else {
    if (board_get_position(1, 1) == 0) {
      *row = 1;
      *col = 1;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<strat_can_play_corner_or_center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1050 <board_count_moves@plt>
cmp    $0x0,%rax
jne    1166 <strat_can_play_corner_or_center+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strat_can_play_any_corner@plt>
mov    %al,-0x1(%rbp)
jmp    119c <strat_can_play_corner_or_center+0x6c>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <board_get_position@plt>
cmp    $0x0,%rax
jne    1193 <strat_can_play_corner_or_center+0x63>
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax)
movb   $0x1,-0x1(%rbp)
jmp    119c <strat_can_play_corner_or_center+0x6c>
jmp    1198 <strat_can_play_corner_or_center+0x68>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strat_can_play_corner_or_center>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <board_count_moves@plt>
test   %rax,%rax
je     115e <strat_can_play_corner_or_center+0x2e>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <board_get_position@plt>
test   %rax,%rax
je     1170 <strat_can_play_corner_or_center+0x40>
xor    %eax,%eax
jmp    1179 <strat_can_play_corner_or_center+0x49>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strat_can_play_any_corner@plt>
movb   $0x1,(%rbx)
movb   $0x1,(%r14)
mov    $0x1,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @strat_can_play_corner_or_center(i8* %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = call i64 @board_count_moves(i32 0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call signext i8 @strat_can_play_any_corner(i8* %9, i8* %10)
store i8 %11, i8* %3
br label %20
12: ; preds = %2
%13 = call i64 @board_get_position(i32 1, i32 1)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %4
store i8 1, i8* %16
%17 = load i8*, i8** %5
store i8 1, i8* %17
store i8 1, i8* %3
br label %20
18: ; preds = %12
br label %19
19: ; preds = %18
store i8 0, i8* %3
br label %20
20: ; preds = %19, %15, %8
%21 = load i8, i8* %3
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @strat_can_play_corner_or_center(i8* %0, i8* %1) {
%3 = tail call i64 @board_count_moves(i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call signext i8 @strat_can_play_any_corner(i8* %0, i8* %1)
br label %11
7: ; preds = %2
%8 = tail call i64 @board_get_position(i32 1, i32 1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 1, i8* %0
store i8 1, i8* %1
br label %11
11: ; preds = %7, %10, %5
%12 = phi i8 [ %6, %5 ], [ 1, %10 ], [ 0, %7 ]
ret i8 %12
}