// File: /workspace/github_cpp_makefile_star2_O1/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
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rsi), %r15
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x91ca
movzbl 0x19(%r13), %eax
cmpl %ebp, %eax
jne 0xbf04
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x91ca
cmpb $-0x4, 0x1a(%r13)
jne 0xbeb5
leaq 0x68(%rsp), %r13
movq %r13, %rdi
callq 0xdab0
movb %al, 0x1a(%r13)
cmpb $0x0, 0x82(%rsp)
js 0xbf62
leaq 0x188(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1e16a(%rip), %rsi     # 0x2a040
leaq 0x1e17c(%rip), %rdx     # 0x2a059
leaq 0x178(%rsp), %r14
movq %r14, %rdi
callq 0xa874
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8d7a
movq 0x178(%rsp), %rdi
jmp 0xbf43
leaq 0x1a8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1e10a(%rip), %rsi     # 0x2a021
leaq 0x1e121(%rip), %rdx     # 0x2a03f
leaq 0x198(%rsp), %r14
movq %r14, %rdi
callq 0xa874
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8d7a
movq 0x198(%rsp), %rdi
cmpq %r15, %rdi
je 0xbf4d
callq 0x42b0
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
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0xd110
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x91ca
movl (%r13), %eax
btl $0xb, %eax
jb 0xc03d
movsbq %al, %rax
leaq 0x1f031(%rip), %rcx     # 0x2afd0
movq (%rcx,%rax,8), %rax
andq 0x68(%rsp), %rax
jne 0xc03d
leaq 0x4(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xdb14
movq 0x90(%r14), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x28(%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1e089(%rip), %rsi     # 0x2a067
leaq 0x1e087(%rip), %rdx     # 0x2a06c
leaq 0x8(%rsp), %rdi
callq 0xa874
cmpl $0x1, %ebp
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rsi
movl $0x77, %eax
movl $0x62, %r8d
cmovel %eax, %r8d
movl $0x1, %ecx
xorl %edx, %edx
callq 0x4600
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc083
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xc08c
leaq 0x168(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1e00a(%rip), %rsi     # 0x2a05a
leaq 0x1e00f(%rip), %rdx     # 0x2a066
leaq 0x158(%rsp), %rdi
callq 0xa874
leaq 0x158(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8d7a
movq 0x158(%rsp), %rdi
jmp 0xc289
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rdi), %rsi
movl $0x1, %ecx
xorl %edx, %edx
movl $0x20, %r8d
callq 0x4600
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc0ef
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0xc0f9
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x98(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
leaq 0x4(%rsp), %rsi
xorl %edx, %edx
callq 0x99d8
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %r8
movq 0x30(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0xc150
movq 0xa0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xc16f
leaq 0x38(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0xc16a
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xc183
movq 0x28(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x40b0
jmp 0xc191
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x78(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0xc1b5
movq %rsi, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0xc1bd
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x68(%rsp), %rsi
movq %r14, %rdi
callq 0x90f4
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc1fa
callq 0x42b0
leaq 0x38(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0xc20d
callq 0x42b0
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0xc21f
callq 0x42b0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x18(%rsp), %r12
je 0xc233
callq 0x42b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc242
callq 0x42b0
cmpl $0x2, 0x50(%r14)
jge 0xc297
leaq 0x148(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1d887(%rip), %rdx     # 0x29ae3
leaq 0x138(%rsp), %rdi
movq %rdx, %rsi
callq 0xa874
leaq 0x138(%rsp), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x8d7a
movq 0x138(%rsp), %rdi
cmpq %r14, %rdi
jne 0xbf48
jmp 0xbf4d
leaq 0x1b8(%rsp), %r12
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x99d8
leaq 0x1ddb8(%rip), %rcx     # 0x2a06d
movl $0xb, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x128(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xc2ef
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r12)
jmp 0xc302
movq %rdx, 0x118(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x128(%rsp)
movq 0x8(%rax), %rdx
leaq 0x118(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1dd51(%rip), %rsi     # 0x2a079
callq 0x4610
movq %r13, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xc34d
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r13)
jmp 0xc35a
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x91ca
leaq 0xf8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x1714e
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x100(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0xc3b8
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xc3dd
leaq 0x108(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0xc3d8
movq 0x108(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xc3f1
movq 0xf8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x40b0
jmp 0xc402
leaq 0xf8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jne 0xc422
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rsi)
jmp 0xc42f
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1d68f(%rip), %rsi     # 0x29ae2
leaq 0x8(%rsp), %rdi
callq 0x4610
movq %rbp, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xc47c
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rbp)
jmp 0xc489
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x91ca
movzbl 0x54(%r14), %edx
leaq 0xd8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x15f84
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0xe0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbp, %rcx
je 0xc4f2
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xc517
leaq 0xe8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0xc512
movq 0xe8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xc52b
movq 0xd8(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x40b0
jmp 0xc53c
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0xc8(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0xc55e
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rdx)
jmp 0xc571
movq %rsi, 0xb8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc8(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xc0(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x2aa48(%rip), %rax     # 0x36fe0
movq (%rax), %rsi
leaq 0xc8(%rsp), %r14
movq -0x10(%r14), %rdi
callq 0x4320
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0xc5ba
callq 0x42b0
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc5d0
callq 0x42b0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc5df
callq 0x42b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xc5f3
callq 0x42b0
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc609
callq 0x42b0
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xc618
callq 0x42b0
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0xc62a
callq 0x42b0
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc249
callq 0x42b0
jmp 0xc249
movq %rax, %rbx
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc726
callq 0x42b0
jmp 0xc726
movq %rax, %rbx
jmp 0xc735
movq %rax, %rbx
jmp 0xc749
movq %rax, %rbx
jmp 0xc773
movq %rax, %rbx
jmp 0xc785
movq %rax, %rbx
movq 0x138(%rsp), %rdi
jmp 0xc715
jmp 0xc71e
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc6b8
callq 0x42b0
jmp 0xc6b8
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc6d0
callq 0x42b0
jmp 0xc6d0
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0xc6e7
callq 0x42b0
jmp 0xc6e7
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc6fb
callq 0x42b0
jmp 0xc6fb
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
jmp 0xc791
movq %rax, %rbx
movq 0x158(%rsp), %rdi
cmpq %r14, %rdi
jne 0xc796
jmp 0xc79b
jmp 0xc71e
movq %rax, %rbx
jmp 0xc79b
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc735
callq 0x42b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xc749
callq 0x42b0
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc764
callq 0x42b0
jmp 0xc764
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xc773
callq 0x42b0
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0xc785
callq 0x42b0
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc79b
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
movq %rax, %rbx
movq 0x178(%rsp), %rdi
jmp 0xc7bb
movq %rax, %rbx
movq 0x198(%rsp), %rdi
cmpq %r15, %rdi
jne 0xc796
jmp 0xc79b