// File: Proudc[P]CTSS/src/ContinuousQuery/Base.cpp
// Function: initializeFirstPath(Graph*, TraversingPath*, int, std::vector<Edge, std::allocator<Edge>>&)
void initializeFirstPath(Graph* myGraph, TraversingPath* path, int currentVertex, std::vector<Edge>& currentPath)
{
	printf("Start initializing the first path...\n");
	path->finalVertexID = currentVertex;
	path->distToRefer   = 0;
	path->minPos        = 0;
	path->maxPos        = myGraph->vertexsVector[currentVertex].maxPos;
	for (unsigned int i = 0; i < currentPath.size(); i++)
	{
		const Vertex firstVertex = myGraph->vertexsVector[currentPath[i].firstVertexID];
		const Vertex secVertex   = myGraph->vertexsVector[currentPath[i].secVertexID];
		path->edges.push_back(currentPath[i].edgeID);
		path->distToRefer = std::max(path->distToRefer, firstVertex.distToRefer);
		path->distToRefer = std::max(path->distToRefer, secVertex.distToRefer);
		path->minPos      = std::max(path->minPos, firstVertex.minPos);
		path->minPos      = std::max(path->minPos, secVertex.minPos);
	}
	printf("The first path is initialized!!!\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
leaq 0x12503(%rip), %rdi     # 0x19264
movb $0x0, %al
callq 0x2040
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x120(%rbp)
movq -0x20(%rbp), %rdi
callq 0x5360
movq %rax, %rcx
movq -0x120(%rbp), %rax
cmpq %rcx, %rax
jae 0x6f8d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq -0x130(%rbp), %rsi
movslq 0x4(%rax), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x8f20
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x128(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq -0x128(%rbp), %rsi
movslq 0x8(%rax), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0x8f20
jmp 0x6e4a
movq -0x10(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x138(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x8fb0
jmp 0x6e78
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
leaq -0x70(%rbp), %rsi
callq 0x9020
movq %rax, -0x140(%rbp)
jmp 0x6e92
movq -0x140(%rbp), %rax
movsd (%rax), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x9020
movq %rax, -0x148(%rbp)
jmp 0x6ec3
movq -0x148(%rbp), %rax
movsd (%rax), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rdi
leaq -0x94(%rbp), %rsi
callq 0x9060
movq %rax, -0x150(%rbp)
jmp 0x6ef0
movq -0x150(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
leaq -0x104(%rbp), %rsi
callq 0x9060
movq %rax, -0x158(%rbp)
jmp 0x6f18
movq -0x158(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
leaq -0x108(%rbp), %rdi
callq 0x90a0
leaq -0x98(%rbp), %rdi
callq 0x90a0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6dac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
jmp 0x6f7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x90a0
leaq -0x98(%rbp), %rdi
callq 0x90a0
jmp 0x6fa4
leaq 0x122f6(%rip), %rdi     # 0x1928a
movb $0x0, %al
callq 0x2040
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x110(%rbp), %rdi
callq 0x2240