// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/graphstorage.cc
// Function: DIJKSTRA_NETWORK::buildDijkstraNetwork(VORONOI_NETWORK const*, DIJKSTRA_NETWORK*)
void DIJKSTRA_NETWORK::buildDijkstraNetwork(const VORONOI_NETWORK *vornet, DIJKSTRA_NETWORK *dnet){
    vector<VOR_NODE> ::const_iterator niter = vornet->nodes.begin();
    int i = 0;
    dnet->nodes.clear();
    
    // Add copies of all nodes to the network
    while(niter != vornet->nodes.end()){
        DIJKSTRA_NODE node = DIJKSTRA_NODE(i, niter->x, niter->y, niter->z, niter->rad_stat_sphere, niter->active);
        i++;
        niter++;
        dnet->nodes.push_back(node);
    }
    
    // For each edge, store it in the DIJKSTRA node's list of connections that the connection
    // stems from
    vector<VOR_EDGE> ::const_iterator eiter = vornet->edges.begin();
    while(eiter != vornet->edges.end()){
        DELTA_POS pos = DELTA_POS(eiter->delta_uc_x, eiter->delta_uc_y, eiter->delta_uc_z);
        CONN conn = CONN(eiter->from, eiter->to, eiter->length, eiter->rad_moving_sphere,pos);
        dnet->nodes.at(conn.from).connections.push_back(conn);
        eiter++;
    }
    
    // Copy the unit cell vectors into the DIJKSTRA_NETWORK
    dnet->v_a = vornet->v_a;
    dnet->v_b = vornet->v_b;
    dnet->v_c = vornet->v_c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x48(%rdi), %r12
movq (%rsi), %rsi
movq %rbx, %rdi
callq 0x50f00
cmpq 0x50(%r14), %r12
je 0x50cb1
xorl %ebp, %ebp
leaq 0x20(%rsp), %r13
movq %rsp, %r15
movsd 0x10(%r12), %xmm0
movsd 0x18(%r12), %xmm1
movb 0x38(%r12), %al
movl %ebp, (%rsp)
movups (%r12), %xmm2
movups %xmm2, 0x8(%rsp)
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movq $0x0, 0x10(%r13)
movsd %xmm1, 0x38(%rsp)
movb %al, 0x40(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x50ea0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x50ca5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x40, %r12
incl %ebp
cmpq 0x50(%r14), %r12
jne 0x50c43
movq 0x60(%r14), %r12
cmpq 0x68(%r14), %r12
je 0x50d6b
movabsq $-0x71c71c71c71c71c7, %r13 # imm = 0x8E38E38E38E38E39
movq %rsp, %r15
movq 0x10(%r12), %rax
movl 0x18(%r12), %ecx
movsd 0x20(%r12), %xmm0
movsd 0x8(%r12), %xmm1
movq (%r12), %rdx
movq %rdx, (%rsp)
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movl %ecx, 0x20(%rsp)
movslq %edx, %rsi
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %rsi, %rdx
jbe 0x50dac
leaq (%rsi,%rsi,8), %rcx
leaq (%rax,%rcx,8), %rdi
addq $0x20, %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x50d55
movq 0x20(%rsp), %rax
movq %rax, 0x20(%rsi)
movups (%rsp), %xmm0
movups 0x10(%rsp), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x28, 0x8(%rdi)
jmp 0x50d5d
movq %r15, %rdx
callq 0x392d4
addq $0x28, %r12
cmpq 0x68(%r14), %r12
jne 0x50ccc
movq 0x10(%r14), %rax
movq %rax, 0x28(%rbx)
movups (%r14), %xmm0
movups %xmm0, 0x18(%rbx)
movups 0x18(%r14), %xmm0
movups %xmm0, 0x30(%rbx)
movq 0x28(%r14), %rax
movq %rax, 0x40(%rbx)
movups 0x30(%r14), %xmm0
movups %xmm0, 0x48(%rbx)
movq 0x40(%r14), %rax
movq %rax, 0x58(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfc942(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x50dd4
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780