// File: rtackx[P]ComSim/projection.cpp
// Function: JaccardIndex::similarity_projection(Node*&, Node*&)
float JaccardIndex::similarity_projection(Node*& node1, Node*& node2)
{
	set<Node*> intersection = get_intersection(node1, node2);

	float projection_weight, sum_weight, wtemp;
	projection_weight = sum_weight = 0.0;

	for(auto& neighbor : node1->neighbor_weights)
	{
		wtemp = node1->neighbor_weights[neighbor.first];
		if(intersection.find(neighbor.first) != intersection.end())
		{
			projection_weight += wtemp;
		}

		sum_weight += wtemp;
	}
	for(auto& neighbor : node2->neighbor_weights)
	{
		wtemp = node2->neighbor_weights[neighbor.first];
		if(intersection.find(neighbor.first) != intersection.end())
		{
			projection_weight += wtemp;
		}

		sum_weight += wtemp;
	}

	return 1.0 * projection_weight / sum_weight;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq %rdx, 0xe0(%rsp)
movq 0xf0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
movq 0xe0(%rsp), %rcx
leaq 0xb0(%rsp), %rdi
callq 0xefe0
xorps %xmm0, %xmm0
movss %xmm0, 0xa8(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0xac(%rsp)
movq 0xe8(%rsp), %rax
movq (%rax), %rax
addq $0x30, %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
callq 0x107e0
movq %rax, 0x90(%rsp)
movq 0x98(%rsp), %rdi
callq 0x10810
movq %rax, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x10840
testb $0x1, %al
jne 0xf7fb
jmp 0xf8fc
leaq 0x90(%rsp), %rdi
callq 0x10860
movq %rax, 0x80(%rsp)
movq 0xe8(%rsp), %rax
movq (%rax), %rdi
addq $0x30, %rdi
movq 0x80(%rsp), %rsi
callq 0x7c60
movq %rax, 0x28(%rsp)
jmp 0xf833
movq 0x28(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0xa4(%rsp)
movq 0x80(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x10d10
movq %rax, 0x20(%rsp)
jmp 0xf861
movq 0x20(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x10d50
movq %rax, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x10cf0
testb $0x1, %al
jne 0xf892
jmp 0xf8cf
movss 0xa4(%rsp), %xmm0
addss 0xac(%rsp), %xmm0
movss %xmm0, 0xac(%rsp)
jmp 0xf8cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x10ce0
jmp 0xfa65
movss 0xa4(%rsp), %xmm0
addss 0xa8(%rsp), %xmm0
movss %xmm0, 0xa8(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x10880
jmp 0xf7dd
movq 0xe0(%rsp), %rax
movq (%rax), %rax
addq $0x30, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
callq 0x107e0
movq %rax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
callq 0x10810
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x10840
testb $0x1, %al
jne 0xf946
jmp 0xfa16
leaq 0x50(%rsp), %rdi
callq 0x10860
movq %rax, 0x40(%rsp)
movq 0xe0(%rsp), %rax
movq (%rax), %rdi
addq $0x30, %rdi
movq 0x40(%rsp), %rsi
callq 0x7c60
movq %rax, 0x18(%rsp)
jmp 0xf975
movq 0x18(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0xa4(%rsp)
movq 0x40(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x10d10
movq %rax, 0x10(%rsp)
jmp 0xf9a0
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x10d50
movq %rax, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x10cf0
testb $0x1, %al
jne 0xf9d1
jmp 0xf9ec
movss 0xa4(%rsp), %xmm0
addss 0xac(%rsp), %xmm0
movss %xmm0, 0xac(%rsp)
movss 0xa4(%rsp), %xmm0
addss 0xa8(%rsp), %xmm0
movss %xmm0, 0xa8(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x10880
jmp 0xf92e
movss 0xac(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x12e85(%rip), %xmm0    # 0x228b0
mulsd %xmm1, %xmm0
movss 0xa8(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x10ce0
movss 0xc(%rsp), %xmm0
addq $0xf8, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x3400
nop