// File: /workspace/github_cpp_makefile_star2_O3/rtackx[P]ComSim/projection.cpp
// Function: Projection::get_neighbors(unsigned int&, unsigned int&) const
vector<Node*> Projection::get_neighbors(unsigned int& index, unsigned int& distance) const
{
	vector<Node*> list_neighbors, hist_list_neighbors, list_distance_neighbors;
	vector<Node*> neighbors_node;
	unsigned int i, d = 0;
	Node* node = in_graph->list_nodes[index];
	list_neighbors.push_back(node);

	while(d < distance && list_neighbors.size() > 0)
	{
		hist_list_neighbors.insert(hist_list_neighbors.end(), list_neighbors.begin(), list_neighbors.end());
		list_distance_neighbors.clear();

		for(auto& n : list_neighbors)
		{
			neighbors_node.clear();
			for(auto& neighbor : n->neighbor_weights)
				neighbors_node.push_back(neighbor.first);

			list_distance_neighbors.insert(list_distance_neighbors.end(), neighbors_node.begin(), neighbors_node.end());
		}

		sort(list_distance_neighbors.begin(), list_distance_neighbors.end());
		sort(hist_list_neighbors.begin(), hist_list_neighbors.end());
		list_distance_neighbors.erase(unique(list_distance_neighbors.begin(), list_distance_neighbors.end()), list_distance_neighbors.end());
		list_neighbors.clear();

		set_difference(list_distance_neighbors.begin(), list_distance_neighbors.end(),
					   hist_list_neighbors.begin(), hist_list_neighbors.end(),
					   back_inserter(list_neighbors));

		d++;

	}

	return list_neighbors;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %rbx
xorl %eax, %eax
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0x10(%rsi), %rax
movq 0x8(%rax), %rax
movl (%rdx), %ecx
movq (%rax,%rcx,8), %rax
leaq 0x70(%rsp), %rdx
movq %rax, (%rdx)
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
callq 0x69c8
cmpl $0x0, (%rbx)
je 0x58dd
xorl %r14d, %r14d
leaq 0x10(%rsp), %r12
leaq 0x30(%rsp), %r13
movq %rbx, 0x68(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rcx
cmpq %rdx, %rcx
je 0x58dd
movq 0x58(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x6afe
movl %r14d, 0x4c(%rsp)
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r15
cmpq %rbp, %r15
je 0x5744
movq %rbp, 0x18(%rsp)
movq %rbp, %r15
movq 0x8(%rsp), %rax
movq (%rax), %rbx
movq 0x8(%rax), %r14
cmpq %r14, %rbx
je 0x57d0
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
cmpq %rdx, %rcx
je 0x576c
movq %rdx, 0x38(%rsp)
movq %rdx, %rcx
movq (%rbx), %rax
movq 0x40(%rax), %r15
testq %r15, %r15
je 0x57b0
leaq 0x8(%r15), %rdx
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x5796
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, 0x38(%rsp)
jmp 0x579e
movq %r13, %rdi
callq 0x69c8
movq (%r15), %r15
testq %r15, %r15
jne 0x5778
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x18(%rsp), %rsi
movq %r12, %rdi
callq 0x6afe
addq $0x8, %rbx
cmpq %r14, %rbx
jne 0x5755
movq 0x10(%rsp), %rbp
movq 0x18(%rsp), %r15
cmpq %r15, %rbp
movq 0x68(%rsp), %rbx
movl 0x4c(%rsp), %r14d
je 0x580c
movq %r15, %rax
subq %rbp, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x6cb2
movq %rbp, %rdi
movq %r15, %rsi
callq 0x6d9b
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %rbp
cmpq %rbp, %r15
je 0x5848
movq %rbp, %rax
subq %r15, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x6cb2
movq %r15, %rdi
movq %rbp, %rsi
callq 0x6d9b
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
cmpq %rsi, %rdi
je 0x58a0
leaq 0x8(%rdi), %rax
cmpq %rsi, %rax
je 0x58b0
movq -0x8(%rax), %rcx
leaq 0x8(%rax), %rdx
cmpq (%rax), %rcx
movq %rdx, %rax
jne 0x585b
leaq -0x10(%rdx), %rax
cmpq %rsi, %rdx
je 0x589a
movq %rcx, %r8
movq (%rdx), %rcx
cmpq %rcx, %r8
je 0x588c
movq %rcx, 0x8(%rax)
addq $0x8, %rax
addq $0x8, %rdx
cmpq %rsi, %rdx
jne 0x5879
movq 0x18(%rsp), %rsi
addq $0x8, %rax
jmp 0x58a3
movq %rdi, %rax
cmpq %rsi, %rax
je 0x58b0
movq %rax, 0x18(%rsp)
movq %rax, %rsi
movq 0x8(%rsp), %r8
movq (%r8), %rax
cmpq %rax, 0x8(%r8)
je 0x58c2
movq %rax, 0x8(%r8)
movq 0x50(%rsp), %rdx
movq 0x58(%rsp), %rcx
callq 0x700c
incl %r14d
cmpl (%rbx), %r14d
jb 0x5704
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x58ec
callq 0x2220
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x58fb
callq 0x2220
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x590a
callq 0x2220
movq 0x8(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5926
jmp 0x5926
jmp 0x5926
jmp 0x5926
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5938
callq 0x2220
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5947
callq 0x2220
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5956
callq 0x2220
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x5968
callq 0x2220
movq %r14, %rdi
callq 0x23d0