// File: /workspace/github_cpp_makefile_star2_O1/tewalds[P]morat/hex/gtpgeneral.cpp
// Function: Morat::Hex::GTP::gtp_dists(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_dists(vecstr args){
	using std::string;
	Board board = *hist;
	LBDists dists(&board);

	Side side = Side::NONE;
	if(args.size() >= 1){
		switch(tolower(args[0][0])){
			case 'w': side = Side::P1; break;
			case 'b': side = Side::P2; break;
			default:
				return GTPResponse(false, "Invalid player selection");
		}
	}

	if(args.size() >= 2) {
		return GTPResponse(true, to_str(dists.get(Move(args[1]), side)));
	}

	return GTPResponse(true, "\n" + dists.to_s(side));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9d30, %rsp           # imm = 0x9D30
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x88(%rsi), %eax
leaq 0x98(%rsp), %r12
movw %ax, -0x8(%r12)
movq 0x80(%rsi), %rax
movq %rax, -0x10(%r12)
addq $0x90, %rsi
movq %r12, %rdi
callq 0xb34a
vmovups 0xa8(%r14), %xmm0
vmovups %xmm0, 0x18(%r12)
movq 0xc0(%r14), %rax
vmovups 0xb8(%r14), %xmm0
vmovups %xmm0, 0x28(%r12)
testq %rax, %rax
je 0x2b740
movq 0x1e896(%rip), %rcx     # 0x49fc8
cmpb $0x0, (%rcx)
je 0x2b73c
incl 0x8(%rax)
jmp 0x2b740
lock
incl 0x8(%rax)
leaq 0xd0(%rsp), %r14
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x2d498
movq (%r15), %r12
movq 0x8(%r15), %r13
subq %r12, %r13
je 0x2b787
movq (%r12), %rax
movsbl (%rax), %edi
callq 0x54a0
cmpl $0x62, %eax
je 0x2b790
cmpl $0x77, %eax
jne 0x2b867
leaq 0xac25(%rip), %rax      # 0x363aa
jmp 0x2b797
leaq 0xac1b(%rip), %rax      # 0x363a9
jmp 0x2b797
leaq 0xac14(%rip), %rax      # 0x363ab
movsbq (%rax), %r15
cmpq $0x21, %r13
jb 0x2b810
addq $0x20, %r12
leaq 0x6(%rsp), %rdi
movq %r12, %rsi
callq 0x11286
movzwl 0x6(%rsp), %eax
movsbl %al, %ecx
shrl $0x8, %eax
movq 0x9d28(%rsp), %rdx
movsbl (%rdx), %edx
imull %ecx, %edx
movsbl %al, %eax
addl %edx, %eax
imulq $0x9c4, %r15, %rcx      # imm = 0x9C4
cltq
addq %r14, %rcx
movl 0x9c4(%rcx,%rax,4), %esi
addl -0x9c4(%rcx,%rax,4), %esi
leaq 0x68(%rsp), %rdi
callq 0x11187
leaq 0x68(%rsp), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0xa7f0
leaq 0x78(%rsp), %rax
jmp 0x2b8e9
leaq 0x48(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movl %r15d, %edx
callq 0x2cbc2
leaq 0x60da(%rip), %rcx      # 0x31906
leaq 0x48(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b8a3
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x2b8ac
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xa2be(%rip), %rsi      # 0x35b35
leaq 0xa2cf(%rip), %rdx      # 0x35b4d
leaq 0x28(%rsp), %rdi
callq 0xb0e0
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa7f0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2b8f2
jmp 0x2b8f7
vmovups (%rcx), %xmm0
vmovups %xmm0, (%r14)
movq 0x8(%rax), %rsi
leaq 0x8(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xa7f0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2b8e4
callq 0x52e0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b8f7
callq 0x52e0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x2b909
callq 0xb170
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x2b91b
callq 0x52e0
movq %rbx, %rax
addq $0x9d30, %rsp           # imm = 0x9D30
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2b96f
jmp 0x2b97d
jmp 0x2b97a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2b961
callq 0x52e0
jmp 0x2b961
movq %rax, %rbx
leaq 0x78(%rsp), %rax
jmp 0x2b966
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b97d
callq 0x52e0
jmp 0x2b97d
jmp 0x2b97a
jmp 0x2b97a
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x9ce0
movq %rbx, %rdi
callq 0x5670