// File: /workspace/github_cpp_makefile_star2_O1/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 0x512a4
cmpq 0x50(%r14), %r12
je 0x5104f
xorl %ebp, %ebp
movq %rsp, %r15
movsd (%r12), %xmm0
movsd 0x8(%r12), %xmm1
movsd 0x10(%r12), %xmm2
movsd 0x18(%r12), %xmm3
movzbl 0x38(%r12), %edx
movq %r15, %rdi
movl %ebp, %esi
callq 0x50c7c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51244
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x51043
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x40, %r12
incl %ebp
cmpq 0x50(%r14), %r12
jne 0x50ff6
movq 0x60(%r14), %r12
cmpq 0x68(%r14), %r12
je 0x5110e
movabsq $-0x71c71c71c71c71c7, %r13 # imm = 0x8E38E38E38E38E39
movq %rsp, %r15
movl 0x18(%r12), %eax
movq 0x10(%r12), %rcx
movslq (%r12), %rsi
movl 0x4(%r12), %edx
movsd 0x20(%r12), %xmm0
movsd 0x8(%r12), %xmm1
movl %esi, (%rsp)
movl %edx, 0x4(%rsp)
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %rsi, %rdx
jbe 0x5114f
leaq (%rsi,%rsi,8), %rcx
leaq (%rax,%rcx,8), %rdi
addq $0x20, %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x510f8
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 0x51100
movq %r15, %rdx
callq 0x396ae
addq $0x28, %r12
cmpq 0x68(%r14), %r12
jne 0x5106a
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 0xfe54f(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x51177
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780
nop