// File: 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
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
callq 0x94da0
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x94dd0
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
callq 0x94e30
movq %rax, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x94df0
testb $0x1, %al
jne 0x9491b
jmp 0x94a2b
movl -0x1c(%rbp), %eax
movl %eax, -0x12c(%rbp)
leaq -0x18(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x59b70
movq -0x108(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x128(%rbp)
callq 0x59b70
movq -0x108(%rbp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x120(%rbp)
callq 0x59b70
movq -0x108(%rbp), %rdi
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x118(%rbp)
callq 0x59b70
movq -0x108(%rbp), %rdi
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x110(%rbp)
callq 0x59b70
movl -0x12c(%rbp), %esi
movsd -0x128(%rbp), %xmm0
movsd -0x120(%rbp), %xmm1
movsd -0x118(%rbp), %xmm2
movsd -0x110(%rbp), %xmm3
movzbl 0x38(%rax), %edx
andl $0x1, %edx
leaq -0x70(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x94580
movq -0x108(%rbp), %rdi
movl -0x1c(%rbp), %eax
incl %eax
movl %eax, -0x1c(%rbp)
xorl %esi, %esi
callq 0x59b90
movq -0x100(%rbp), %rsi
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0x94e60
jmp 0x94a00
leaq -0x70(%rbp), %rdi
callq 0x100e0
jmp 0x948f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x100e0
jmp 0x94c1a
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
callq 0x94ed0
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
callq 0x94f40
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x94f00
testb $0x1, %al
jne 0x94a6f
jmp 0x94bb2
leaq -0x90(%rbp), %rdi
callq 0x94f70
movl 0x10(%rax), %eax
movl %eax, -0x148(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x94f70
movl 0x14(%rax), %eax
movl %eax, -0x144(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x94f70
movl -0x148(%rbp), %esi
movl -0x144(%rbp), %edx
movl 0x18(%rax), %ecx
leaq -0xa4(%rbp), %rdi
callq 0x94010
leaq -0x90(%rbp), %rdi
callq 0x94f70
movl (%rax), %eax
movl %eax, -0x140(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x94f70
movl 0x4(%rax), %eax
movl %eax, -0x13c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x94f70
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x138(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x94f70
movl -0x140(%rbp), %esi
movl -0x13c(%rbp), %edx
movsd -0x138(%rbp), %xmm0
movsd 0x8(%rax), %xmm1
movq -0xa4(%rbp), %rax
movq %rax, -0xdc(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0xdc(%rbp), %rax
movq %rax, -0xec(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0xe4(%rbp)
movq -0xec(%rbp), %rcx
movl -0xe4(%rbp), %r8d
leaq -0xd0(%rbp), %rdi
callq 0x94400
movq -0x10(%rbp), %rdi
movslq -0xd0(%rbp), %rsi
callq 0x10130
movq %rax, %rdi
addq $0x20, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x64790
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
callq 0x94f90
movq %rax, -0xf8(%rbp)
jmp 0x94a3f
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x18(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x20(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x18(%rcx), %rdx
movq %rdx, 0x30(%rax)
movq 0x20(%rcx), %rdx
movq %rdx, 0x38(%rax)
movq 0x28(%rcx), %rcx
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x30(%rcx), %rdx
movq %rdx, 0x48(%rax)
movq 0x38(%rcx), %rdx
movq %rdx, 0x50(%rax)
movq 0x40(%rcx), %rcx
movq %rcx, 0x58(%rax)
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)