// File: /workspace/github_cpp_makefile_star2_O3/tewalds[P]morat/hex/gtpagent.cpp
// Function: Morat::Hex::GTP::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 GTP::gtp_genmove(vecstr args){
	if(hist->outcome() >= 0)
		return GTPResponse(true, "resign");

	double use_time = (args.size() >= 2 ? from_str<double>(args[1]) : 0);
	if (use_time == 0)
		use_time = time_control.get_time(hist.len(), hist->moves_remain(), agent->gamelen());

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

	Time start;
	agent->search(use_time, time_control.max_sims, verbose);
	time_control.use(Time() - start);


	Move best = agent->return_move(verbose);

	move(best);

	if(verbose >= 2)
		logerr(hist->to_s(colorboard) + "\n");

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movb 0x89(%rsi), %al
movq %rdi, %rbx
testb %al, %al
js 0x20d6f
leaq 0x118(%rsp), %r15
leaq 0x108(%rsp), %r14
leaq 0x11a67(%rip), %rsi     # 0x3278c
leaq 0x11a66(%rip), %rdx     # 0x32792
movq %r14, %rdi
movq %r15, -0x10(%r15)
callq 0xb1dc
movl $0x1, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa8ba
movq 0x108(%rsp), %rdi
cmpq %r15, %rdi
je 0x20d5a
callq 0x52e0
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rdx), %rdi
movq 0x8(%rdx), %rcx
movq %rsi, %r14
subq %rdi, %rcx
cmpq $0x21, %rcx
jb 0x20d9e
addq $0x20, %rdi
callq 0x28d4a
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm1, %xmm0
jne 0x20deb
jp 0x20deb
movb 0x89(%r14), %al
movq 0x70(%r14), %r12
movq 0xd8(%r14), %rdi
leaq 0x15601(%rip), %rcx     # 0x363b1
movswl 0x82(%r14), %edx
movswl 0x84(%r14), %esi
xorl %ebp, %ebp
leaq 0x30(%r14), %r15
subq 0x68(%r14), %r12
subl %esi, %edx
shrq %r12
cmpb (%rcx), %al
movq (%rdi), %rax
cmovll %edx, %ebp
callq *0x50(%rax)
vcvttsd2si %xmm0, %ecx
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x28dd4
cmpl $0x0, 0xc8(%r14)
vmovsd %xmm0, 0x20(%rsp)
jne 0x20f2f
movq %rsp, %r12
leaq 0x68(%r14), %r15
movq %r12, %rdi
xorl %esi, %esi
callq 0x55b0
movq 0xd8(%r14), %rdi
vmovsd 0x20(%rsp), %xmm0
movq 0x58(%r14), %rsi
movl 0xc8(%r14), %edx
movq (%r12), %r13
movq 0x8(%r12), %rbp
movq (%rdi), %rax
callq *0x10(%rax)
movq %rsp, %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x55b0
vpbroadcastq 0x8(%r12), %xmm1
vmovdqa (%r12), %xmm0
vpinsrq $0x1, %rbp, %xmm1, %xmm1
vpinsrq $0x1, %r13, %xmm0, %xmm0
vcvtqq2pd %xmm1, %xmm1
vdivpd 0x1019b(%rip){1to2}, %xmm1, %xmm1 # 0x31008
vcvtqq2pd %xmm0, %xmm0
kmovb 0x50(%r14), %k1
vaddpd %xmm0, %xmm1, %xmm0
vmovsd 0x48(%r14), %xmm1
vhsubpd %xmm0, %xmm0, %xmm0
vsubsd %xmm0, %xmm1, %xmm0
vxorpd %xmm1, %xmm1, %xmm1
vminsd %xmm1, %xmm0, %xmm2
vmovsd %xmm0, %xmm2, %xmm2 {%k1}
vaddsd 0x60(%r14), %xmm2, %xmm0
vmaxsd %xmm0, %xmm1, %xmm0
vmovsd %xmm0, 0x60(%r14)
movq 0xd8(%r14), %rdi
movl 0xc8(%r14), %esi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x28(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movw %ax, (%r12)
callq 0x290d4
movq 0xd8(%r14), %rdi
movq %r12, %rsi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x2, 0xc8(%r14)
jge 0x20f89
leaq 0x128(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x10e7e
movl $0x1, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa8ba
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x20d55
jmp 0x20d5a
vmovsd 0x60(%r14), %xmm0
leaq 0x148(%rsp), %r15
movl $0x1, %esi
movq %r15, %rdi
callq 0x2f6e8
leaq 0x13bd1(%rip), %rcx     # 0x34b22
movl $0x15, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0xd8(%rsp), %r15
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, -0x10(%r15)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x20fca
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r15)
jmp 0x20fdd
movzbl 0xcd(%r14), %edx
subq $-0x80, %r14
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1f644
leaq 0x1095c(%rip), %rsi     # 0x31906
movq %r15, %rdi
callq 0x56e0
leaq 0x168(%rsp), %rdi
movq %rsp, %rdx
movq %rax, %rsi
callq 0x5b1e
jmp 0x20ef0
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
movq 0x8(%rax), %rdx
leaq 0xc8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x13b35(%rip), %rsi     # 0x34b38
callq 0x56e0
vmovsd 0x20(%rsp), %xmm0
leaq 0x78(%rsp), %r12
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, -0x10(%r12)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x21033
vmovupd (%rcx), %xmm1
vmovupd %xmm1, (%r12)
jmp 0x21040
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xa8(%rsp), %rdi
movl $0x3, %esi
callq 0x2f6e8
movq 0x70(%rsp), %r8
movq 0xb0(%rsp), %rdx
movq 0x68(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %r12, %rcx
je 0x2108f
movq 0x78(%rsp), %rdi
movq 0xa8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x210bb
leaq 0xb8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x210b6
movq 0xb8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x210c7
leaq 0x68(%rsp), %rdi
callq 0x50c0
jmp 0x210d8
leaq 0xa8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x58(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0x210f7
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x21104
movq %rsi, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x139f1(%rip), %rsi     # 0x34b19
leaq 0x48(%rsp), %rdi
callq 0x56e0
leaq 0x38(%rsp), %r13
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, -0x10(%r13)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x21156
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r13)
jmp 0x21163
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)
movq 0x58(%r14), %rsi
leaq 0x88(%rsp), %rdi
callq 0x28e47
movq 0x30(%rsp), %r8
movq 0x90(%rsp), %rdx
movq 0x28(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %r13, %rcx
je 0x211b1
movq 0x38(%rsp), %rdi
movq 0x88(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x211dd
leaq 0x98(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x211d8
movq 0x98(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x211e9
leaq 0x28(%rsp), %rdi
callq 0x50c0
jmp 0x211fa
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x10(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0x21219
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x21225
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x106bd(%rip), %rsi     # 0x31906
movq %rsp, %rdi
callq 0x56e0
leaq 0xf8(%rsp), %rbp
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x21277
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x2128a
movq %rdx, 0xe8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf8(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0xf0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x27d24(%rip), %rax     # 0x48fd0
movq 0xe8(%rsp), %rdi
movq (%rax), %rsi
callq 0x5370
movq 0xe8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x212ce
callq 0x52e0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x212e1
callq 0x52e0
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x212f7
callq 0x52e0
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x21306
callq 0x52e0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21319
callq 0x52e0
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2132f
callq 0x52e0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x2133e
callq 0x52e0
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x21350
callq 0x52e0
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20dff
callq 0x52e0
jmp 0x20dff
leaq 0x10(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x2138a
callq 0x52e0
jmp 0x2138a
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x213a5
callq 0x52e0
jmp 0x213a5
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x213b9
callq 0x52e0
jmp 0x213b9
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x213d1
callq 0x52e0
jmp 0x213d1
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x213ec
callq 0x52e0
jmp 0x213ec
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x21400
callq 0x52e0
jmp 0x21400
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x21421
callq 0x52e0
jmp 0x21421
movq %rax, %rbx
leaq 0x10(%rsp), %rax
jmp 0x21429
movq %rax, %rbx
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21437
callq 0x52e0
movq %rbx, %rdi
callq 0x5670
movq %rax, %rbx
leaq 0x138(%rsp), %rax
jmp 0x21429
movq 0x108(%rsp), %rdi
movq %rax, %rbx
cmpq %r15, %rdi
jne 0x21432
jmp 0x21437