// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %r9, -0x70(%rbp)
movl %r8d, %r15d
movl %ecx, %ebx
movq %rdi, %r12
movl 0x4(%rdi), %eax
movq %rsp, %r10
leaq 0xf(%rax), %rcx
andq $-0x10, %rcx
subq %rcx, %r10
movq %r10, %rsp
movq %rsp, %r11
subq %rcx, %r11
movq %r11, %rsp
xorl %ecx, %ecx
xorl %edi, %edi
cmpq %rdi, %rax
je 0x82f7
movb %cl, (%r10,%rdi)
movb %cl, (%r11,%rdi)
incq %rdi
jmp 0x82e5
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
movb $0x1, %r9b
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0x8348
movq %rdx, %r8
shlq $0x5, %r8
movslq 0x4(%rax,%r8), %rdi
movl 0x8(%rax,%r8), %r8d
cmpl %ebx, %edi
je 0x833a
cmpl %ebx, %r8d
je 0x833a
movslq %r8d, %r8
movb %r9b, (%r10,%rdi)
movb %r9b, (%r10,%r8)
incl %edx
jmp 0x830a
cmpl %ebx, %edi
cmovel %ebx, %r8d
movslq %r8d, %rdx
movb $0x1, (%r10,%rdx)
xorl %edi, %edi
movb $0x1, %dl
movl %edi, %r9d
cmpq %r9, %rcx
jbe 0x8373
movq %r9, %rdi
shlq $0x5, %rdi
movslq 0x4(%rax,%rdi), %r8
movb %dl, (%r11,%r8)
movslq 0x8(%rax,%rdi), %rdi
movb %dl, (%r11,%rdi)
leal 0x1(%r9), %edi
jmp 0x834c
movq %r11, -0x78(%rbp)
movq %r10, -0x38(%rbp)
movq %rsi, -0x60(%rbp)
pushq $0x70
popq %rdi
callq 0x2110
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movl %r15d, (%rax)
leaq -0xc8(%rbp), %r13
movq %r13, %rdi
callq 0x88e2
movq %r13, %rdi
movq %r14, %rsi
callq 0x8ec8
movslq %ebx, %rax
movslq %r15d, %rcx
imulq $0x70, %rax, %rax
movq %rax, -0x68(%rbp)
imulq $0x70, %rcx, %rax
movq %rax, -0x58(%rbp)
leaq -0x388(%rbp), %r14
movl %r15d, %r13d
movl %r15d, -0x2c(%rbp)
movq -0xb8(%rbp), %rsi
cmpq %rsi, -0x98(%rbp)
je 0x85f1
leaq -0x158(%rbp), %rdi
callq 0x5734
leaq -0xc8(%rbp), %rdi
callq 0x9164
movslq -0x158(%rbp), %r15
movq -0x38(%rbp), %rsi
movb $0x1, (%rsi,%r15)
movq -0x78(%rbp), %rax
cmpb $0x0, (%rax,%r15)
je 0x858b
movq -0x70(%rbp), %rax
movl %r15d, (%rax)
andq $0x0, -0x40(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
leaq -0x2d8(%rbp), %rax
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x10(%r12), %rsi
movslq %r15d, %rax
imulq $0x70, %rax, %rax
cmpl %r13d, (%rsi,%rax)
je 0x84c1
addq %rax, %rsi
movl 0xc(%rsi), %r15d
leaq -0x238(%rbp), %rdi
callq 0x5734
movslq %r15d, %rax
imulq $0x70, %rax, %rsi
addq 0x10(%r12), %rsi
movq %r14, %rdi
callq 0x5734
leaq -0xe8(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
leaq -0x238(%rbp), %rdx
movq %r14, %rcx
callq 0x52b3
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x91e4
movq %r14, %rdi
callq 0x57ca
leaq -0x238(%rbp), %rdi
callq 0x57ca
jmp 0x844a
addq -0x68(%rbp), %rsi
leaq -0x1c8(%rbp), %rdi
callq 0x5734
movq 0x10(%r12), %rsi
addq -0x58(%rbp), %rsi
leaq -0x2a8(%rbp), %r15
movq %r15, %rdi
callq 0x5734
movq -0x60(%rbp), %r13
leaq -0xe8(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
leaq -0x1c8(%rbp), %rdx
movq %r15, %rcx
callq 0x52b3
movq %r13, %rdi
movq %rbx, %rsi
callq 0x91e4
leaq -0x2a8(%rbp), %rdi
callq 0x57ca
leaq -0x1c8(%rbp), %rdi
callq 0x57ca
movq -0x48(%rbp), %rax
subq -0x50(%rbp), %rax
shrq $0x5, %rax
movl %eax, %r15d
decq %r15
testl %r15d, %r15d
js 0x8561
movl %r15d, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
shlq $0x5, %rsi
addq -0x50(%rbp), %rsi
decq %r15
movq %r13, %rdi
callq 0x4066
jmp 0x853e
leaq -0x318(%rbp), %rdi
callq 0x57ca
leaq -0x50(%rbp), %rdi
callq 0x4092
leaq -0x158(%rbp), %rdi
callq 0x57ca
movl -0x2c(%rbp), %r13d
jmp 0x83da
xorl %r13d, %r13d
movl %r13d, %r13d
movq 0x10(%r12), %rax
movslq %r15d, %rcx
imulq $0x70, %rcx, %rdx
movq 0x40(%rax,%rdx), %rcx
movq 0x48(%rax,%rdx), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r13, %rdx
jbe 0x8576
movslq (%rcx,%r13,4), %rcx
cmpb $0x0, (%rsi,%rcx)
jne 0x85ec
imulq $0x70, %rcx, %rdx
cmpb $0x1, 0x11(%rax,%rdx)
jne 0x85ec
movb $0x1, (%rsi,%rcx)
leaq (%rax,%rdx), %rsi
movl %r15d, 0xc(%rax,%rdx)
leaq -0xc8(%rbp), %rdi
callq 0x8ec8
movl -0x158(%rbp), %r15d
movq -0x38(%rbp), %rsi
incl %r13d
jmp 0x858e
leaq -0xc8(%rbp), %rdi
callq 0x8b16
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8615
jmp 0x8639
movq %rax, %rbx
jmp 0x8629
movq %rax, %rbx
jmp 0x867f
movq %rax, %rbx
leaq -0x2a8(%rbp), %rdi
callq 0x57ca
leaq -0x1c8(%rbp), %rdi
jmp 0x8659
movq %rax, %rbx
jmp 0x8673
jmp 0x8639
movq %rax, %rbx
jmp 0x865e
movq %rax, %rbx
jmp 0x8652
movq %rax, %rbx
leaq -0x388(%rbp), %rdi
callq 0x57ca
leaq -0x238(%rbp), %rdi
callq 0x57ca
leaq -0x318(%rbp), %rdi
callq 0x57ca
leaq -0x50(%rbp), %rdi
callq 0x4092
leaq -0x158(%rbp), %rdi
callq 0x57ca
leaq -0xc8(%rbp), %rdi
callq 0x8b16
movq %rbx, %rdi
callq 0x2200