// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/networkstorage.cc
// Function: pruneVoronoiNetworkfromEdgeList(VORONOI_NETWORK*, VORONOI_NETWORK*, std::vector<int, std::allocator<int>>)
void pruneVoronoiNetworkfromEdgeList(VORONOI_NETWORK *vornet,
                                     VORONOI_NETWORK *newVornet,
                                     vector <int> ids){
    
    newVornet->nodes = vornet->nodes;
    
    vector<VOR_EDGE>::iterator edgeIter = vornet->edges.begin();
    vector<VOR_EDGE> newEdges;
    
    // Add all edges whose are not connected to specified nodes
    while(edgeIter != vornet->edges.end()){
        int flag=0;
        for(unsigned int i=0; i<ids.size(); i++){
            // if edge connects to node of specified id, flag it
            if(edgeIter->from==ids[i]||edgeIter->to==ids[i]) flag++;
        };
        
        if(flag==0){ // only keep unflagged edges
            VOR_EDGE newEdge;
            newEdge.from = edgeIter->from;
            newEdge.to   = edgeIter->to;
            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++;
    }
    
    
    newVornet->edges = newEdges;
    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 $0x48, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x48(%rdi), %rsi
leaq 0x48(%rbx), %rdi
callq 0x67cfa
movq 0x60(%r14), %rbp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpq 0x68(%r14), %rbp
je 0x56273
movq %rsp, %r12
leaq 0x20(%rsp), %r13
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
je 0x56221
sarq $0x2, %rcx
movl (%rbp), %edx
xorl %esi, %esi
xorl %edi, %edi
movl (%rax,%rsi,4), %r8d
cmpl %r8d, %edx
je 0x56210
cmpl %r8d, 0x4(%rbp)
jne 0x56212
incl %edi
incq %rsi
movl %esi, %r8d
cmpq %r8, %rcx
ja 0x56201
testl %edi, %edi
jne 0x56265
movl (%rbp), %eax
movl %eax, 0x20(%rsp)
movl 0x4(%rbp), %eax
movl %eax, 0x24(%rsp)
movsd 0x8(%rbp), %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0x10(%rbp), %eax
movl %eax, 0x30(%rsp)
movl 0x14(%rbp), %eax
movl %eax, 0x34(%rsp)
movl 0x18(%rbp), %eax
movl %eax, 0x38(%rsp)
movsd 0x20(%rbp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0xe9ba
addq $0x28, %rbp
cmpq 0x68(%r14), %rbp
jne 0x561ea
leaq 0x60(%rbx), %rdi
movq %rsp, %rsi
callq 0x67b72
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 (%rsp), %rdi
testq %rdi, %rdi
je 0x562c6
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x562d7
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x562f0
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780