// File: tewalds[P]pentagod/gtpagent.cpp
// Function: PentagoGTP::gtp_genmove(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
GTPResponse PentagoGTP::gtp_genmove(vecstr args){
	if(game.getboard().won() >= 0)
		return GTPResponse(true, "resign");

	double use_time = (args.size() >= 2 ? from_str<double>(args[1]) : get_time());

	if(verbose)
		logerr("time:        remain: " + to_str(time_remain, 1) + ", use: " + to_str(use_time, 3) + ", sims: " + to_str(time.max_sims) + "\n");

	Time start;
	agent->search(use_time, time.max_sims, verbose);
	time_used(Time() - start);


	Move best = agent->return_move(verbose);

	move(best);

	if(verbose >= 2)
		logerr(game.getboard().to_s(colorboard) + "\n");

	return GTPResponse(true, best.to_s());
}

// Assembly:
subq $0x298, %rsp            # imm = 0x298
movq %rdx, 0x38(%rsp)
movq %rdi, 0x40(%rsp)
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq %rdi, 0x290(%rsp)
movq %rsi, 0x288(%rsp)
movq %rdx, 0x280(%rsp)
movq 0x288(%rsp), %rsi
movq %rsi, 0x50(%rsp)
addq $0x38, %rsi
leaq 0x258(%rsp), %rdi
xorl %edx, %edx
callq 0xcf40
leaq 0x258(%rsp), %rdi
callq 0x15fb0
movsbl %al, %eax
cmpl $0x0, %eax
jl 0x19de8
leaq 0x237(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x4670
movq 0x30(%rsp), %rdx
leaq 0x23d24(%rip), %rsi     # 0x3da7c
leaq 0x238(%rsp), %rdi
callq 0x44d0
jmp 0x19d67
movq 0x40(%rsp), %rdi
movl $0x1, %esi
leaq 0x238(%rsp), %rdx
callq 0xb680
jmp 0x19d80
leaq 0x238(%rsp), %rdi
callq 0x4210
leaq 0x237(%rsp), %rdi
callq 0x43f0
jmp 0x1a2e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x19dd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x4210
leaq 0x237(%rsp), %rdi
callq 0x43f0
jmp 0x1a2f0
movq 0x38(%rsp), %rdi
callq 0xcbe0
cmpq $0x2, %rax
jb 0x19e17
movq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0xcc00
movq %rax, %rdi
callq 0x1e430
vmovsd %xmm0, 0x28(%rsp)
jmp 0x19e27
movq 0x50(%rsp), %rdi
callq 0x19410
vmovsd %xmm0, 0x28(%rsp)
movq 0x50(%rsp), %rax
vmovsd 0x28(%rsp), %xmm0
vmovsd %xmm0, 0x218(%rsp)
cmpl $0x0, 0x50(%rax)
je 0x1a126
movq 0x50(%rsp), %rax
vmovsd 0x80(%rax), %xmm0
leaq 0x138(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movl $0x1, %esi
callq 0x1e870
movq 0x20(%rsp), %rdx
leaq 0x247a8(%rip), %rsi     # 0x3e61d
leaq 0x158(%rsp), %rdi
callq 0xe5f0
jmp 0x19e84
leaq 0x247a8(%rip), %rdx     # 0x3e633
leaq 0x178(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x93b0
jmp 0x19ea2
vmovsd 0x218(%rsp), %xmm0
leaq 0x118(%rsp), %rdi
movl $0x3, %esi
callq 0x1e870
jmp 0x19ebf
leaq 0x198(%rsp), %rdi
leaq 0x178(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0xe470
jmp 0x19ede
leaq 0x2472f(%rip), %rdx     # 0x3e614
leaq 0x1b8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x93b0
jmp 0x19efc
movq 0x50(%rsp), %rax
movl 0x7c(%rax), %esi
leaq 0xf8(%rsp), %rdi
callq 0x16070
jmp 0x19f13
leaq 0x1d8(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0xe470
jmp 0x19f32
leaq 0x23b77(%rip), %rdx     # 0x3dab0
leaq 0x1f8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x93b0
jmp 0x19f50
leaq 0x1f8(%rsp), %rdi
callq 0x15ad0
jmp 0x19f5f
leaq 0x1f8(%rsp), %rdi
callq 0x4210
leaq 0x1d8(%rsp), %rdi
callq 0x4210
leaq 0xf8(%rsp), %rdi
callq 0x4210
leaq 0x1b8(%rsp), %rdi
callq 0x4210
leaq 0x198(%rsp), %rdi
callq 0x4210
leaq 0x118(%rsp), %rdi
callq 0x4210
leaq 0x178(%rsp), %rdi
callq 0x4210
leaq 0x158(%rsp), %rdi
callq 0x4210
leaq 0x138(%rsp), %rdi
callq 0x4210
jmp 0x1a126
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a114
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a107
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a0fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a0ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a0e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a0d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a0c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a0b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x1f8(%rsp), %rdi
callq 0x4210
leaq 0x1d8(%rsp), %rdi
callq 0x4210
leaq 0xf8(%rsp), %rdi
callq 0x4210
leaq 0x1b8(%rsp), %rdi
callq 0x4210
leaq 0x198(%rsp), %rdi
callq 0x4210
leaq 0x118(%rsp), %rdi
callq 0x4210
leaq 0x178(%rsp), %rdi
callq 0x4210
leaq 0x158(%rsp), %rdi
callq 0x4210
leaq 0x138(%rsp), %rdi
callq 0x4210
jmp 0x1a2f0
leaq 0xf0(%rsp), %rdi
callq 0x5500
movq 0x50(%rsp), %rax
movq 0x90(%rax), %rdi
vmovsd 0x218(%rsp), %xmm0
movslq 0x7c(%rax), %rsi
movl 0x50(%rax), %edx
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0xe8(%rsp), %rdi
callq 0x5500
leaq 0xe8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x116e0
movq 0x50(%rsp), %rdi
callq 0x19570
movq 0x50(%rsp), %rax
movq 0x90(%rax), %rdi
movl 0x50(%rax), %esi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x50(%rsp), %rdi
movw %ax, 0xe4(%rsp)
leaq 0xe4(%rsp), %rsi
callq 0x16030
movq 0x50(%rsp), %rax
cmpl $0x2, 0x50(%rax)
jl 0x1a288
movq 0x50(%rsp), %rsi
addq $0x38, %rsi
leaq 0x78(%rsp), %rdi
movq %rdi, 0x10(%rsp)
xorl %edx, %edx
callq 0xcf40
movq 0x50(%rsp), %rax
movq 0x10(%rsp), %rsi
movzbl 0x54(%rax), %edx
andl $0x1, %edx
leaq 0xa0(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x1f740
movq 0x18(%rsp), %rsi
leaq 0x238a8(%rip), %rdx     # 0x3dab0
leaq 0xc0(%rsp), %rdi
callq 0x93b0
jmp 0x1a217
leaq 0xc0(%rsp), %rdi
callq 0x15ad0
jmp 0x1a226
leaq 0xc0(%rsp), %rdi
callq 0x4210
leaq 0xa0(%rsp), %rdi
callq 0x4210
jmp 0x1a288
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x1a279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x4210
leaq 0xa0(%rsp), %rdi
callq 0x4210
jmp 0x1a2f0
leaq 0x58(%rsp), %rdi
movq %rdi, 0x8(%rsp)
leaq 0xe4(%rsp), %rsi
xorl %edx, %edx
callq 0xdec0
movq 0x40(%rsp), %rdi
movq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0xb680
jmp 0x1a2b7
leaq 0x58(%rsp), %rdi
callq 0x4210
jmp 0x1a2e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x4210
jmp 0x1a2f0
movq 0x48(%rsp), %rax
addq $0x298, %rsp            # imm = 0x298
retq
movq 0x228(%rsp), %rdi
callq 0x4660
nopl (%rax)