// File: /workspace/github_cpp_makefile_star2_O1/Proudc[P]CTSS/src/ContinuousQuery/Frechet.cpp
// Function: (anonymous namespace)::dist(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&, int, int, Point*, Point*)
double dist(std::vector<std::vector<double>>& ca, int i, int j, Point* p, Point* q)
{
	if (ca[i][j] > -1)
	{
		return ca[i][j];
	}
	else if (i == 0 && j == 0)
	{
		ca[i][j] = euc(p[0], q[0]);
	}
	else if (i > 0 && j == 0)
	{
		ca[i][j] = max(dist(ca, i - 1, 0, p, q), euc(p[i], q[0]));
	}
	else if (i == 0 && j > 0)
	{
		ca[i][j] = max(dist(ca, 0, j - 1, p, q), euc(p[0], q[j]));
	}
	else if (i > 0 && j > 0)
	{
		ca[i][j] = max(
			min(
				dist(ca, i - 1, j, p, q),
				dist(ca, i - 1, j - 1, p, q),
				dist(ca, i, j - 1, p, q)),
			euc(p[i], q[j]));
	}
	else
	{
		ca[i][j] = DBL_MAX;
	}
	return ca[i][j];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r13d
movslq %esi, %r14
movq (%rdi), %rax
leaq (%r14,%r14,2), %rsi
movslq %edx, %rbx
movq (%rax,%rsi,8), %rax
leaq (%rax,%rbx,8), %rax
movsd (%rax), %xmm0
ucomisd 0x4e4d(%rip), %xmm0     # 0xc998
ja 0x7db2
movq %rcx, %r15
movl %edx, %r12d
movl %edx, %ecx
orl %r13d, %ecx
je 0x7bd0
testl %r12d, %r12d
setne %cl
testl %r13d, %r13d
setle %dl
orb %cl, %dl
jne 0x7c05
movq %rsi, %r12
decl %r13d
movq %rdi, -0x38(%rbp)
movl %r13d, %esi
xorl %edx, %edx
movq %r15, %rcx
movq %r8, %r13
callq 0x7b16
movapd %xmm0, %xmm2
shlq $0x4, %r14
movsd (%r15,%r14), %xmm0
movsd 0x8(%r15,%r14), %xmm1
subsd (%r13), %xmm0
subsd 0x8(%r13), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7c9a
sqrtsd %xmm0, %xmm0
jmp 0x7ca9
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
subsd (%r8), %xmm0
subsd 0x8(%r8), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7c78
sqrtsd %xmm0, %xmm0
jmp 0x7c89
testl %r13d, %r13d
setne %cl
testl %r12d, %r12d
setle %dl
orb %cl, %dl
jne 0x7cbc
movq %rsi, %r14
decl %r12d
movq %rdi, %r13
xorl %esi, %esi
movl %r12d, %edx
movq %r15, %rcx
movq %r8, %r12
callq 0x7b16
movapd %xmm0, %xmm2
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movq %rbx, %rax
shlq $0x4, %rax
subsd (%r12,%rax), %xmm0
subsd 0x8(%r12,%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7d7e
sqrtsd %xmm0, %xmm0
jmp 0x7d8d
movq %rsi, %r14
movq %rdi, %r15
callq 0x2100
movq %r15, %rdi
movq %r14, %rsi
movq (%rdi), %rax
movq (%rax,%rsi,8), %rax
movsd %xmm0, (%rax,%rbx,8)
jmp 0x7da4
movsd %xmm2, -0x30(%rbp)
callq 0x2100
movsd -0x30(%rbp), %xmm2
movq %r12, %rsi
maxsd %xmm0, %xmm2
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
jmp 0x7d9b
testl %r12d, %r12d
setle %cl
testl %r13d, %r13d
setle %dl
orb %cl, %dl
jne 0x7dc5
movq %rsi, -0x48(%rbp)
leal -0x1(%r13), %esi
movl %esi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
movl %r12d, %edx
movq %r15, %rcx
movq %r8, -0x50(%rbp)
callq 0x7b16
movsd %xmm0, -0x30(%rbp)
decl %r12d
movq -0x38(%rbp), %rdi
movl -0x40(%rbp), %esi
movl %r12d, %edx
movq %r15, %rcx
movq -0x50(%rbp), %r8
callq 0x7b16
movsd %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movl %r13d, %esi
movl %r12d, %edx
movq %r15, %rcx
movq -0x50(%rbp), %r12
movq %r12, %r8
callq 0x7b16
movsd -0x30(%rbp), %xmm1
minsd -0x40(%rbp), %xmm1
minsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
shlq $0x4, %r14
movsd (%r15,%r14), %xmm0
movsd 0x8(%r15,%r14), %xmm1
movq %rbx, %rax
shlq $0x4, %rax
subsd (%r12,%rax), %xmm0
subsd 0x8(%r12,%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7dd4
sqrtsd %xmm0, %xmm0
jmp 0x7dd9
movsd %xmm2, -0x30(%rbp)
callq 0x2100
movsd -0x30(%rbp), %xmm2
movq %r14, %rsi
maxsd %xmm0, %xmm2
movq %r13, %rdi
movq (%r13), %rax
movq (%rax,%rsi,8), %rax
movsd %xmm2, (%rax,%rbx,8)
movq (%rdi), %rax
shlq $0x3, %rbx
addq (%rax,%rsi,8), %rbx
movq %rbx, %rax
movsd (%rax), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0x7fefffffffffffff, %rcx # imm = 0x7FEFFFFFFFFFFFFF
movq %rcx, (%rax)
jmp 0x7da4
callq 0x2100
movq -0x48(%rbp), %rsi
movsd -0x30(%rbp), %xmm1
maxsd %xmm0, %xmm1
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
movq (%rax,%rsi,8), %rax
movsd %xmm1, (%rax,%rbx,8)
jmp 0x7da4