// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/networkstorage.cc
// Function: filterVoronoiNetwork(VORONOI_NETWORK*, VORONOI_NETWORK*, double)
void filterVoronoiNetwork(VORONOI_NETWORK *vornet, VORONOI_NETWORK *newVornet, double minRadius){
    map<int,int> idMappings;
    vector<VOR_NODE>::iterator nodeIter = vornet->nodes.begin();
    vector<VOR_NODE> newNodes;
    int i = 0;
    int idCount = 0;
    
    // Add all nodes whose radius is greater than the provided minimum to a list
    while(nodeIter != vornet->nodes.end()){
        if(nodeIter->rad_stat_sphere > minRadius){
            newNodes.push_back(*nodeIter);
            idMappings.insert(pair<int,int> (i, idCount));
            idCount++;
        }
        i++;
        nodeIter++;
    }
    
    // Copy nodes that met requirement
    newVornet->nodes = newNodes;
    
    vector<VOR_EDGE>::iterator edgeIter = vornet->edges.begin();
    vector<VOR_EDGE> newEdges;
    
    // Add all edges whose radius is greater than the provided minimum to a list
    while(edgeIter != vornet->edges.end()){
        if((edgeIter->rad_moving_sphere > minRadius) && (
                                                         idMappings.find(edgeIter->from) != idMappings.end()) && (
                                                                                                                  idMappings.find(edgeIter->to) != idMappings.end())){
            VOR_EDGE newEdge;
            newEdge.from = idMappings.find(edgeIter->from)->second;
            newEdge.to   = idMappings.find(edgeIter->to)->second;
            newEdge.rad_moving_sphere = edgeIter->rad_moving_sphere;
            newEdge.delta_uc_x = edgeIter->delta_uc_x;
            newEdge.delta_uc_y = edgeIter->delta_uc_y;
            newEdge.delta_uc_z = edgeIter->delta_uc_z;
            newEdge.length = edgeIter->length;
            newEdges.push_back(newEdge);
        }
        edgeIter++;
    }
    
    // Copy edges that met requirement
    newVornet->edges = newEdges;
    
    // Copy unitcell vectors to new network
    newVornet->v_a = vornet->v_a;
    newVornet->v_b = vornet->v_b;
    newVornet->v_c = vornet->v_c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdi, %r14
leaq 0x80(%rsp), %rbx
movl $0x0, (%rbx)
xorl %r12d, %r12d
movq %r12, 0x8(%rbx)
movq %rbx, 0x10(%rbx)
movq %rbx, 0x18(%rbx)
movq %r12, 0x20(%rbx)
movq 0x48(%rdi), %r15
movq %r12, 0x60(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
cmpq 0x50(%rdi), %r15
je 0x55dd4
leaq 0x28(%rsp), %rbp
xorl %r13d, %r13d
movsd 0x18(%r15), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x55dc7
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0xe962
movl %r12d, 0x28(%rsp)
movl %r13d, 0x2c(%rsp)
leaq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x13690
incl %r13d
incl %r12d
addq $0x40, %r15
cmpq 0x50(%r14), %r15
jne 0x55d92
movq 0x70(%rsp), %rbp
leaq 0x48(%rbp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x67cfa
movq 0x60(%r14), %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
cmpq 0x68(%r14), %r13
je 0x55f8e
leaq 0x10(%rsp), %r15
leaq 0x28(%rsp), %r12
movsd 0x8(%r13), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x55f80
movq 0x88(%rsp), %rax
movq %rbx, %rcx
testq %rax, %rax
je 0x55e55
movl (%r13), %edx
movq %rax, %rsi
movq %rbx, %rcx
xorl %edi, %edi
cmpl %edx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rcx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x55e3e
movq %rbx, %rdx
cmpq %rbx, %rcx
je 0x55e6b
movl (%r13), %edx
cmpl 0x20(%rcx), %edx
cmovlq %rbx, %rcx
movq %rcx, %rdx
cmpq %rbx, %rdx
je 0x55f80
movq %rbx, %rcx
testq %rax, %rax
je 0x55e9d
movl 0x4(%r13), %edx
movq %rax, %rsi
movq %rbx, %rcx
xorl %edi, %edi
cmpl %edx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rcx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x55e86
movq %rbx, %rdx
cmpq %rbx, %rcx
je 0x55eb3
movl 0x4(%r13), %edx
cmpl 0x20(%rcx), %edx
cmovlq %rbx, %rcx
movq %rcx, %rdx
cmpq %rbx, %rdx
je 0x55f80
movq %rbx, %rcx
testq %rax, %rax
je 0x55ee5
movl (%r13), %edx
movq %rax, %rsi
movq %rbx, %rcx
xorl %edi, %edi
cmpl %edx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rcx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x55ece
movq %rbx, %rdx
cmpq %rbx, %rcx
je 0x55efb
movl (%r13), %edx
cmpl 0x20(%rcx), %edx
cmovlq %rbx, %rcx
movq %rcx, %rdx
movl 0x24(%rdx), %ecx
movl %ecx, 0x28(%rsp)
movq %rbx, %rcx
testq %rax, %rax
je 0x55f28
movl 0x4(%r13), %edx
movq %rbx, %rcx
xorl %esi, %esi
cmpl %edx, 0x20(%rax)
setl %sil
cmovgeq %rax, %rcx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0x55f11
movq %rbx, %rax
cmpq %rbx, %rcx
je 0x55f3e
movl 0x4(%r13), %eax
cmpl 0x20(%rcx), %eax
cmovlq %rbx, %rcx
movq %rcx, %rax
movl 0x24(%rax), %eax
movl %eax, 0x2c(%rsp)
movsd 0x8(%r13), %xmm0
movsd %xmm0, 0x30(%rsp)
movl 0x10(%r13), %eax
movl %eax, 0x38(%rsp)
movl 0x14(%r13), %eax
movl %eax, 0x3c(%rsp)
movl 0x18(%r13), %eax
movl %eax, 0x40(%rsp)
movsd 0x20(%r13), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xe9ba
addq $0x28, %r13
cmpq 0x68(%r14), %r13
jne 0x55e12
leaq 0x60(%rbp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x67b72
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbp)
movups (%r14), %xmm0
movups %xmm0, (%rbp)
movq 0x28(%r14), %rax
movq %rax, 0x28(%rbp)
movups 0x18(%r14), %xmm0
movups %xmm0, 0x18(%rbp)
movq 0x40(%r14), %rax
movq %rax, 0x40(%rbp)
movups 0x30(%r14), %xmm0
movups %xmm0, 0x30(%rbp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x55fe5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x50(%rsp), %rdi
callq 0xf1b8
leaq 0x78(%rsp), %rdi
callq 0xf118
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5600f
jmp 0x5602d
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x56030
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x56030
jmp 0x5602d
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xf1b8
leaq 0x78(%rsp), %rdi
callq 0xf118
movq %rbx, %rdi
callq 0x4780