// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
leaq 0x38(%rsi), %r15
leaq 0x28(%rsp), %r13
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
xorl %edx, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x7a62
movq %r13, %rdi
callq 0xae70
testb %al, %al
js 0xc842
leaq 0x10274(%rip), %rsi     # 0x1ca84
leaq 0xf0(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x40f0
pushq $0x1
popq %rsi
leaq 0xf0(%rsp), %rdx
movq %rbx, %rdi
callq 0x761c
leaq 0xf0(%rsp), %rdi
jmp 0xcab7
movq (%r12), %rdi
movq 0x8(%r12), %rax
subq %rdi, %rax
cmpq $0x21, %rax
jb 0xc85f
addq $0x20, %rdi
callq 0xf0be
jmp 0xc867
movq %r14, %rdi
callq 0xc2e4
cmpl $0x0, 0x50(%r14)
vmovsd %xmm0, (%rsp)
je 0xc9ba
vmovsd 0x80(%r14), %xmm0
leaq 0x130(%rsp), %r12
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0xf350
leaq 0x10d93(%rip), %rsi     # 0x1d62d
leaq 0xd0(%rsp), %rdi
movq %r12, %rdx
callq 0x8423
leaq 0x10d92(%rip), %rdx     # 0x1d643
leaq 0x50(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x6821
leaq 0xb0(%rsp), %rdi
pushq $0x3
popq %rsi
vmovsd (%rsp), %xmm0
callq 0xf350
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x8365
leaq 0x10d2e(%rip), %rdx     # 0x1d624
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x6821
movl 0x7c(%r14), %esi
leaq 0x90(%rsp), %rdi
callq 0xaee1
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x8365
leaq 0x10184(%rip), %rdx     # 0x1cab8
leaq 0x170(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x6821
leaq 0x170(%rsp), %r12
movq %r12, %rdi
callq 0xac65
movq %r12, %rdi
callq 0x4130
leaq 0x28(%rsp), %rdi
callq 0x4130
leaq 0x90(%rsp), %rdi
callq 0x4130
leaq 0x8(%rsp), %rdi
callq 0x4130
leaq 0x70(%rsp), %rdi
callq 0x4130
leaq 0xb0(%rsp), %rdi
callq 0x4130
leaq 0x50(%rsp), %rdi
callq 0x4130
leaq 0xd0(%rsp), %rdi
callq 0x4130
leaq 0x130(%rsp), %rdi
callq 0x4130
leaq 0x70(%rsp), %r12
movq %r12, %rdi
callq 0x4c50
movq 0x90(%r14), %rdi
vmovsd (%rsp), %xmm0
movslq 0x7c(%r14), %rsi
movl 0x50(%r14), %edx
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x4c50
vmovsd (%r13), %xmm0
movq %r14, %rdi
vsubsd (%r12), %xmm0, %xmm0
callq 0xc394
movq 0x90(%r14), %rdi
movl 0x50(%r14), %esi
movq (%rdi), %rax
callq *0x18(%rax)
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
movw %ax, (%rsi)
callq 0xaeb4
cmpl $0x2, 0x50(%r14)
jl 0xca8a
leaq 0x28(%rsp), %r12
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rdi
callq 0x7a62
movzbl 0x54(%r14), %edx
leaq 0x8(%rsp), %r14
movq %r12, %rsi
movq %r14, %rdi
callq 0xf8fc
leaq 0x10060(%rip), %rdx     # 0x1cab8
leaq 0x150(%rsp), %rdi
movq %r14, %rsi
callq 0x6821
leaq 0x150(%rsp), %r14
movq %r14, %rdi
callq 0xac65
movq %r14, %rdi
callq 0x4130
leaq 0x8(%rsp), %rdi
callq 0x4130
leaq 0x110(%rsp), %r14
leaq 0x50(%rsp), %rsi
xorl %edx, %edx
movq %r14, %rdi
callq 0x8178
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x761c
leaq 0x110(%rsp), %rdi
callq 0x4130
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x8(%rsp), %rdi
jmp 0xcb6b
leaq 0x28(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
jmp 0xcaec
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x4130
jmp 0xcafe
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4130
jmp 0xcb0d
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x4130
jmp 0xcb1c
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x4130
leaq 0x50(%rsp), %rdi
callq 0x4130
leaq 0xd0(%rsp), %rdi
callq 0x4130
leaq 0x130(%rsp), %rdi
jmp 0xcb6e
movq %rax, %rbx
jmp 0xcb29
movq %rax, %rbx
jmp 0xcb33
movq %rax, %rbx
jmp 0xcb40
leaq 0x110(%rsp), %rdi
jmp 0xcb6b
leaq 0xf0(%rsp), %rdi
movq %rax, %rbx
callq 0x4130
movq %rbx, %rdi
callq 0x4590
movq %rax, %rbx
jmp 0xcb73