// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/networkstorage.cc
// Function: getNodeID(Point, ATOM_NETWORK*, VORONOI_NETWORK*)
int getNodeID(Point pt, ATOM_NETWORK *atmnet, VORONOI_NETWORK *vornet){
    double minDist = DBL_MAX;
    int minID = -1;
    for(unsigned int i = 0; i < vornet->nodes.size(); i++){
        VOR_NODE curNode = vornet->nodes.at(i);
        double dist = atmnet->calcDistanceXYZ(pt[0], pt[1], pt[2], curNode.x, curNode.y, curNode.z);
        if(dist < threshold)
            return i;
        else {
            if(dist < minDist){
                minDist = dist;
                minID = i;
            }
        }
    }
    
    cerr << "Warning : When identifying Voronoi node, the distance exceeded the threshold of " << threshold << "\n"
    << "Occurred during analysis of " << atmnet->name << "\n"
    << "Closest node was within " << minDist << "\n"
    << "Proceeding with analysis" << "\n";
    return minID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x48(%rsi), %rax
cmpq %rax, 0x50(%rsi)
je 0x59b94
movq %rsi, %r14
leaq 0xa0(%rsp), %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movsd 0xf8d17(%rip), %xmm0    # 0x152778
movsd %xmm0, (%rsp)
movl $0x1, %r12d
xorl %ecx, %ecx
shlq $0x6, %rcx
leaq (%rax,%rcx), %r13
addq $0x20, %r13
movupd -0x20(%r13), %xmm0
movupd -0x10(%r13), %xmm1
movapd %xmm1, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0xe8f8
movb 0x18(%r13), %al
movb %al, 0x58(%rsp)
movq %r15, %rdi
xorl %esi, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
movl $0x1, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r15, %rdi
movl $0x2, %esi
callq 0x83f9a
movsd (%rax), %xmm2
movsd 0x20(%rsp), %xmm3
movsd 0x28(%rsp), %xmm4
movsd 0x30(%rsp), %xmm5
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x5364c
movapd %xmm0, %xmm2
leal -0x1(%r12), %eax
movsd 0xf875e(%rip), %xmm0    # 0x152278
ucomisd %xmm2, %xmm0
ja 0x59b3b
movsd (%rsp), %xmm1
ucomisd %xmm2, %xmm1
cmoval %eax, %ebp
movapd %xmm2, %xmm0
minsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
jmp 0x59b3f
movl %eax, 0x14(%rsp)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x59b62
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
movsd %xmm2, 0x8(%rsp)
callq 0x4470
movsd 0x8(%rsp), %xmm2
movsd 0xf870e(%rip), %xmm0    # 0x152278
ucomisd %xmm2, %xmm0
ja 0x59c84
movl %r12d, %ecx
movq 0x48(%r14), %rax
movq 0x50(%r14), %rdx
subq %rax, %rdx
sarq $0x6, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x59a6e
jmp 0x59ba6
movsd 0xf8bdc(%rip), %xmm0    # 0x152778
movsd %xmm0, (%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x13b443(%rip), %r14    # 0x194ff0
leaq 0xf963b(%rip), %rsi     # 0x1531ef
movl $0x50, %edx
movq %r14, %rdi
callq 0x44e0
movsd 0xf86af(%rip), %xmm0    # 0x152278
movq %r14, %rdi
callq 0x46b0
movq %rax, %r15
leaq 0xf9a43(%rip), %r14     # 0x15361e
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
leaq 0xf964e(%rip), %rsi     # 0x153240
movl $0x1c, %edx
movq %r15, %rdi
callq 0x44e0
movq 0x320(%rbx), %rsi
movq 0x328(%rbx), %rdx
movq %r15, %rdi
callq 0x44e0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
leaq 0xf962e(%rip), %rsi     # 0x15325d
movl $0x18, %edx
movq %rbx, %rdi
callq 0x44e0
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x46b0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
leaq 0xf9613(%rip), %rsi     # 0x153276
movl $0x18, %edx
movq %rbx, %rdi
callq 0x44e0
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44e0
movl %ebp, %eax
jmp 0x59c88
movl 0x14(%rsp), %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x59cb1
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780