// File: Luthaf[P]zeopp/networkstorage.cc
// Function: VORONOI_NETWORK::prune(double const&)
const VORONOI_NETWORK VORONOI_NETWORK::prune(const double& minRadius)
{
    vector<VOR_EDGE> newEdges;
    // Add edges whose radius is greater than the input minimum to a list
    for(vector<VOR_EDGE>::iterator edgeIter = edges.begin();
        edgeIter != edges.end(); edgeIter++) {
        if(edgeIter->rad_moving_sphere > minRadius){
            //VOR_EDGE newEdge = *edgeIter;
            
            // further check: keep edges only if they connect accessible nodes
            if( nodes[edgeIter->from].rad_stat_sphere > minRadius && nodes[edgeIter->to].rad_stat_sphere > minRadius )
                newEdges.push_back(*edgeIter);
            
        }
    };
    
    vector<VOR_NODE> newNodes = nodes;
    for(unsigned int i = 0; i < nodes.size(); i++)
    {
        if(nodes[i].rad_stat_sphere > minRadius) newNodes[i].active = true; else newNodes[i].active = false;
    };
    
    return VORONOI_NETWORK(v_a, v_b, v_c, newNodes, newEdges);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x90(%rbp)
movq %rdi, %rax
movq %rax, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xae670
movq -0x80(%rbp), %rdi
addq $0x60, %rdi
callq 0x263c0
movq %rax, -0x38(%rbp)
movq -0x80(%rbp), %rdi
addq $0x60, %rdi
callq 0x26230
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x59a50
testb $0x1, %al
jne 0x9abb1
jmp 0x9ac7c
leaq -0x38(%rbp), %rdi
callq 0x59a90
movsd 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
ucomisd (%rax), %xmm0
jbe 0x9ac66
movq -0x80(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x98(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x59a90
movq -0x98(%rbp), %rdi
movslq (%rax), %rsi
callq 0x24e20
movsd 0x18(%rax), %xmm0
movq -0x18(%rbp), %rax
ucomisd (%rax), %xmm0
jbe 0x9ac64
movq -0x80(%rbp), %rax
addq $0x48, %rax
movq %rax, -0xa0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x59a90
movq -0xa0(%rbp), %rdi
movslq 0x4(%rax), %rsi
callq 0x24e20
movsd 0x18(%rax), %xmm0
movq -0x18(%rbp), %rax
ucomisd (%rax), %xmm0
jbe 0x9ac64
leaq -0x38(%rbp), %rdi
callq 0xaedb0
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
callq 0xf5e0
jmp 0x9ac51
jmp 0x9ac64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9ad6f
jmp 0x9ac66
jmp 0x9ac68
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x59ab0
movq %rax, -0x58(%rbp)
jmp 0x9ab8a
movq -0x80(%rbp), %rsi
addq $0x48, %rsi
leaq -0x70(%rbp), %rdi
callq 0xae690
jmp 0x9ac8f
movl $0x0, -0x74(%rbp)
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %eax
movq %rax, -0xa8(%rbp)
addq $0x48, %rdi
callq 0xf270
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x9ad10
movq -0x80(%rbp), %rdi
addq $0x48, %rdi
movl -0x74(%rbp), %eax
movl %eax, %esi
callq 0x24e20
movsd 0x18(%rax), %xmm0
movq -0x18(%rbp), %rax
ucomisd (%rax), %xmm0
jbe 0x9acf1
movl -0x74(%rbp), %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x24e20
movb $0x1, 0x38(%rax)
jmp 0x9ad03
movl -0x74(%rbp), %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x24e20
movb $0x0, 0x38(%rax)
jmp 0x9ad05
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x9ac96
movq -0x80(%rbp), %rsi
movq -0x90(%rbp), %rdi
movq %rsi, %rdx
addq $0x18, %rdx
movq %rsi, %rcx
addq $0x30, %rcx
leaq -0x70(%rbp), %r8
leaq -0x30(%rbp), %r9
callq 0x99c10
jmp 0x9ad38
leaq -0x70(%rbp), %rdi
callq 0x11be0
leaq -0x30(%rbp), %rdi
callq 0x11b80
movq -0x88(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x11be0
leaq -0x30(%rbp), %rdi
callq 0x11b80
movq -0x48(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)