// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x38(%rsi), %r15
leaq 0x10(%rsp), %r13
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
xorl %edx, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x920c
movb 0x1a(%r13), %al
cmpb $-0x4, %al
jne 0xfef8
leaq 0x10(%rsp), %rdi
callq 0xd9e4
testb %al, %al
js 0xff5d
leaq 0x128(%rsp), %r15
leaq 0x118(%rsp), %r14
leaq 0x18b9b(%rip), %rsi     # 0x28aae
leaq 0x18b9a(%rip), %rdx     # 0x28ab4
movq %r14, %rdi
movq %r15, -0x10(%r15)
callq 0xa810
movl $0x1, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8dba
movq 0x118(%rsp), %rdi
cmpq %r15, %rdi
je 0xff48
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 0xff7a
addq $0x20, %rdi
callq 0x152db
jmp 0xff82
movq %r14, %rdi
callq 0xf5f2
cmpl $0x0, 0x50(%r14)
vmovsd %xmm0, 0x8(%rsp)
jne 0x100c2
leaq 0x10(%rsp), %r12
xorl %esi, %esi
movq %r12, %rdi
callq 0x4500
movq 0x90(%r14), %rdi
vmovsd 0x8(%rsp), %xmm0
movslq 0x7c(%r14), %rsi
movl 0x50(%r14), %edx
movq (%r12), %r13
movq 0x8(%r12), %rbp
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x10(%rsp), %r12
xorl %esi, %esi
movq %r12, %rdi
callq 0x4500
vpbroadcastq 0x8(%r12), %xmm1
vmovdqa (%r12), %xmm0
vpinsrq $0x1, %rbp, %xmm1, %xmm1
vpinsrq $0x1, %r13, %xmm0, %xmm0
vcvtqq2pd %xmm1, %xmm1
vdivpd 0x1800a(%rip){1to2}, %xmm1, %xmm1 # 0x28008
vcvtqq2pd %xmm0, %xmm0
kmovb 0x78(%r14), %k1
vaddpd %xmm0, %xmm1, %xmm0
vmovsd 0x70(%r14), %xmm1
vhsubpd %xmm0, %xmm0, %xmm0
vsubsd %xmm0, %xmm1, %xmm0
vxorpd %xmm1, %xmm1, %xmm1
vminsd %xmm1, %xmm0, %xmm2
vmovsd %xmm0, %xmm2, %xmm2 {%k1}
vaddsd 0x80(%r14), %xmm2, %xmm0
vmaxsd %xmm0, %xmm1, %xmm0
vmovsd %xmm0, 0x80(%r14)
movq 0x90(%r14), %rdi
movl 0x50(%r14), %esi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x38(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movw %ax, (%r12)
callq 0xda48
movq 0x90(%r14), %rdi
movq %r12, %rsi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x2, 0x50(%r14)
jge 0x10121
leaq 0x138(%rsp), %r14
leaq 0x38(%rsp), %rsi
xorl %edx, %edx
movq %r14, %rdi
callq 0x999a
movl $0x1, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8dba
leaq 0x148(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xff43
jmp 0xff48
vmovsd 0x80(%r14), %xmm0
leaq 0x158(%rsp), %r12
movl $0x1, %esi
movq %r12, %rdi
callq 0x15694
leaq 0x19576(%rip), %rcx     # 0x2965d
movl $0x15, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0xe8(%rsp), %r12
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, -0x10(%r12)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x10176
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r12)
jmp 0x10189
leaq 0x10(%rsp), %r12
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rdi
callq 0x920c
movzbl 0x54(%r14), %edx
leaq 0x58(%rsp), %r14
movq %r12, %rsi
movq %r14, %rdi
callq 0x15e7a
leaq 0x18993(%rip), %rsi     # 0x28ae2
movq %r14, %rdi
callq 0x4610
leaq 0x178(%rsp), %rdi
leaq 0x58(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rax, %rsi
callq 0x47f5
jmp 0x10081
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 0x194c4(%rip), %rsi     # 0x29673
callq 0x4610
leaq 0x88(%rsp), %r13
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, -0x10(%r13)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x101db
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r13)
jmp 0x101eb
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)
vmovsd 0x8(%rsp), %xmm0
leaq 0xb8(%rsp), %rdi
movl $0x3, %esi
callq 0x15694
movq 0x80(%rsp), %r8
movq 0xc0(%rsp), %rdx
movq 0x78(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %r13, %rcx
je 0x10249
movq 0x88(%rsp), %rdi
movq 0xb8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x10275
leaq 0xc8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x10270
movq 0xc8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x10281
leaq 0x78(%rsp), %rdi
callq 0x40b0
jmp 0x10292
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x48(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0x102b1
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x102be
movq %rsi, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %rsi, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x19372(%rip), %rsi     # 0x29654
leaq 0x38(%rsp), %rdi
callq 0x4610
leaq 0x68(%rsp), %rbp
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x1030f
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rbp)
jmp 0x1031c
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 0xd4eb
movq 0x60(%rsp), %r8
movq 0xa0(%rsp), %rdx
movq 0x58(%rsp), %rcx
movl $0xf, %edi
leaq (%rdx,%r8), %rax
cmpq %rbp, %rcx
je 0x1036a
movq 0x68(%rsp), %rdi
movq 0x98(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x10396
leaq 0xa8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x10391
movq 0xa8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x103a2
leaq 0x58(%rsp), %rdi
callq 0x40b0
jmp 0x103b3
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4330
leaq 0x20(%rsp), %rdx
leaq 0x10(%rax), %rcx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
cmpq %rcx, %rsi
jne 0x103d2
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%rdx)
jmp 0x103df
movq %rsi, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
movq 0x8(%rax), %rsi
movq %rax, %rdx
addq $0x8, %rdx
movq %r12, %r13
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x186dc(%rip), %rsi     # 0x28ae2
leaq 0x10(%rsp), %rdi
callq 0x4610
leaq 0x108(%rsp), %r12
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, -0x10(%r12)
movq (%rax), %rdx
cmpq %rcx, %rdx
jne 0x10438
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r12)
jmp 0x1044b
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 0x25b73(%rip), %rax     # 0x35fe0
movq 0xf8(%rsp), %rdi
movq (%rax), %rsi
callq 0x4320
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1048f
callq 0x42b0
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x104a2
callq 0x42b0
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x104b8
callq 0x42b0
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x104c7
callq 0x42b0
leaq 0x48(%rsp), %rax
leaq 0x88(%rsp), %r12
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x104e2
callq 0x42b0
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x104f8
callq 0x42b0
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x10507
callq 0x42b0
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x10519
callq 0x42b0
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xff93
callq 0x42b0
jmp 0xff93
leaq 0x20(%rsp), %rcx
movq %rax, %rbx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x10556
callq 0x42b0
jmp 0x10556
movq %r12, %r13
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10574
callq 0x42b0
jmp 0x10574
movq %r12, %r13
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1058b
callq 0x42b0
jmp 0x1058b
movq %r12, %r13
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x105a6
callq 0x42b0
jmp 0x105a6
movq %r12, %r13
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x105c4
callq 0x42b0
jmp 0x105c4
movq %r12, %r13
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x105e3
callq 0x42b0
jmp 0x105e3
movq %r12, %r13
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x10604
callq 0x42b0
jmp 0x10604
movq %rax, %rbx
leaq 0x68(%rsp), %rax
jmp 0x1060c
movq %rax, %rbx
leaq 0x168(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1061a
callq 0x42b0
movq %rbx, %rdi
callq 0x45b0
movq %rax, %rbx
leaq 0x148(%rsp), %rax
jmp 0x1060c
movq 0x118(%rsp), %rdi
movq %rax, %rbx
cmpq %r15, %rdi
jne 0x10615
jmp 0x1061a
nop