// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x68(%rsp), %r13
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movl %ecx, %ebp
xorl %edx, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x920c
movzbl 0x19(%r13), %eax
cmpl %ebp, %eax
jne 0xbe6c
leaq 0x68(%rsp), %r13
movq %r15, %rsi
xorl %edx, %edx
movq %r13, %rdi
callq 0x920c
movb 0x1a(%r13), %al
cmpb $-0x4, %al
jne 0xbe23
leaq 0x68(%rsp), %rdi
callq 0xd9e4
testb %al, %al
js 0xbeca
leaq 0x188(%rsp), %r15
leaq 0x178(%rsp), %r14
leaq 0x1d1ee(%rip), %rsi     # 0x29030
leaq 0x1d200(%rip), %rdx     # 0x29049
movq %r14, %rdi
movq %r15, -0x10(%r15)
callq 0xa810
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8dba
movq 0x178(%rsp), %rdi
jmp 0xbeab
leaq 0x1a8(%rsp), %r15
leaq 0x198(%rsp), %r14
leaq 0x1d18e(%rip), %rsi     # 0x29011
leaq 0x1d1a5(%rip), %rdx     # 0x2902f
movq %r14, %rdi
movq %r15, -0x10(%r15)
callq 0xa810
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8dba
movq 0x198(%rsp), %rdi
cmpq %r15, %rdi
je 0xbeb5
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
movl $0x8, %edx
movq %r12, %rsi
movq %r13, %rdi
callq 0xd07c
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x920c
movl (%r13), %eax
btl $0xb, %eax
jb 0xbfa5
leaq 0x1e0cd(%rip), %rcx     # 0x29fd0
movsbq %al, %rax
movq (%rcx,%rax,8), %rax
andq 0x68(%rsp), %rax
jne 0xbfa5
leaq 0x4(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xda48
movq 0x90(%r14), %rdi
movq %r12, %rsi
movq (%rdi), %rax
callq *0x28(%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1d111(%rip), %rsi     # 0x29057
leaq 0x1d10f(%rip), %rdx     # 0x2905c
leaq 0x8(%rsp), %rdi
callq 0xa810
leaq 0x8(%rsp), %rdi
cmpl $0x1, %ebp
movl $0x77, %eax
movl $0x62, %r8d
movq 0x8(%rdi), %rsi
cmovel %eax, %r8d
movl $0x1, %ecx
xorl %edx, %edx
callq 0x4600
leaq 0x58(%rsp), %rbp
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0xbfeb
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xbff4
leaq 0x168(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1d092(%rip), %rsi     # 0x2904a
leaq 0x1d097(%rip), %rdx     # 0x29056
leaq 0x158(%rsp), %rdi
callq 0xa810
leaq 0x158(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8dba
movq 0x158(%rsp), %rdi
jmp 0xc1f0
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
movl $0x20, %r8d
xorl %edx, %edx
callq 0x4600
leaq 0xa0(%rsp), %r12
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, -0x10(%r12)
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0xc057
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0xc061
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 0x999a
movq 0x98(%rsp), %r8
movq 0x30(%rsp), %rdx
movq 0x90(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %r12, %rcx
je 0xc0b8
movq 0xa0(%rsp), %rdi
movq 0x28(%rsp), %rsi
cmpq %rdi, %rax
jbe 0xc0db
leaq 0x38(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0xc0d6
movq 0x38(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xc0ea
leaq 0x90(%rsp), %rdi
callq 0x40b0
jmp 0xc0f8
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x78(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
je 0xc11c
movq %rsi, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0xc124
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rdx)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x68(%rsp), %rsi
movq %r14, %rdi
callq 0x9136
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc161
callq 0x42b0
leaq 0x38(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0xc174
callq 0x42b0
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0xc186
callq 0x42b0
movq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %r12
cmpq %rbp, %rdi
je 0xc19a
callq 0x42b0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc1a9
callq 0x42b0
cmpl $0x2, 0x50(%r14)
jge 0xc1fe
leaq 0x148(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c920(%rip), %rdx     # 0x28ae3
leaq 0x138(%rsp), %rdi
movq %rdx, %rsi
callq 0xa810
leaq 0x138(%rsp), %rdx
movl $0x1, %esi
movq %rbx, %rdi
callq 0x8dba
movq 0x138(%rsp), %rdi
cmpq %r14, %rdi
jne 0xbeb0
jmp 0xbeb5
leaq 0x1b8(%rsp), %r12
leaq 0x4(%rsp), %rsi
xorl %edx, %edx
movq %r12, %rdi
callq 0x999a
leaq 0x1ce41(%rip), %rcx     # 0x2905d
movl $0xb, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x128(%rsp), %r12
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, -0x10(%r12)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0xc256
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r12)
jmp 0xc269
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 0x1cdda(%rip), %rsi     # 0x29069
callq 0x4610
movq %r13, 0x28(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0xc2b4
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r13)
jmp 0xc2c1
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 0x920c
leaq 0xf8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x16f6c
movq 0x30(%rsp), %r8
movq 0x100(%rsp), %rdx
movq 0x28(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %r13, %rcx
je 0xc31f
movq 0x38(%rsp), %rdi
movq 0xf8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0xc34b
leaq 0x108(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0xc346
movq 0x108(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xc357
leaq 0x28(%rsp), %rdi
callq 0x40b0
jmp 0xc368
leaq 0xf8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x18(%rsp), %rsi
leaq 0x10(%rax), %rcx
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0xc388
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rsi)
jmp 0xc395
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1c729(%rip), %rsi     # 0x28ae2
leaq 0x8(%rsp), %rdi
callq 0x4610
movq %rbp, 0x48(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0xc3e2
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rbp)
jmp 0xc3ef
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 0x920c
movzbl 0x54(%r14), %edx
leaq 0xd8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x15e7a
movq 0x50(%rsp), %r8
movq 0xe0(%rsp), %rdx
movq 0x48(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %rbp, %rcx
je 0xc458
movq 0x58(%rsp), %rdi
movq 0xd8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0xc484
leaq 0xe8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0xc47f
movq 0xe8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xc490
leaq 0x48(%rsp), %rdi
callq 0x40b0
jmp 0xc4a1
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0xc8(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0xc4c3
vmovups (%rcx), %xmm0
vmovups %xmm0, (%rdx)
jmp 0xc4d6
movq %rsi, 0xb8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc8(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
leaq 0xc8(%rsp), %r14
movq %rsi, 0xc0(%rsp)
movq %rcx, (%rax)
movq 0x29ae5(%rip), %rax     # 0x35fe0
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x10(%r14), %rdi
movq (%rax), %rsi
callq 0x4320
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0xc51f
callq 0x42b0
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc535
callq 0x42b0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc544
callq 0x42b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xc558
callq 0x42b0
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc56e
callq 0x42b0
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xc57d
callq 0x42b0
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0xc58f
callq 0x42b0
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc1b0
callq 0x42b0
jmp 0xc1b0
leaq 0xe8(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0xc688
callq 0x42b0
jmp 0xc688
movq %rax, %rbx
jmp 0xc697
movq %rax, %rbx
jmp 0xc6ab
movq %rax, %rbx
jmp 0xc6d5
movq %rax, %rbx
jmp 0xc6e7
movq 0x138(%rsp), %rdi
jmp 0xc674
jmp 0xc680
leaq 0x78(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0xc61a
callq 0x42b0
jmp 0xc61a
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc632
callq 0x42b0
jmp 0xc632
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0xc649
callq 0x42b0
jmp 0xc649
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc65d
callq 0x42b0
jmp 0xc65d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
jmp 0xc6f3
movq 0x158(%rsp), %rdi
movq %rax, %rbx
cmpq %r14, %rdi
jne 0xc6f8
jmp 0xc6fd
jmp 0xc680
movq %rax, %rbx
jmp 0xc6fd
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xc697
callq 0x42b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xc6ab
callq 0x42b0
leaq 0x108(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc6c6
callq 0x42b0
jmp 0xc6c6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xc6d5
callq 0x42b0
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0xc6e7
callq 0x42b0
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc6fd
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
movq 0x178(%rsp), %rdi
jmp 0xc717
movq 0x198(%rsp), %rdi
movq %rax, %rbx
cmpq %r15, %rdi
jne 0xc6f8
jmp 0xc6fd
nop