// File: tewalds[P]morat/hex/gtpgeneral.cpp
// Function: Morat::Hex::GTP::play(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Morat::Side)
GTPResponse GTP::play(const std::string & pos, Side to_play){
	if(to_play != hist->to_play())
		return GTPResponse(false, "It is the other player's turn!");

	if(hist->outcome() >= Outcome::DRAW)
		return GTPResponse(false, "The game is already over.");

	Move m(pos);

	if(!hist->valid_move(m))
		return GTPResponse(false, "Invalid move");

	move(m);

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

	return GTPResponse(true);
}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x40(%rsp)
movb %cl, %al
movq %rdi, %rcx
movq %rcx, 0x48(%rsp)
movq %rdi, 0x230(%rsp)
movb %al, 0x22f(%rsp)
movq %rsi, 0x220(%rsp)
movq %rdx, 0x218(%rsp)
movq 0x220(%rsp), %rdi
movq %rdi, 0x50(%rsp)
addq $0x68, %rdi
callq 0x3ea90
movq %rax, %rdi
callq 0x1a8a0
movb %al, 0x217(%rsp)
leaq 0x22f(%rsp), %rdi
leaq 0x217(%rsp), %rsi
callq 0x29c60
testb $0x1, %al
jne 0x40658
jmp 0x40703
leaq 0x1ef(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x5770
movq 0x38(%rsp), %rdx
leaq 0xfedb(%rip), %rsi      # 0x50551
leaq 0x1f0(%rsp), %rdi
callq 0x5590
jmp 0x40685
movq 0x40(%rsp), %rdi
xorl %esi, %esi
leaq 0x1f0(%rsp), %rdx
callq 0xd9a0
jmp 0x4069b
leaq 0x1f0(%rsp), %rdi
callq 0x5260
leaq 0x1ef(%rsp), %rdi
callq 0x5450
jmp 0x40c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x406f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x5260
leaq 0x1ef(%rsp), %rdi
callq 0x5450
jmp 0x40c61
movq 0x50(%rsp), %rdi
addq $0x68, %rdi
callq 0x3ea90
movq %rax, %rdi
callq 0x1a900
movb %al, 0x1db(%rsp)
leaq 0x1db(%rsp), %rdi
leaq 0x2cd94(%rip), %rsi     # 0x6d4c3
callq 0x1a8c0
testb $0x1, %al
jne 0x4073d
jmp 0x407e8
leaq 0x1b7(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x5770
movq 0x30(%rsp), %rdx
leaq 0xfe15(%rip), %rsi      # 0x50570
leaq 0x1b8(%rsp), %rdi
callq 0x5590
jmp 0x4076a
movq 0x40(%rsp), %rdi
xorl %esi, %esi
leaq 0x1b8(%rsp), %rdx
callq 0xd9a0
jmp 0x40780
leaq 0x1b8(%rsp), %rdi
callq 0x5260
leaq 0x1b7(%rsp), %rdi
callq 0x5450
jmp 0x40c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x407d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0x5260
leaq 0x1b7(%rsp), %rdi
callq 0x5450
jmp 0x40c61
movq 0x218(%rsp), %rsi
leaq 0x1b5(%rsp), %rdi
callq 0x1a5e0
movq 0x50(%rsp), %rdi
addq $0x68, %rdi
callq 0x3ea90
movq %rax, %rdi
leaq 0x1b5(%rsp), %rsi
callq 0x3f0c0
testb $0x1, %al
jne 0x408ce
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x5770
movq 0x28(%rsp), %rdx
leaq 0xfd49(%rip), %rsi      # 0x5058a
leaq 0x190(%rsp), %rdi
callq 0x5590
jmp 0x40850
movq 0x40(%rsp), %rdi
xorl %esi, %esi
leaq 0x190(%rsp), %rdx
callq 0xd9a0
jmp 0x40866
leaq 0x190(%rsp), %rdi
callq 0x5260
leaq 0x18f(%rsp), %rdi
callq 0x5450
jmp 0x40c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x408bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5260
leaq 0x18f(%rsp), %rdi
callq 0x5450
jmp 0x40c61
movq 0x50(%rsp), %rdi
leaq 0x1b5(%rsp), %rsi
callq 0x3ed80
movq 0x50(%rsp), %rax
cmpl $0x2, 0xc8(%rax)
jl 0x40bc3
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
leaq 0x1b5(%rsp), %rsi
callq 0x19f80
movq 0x20(%rsp), %rdx
leaq 0xfc7f(%rip), %rsi      # 0x50597
leaq 0xe8(%rsp), %rdi
callq 0x19f30
jmp 0x40927
leaq 0xfc75(%rip), %rdx      # 0x505a3
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xb910
jmp 0x40945
movq 0x50(%rsp), %rdi
addq $0x68, %rdi
callq 0x3ea90
movq %rax, 0x18(%rsp)
jmp 0x4095a
movq 0x18(%rsp), %rdi
callq 0x1a900
movb %al, 0x17(%rsp)
jmp 0x4096a
movb 0x17(%rsp), %al
movb %al, 0xa7(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0xa7(%rsp), %rsi
callq 0x47e40
jmp 0x4098c
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x19e40
jmp 0x409ab
leaq 0xbf36(%rip), %rdx      # 0x4c8e8
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0xb910
jmp 0x409c9
movq 0x50(%rsp), %rdi
addq $0x68, %rdi
callq 0x3ea90
movq %rax, 0x8(%rsp)
jmp 0x409de
movq 0x8(%rsp), %rsi
movq 0x50(%rsp), %rax
movzbl 0xcd(%rax), %edx
andl $0x1, %edx
leaq 0x80(%rsp), %rdi
callq 0x35f30
jmp 0x40a01
leaq 0x168(%rsp), %rdi
leaq 0x148(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x19e40
jmp 0x40a20
leaq 0x168(%rsp), %rdi
callq 0x1a9b0
jmp 0x40a2f
leaq 0x168(%rsp), %rdi
callq 0x5260
leaq 0x80(%rsp), %rdi
callq 0x5260
leaq 0x148(%rsp), %rdi
callq 0x5260
leaq 0x128(%rsp), %rdi
callq 0x5260
leaq 0xa8(%rsp), %rdi
callq 0x5260
leaq 0x108(%rsp), %rdi
callq 0x5260
leaq 0xe8(%rsp), %rdi
callq 0x5260
leaq 0xc8(%rsp), %rdi
callq 0x5260
jmp 0x40bc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40bb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40ba4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40b97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40b8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40b7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40b70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40b63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x5260
leaq 0x80(%rsp), %rdi
callq 0x5260
leaq 0x148(%rsp), %rdi
callq 0x5260
leaq 0x128(%rsp), %rdi
callq 0x5260
leaq 0xa8(%rsp), %rdi
callq 0x5260
leaq 0x108(%rsp), %rdi
callq 0x5260
leaq 0xe8(%rsp), %rdi
callq 0x5260
leaq 0xc8(%rsp), %rdi
callq 0x5260
jmp 0x40c61
leaq 0x5f(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x5770
movq (%rsp), %rdx
leaq 0xbd0d(%rip), %rsi      # 0x4c8e9
leaq 0x60(%rsp), %rdi
callq 0x5590
jmp 0x40be8
movq 0x40(%rsp), %rdi
movl $0x1, %esi
leaq 0x60(%rsp), %rdx
callq 0xd9a0
jmp 0x40bfe
leaq 0x60(%rsp), %rdi
callq 0x5260
leaq 0x5f(%rsp), %rdi
callq 0x5450
jmp 0x40c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
jmp 0x40c48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1e0(%rsp)
movl %eax, 0x1dc(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x5260
leaq 0x5f(%rsp), %rdi
callq 0x5450
jmp 0x40c61
movq 0x48(%rsp), %rax
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x1e0(%rsp), %rdi
callq 0x5760
nop