// File: Luthaf[P]zeopp/networkanalysis.cc
// Function: calculateNodeOverlap(ATOM_NETWORK*, VORONOI_NETWORK*)
vector< vector<double> > calculateNodeOverlap(ATOM_NETWORK *atmnet, VORONOI_NETWORK *vornet){
  unsigned int numNodes = vornet->nodes.size();
  vector< vector<double> > overlapFractions = vector< vector<double> > (numNodes, vector<double> (numNodes, 0));
  for(unsigned int i = 0; i < numNodes; i++){
    VOR_NODE n1 = vornet->nodes[i];
    for(unsigned int j = i + 1; j < numNodes; j++){
	VOR_NODE n2 = vornet->nodes[j];
	double sumRadii =  n1.rad_stat_sphere + n2.rad_stat_sphere;
	overlapFractions[i][j] = overlapFractions[j][i] = max(0.0, (sumRadii - atmnet->calcDistanceXYZ(n1.x, n1.y, n1.z, n2.x, n2.y, n2.z))/sumRadii);
      }
   }	    
    return overlapFractions;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x120(%rbp)
movq %rdi, %rax
movq %rax, -0x118(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
callq 0xf270
movl %eax, -0x1c(%rbp)
movb $0x0, -0x1d(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x110(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x10b20
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rcx
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x64ff0
jmp 0x6080b
leaq -0x55(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x12bf0
movq -0x120(%rbp), %rdi
movq -0x110(%rbp), %rsi
movq -0x128(%rbp), %rcx
leaq -0x38(%rbp), %rdx
callq 0x65550
jmp 0x6083b
leaq -0x55(%rbp), %rdi
callq 0x2c2f0
leaq -0x38(%rbp), %rdi
callq 0xf9d0
leaq -0x41(%rbp), %rdi
callq 0x1ebe0
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x60ab0
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
callq 0x24e20
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0xf3d0
jmp 0x6088c
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x60a88
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
movl -0xa4(%rbp), %eax
movl %eax, %esi
callq 0x24e20
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
callq 0xf3d0
jmp 0x608cd
movsd -0x88(%rbp), %xmm0
movsd -0xd0(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movq $0x0, -0xf8(%rbp)
movsd -0xf0(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
movq -0x10(%rbp), %rdi
movsd -0xa0(%rbp), %xmm0
movsd -0x98(%rbp), %xmm1
movsd -0x90(%rbp), %xmm2
movsd -0xe8(%rbp), %xmm3
movsd -0xe0(%rbp), %xmm4
movsd -0xd8(%rbp), %xmm5
callq 0x97a10
movsd %xmm0, -0x130(%rbp)
jmp 0x60947
movsd -0x130(%rbp), %xmm1
movsd -0x138(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd -0xf0(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x64c70
movq %rax, -0x140(%rbp)
jmp 0x6098b
movq -0x120(%rbp), %rdi
movq -0x140(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x148(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, %esi
callq 0x162d0
movq %rax, %rdi
movl -0x5c(%rbp), %eax
movl %eax, %esi
callq 0xedb0
movq -0x120(%rbp), %rdi
movsd -0x148(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x5c(%rbp), %eax
movl %eax, %esi
callq 0x162d0
movq %rax, %rdi
movl -0xa4(%rbp), %eax
movl %eax, %esi
callq 0xedb0
movsd -0x148(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0xe8(%rbp), %rdi
callq 0xf5c0
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x60898
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x60a44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x55(%rbp), %rdi
callq 0x2c2f0
leaq -0x38(%rbp), %rdi
callq 0xf9d0
leaq -0x41(%rbp), %rdi
callq 0x1ebe0
jmp 0x60ae2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x60ad6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x60aa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xf5c0
jmp 0x60aa2
leaq -0xa0(%rbp), %rdi
callq 0xf5c0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x6085d
leaq -0xa0(%rbp), %rdi
callq 0xf5c0
jmp 0x60ad6
movb $0x1, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0x60ac6
movq -0x120(%rbp), %rdi
callq 0x10790
movq -0x118(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x120(%rbp), %rdi
callq 0x10790
movq -0x50(%rbp), %rdi
callq 0x58f0
nopl (%rax,%rax)