// File: Proudc[P]CTSS/src/ContinuousQuery/Pruneline.cpp
// Function: maxmalOverlapPath(Graph*, std::vector<Edge, std::allocator<Edge>>&, std::vector<Edge, std::allocator<Edge>>&, int, int, int*)
void maxmalOverlapPath(Graph* myGraph, std::vector<Edge>& localPath, std::vector<Edge>& lastPath, int firstVertexID, int secVertexID, int* endVertexID)
{
	bool bfsFlag[(myGraph->vertexPos)];
	bool lastPathFlag[(myGraph->vertexPos)];
	for (unsigned int i = 0; i < myGraph->vertexPos; i++)
	{
		bfsFlag[i] = false;
		lastPathFlag[i] = false;
	}
	for (unsigned int i = 0; i < lastPath.size(); i++)
	{
		Edge temEdge = lastPath[i];
		if (temEdge.firstVertexID == firstVertexID || temEdge.secVertexID == firstVertexID)
		{
			if (temEdge.firstVertexID == firstVertexID)
			{
				bfsFlag[temEdge.firstVertexID] = true;
			}
			else
			{
				bfsFlag[temEdge.secVertexID] = true;
			}
			break;
		}
		else
		{
			bfsFlag[temEdge.firstVertexID] = true;
			bfsFlag[temEdge.secVertexID]   = true;
		}
	}
	for (unsigned int i = 0; i < lastPath.size(); i++)
	{
		lastPathFlag[lastPath[i].firstVertexID] = true;
		lastPathFlag[lastPath[i].secVertexID]   = true;
	}
	Vertex* initVertex = new Vertex;
	initVertex->vertexID = secVertexID;
	std::queue<Vertex> queue;
	queue.push(*initVertex);
	while (!queue.empty())
	{
		Vertex temVertex = queue.front();
		queue.pop();
		bfsFlag[temVertex.vertexID] = true;
		if (lastPathFlag[temVertex.vertexID] == false)
		{
			for (unsigned int i = 0; i < myGraph->vertexsVector[temVertex.vertexID].adjVertexID.size(); i++)
			{
				int nextVertexID = myGraph->vertexsVector[temVertex.vertexID].adjVertexID[i];
				if (bfsFlag[nextVertexID] == false && myGraph->vertexsVector[nextVertexID].locationFlag == true)
				{
					bfsFlag[nextVertexID] = true;
					Vertex* newVertex = new Vertex;
					newVertex = &myGraph->vertexsVector[nextVertexID];
					newVertex->parentVertexID = temVertex.vertexID;
					queue.push(*newVertex);
				}
			}
		}
		else
		{
			(*endVertexID) = temVertex.vertexID;
			std::vector<Edge> temPath;
			Vertex newVertex;
			int temID = temVertex.vertexID;
			while (myGraph->vertexsVector[temID].vertexID != secVertexID)
			{
				int temParentID = myGraph->vertexsVector[temID].parentVertexID;
				temPath.push_back(findEdge(myGraph, myGraph->vertexsVector[temID], myGraph->vertexsVector[temParentID]));
				temID = temParentID;
			}
			localPath.push_back(findEdge(myGraph, myGraph->vertexsVector[firstVertexID], myGraph->vertexsVector[secVertexID]));
			for (int i = temPath.size() - 1; i >= 0; i--)
			{
				localPath.push_back(temPath[i]);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x460, %rsp            # imm = 0x460
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x30(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x400(%rbp)
movq %rcx, %rsp
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x3f8(%rbp)
movq %rcx, %rsp
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x1370f
movq -0x3f8(%rbp), %rax
movq -0x400(%rbp), %rcx
movl -0x44(%rbp), %edx
movb $0x0, (%rcx,%rdx)
movl -0x44(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x136dc
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq %rax, -0x408(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5360
movq %rax, %rcx
movq -0x408(%rbp), %rax
cmpq %rcx, %rax
jae 0x137ca
movq -0x18(%rbp), %rdi
movl -0x48(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq (%rax), %rcx
movq %rcx, -0x68(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x60(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x58(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x13779
movl -0x60(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x137a3
movl -0x64(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x13792
movq -0x400(%rbp), %rax
movslq -0x64(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x137a1
movq -0x400(%rbp), %rax
movslq -0x60(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x137ca
movq -0x400(%rbp), %rax
movslq -0x64(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movslq -0x60(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x137bc
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x13716
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq %rax, -0x410(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5360
movq %rax, %rcx
movq -0x410(%rbp), %rax
cmpq %rcx, %rax
jae 0x1383e
movq -0x18(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq %rax, %rcx
movq -0x3f8(%rbp), %rax
movslq 0x4(%rcx), %rcx
movb $0x1, (%rax,%rcx)
movq -0x18(%rbp), %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x5380
movq %rax, %rcx
movq -0x3f8(%rbp), %rax
movslq 0x8(%rcx), %rcx
movb $0x1, (%rax,%rcx)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x137d1
movl $0x70, %edi
callq 0x2170
movq %rax, %rdi
movq %rdi, -0x420(%rbp)
callq 0x8dd0
movq -0x420(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x20(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, (%rax)
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x14380
movq -0x418(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x143b0
jmp 0x13890
jmp 0x13892
leaq -0xc8(%rbp), %rdi
callq 0x143e0
movb %al, -0x421(%rbp)
jmp 0x138a6
movb -0x421(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x138b7
jmp 0x13dc1
leaq -0xc8(%rbp), %rdi
callq 0x14400
movq %rax, -0x430(%rbp)
jmp 0x138cc
movq -0x430(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x8f20
jmp 0x138e1
leaq -0xc8(%rbp), %rdi
callq 0x14420
jmp 0x138ef
movq -0x3f8(%rbp), %rax
movq -0x400(%rbp), %rcx
movslq -0x148(%rbp), %rdx
movb $0x1, (%rcx,%rdx)
movslq -0x148(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x13aad
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movq %rax, -0x438(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x148(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rdi
addq $0x40, %rdi
callq 0x90e0
movq %rax, %rcx
movq -0x438(%rbp), %rax
cmpq %rcx, %rax
jae 0x13aa8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x148(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rdi
addq $0x40, %rdi
movl -0x14c(%rbp), %eax
movl %eax, %esi
callq 0x9100
movq %rax, %rcx
movq -0x400(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x150(%rbp)
movslq -0x150(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x13a92
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x150(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movb 0x11(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x13a92
movq -0x400(%rbp), %rax
movslq -0x150(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movl $0x70, %edi
callq 0x2170
movq %rax, -0x440(%rbp)
jmp 0x13a06
movq -0x440(%rbp), %rdi
callq 0x8dd0
movq -0x440(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x150(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x158(%rbp)
movl -0x148(%rbp), %ecx
movq -0x158(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x158(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x143b0
jmp 0x13a62
jmp 0x13a92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x13dd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x13db3
jmp 0x13a94
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x1392a
jmp 0x13da2
movl -0x148(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
leaq -0x170(%rbp), %rdi
callq 0x53a0
leaq -0x1e0(%rbp), %rdi
callq 0x8dd0
movl -0x148(%rbp), %eax
movl %eax, -0x1e4(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1e4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x20(%rbp), %eax
je 0x13c25
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1e4(%rbp), %rcx
imulq $0x70, %rcx, %rcx
movl 0xc(%rax,%rcx), %eax
movl %eax, -0x1e8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x448(%rbp)
movq 0x10(%rax), %rsi
movslq -0x1e4(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq -0x278(%rbp), %rdi
callq 0x8f20
jmp 0x13b46
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movslq -0x1e8(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq -0x2e8(%rbp), %rdi
callq 0x8f20
jmp 0x13b6a
movq -0x448(%rbp), %rsi
leaq -0x208(%rbp), %rdi
leaq -0x278(%rbp), %rdx
leaq -0x2e8(%rbp), %rcx
callq 0x8340
jmp 0x13b8d
leaq -0x170(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x14440
jmp 0x13ba2
leaq -0x2e8(%rbp), %rdi
callq 0x90a0
leaq -0x278(%rbp), %rdi
callq 0x90a0
movl -0x1e8(%rbp), %eax
movl %eax, -0x1e4(%rbp)
jmp 0x13add
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x13d88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x13c14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x90a0
leaq -0x278(%rbp), %rdi
callq 0x90a0
jmp 0x13d88
movq -0x10(%rbp), %rax
movq %rax, -0x458(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x450(%rbp)
movq 0x10(%rax), %rsi
movslq -0x1c(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq -0x378(%rbp), %rdi
callq 0x8f20
jmp 0x13c58
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movslq -0x20(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq -0x3e8(%rbp), %rdi
callq 0x8f20
jmp 0x13c79
movq -0x450(%rbp), %rsi
leaq -0x308(%rbp), %rdi
leaq -0x378(%rbp), %rdx
leaq -0x3e8(%rbp), %rcx
callq 0x8340
jmp 0x13c9c
movq -0x458(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x14440
jmp 0x13cb1
leaq -0x3e8(%rbp), %rdi
callq 0x90a0
leaq -0x378(%rbp), %rdi
callq 0x90a0
leaq -0x170(%rbp), %rdi
callq 0x5360
subq $0x1, %rax
movl %eax, -0x3ec(%rbp)
cmpl $0x0, -0x3ec(%rbp)
jl 0x13d6e
movq -0x10(%rbp), %rax
movq %rax, -0x460(%rbp)
movslq -0x3ec(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x5380
movq -0x460(%rbp), %rdi
movq %rax, %rsi
callq 0x55f0
jmp 0x13d1b
jmp 0x13d1d
movl -0x3ec(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3ec(%rbp)
jmp 0x13cdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x13d60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x3e8(%rbp), %rdi
callq 0x90a0
leaq -0x378(%rbp), %rdi
callq 0x90a0
jmp 0x13d88
leaq -0x1e0(%rbp), %rdi
callq 0x90a0
leaq -0x170(%rbp), %rdi
callq 0x54b0
jmp 0x13da2
leaq -0x1e0(%rbp), %rdi
callq 0x90a0
leaq -0x170(%rbp), %rdi
callq 0x54b0
jmp 0x13db3
leaq -0x148(%rbp), %rdi
callq 0x90a0
jmp 0x13892
leaq -0x148(%rbp), %rdi
callq 0x90a0
jmp 0x13dd9
leaq -0xc8(%rbp), %rdi
callq 0x14470
movq -0x30(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
leaq -0xc8(%rbp), %rdi
callq 0x14470
movq -0xd0(%rbp), %rdi
callq 0x2240
nopw %cs:(%rax,%rax)