// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/voronoicell.cc
// Function: writeVornet(std::basic_fstream<char, std::char_traits<char>>&, ATOM_NETWORK*, VORONOI_NETWORK*)
void writeVornet(fstream &output, ATOM_NETWORK *atmnet, VORONOI_NETWORK *vornet){
  output << "set vornets(0) {" << "\n";

  // Iterate over all Voronoi nodes
  for(unsigned int i = 0; i < vornet->nodes.size(); i++){
    VOR_NODE curNode = vornet->nodes.at(i);
    output << "{color $nodeColors("<< i << ") }" << "\n"
	       << "{sphere {" << curNode.x << " " << curNode.y << " " << curNode.z 
	       << "} radius $nodeRadii(" << i << ") resolution $sphere_resolution}" << "\n";
  }

  // Iterate over all Voronoi edges
  output << "{color $vornetColors(0)}" << "\n";
  for(unsigned int i = 0; i < vornet->edges.size(); i++){
    VOR_EDGE curEdge = vornet->edges.at(i);
    VOR_NODE startNode = vornet->nodes.at(curEdge.from);
    Point start = Point(startNode.x, startNode.y, startNode.z);
    VOR_NODE endNode = vornet->nodes.at(curEdge.to);
    Point end = Point(endNode.x, endNode.y, endNode.z);
    atmnet->translatePoint(&end, curEdge.delta_uc_x, curEdge.delta_uc_y, curEdge.delta_uc_z);
    output << "{line {" 
	   << start[0] << " " << start[1] << " " << start[2] << "} " 
	   << "{" << end[0] << " " << end[1] << " " << end[2] << "}" 
	   << "}" << "\n";
  }
  output << "}" << "\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, %r14
movq %rsi, 0x58(%rsp)
movq %rdi, %rbx
addq $0x10, %rbx
leaq 0xe4def(%rip), %rsi     # 0x15157d
movl $0x10, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe6e7c(%rip), %rsi     # 0x15361e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
movq 0x48(%r14), %rax
cmpq %rax, 0x50(%r14)
je 0x6c937
movl $0x1, %ebp
xorl %r13d, %r13d
leaq 0xe8e0a(%rip), %r12     # 0x1555d6
movq %r13, %rcx
shlq $0x6, %rcx
leaq (%rax,%rcx), %r15
addq $0x20, %r15
movupd -0x20(%r15), %xmm0
movupd -0x10(%r15), %xmm1
movapd %xmm1, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xe8f8
movb 0x18(%r15), %al
movb %al, 0x48(%rsp)
movl $0x13, %edx
movq %rbx, %rdi
leaq 0xe7b77(%rip), %rsi     # 0x15438e
callq 0x44e0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x42b0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0xe7b43(%rip), %rsi     # 0x15437c
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe6dd1(%rip), %rsi     # 0x15361e
callq 0x44e0
movl $0x9, %edx
movq %r15, %rdi
leaq 0xe4c62(%rip), %rsi     # 0x1514c3
callq 0x44e0
movsd 0x10(%rsp), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
movsd 0x18(%rsp), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
movsd 0x20(%rsp), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x14, %edx
movq %rax, %rdi
leaq 0xe7ada(%rip), %rsi     # 0x1543a2
callq 0x44e0
movq %r15, %rdi
movq %r13, %rsi
callq 0x42b0
movq %rax, %r15
movl $0x20, %edx
movq %rax, %rdi
leaq 0xe7acd(%rip), %rsi     # 0x1543b7
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe6d20(%rip), %rsi     # 0x15361e
callq 0x44e0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x6c91a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl %ebp, %r13d
movq 0x48(%r14), %rax
movq 0x50(%r14), %rcx
subq %rax, %rcx
sarq $0x6, %rcx
incl %ebp
cmpq %r13, %rcx
ja 0x6c7cc
leaq 0xe7b00(%rip), %rsi     # 0x15443e
movl $0x18, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe6ccc(%rip), %rsi     # 0x15361e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
movq 0x60(%r14), %rax
cmpq %rax, 0x68(%r14)
je 0x6cc95
movl $0x1, %r12d
xorl %ecx, %ecx
leaq 0xe0(%rsp), %rbp
leaq 0xc8(%rsp), %r13
movq %r14, 0x8(%rsp)
movq %r14, %r15
movq %rbx, %r14
movq %r13, %rbx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x551fc
movslq 0xa0(%rsp), %rsi
movq 0x48(%r15), %rax
movq 0x50(%r15), %rdx
subq %rax, %rdx
sarq $0x6, %rdx
cmpq %rsi, %rdx
jbe 0x6cce0
shlq $0x6, %rsi
leaq (%rax,%rsi), %r15
addq $0x20, %r15
movups -0x20(%r15), %xmm0
movups -0x10(%r15), %xmm1
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xe8f8
movb 0x18(%r15), %al
movb %al, 0x48(%rsp)
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movq %rbp, %r13
movq %rbp, %rdi
callq 0x83f68
movslq 0xa4(%rsp), %r15
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rbp
movq 0x50(%rax), %rdx
subq %rbp, %rdx
sarq $0x6, %rdx
cmpq %r15, %rdx
jbe 0x6cccf
shlq $0x6, %r15
leaq (%r15,%rbp), %rsi
addq $0x20, %rsi
movupd -0x20(%rsi), %xmm0
movupd -0x10(%rsi), %xmm1
movapd %xmm1, 0x70(%rsp)
movapd %xmm0, 0x60(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xe8f8
addq %r15, %rbp
movb 0x38(%rbp), %al
movb %al, 0x98(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
movsd 0x70(%rsp), %xmm2
movq %rbx, %rdi
callq 0x83f68
movq %r13, %rbp
movq %rbx, %r13
movq %r14, %rbx
leaq 0xe8b31(%rip), %r14     # 0x1555d6
xorps %xmm0, %xmm0
cvtsi2sdl 0xb0(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0xb4(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0xb8(%rsp), %xmm2
movq 0x58(%rsp), %rdi
movq %r13, %rsi
callq 0x5395a
movl $0x7, %edx
movq %rbx, %rdi
leaq 0xe4abb(%rip), %rsi     # 0x1515a0
callq 0x44e0
movq %rbp, %rdi
xorl %esi, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
movq %rbp, %rdi
movl $0x1, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
movq %rbp, %rdi
movl $0x2, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0xe4a2e(%rip), %rsi     # 0x151598
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe789c(%rip), %rsi     # 0x15441a
callq 0x44e0
movq %r13, %rdi
xorl %esi, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
movq %r13, %rdi
movl $0x1, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x44e0
movq %r13, %rdi
movl $0x2, %esi
callq 0x83f9a
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe777b(%rip), %rsi     # 0x15437e
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe7767(%rip), %rsi     # 0x15437e
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe69f3(%rip), %rsi     # 0x15361e
callq 0x44e0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x6cc4d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %r14
je 0x6cc69
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movl %r12d, %ecx
movq 0x60(%r14), %rax
movq 0x68(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rsi, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x6c98a
leaq 0xe76e2(%rip), %rsi     # 0x15437e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe696e(%rip), %rsi     # 0x15361e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe0a1f(%rip), %rdi     # 0x14d6f5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xe0a0e(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
jmp 0x6ccf4
jmp 0x6ccf4
jmp 0x6ccf4
movq %rax, %rbx
jmp 0x6cd19
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x6cd19
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x6cd30
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780