// File: 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:
subq $0x338, %rsp            # imm = 0x338
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0x330(%rsp)
movq %rsi, 0x328(%rsp)
movq %rdx, 0x320(%rsp)
movl %ecx, 0x31c(%rsp)
movq 0x328(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movl 0x31c(%rsp), %eax
movl %eax, 0x48(%rsp)
addq $0x38, %rdi
callq 0x15f80
movl %eax, %ecx
movl 0x48(%rsp), %eax
cmpl %ecx, %eax
je 0x140cd
leaq 0x2f7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x4670
movq 0x28(%rsp), %rdx
leaq 0x29f85(%rip), %rsi     # 0x3dfc5
leaq 0x2f8(%rsp), %rdi
callq 0x44d0
jmp 0x1404f
movq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x2f8(%rsp), %rdx
callq 0xb680
jmp 0x14065
leaq 0x2f8(%rsp), %rdi
callq 0x4210
leaq 0x2f7(%rsp), %rdi
callq 0x43f0
jmp 0x147e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x140bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x2f8(%rsp), %rdi
callq 0x4210
leaq 0x2f7(%rsp), %rdi
callq 0x43f0
jmp 0x147f3
movq 0x40(%rsp), %rsi
addq $0x38, %rsi
leaq 0x2b8(%rsp), %rdi
xorl %edx, %edx
callq 0xcf40
leaq 0x2b8(%rsp), %rdi
callq 0x15fb0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x141a9
leaq 0x297(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x4670
movq 0x20(%rsp), %rdx
leaq 0x29ec8(%rip), %rsi     # 0x3dfe4
leaq 0x298(%rsp), %rdi
callq 0x44d0
jmp 0x1412b
movq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x298(%rsp), %rdx
callq 0xb680
jmp 0x14141
leaq 0x298(%rsp), %rdi
callq 0x4210
leaq 0x297(%rsp), %rdi
callq 0x43f0
jmp 0x147e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x14197
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x298(%rsp), %rdi
callq 0x4210
leaq 0x297(%rsp), %rdi
callq 0x43f0
jmp 0x147f3
movq 0x320(%rsp), %rsi
leaq 0x290(%rsp), %rdi
movl $0x8, %edx
callq 0x155f0
movq 0x40(%rsp), %rdi
addq $0x38, %rdi
leaq 0x290(%rsp), %rsi
callq 0x15ff0
testb $0x1, %al
jne 0x1428c
leaq 0x26f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x4670
movq 0x18(%rsp), %rdx
leaq 0x29dff(%rip), %rsi     # 0x3dffe
leaq 0x270(%rsp), %rdi
callq 0x44d0
jmp 0x1420e
movq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x270(%rsp), %rdx
callq 0xb680
jmp 0x14224
leaq 0x270(%rsp), %rdi
callq 0x4210
leaq 0x26f(%rsp), %rdi
callq 0x43f0
jmp 0x147e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x1427a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x270(%rsp), %rdi
callq 0x4210
leaq 0x26f(%rsp), %rdi
callq 0x43f0
jmp 0x147f3
movq 0x40(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x16030
leaq 0x1e7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x4670
movq 0x10(%rsp), %rdx
leaq 0x29d4f(%rip), %rsi     # 0x3e00b
leaq 0x1e8(%rsp), %rdi
callq 0x44d0
jmp 0x142cb
movl 0x31c(%rsp), %eax
subl $0x1, %eax
movl $0x77, %eax
movl $0x62, %edx
cmovel %eax, %edx
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0xe420
jmp 0x142f9
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
movl $0x20, %edx
callq 0xe420
jmp 0x14315
leaq 0x1c0(%rsp), %rdi
leaq 0x290(%rsp), %rsi
xorl %edx, %edx
callq 0xdec0
jmp 0x1432e
leaq 0x248(%rsp), %rdi
leaq 0x228(%rsp), %rsi
leaq 0x1c0(%rsp), %rdx
callq 0xe470
jmp 0x1434d
movq 0x40(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0xcc20
jmp 0x14361
leaq 0x248(%rsp), %rdi
callq 0x4210
leaq 0x1c0(%rsp), %rdi
callq 0x4210
leaq 0x228(%rsp), %rdi
callq 0x4210
leaq 0x208(%rsp), %rdi
callq 0x4210
leaq 0x1e8(%rsp), %rdi
callq 0x4210
leaq 0x1e7(%rsp), %rdi
callq 0x43f0
movq 0x40(%rsp), %rax
cmpl $0x2, 0x50(%rax)
jl 0x14755
leaq 0x100(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0x290(%rsp), %rsi
xorl %edx, %edx
callq 0xdec0
movq 0x8(%rsp), %rdx
leaq 0x29c2b(%rip), %rsi     # 0x3e011
leaq 0x120(%rsp), %rdi
callq 0xe5f0
jmp 0x143f5
leaq 0x29c21(%rip), %rdx     # 0x3e01d
leaq 0x140(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x93b0
jmp 0x14413
movq 0x40(%rsp), %rsi
addq $0x38, %rsi
leaq 0xb8(%rsp), %rdi
xorl %edx, %edx
callq 0xcf40
jmp 0x1442d
leaq 0xe0(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x20f70
jmp 0x14444
leaq 0x160(%rsp), %rdi
leaq 0x140(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
callq 0xe470
jmp 0x14463
leaq 0x29646(%rip), %rdx     # 0x3dab0
leaq 0x180(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x93b0
jmp 0x14481
movq 0x40(%rsp), %rsi
addq $0x38, %rsi
leaq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0xcf40
jmp 0x14498
movq 0x40(%rsp), %rax
movzbl 0x54(%rax), %edx
andl $0x1, %edx
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x1f740
jmp 0x144b8
leaq 0x1a0(%rsp), %rdi
leaq 0x180(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0xe470
jmp 0x144d7
leaq 0x1a0(%rsp), %rdi
callq 0x15ad0
jmp 0x144e6
leaq 0x1a0(%rsp), %rdi
callq 0x4210
leaq 0x98(%rsp), %rdi
callq 0x4210
leaq 0x180(%rsp), %rdi
callq 0x4210
leaq 0x160(%rsp), %rdi
callq 0x4210
leaq 0xe0(%rsp), %rdi
callq 0x4210
leaq 0x140(%rsp), %rdi
callq 0x4210
leaq 0x120(%rsp), %rdi
callq 0x4210
leaq 0x100(%rsp), %rdi
callq 0x4210
jmp 0x14755
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x1461c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x1460f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x14602
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x145f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x145e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x248(%rsp), %rdi
callq 0x4210
leaq 0x1c0(%rsp), %rdi
callq 0x4210
leaq 0x228(%rsp), %rdi
callq 0x4210
leaq 0x208(%rsp), %rdi
callq 0x4210
leaq 0x1e8(%rsp), %rdi
callq 0x4210
leaq 0x1e7(%rsp), %rdi
callq 0x43f0
jmp 0x147f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x14743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x14736
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x14729
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x1471c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x1470f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x14702
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x146f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x4210
leaq 0x98(%rsp), %rdi
callq 0x4210
leaq 0x180(%rsp), %rdi
callq 0x4210
leaq 0x160(%rsp), %rdi
callq 0x4210
leaq 0xe0(%rsp), %rdi
callq 0x4210
leaq 0x140(%rsp), %rdi
callq 0x4210
leaq 0x120(%rsp), %rdi
callq 0x4210
leaq 0x100(%rsp), %rdi
callq 0x4210
jmp 0x147f3
leaq 0x4f(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x4670
movq (%rsp), %rdx
leaq 0x29343(%rip), %rsi     # 0x3dab1
leaq 0x50(%rsp), %rdi
callq 0x44d0
jmp 0x1477a
movq 0x30(%rsp), %rdi
movl $0x1, %esi
leaq 0x50(%rsp), %rdx
callq 0xb680
jmp 0x14790
leaq 0x50(%rsp), %rdi
callq 0x4210
leaq 0x4f(%rsp), %rdi
callq 0x43f0
jmp 0x147e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
jmp 0x147da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2e8(%rsp)
movl %eax, 0x2e4(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x4210
leaq 0x4f(%rsp), %rdi
callq 0x43f0
jmp 0x147f3
movq 0x38(%rsp), %rax
addq $0x338, %rsp            # imm = 0x338
retq
movq 0x2e8(%rsp), %rdi
callq 0x4660