// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/v_network.cc
// Function: voronoi_network::store_network(std::vector<VOR_NODE, std::allocator<VOR_NODE>>&, std::vector<VOR_EDGE, std::allocator<VOR_EDGE>>&, bool)
void voronoi_network::store_network(vector<VOR_NODE> &nodes, vector <VOR_EDGE> &edges, bool reverse_remove) {
  int ai,aj,ak,j,l,ll,q;
  double x,y,z,x2,y2,z2,*ptsp;
  
  nodes.clear(); edges.clear();

  // Print the vertex table
  for(l=0;l<edc;l++) {
    ptsp=pts[reg[l]];j=4*regp[l];

    vector<int> atomIDs;
    for(ll=0;ll<nec[l];ll++) atomIDs.push_back(ne[l][ll]);

    nodes.push_back(VOR_NODE(ptsp[j], ptsp[j+1], ptsp[j+2], ptsp[j+3], atomIDs));
  }
  
  // Print out the edge table, loop over vertices
  for(l=0;l<edc;l++) {
    
    // Store the position of this vertex
    ptsp=pts[reg[l]];j=4*regp[l];
    x=ptsp[j];y=ptsp[j+1];z=ptsp[j+2];

    // Loop over edges of this vertex
    for(q=0;q<nu[l];q++) {
      
      unpack_periodicity(pered[l][q],ai,aj,ak);
      
      // If this option is enabled, then the code will not
      // print edges from i to j for j<i.
      if(reverse_remove) if(ed[l][q]<l&&ai==0&&aj==0&&ak==0) continue;
      
      // Compute and print the length of the edge 
      ptsp=pts[reg[ed[l][q]]];j=4*regp[ed[l][q]];
      x2=ptsp[j]+ai*bx+aj*bxy+ak*bxz-x;
      y2=ptsp[j+1]+aj*by+ak*byz-y;
      z2=ptsp[j+2]+ak*bz-z;
      edges.push_back(VOR_EDGE(l, ed[l][q], raded[l][q].e, ai, aj, ak, sqrt(x2*x2+y2*y2+z2*z2)));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %ecx, 0x2c(%rsp)
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %r15
movq (%rsi), %rsi
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x13406
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x813e5
movq %rax, 0x8(%rbx)
movq %rbx, 0x58(%rsp)
cmpl $0x0, 0xa0(%r15)
jle 0x81571
xorl %ebx, %ebx
movq 0x60(%r15), %rax
movq 0xc0(%r15), %rcx
movslq (%rcx,%rbx,4), %rcx
movq (%rax,%rcx,8), %r14
movq 0xc8(%r15), %rax
movslq (%rax,%rbx,4), %rbp
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0xb0(%r15), %rax
cmpl $0x0, (%rax,%rbx,4)
jle 0x81486
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x88(%r15), %rax
movq (%rax,%rbx,8), %rdx
addq %r12, %rdx
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x81465
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x8146f
leaq 0x30(%rsp), %rdi
callq 0xf7b4
incq %r13
movq 0xb0(%r15), %rax
movslq (%rax,%rbx,4), %rax
addq $0x4, %r12
cmpq %rax, %r13
jl 0x8143c
shlq $0x2, %rbp
movsd (%r14,%rbp,8), %xmm0
movsd %xmm0, (%rsp)
movl %ebp, %eax
orl $0x1, %eax
cltq
movsd (%r14,%rax,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movl %ebp, %eax
orl $0x2, %eax
cltq
movsd (%r14,%rax,8), %xmm0
movsd %xmm0, 0x18(%rsp)
orl $0x3, %ebp
movslq %ebp, %rax
movsd (%r14,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x60(%rsp), %r14
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
callq 0xe886
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movsd (%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
movq %r14, %rsi
callq 0x55564
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x84182
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x81530
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x81547
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8155e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
incq %rbx
movslq 0xa0(%r15), %rax
cmpq %rax, %rbx
jl 0x813fa
cmpl $0x0, 0xa0(%r15)
jle 0x817bf
xorl %esi, %esi
movq 0xa8(%r15), %rax
cmpl $0x0, (%rax,%rsi,4)
jle 0x817ac
movq 0xc0(%r15), %rax
movslq (%rax,%rsi,4), %rax
movq 0x60(%r15), %rcx
movq (%rcx,%rax,8), %rax
movq 0xc8(%r15), %rcx
movslq (%rcx,%rsi,4), %rcx
leaq (,%rcx,4), %rdx
shlq $0x5, %rcx
movsd (%rax,%rcx), %xmm0
movsd %xmm0, 0x20(%rsp)
leal 0x1(%rdx), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x18(%rsp)
orl $0x2, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x8, %r13d
xorl %r12d, %r12d
movq %rsi, (%rsp)
movq 0x98(%r15), %rax
movq (%rax,%rsi,8), %rax
movl (%rax,%r12,4), %r14d
movl %r14d, %ebx
shrl $0x10, %ebx
addl $-0x7f, %ebx
movl %r14d, %ebp
shrl $0x8, %ebp
movl $0xff, %eax
andl %eax, %ebp
addl $-0x7f, %ebp
andl %eax, %r14d
addl $-0x7f, %r14d
cmpb $0x0, 0x2c(%rsp)
je 0x81651
movq 0x80(%r15), %rax
movq (%rax,%rsi,8), %rax
movslq (%rax,%r12,4), %rax
cmpq %rax, %rsi
jle 0x81651
testl %ebx, %ebx
jne 0x81651
testl %ebp, %ebp
jne 0x81651
testl %r14d, %r14d
je 0x81791
movq 0xc0(%r15), %rcx
movq 0x60(%r15), %rdx
movq 0x80(%r15), %rax
movq (%rax,%rsi,8), %rdi
movslq (%rdi,%r12,4), %rdi
movslq (%rcx,%rdi,4), %rcx
movq (%rdx,%rcx,8), %rcx
movq 0xc8(%r15), %rdx
movslq (%rdx,%rdi,4), %rdi
leaq (,%rdi,4), %rdx
shlq $0x5, %rdi
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
mulsd (%r15), %xmm0
addsd (%rcx,%rdi), %xmm0
xorps %xmm2, %xmm2
cvtsi2sd %ebp, %xmm2
movsd 0x8(%r15), %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd 0x18(%r15), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm3, %xmm1
leal 0x1(%rdx), %edi
movslq %edi, %rdi
mulsd 0x10(%r15), %xmm2
addsd (%rcx,%rdi,8), %xmm2
subsd 0x20(%rsp), %xmm1
movsd 0x20(%r15), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
subsd 0x18(%rsp), %xmm3
orl $0x2, %edx
mulsd 0x28(%r15), %xmm0
movslq %edx, %rdx
addsd (%rcx,%rdx,8), %xmm0
subsd 0x10(%rsp), %xmm0
movq (%rax,%rsi,8), %rax
movl (%rax,%r12,4), %edx
movq 0x90(%r15), %rax
movq (%rax,%rsi,8), %rax
movsd (%rax,%r13), %xmm2
mulsd %xmm3, %xmm3
mulsd %xmm1, %xmm1
addsd %xmm3, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0xd1b83(%rip), %xmm0    # 0x1532c0
jb 0x81748
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
jmp 0x81769
movl %edx, 0x8(%rsp)
movsd %xmm2, 0x50(%rsp)
callq 0x4350
movsd 0x50(%rsp), %xmm2
movl 0x8(%rsp), %edx
movq (%rsp), %rsi
movapd %xmm0, %xmm1
leaq 0x78(%rsp), %rdi
movaps %xmm2, %xmm0
movl %ebx, %ecx
movl %ebp, %r8d
movl %r14d, %r9d
callq 0x55510
movq 0x58(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x69134
movq (%rsp), %rsi
incq %r12
movq 0xa8(%r15), %rax
movslq (%rax,%rsi,4), %rax
addq $0x10, %r13
cmpq %rax, %r12
jl 0x815f6
incq %rsi
movslq 0xa0(%r15), %rax
cmpq %rax, %rsi
jl 0x81581
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x81811
movq %rax, %rbx
jmp 0x817f8
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x817f8
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x81814
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x81814
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8182b
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780
nop