// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/gtpgeneral.cpp
// Function: PentagoGTP::play(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
GTPResponse PentagoGTP::play(const string & pos, int toplay){
	if(toplay != game.toplay())
		return GTPResponse(false, "It is the other player's turn!");

	if(game.getboard().won() >= 0)
		return GTPResponse(false, "The game is already over.");

	Move m(pos);

	if(!game.valid(m))
		return GTPResponse(false, "Invalid move");

	move(m);

	log(string("play ") + (toplay == 1 ? 'w' : 'b') + ' ' + m.to_s());

	if(verbose >= 2)
		logerr("Placement: " + m.to_s() + ", outcome: " + game.getboard().won_str() + "\n" + game.getboard().to_s(colorboard));

	return GTPResponse(true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
leaq 0x38(%rsi), %r15
movq %rdi, %rbx
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r14
movq %r15, %rdi
callq 0xae4e
cmpl %ebp, %eax
jne 0x9f53
leaq 0x8(%rsp), %r13
movq %r15, %rsi
xorl %edx, %edx
movq %r13, %rdi
callq 0x7a62
movq %r13, %rdi
callq 0xae70
testb %al, %al
js 0x9fa0
leaq 0x130db(%rip), %rsi     # 0x1d000
leaq 0x158(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x40f0
leaq 0x158(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x761c
leaq 0x158(%rsp), %rdi
jmp 0x9f86
leaq 0x13087(%rip), %rsi     # 0x1cfe1
leaq 0x178(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x40f0
leaq 0x178(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x761c
leaq 0x178(%rsp), %rdi
callq 0x4130
movq %rbx, %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4(%rsp), %r13
pushq $0x8
popq %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0xaa8c
movq %r15, %rdi
movq %r13, %rsi
callq 0xae86
testb %al, %al
je 0xa20f
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xaeb4
leaq 0x1304d(%rip), %rsi     # 0x1d027
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x40f0
cmpl $0x1, %ebp
pushq $0x77
popq %rax
pushq $0x62
popq %rdx
cmovel %eax, %edx
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x8343
leaq 0xb0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
pushq $0x20
popq %rdx
callq 0x8343
leaq 0x30(%rsp), %rdi
leaq 0x4(%rsp), %rsi
xorl %edx, %edx
callq 0x8178
leaq 0x8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x8365
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x79e4
leaq 0x8(%rsp), %rdi
callq 0x4130
leaq 0x30(%rsp), %rdi
callq 0x4130
leaq 0xb0(%rsp), %rdi
callq 0x4130
leaq 0x70(%rsp), %rdi
callq 0x4130
leaq 0x50(%rsp), %rdi
callq 0x4130
cmpl $0x2, 0x50(%r14)
jl 0xa1d6
leaq 0x198(%rsp), %r12
leaq 0x4(%rsp), %rsi
xorl %edx, %edx
movq %r12, %rdi
callq 0x8178
leaq 0x12f7e(%rip), %rsi     # 0x1d02d
leaq 0x90(%rsp), %rdi
movq %r12, %rdx
callq 0x8423
leaq 0x12f73(%rip), %rdx     # 0x1d039
leaq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x6821
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x7a62
leaq 0x118(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10396
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x8365
leaq 0x129a1(%rip), %rdx     # 0x1cab8
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x6821
leaq 0xb0(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x7a62
movzbl 0x54(%r14), %edx
leaq 0xf8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xf8fc
leaq 0x1b8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x8365
leaq 0x1b8(%rsp), %r14
movq %r14, %rdi
callq 0xac65
movq %r14, %rdi
callq 0x4130
leaq 0xf8(%rsp), %rdi
callq 0x4130
leaq 0x70(%rsp), %rdi
callq 0x4130
leaq 0x50(%rsp), %rdi
callq 0x4130
leaq 0x118(%rsp), %rdi
callq 0x4130
leaq 0x30(%rsp), %rdi
callq 0x4130
leaq 0x90(%rsp), %rdi
callq 0x4130
leaq 0x198(%rsp), %rdi
callq 0x4130
leaq 0x128dc(%rip), %rsi     # 0x1cab9
leaq 0xd8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x40f0
pushq $0x1
popq %rsi
leaq 0xd8(%rsp), %rdx
movq %rbx, %rdi
callq 0x761c
leaq 0xd8(%rsp), %rdi
jmp 0x9f86
leaq 0x12e04(%rip), %rsi     # 0x1d01a
leaq 0x138(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x40f0
leaq 0x138(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x761c
leaq 0x138(%rsp), %rdi
jmp 0x9f86
leaq 0xf8(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xa270
movq %rax, %rbx
jmp 0xa27a
movq %rax, %rbx
jmp 0xa284
movq %rax, %rbx
jmp 0xa2b2
movq %rax, %rbx
jmp 0xa2bf
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x4130
leaq 0x50(%rsp), %rdi
callq 0x4130
leaq 0x118(%rsp), %rdi
callq 0x4130
jmp 0xa2a8
leaq 0xd8(%rsp), %rdi
jmp 0xa334
jmp 0xa33e
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4130
leaq 0x90(%rsp), %rdi
callq 0x4130
leaq 0x198(%rsp), %rdi
jmp 0xa337
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xa2db
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4130
jmp 0xa2ea
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x4130
jmp 0xa2fc
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x4130
jmp 0xa315
leaq 0x138(%rsp), %rdi
jmp 0xa334
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0xa337
jmp 0xa33e
jmp 0xa33e
leaq 0x158(%rsp), %rdi
jmp 0xa334
jmp 0xa33e
leaq 0x178(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xa341
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4590
nop