// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x9d30, %rsp           # imm = 0x9D30
movzwl 0x88(%rsi), %eax
leaq 0x98(%rsp), %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %r15
movq %r12, %rdi
movw %ax, -0x8(%r12)
movq 0x80(%rsi), %rax
addq $0x90, %rsi
movq %rax, -0x10(%r12)
callq 0xb44a
vmovups 0xa8(%r14), %xmm0
vmovups %xmm0, 0x18(%r12)
vmovups 0xb8(%r14), %xmm0
movq 0xc0(%r14), %rax
vmovups %xmm0, 0x28(%r12)
testq %rax, %rax
je 0x2b64f
movq 0x1d987(%rip), %rcx     # 0x48fc8
cmpb $0x0, (%rcx)
je 0x2b64b
incl 0x8(%rax)
jmp 0x2b64f
lock
incl 0x8(%rax)
leaq 0xd0(%rsp), %r14
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x2d3b2
movq (%r15), %r12
movq 0x8(%r15), %r15
subq %r12, %r15
je 0x2b696
movq (%r12), %rax
movsbl (%rax), %edi
callq 0x54a0
cmpl $0x62, %eax
je 0x2b6a5
cmpl $0x77, %eax
jne 0x2b80c
leaq 0xad16(%rip), %rax      # 0x363aa
jmp 0x2b6ac
leaq 0xad0c(%rip), %rax      # 0x363a9
movb (%rax), %bpl
jmp 0x2b729
leaq 0xacff(%rip), %rax      # 0x363ab
movb (%rax), %bpl
cmpq $0x21, %r15
jb 0x2b729
addq $0x20, %r12
leaq 0x6(%rsp), %rdi
movq %r12, %rsi
callq 0x11418
movq 0x9d28(%rsp), %rsi
movzwl 0x6(%rsp), %ecx
movsbq %bpl, %rax
imulq $0x9c4, %rax, %rax      # imm = 0x9C4
addq %r14, %rax
movsbl (%rsi), %esi
movsbl %cl, %edx
shrl $0x8, %ecx
movsbl %cl, %ecx
imull %edx, %esi
addl %esi, %ecx
movslq %ecx, %rcx
movl 0x9c4(%rax,%rcx,4), %esi
addl -0x9c4(%rax,%rcx,4), %esi
leaq 0x68(%rsp), %rdi
callq 0x1131a
leaq 0x68(%rsp), %rdx
movl $0x1, %esi
movq %rbx, %rdi
callq 0xa8ba
leaq 0x78(%rsp), %rax
jmp 0x2b7c7
movzbl %bpl, %edx
leaq 0x48(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x2cae0
leaq 0x61c0(%rip), %rcx      # 0x31906
leaq 0x48(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x18(%rsp), %r14
movq %rax, %rcx
addq $0x10, %rcx
movq %r14, -0x10(%r14)
movq (%rax), %rdx
cmpq %rcx, %rdx
je 0x2b781
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x2b78a
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)
movl $0x1, %esi
movq %rbx, %rdi
callq 0xa8ba
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2b7c2
callq 0x52e0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b7d5
callq 0x52e0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x2b7e7
callq 0xb272
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x2b7f9
callq 0x52e0
movq %rbx, %rax
addq $0x9d30, %rsp           # imm = 0x9D30
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xa319(%rip), %rsi      # 0x35b35
leaq 0xa32a(%rip), %rdx      # 0x35b4d
leaq 0x28(%rsp), %rdi
callq 0xb1dc
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa8ba
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2b7d0
jmp 0x2b7d5
movq %rax, %rbx
leaq 0x78(%rsp), %rax
jmp 0x2b881
movq 0x28(%rsp), %rdi
movq %rax, %rbx
cmpq %r14, %rdi
jne 0x2b88a
jmp 0x2b896
jmp 0x2b893
jmp 0x2b893
movq 0x8(%rsp), %rdi
movq %rax, %rbx
cmpq %r14, %rdi
je 0x2b87c
callq 0x52e0
jmp 0x2b87c
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b896
callq 0x52e0
jmp 0x2b896
jmp 0x2b893
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x9d96
movq %rbx, %rdi
callq 0x5670
nop