// File: /workspace/github_cpp_makefile_star2_O3/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, 0x48(%rsp)
movq %rdi, %r14
leaq 0x80(%rsp), %rax
movl $0x0, (%rax)
xorl %ebx, %ebx
movq %rbx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rbx, 0x20(%rax)
movq 0x48(%rdi), %r15
movq %rbx, 0x40(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq 0x50(%rdi), %rax
cmpq %rax, %r15
je 0x55a9e
leaq 0x78(%rsp), %r13
leaq 0x50(%rsp), %rbp
xorl %r12d, %r12d
movsd 0x18(%r15), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x55a93
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xe9d4
movl %ebx, 0x50(%rsp)
movl %r12d, 0x54(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x135ee
incl %r12d
movq 0x50(%r14), %rax
incl %ebx
addq $0x40, %r15
cmpq %rax, %r15
jne 0x55a5d
movq 0x48(%rsp), %rbx
leaq 0x48(%rbx), %rdi
leaq 0x30(%rsp), %rsi
callq 0x673a2
movq 0x60(%r14), %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x68(%r14), %rcx
cmpq %rcx, %r13
leaq 0x80(%rsp), %rbp
je 0x55c6c
leaq 0x10(%rsp), %r15
leaq 0x50(%rsp), %r12
movsd 0x8(%r13), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x55c5f
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x55c5f
movl (%r13), %esi
movq %rax, %r10
movq %rbp, %r9
movq %r9, %rdx
movq %r10, %rdi
movl 0x20(%r10), %r8d
xorl %r10d, %r10d
cmpl %esi, %r8d
setl %r10b
movq %rdi, %r9
cmovlq %rdx, %r9
movq 0x10(%rdi,%r10,8), %r10
testq %r10, %r10
jne 0x55b14
cmpq %rbp, %r9
je 0x55c5f
cmpl %esi, %r8d
cmovlq %rdx, %rdi
cmpl 0x20(%rdi), %esi
jl 0x55c5f
movl 0x4(%r13), %edx
movq %rax, %r11
movq %rbp, %r10
movq %r10, %rdi
movq %r11, %r8
movl 0x20(%r11), %r9d
xorl %r11d, %r11d
cmpl %edx, %r9d
setl %r11b
movq %r8, %r10
cmovlq %rdi, %r10
movq 0x10(%r8,%r11,8), %r11
testq %r11, %r11
jne 0x55b5c
cmpq %rbp, %r10
je 0x55c5f
cmpl %edx, %r9d
cmovlq %rdi, %r8
cmpl 0x20(%r8), %edx
jl 0x55c5f
movq %rax, %r10
movq %rbp, %r8
movq %r8, %rcx
movq %r10, %rdi
movl 0x20(%r10), %r9d
xorl %r10d, %r10d
cmpl %esi, %r9d
setl %r10b
movq %rdi, %r8
cmovlq %rcx, %r8
movq 0x10(%rdi,%r10,8), %r10
testq %r10, %r10
jne 0x55ba1
movq %rbp, %r10
cmpq %rbp, %r8
je 0x55bdf
cmpl %esi, %r9d
cmovlq %rcx, %rdi
cmpl 0x20(%rdi), %esi
cmovlq %rbp, %r8
movq %r8, %r10
movl 0x24(%r10), %ecx
movl %ecx, 0x50(%rsp)
movq %rbp, %rdi
movq %rdi, %rcx
movq %rax, %rsi
movl 0x20(%rax), %r8d
xorl %eax, %eax
cmpl %edx, %r8d
setl %al
movq %rsi, %rdi
cmovlq %rcx, %rdi
movq 0x10(%rsi,%rax,8), %rax
testq %rax, %rax
jne 0x55bea
movq %rbp, %rax
cmpq %rbp, %rdi
je 0x55c26
cmpl %edx, %r8d
cmovlq %rcx, %rsi
cmpl 0x20(%rsi), %edx
cmovlq %rbp, %rdi
movq %rdi, %rax
movl 0x24(%rax), %eax
movl %eax, 0x54(%rsp)
movsd %xmm0, 0x58(%rsp)
movq 0x10(%r13), %rax
movq %rax, 0x60(%rsp)
movl 0x18(%r13), %eax
movl %eax, 0x68(%rsp)
movsd 0x20(%r13), %xmm0
movsd %xmm0, 0x70(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xea2c
movq 0x68(%r14), %rcx
addq $0x28, %r13
cmpq %rcx, %r13
jne 0x55ae7
leaq 0x60(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x67218
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movq 0x28(%r14), %rax
movq %rax, 0x28(%rbx)
movups 0x18(%r14), %xmm0
movups %xmm0, 0x18(%rbx)
movq 0x40(%r14), %rax
movq %rax, 0x40(%rbx)
movups 0x30(%r14), %xmm0
movups %xmm0, 0x30(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x55cc2
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
leaq 0x30(%rsp), %rdi
callq 0xf256
leaq 0x78(%rsp), %rdi
callq 0xf1b6
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x55cea
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x55d0d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x55d0d
jmp 0x55d0a
jmp 0x55d0a
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xf256
leaq 0x78(%rsp), %rdi
callq 0xf1b6
movq %rbx, %rdi
callq 0x4780
nop