// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rsi), %r15
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x91ca
cmpb $-0x4, 0x1a(%r13)
jne 0xfff2
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xdab0
movb %al, 0x1a(%r13)
cmpb $0x0, 0x2a(%rsp)
js 0x1005a
leaq 0x128(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19aa2(%rip), %rsi     # 0x29aae
leaq 0x19aa1(%rip), %rdx     # 0x29ab4
leaq 0x118(%rsp), %r14
movq %r14, %rdi
callq 0xa874
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x8d7a
movq 0x118(%rsp), %rdi
cmpq %r15, %rdi
je 0x10045
callq 0x42b0
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %rdi
movq 0x8(%r12), %rax
subq %rdi, %rax
cmpq $0x21, %rax
jb 0x10077
addq $0x20, %rdi
callq 0x153df
jmp 0x1007f
movq %r14, %rdi
callq 0xf6e6
vmovsd %xmm0, 0x8(%rsp)
cmpl $0x0, 0x50(%r14)
jne 0x10193
leaq 0x10(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x4500
movq (%r12), %r13
movq 0x8(%r12), %rbp
movq 0x90(%r14), %rdi
movslq 0x7c(%r14), %rsi
movl 0x50(%r14), %edx
movq (%rdi), %rax
vmovsd 0x8(%rsp), %xmm0
callq *0x10(%rax)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x4500
vmovdqa (%r12), %xmm0
vpbroadcastq 0x8(%r12), %xmm1
vpinsrq $0x1, %r13, %xmm0, %xmm0
vcvtqq2pd %xmm0, %xmm0
vpinsrq $0x1, %rbp, %xmm1, %xmm1
vcvtqq2pd %xmm1, %xmm1
vdivpd 0x18f07(%rip){1to2}, %xmm1, %xmm1 # 0x29008
vaddpd %xmm0, %xmm1, %xmm0
vhsubpd %xmm0, %xmm0, %xmm0
movq %r14, %rdi
callq 0xf7b8
movq 0x90(%r14), %rdi
movl 0x50(%r14), %esi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x38(%rsp), %r12
movw %ax, (%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0xdb14
movq 0x90(%r14), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x28(%rax)
cmpl $0x2, 0x50(%r14)
jge 0x101f2
leaq 0x138(%rsp), %r14
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x99d8
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x8d7a
leaq 0x148(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x10040
jmp 0x10045
vmovsd 0x80(%r14), %xmm0
leaq 0x158(%rsp), %r12
movq %r12, %rdi
movl $0x1, %esi
callq 0x1579c
leaq 0x1a4b5(%rip), %rcx     # 0x2a66d
movl $0x15, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0xe8(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x10247
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r12)
jmp 0x1025a
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x91ca
movzbl 0x54(%r14), %edx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x15f84
leaq 0x198c2(%rip), %rsi     # 0x29ae2
movq %r14, %rdi
callq 0x4610
leaq 0x178(%rsp), %rdi
leaq 0x58(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rax, %rsi
callq 0x47f7
jmp 0x10152
movq %rdx, 0xd8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe8(%rsp)
movq 0x8(%rax), %rdx
leaq 0xd8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1a403(%rip), %rsi     # 0x2a683
callq 0x4610
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x102ac
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r13)
jmp 0x102bc
movq %rdx, 0x78(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x88(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x80(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb8(%rsp), %rdi
vmovsd 0x8(%rsp), %xmm0
movl $0x3, %esi
callq 0x1579c
movq 0x78(%rsp), %rcx
movq 0x80(%rsp), %r8
movq 0xc0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x1031a
movq 0x88(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1033f
leaq 0xc8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x1033a
movq 0xc8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x10353
movq 0xb8(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x40b0
jmp 0x10364
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x48(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x10383
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x10390
movq %rsi, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1a2b0(%rip), %rsi     # 0x2a664
leaq 0x38(%rsp), %rdi
callq 0x4610
leaq 0x68(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x103e1
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x103ee
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x7c(%r14), %esi
leaq 0x98(%rsp), %rdi
callq 0xd56b
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %r8
movq 0xa0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbp, %rcx
je 0x1043c
movq 0x68(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x10461
leaq 0xa8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x1045c
movq 0xa8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x10475
movq 0x98(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x40b0
jmp 0x10486
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x20(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x104a5
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x104b2
movq %rsi, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq %r12, %r13
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x19609(%rip), %rsi     # 0x29ae2
leaq 0x10(%rsp), %rdi
callq 0x4610
leaq 0x108(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x1050b
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r12)
jmp 0x1051e
movq %rdx, 0xf8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x108(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x100(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x26aa0(%rip), %rax     # 0x36fe0
movq (%rax), %rsi
movq 0xf8(%rsp), %rdi
callq 0x4320
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0x10562
callq 0x42b0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10575
callq 0x42b0
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1058b
callq 0x42b0
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1059a
callq 0x42b0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq 0x88(%rsp), %r12
je 0x105b5
callq 0x42b0
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x105cb
callq 0x42b0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x105da
callq 0x42b0
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x105ec
callq 0x42b0
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10090
callq 0x42b0
jmp 0x10090
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10629
callq 0x42b0
jmp 0x10629
movq %r12, %r13
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10647
callq 0x42b0
jmp 0x10647
movq %r12, %r13
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1065e
callq 0x42b0
jmp 0x1065e
movq %r12, %r13
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10679
callq 0x42b0
jmp 0x10679
movq %r12, %r13
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10697
callq 0x42b0
jmp 0x10697
movq %r12, %r13
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x106b6
callq 0x42b0
jmp 0x106b6
movq %r12, %r13
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x106d7
callq 0x42b0
jmp 0x106d7
movq %rax, %rbx
leaq 0x68(%rsp), %rax
jmp 0x106df
movq %rax, %rbx
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x106ed
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
movq %rax, %rbx
leaq 0x148(%rsp), %rax
jmp 0x106df
movq %rax, %rbx
movq 0x118(%rsp), %rdi
cmpq %r15, %rdi
jne 0x106e8
jmp 0x106ed