// File: Proudc[P]CTSS/src/ContinuousQuery/Pruneline.cpp
// Function: eucSimpleQueryPath(Graph*, ReferencePath*, std::vector<Edge, std::allocator<Edge>>, Record*, int)
bool eucSimpleQueryPath(Graph* myGraph, ReferencePath* referencePath, std::vector<Edge> currentPath, Record* temRecord, int currentVertex)
{
	printf("Start eucSimpleQueryPath...\n");
	TraversingPath* path = new TraversingPath;
	initializeFirstPath(myGraph, path, currentVertex, currentPath);
	if (path->finalVertexID != referencePath->finalVertex)
	{
		double lb = eucLowerBound(myGraph, path, temRecord, referencePath);
		if ((lb != -1) && (lb < (myGraph->delta)))
		{
			delete path;
			return true;
		}
		else
		{
			delete path;
			return false;
		}
	}
	else
	{
		std::vector<Edge> finalPath;
		for (unsigned int i = 0; i < path->edges.size(); i++)
		{
			finalPath.push_back(myGraph->edgesVector[path->edges[i]]);
		}
		double temDist = DFD(myGraph, finalPath, referencePath);
		if (temDist <= (myGraph->delta))
		{
			delete path;
			return true;
		}
		else
		{
			delete path;
			return false;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdx, -0xa0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
leaq 0xa9a3(%rip), %rdi      # 0x19a50
movb $0x0, %al
callq 0x2040
movl $0x40, %edi
callq 0x2170
movq %rax, %rdi
movq %rdi, -0xa8(%rbp)
callq 0x141f0
movq -0xa8(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x6d40
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0xf1ac
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0xf360
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0xa896(%rip), %xmm1     # 0x199c0
ucomisd %xmm1, %xmm0
jne 0xf134
jp 0xf134
jmp 0xf17a
movsd -0x40(%rbp), %xmm1
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xf17a
movq -0x38(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0xf171
movq -0xb0(%rbp), %rdi
callq 0x14210
movq -0xb0(%rbp), %rdi
callq 0x2150
movb $0x1, -0x1(%rbp)
jmp 0xf348
movq -0x38(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
je 0xf1a3
movq -0xb8(%rbp), %rdi
callq 0x14210
movq -0xb8(%rbp), %rdi
callq 0x2150
movb $0x0, -0x1(%rbp)
jmp 0xf348
leaq -0x58(%rbp), %rdi
callq 0x53a0
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq %rax, -0xc0(%rbp)
movq -0x38(%rbp), %rdi
addq $0x28, %rdi
callq 0x90e0
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jae 0xf23d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0x38(%rbp), %rdi
addq $0x28, %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
callq 0x9100
movq -0xc8(%rbp), %rsi
movslq (%rax), %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x55f0
jmp 0xf21f
jmp 0xf221
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xf1bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xf33d
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x53c0
jmp 0xf25a
movq -0xd0(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x90(%rbp), %rsi
callq 0xce50
movsd %xmm0, -0xd8(%rbp)
jmp 0xf27b
leaq -0x90(%rbp), %rdi
callq 0x54b0
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm1
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0xf2fb
movq -0x38(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, %rax
je 0xf2d1
movq -0xe0(%rbp), %rdi
callq 0x14210
movq -0xe0(%rbp), %rdi
callq 0x2150
movb $0x1, -0x1(%rbp)
movl $0x1, -0x94(%rbp)
jmp 0xf332
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x54b0
jmp 0xf33d
movq -0x38(%rbp), %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, %rax
je 0xf324
movq -0xe8(%rbp), %rdi
callq 0x14210
movq -0xe8(%rbp), %rdi
callq 0x2150
movb $0x0, -0x1(%rbp)
movl $0x1, -0x94(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x54b0
jmp 0xf348
leaq -0x58(%rbp), %rdi
callq 0x54b0
jmp 0xf356
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xf0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x2240
nop