// File: Proudc[P]CTSS/src/ContinuousQuery/Base.cpp
// Function: setTraversalOrderWeights(Graph*, ReferencePath*)
void setTraversalOrderWeights(Graph* myGraph, ReferencePath* temPath)
{
	const double x1 = myGraph->vertexsVector[temPath->finalVertex].longitude;
	const double y1 = myGraph->vertexsVector[temPath->finalVertex].latitude;
	double maxEuc = 0.0;
	for (unsigned int i = 0; i < myGraph->vertexPos; i++)
	{
		if (myGraph->vertexsVector[i].locationFlag == true)
		{
			const double x2 = myGraph->vertexsVector[i].longitude;
			const double y2 = myGraph->vertexsVector[i].latitude;
			double eucLength = euc(x1, y1, x2, y2);
			myGraph->vertexsVector[i].eucLengthToFinalVertex = eucLength;
			maxEuc = (std::max)(maxEuc, eucLength);
		}
	}
	for (unsigned int i = 0; i < myGraph->vertexPos; i++)
	{
		if (myGraph->vertexsVector[i].locationFlag == true)
		{
			double firstHalf = (myGraph->vertexsVector[i].distToRefer);
			double secHalf   = (myGraph->vertexsVector[i].eucLengthToFinalVertex) / (maxEuc / (myGraph->delta));
			double temWeights = (0.5) * firstHalf+ (0.5) * secHalf;
			myGraph->vertexsVector[i].traversalOrderWeights = temWeights;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x4(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x4(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x7cfc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb 0x11(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7cec
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
movsd -0x40(%rbp), %xmm3
callq 0x7780
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x30(%rax)
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x9020
movsd (%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x7cee
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x7c31
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x7dd3
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb 0x11(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7dc3
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x30(%rax), %xmm0
movsd -0x28(%rbp), %xmm1
movq -0x8(%rbp), %rax
divsd 0x18(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm0
movsd 0x113a3(%rip), %xmm1    # 0x19130
mulsd -0x60(%rbp), %xmm1
movsd 0x11396(%rip), %xmm2    # 0x19130
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x4c(%rbp), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x38(%rax)
jmp 0x7dc5
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x7d03
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)