// File: rtackx[P]ComSim/projection.cpp
// Function: Projection::get_intersection(Node*&, Node*&) const
set<Node*> Projection::get_intersection(Node*& node1, Node*& node2) const
{
	vector<Node*> set_node1, set_node2;
	vector<Node*> neighbors_node1, neighbors_node2;

	neighbors_node1.reserve(node1->nb_neighbors);
	neighbors_node2.reserve(node2->nb_neighbors);
	for(auto k : node1->neighbor_weights)
		neighbors_node1.push_back(k.first);
	for(auto k : node2->neighbor_weights)
		neighbors_node2.push_back(k.first);

	set<Node*> intersection;

	sort(neighbors_node1.begin(), neighbors_node1.end());
	sort(neighbors_node2.begin(), neighbors_node2.end());

	set_intersection(neighbors_node1.begin(), neighbors_node1.end(),
					 neighbors_node2.begin(), neighbors_node2.end(),
					 inserter(intersection, intersection.begin()));

	return intersection;
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0x1b0(%rsp)
movq %rsi, 0x1a8(%rsp)
movq %rdx, 0x1a0(%rsp)
movq %rcx, 0x198(%rsp)
leaq 0x180(%rsp), %rdi
callq 0x10640
leaq 0x168(%rsp), %rdi
callq 0x10640
leaq 0x150(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x10640
leaq 0x138(%rsp), %rdi
callq 0x10640
movq 0x58(%rsp), %rdi
movq 0x1a0(%rsp), %rax
movq (%rax), %rax
movl 0x28(%rax), %eax
movl %eax, %esi
callq 0x10aa0
jmp 0xf069
movq 0x198(%rsp), %rax
movq (%rax), %rax
movl 0x28(%rax), %eax
movl %eax, %esi
leaq 0x138(%rsp), %rdi
callq 0x10aa0
jmp 0xf088
movq 0x1a0(%rsp), %rax
movq (%rax), %rax
addq $0x30, %rax
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rdi
callq 0x107e0
movq %rax, 0x118(%rsp)
movq 0x120(%rsp), %rdi
callq 0x10810
movq %rax, 0x110(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x10840
testb $0x1, %al
jne 0xf0e4
jmp 0xf13d
leaq 0x118(%rsp), %rdi
callq 0x10860
movups (%rax), %xmm0
movaps %xmm0, 0x100(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10650
jmp 0xf113
jmp 0xf115
leaq 0x118(%rsp), %rdi
callq 0x10880
jmp 0xf0c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
jmp 0xf3db
movq 0x198(%rsp), %rax
movq (%rax), %rax
addq $0x30, %rax
movq %rax, 0xf8(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x107e0
movq %rax, 0xf0(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x10810
movq %rax, 0xe8(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x10840
testb $0x1, %al
jne 0xf199
jmp 0xf1d9
leaq 0xf0(%rsp), %rdi
callq 0x10860
movups (%rax), %xmm0
movaps %xmm0, 0xd0(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x10650
jmp 0xf1c8
jmp 0xf1ca
leaq 0xf0(%rsp), %rdi
callq 0x10880
jmp 0xf17e
movq 0x48(%rsp), %rdi
movb $0x0, 0xcf(%rsp)
callq 0x10bb0
leaq 0x150(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x10420
movq 0x40(%rsp), %rdi
movq %rax, 0xc0(%rsp)
callq 0x10450
movq %rax, 0xb8(%rsp)
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %rsi
callq 0x108b0
jmp 0xf22e
leaq 0x138(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x10420
movq 0x38(%rsp), %rdi
movq %rax, 0xb0(%rsp)
callq 0x10450
movq %rax, 0xa8(%rsp)
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x108b0
jmp 0xf271
leaq 0x150(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x10420
movq 0x18(%rsp), %rdi
movq %rax, 0xa0(%rsp)
callq 0x10450
movq %rax, 0x98(%rsp)
leaq 0x138(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x10420
movq 0x20(%rsp), %rdi
movq %rax, 0x90(%rsp)
callq 0x10450
movq 0x48(%rsp), %rdi
movq %rax, 0x88(%rsp)
callq 0x10cb0
movq 0x48(%rsp), %rdi
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rsi
callq 0x10c70
movq %rdx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
jmp 0xf2f3
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x80(%rsp), %r9
callq 0x10bc0
movq %rdx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
jmp 0xf348
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movb $0x1, 0xcf(%rsp)
testb $0x1, 0xcf(%rsp)
jne 0xf39a
jmp 0xf390
movq 0x48(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x130(%rsp)
movl %eax, 0x12c(%rsp)
callq 0x10ce0
jmp 0xf3db
movq 0x48(%rsp), %rdi
callq 0x10ce0
leaq 0x138(%rsp), %rdi
callq 0x105e0
leaq 0x150(%rsp), %rdi
callq 0x105e0
leaq 0x168(%rsp), %rdi
callq 0x105e0
leaq 0x180(%rsp), %rdi
callq 0x105e0
movq 0x50(%rsp), %rax
addq $0x1b8, %rsp            # imm = 0x1B8
retq
leaq 0x138(%rsp), %rdi
callq 0x105e0
leaq 0x150(%rsp), %rdi
callq 0x105e0
leaq 0x168(%rsp), %rdi
callq 0x105e0
leaq 0x180(%rsp), %rdi
callq 0x105e0
movq 0x130(%rsp), %rdi
callq 0x3400
nopl (%rax)