// File: Proudc[P]CTSS/src/ContinuousQuery/Base.cpp
// Function: filterVertexIsSafeArea(Graph*, ReferencePath*)
void filterVertexIsSafeArea(Graph* myGraph, ReferencePath* temPath)
{
	printf("Start filtering the vertices in the safe area...\n");
	int count = 0;
	for (int i = 0; i < (myGraph->vertexPos); i++)
	{
		if (myGraph->vertexsVector[i].referFlag == true)
		{
			myGraph->vertexsVector[i].locationFlag = true;
			count++;
			continue;
		}
		for (unsigned int j = 0; j < temPath->edges.size(); j++)
		{
			double x = myGraph->vertexsVector[i].longitude;
			double y = myGraph->vertexsVector[i].latitude;
			double x1 = myGraph->vertexsVector[temPath->edges[j].firstVertexID].longitude;
			double y1 = myGraph->vertexsVector[temPath->edges[j].firstVertexID].latitude;
			double x2 = myGraph->vertexsVector[temPath->edges[j].secVertexID].longitude;
			double y2 = myGraph->vertexsVector[temPath->edges[j].secVertexID].latitude;
			double dist = pointToSegDist(x, y, x1, y1, x2, y2);
			if (dist <= (myGraph->delta))
			{
				myGraph->vertexsVector[i].locationFlag = true;
				count++;
				break;
			}
		}
	}
	printf("Finished filtering the vertices in the safe area!!!\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x121a2(%rip), %rdi     # 0x192ac
movb $0x0, %al
callq 0x2040
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x733f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb 0x10(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7174
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb $0x1, 0x11(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7331
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x5360
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x732f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq %rax, %rcx
movq -0x80(%rbp), %rax
movslq 0x4(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq %rax, %rcx
movq -0x78(%rbp), %rax
movslq 0x4(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq %rax, %rcx
movq -0x70(%rbp), %rax
movslq 0x8(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq %rax, %rcx
movq -0x68(%rbp), %rax
movslq 0x8(%rcx), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
movsd -0x40(%rbp), %xmm3
movsd -0x48(%rbp), %xmm4
movsd -0x50(%rbp), %xmm5
callq 0x7360
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm1
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x731f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb $0x1, 0x11(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x732f
jmp 0x7321
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x717b
jmp 0x7331
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x711f
leaq 0x11f98(%rip), %rdi     # 0x192de
movb $0x0, %al
callq 0x2040
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)