// File: 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:
subq $0x9db8, %rsp           # imm = 0x9DB8
movq %rdx, 0x30(%rsp)
movq %rdi, 0x38(%rsp)
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0x9db0(%rsp)
movq %rsi, 0x9da8(%rsp)
movq %rdx, 0x9da0(%rsp)
movq 0x9da8(%rsp), %rdi
addq $0x68, %rdi
callq 0xc070
movq %rax, %rsi
leaq 0x9d58(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x118b0
movq 0x48(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x43a70
jmp 0x41f2b
movq 0x30(%rsp), %rdi
leaq 0x2b584(%rip), %rax     # 0x6d4bb
movb (%rax), %al
movb %al, 0xeb(%rsp)
callq 0x13c80
cmpq $0x1, %rax
jb 0x42096
movq 0x30(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, 0x20(%rsp)
callq 0x13ca0
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x5850
movq %rax, 0x28(%rsp)
jmp 0x41f76
movq 0x28(%rsp), %rax
movsbl (%rax), %edi
callq 0x55f0
movl %eax, %ecx
movl %ecx, 0x1c(%rsp)
subl $0x62, %eax
je 0x41fc9
jmp 0x41f90
movl 0x1c(%rsp), %eax
subl $0x77, %eax
je 0x41fb4
jmp 0x41fde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x42238
leaq 0x2b501(%rip), %rax     # 0x6d4bc
movb (%rax), %al
movb %al, 0xeb(%rsp)
jmp 0x42094
leaq 0x2b4ed(%rip), %rax     # 0x6d4bd
movb (%rax), %al
movb %al, 0xeb(%rsp)
jmp 0x42094
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x5770
movq 0x10(%rsp), %rdx
leaq 0xe5cd(%rip), %rsi      # 0x505c9
leaq 0xc8(%rsp), %rdi
callq 0x5590
jmp 0x4200b
movq 0x38(%rsp), %rdi
xorl %esi, %esi
leaq 0xc8(%rsp), %rdx
callq 0xd9a0
jmp 0x42021
leaq 0xc8(%rsp), %rdi
callq 0x5260
leaq 0xc7(%rsp), %rdi
callq 0x5450
movl $0x1, 0xc0(%rsp)
jmp 0x4221e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x42082
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x5260
leaq 0xc7(%rsp), %rdi
callq 0x5450
jmp 0x42238
jmp 0x42096
movq 0x30(%rsp), %rdi
callq 0x13c80
cmpq $0x2, %rax
jb 0x4216b
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x13ca0
movq %rax, %rsi
leaq 0x9e(%rsp), %rdi
callq 0x1a5e0
jmp 0x420cb
movb 0xeb(%rsp), %al
movb %al, 0x9d(%rsp)
movzbl 0x9d(%rsp), %edx
movzwl 0x9e(%rsp), %esi
leaq 0xf8(%rsp), %rdi
callq 0x29b40
movl %eax, 0xc(%rsp)
jmp 0x420fc
movl 0xc(%rsp), %esi
leaq 0xa0(%rsp), %rdi
callq 0x1a430
jmp 0x4210f
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0xa0(%rsp), %rdx
callq 0xd9a0
jmp 0x42128
leaq 0xa0(%rsp), %rdi
callq 0x5260
movl $0x1, 0xc0(%rsp)
jmp 0x4221e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x5260
jmp 0x42238
movb 0xeb(%rsp), %al
movb %al, 0x57(%rsp)
movzbl 0x57(%rsp), %edx
leaq 0x58(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x43aa0
jmp 0x4218f
leaq 0xa752(%rip), %rsi      # 0x4c8e8
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x19f30
jmp 0x421a7
movq 0x38(%rsp), %rdi
movl $0x1, %esi
leaq 0x78(%rsp), %rdx
callq 0xd9a0
jmp 0x421bd
leaq 0x78(%rsp), %rdi
callq 0x5260
leaq 0x58(%rsp), %rdi
callq 0x5260
movl $0x1, 0xc0(%rsp)
jmp 0x4221e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x42212
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x5260
leaq 0x58(%rsp), %rdi
callq 0x5260
jmp 0x42238
leaq 0x9d58(%rsp), %rdi
callq 0xc040
movq 0x40(%rsp), %rax
addq $0x9db8, %rsp           # imm = 0x9DB8
retq
leaq 0x9d58(%rsp), %rdi
callq 0xc040
movq 0xf0(%rsp), %rdi
callq 0x5760
nopw %cs:(%rax,%rax)