// File: /workspace/github_cpp_makefile_star2_O2/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, 0x18(%rsp)
addq $0x10, %rdi
leaq 0xb02d8(%rip), %rsi     # 0x10050d
movq %rdi, (%rsp)
callq 0x4480
leaq 0xb2339(%rip), %rbx     # 0x10257e
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
leaq 0x48(%r14), %rdi
xorl %r13d, %r13d
leaq 0x40(%rsp), %r12
leaq 0xb42af(%rip), %rbp     # 0x104512
leaq 0xb30ad(%rip), %r15     # 0x103317
movq %rdi, 0x8(%rsp)
movl %r13d, %r13d
movq 0x50(%r14), %rax
subq 0x48(%r14), %rax
sarq $0x6, %rax
cmpq %r13, %rax
jbe 0x50365
movq %r13, %rsi
callq 0xa848
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xa86a
movq (%rsp), %rdi
leaq 0xb3047(%rip), %rsi     # 0x1032ee
callq 0x4480
movq %rax, %rdi
movq %r13, %rsi
callq 0x42e0
movq %rax, %rdi
leaq 0xb301b(%rip), %rsi     # 0x1032dc
callq 0x4480
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
movq %rax, %rdi
leaq 0xb0178(%rip), %rsi     # 0x100453
callq 0x4480
movsd 0x20(%rsp), %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4480
movsd 0x28(%rsp), %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4480
movsd 0x30(%rsp), %xmm0
movq %rax, %rdi
callq 0x46c0
movq %rax, %rdi
leaq 0xb2fd8(%rip), %rsi     # 0x103302
callq 0x4480
movq %rax, %rdi
movq %r13, %rsi
callq 0x42e0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4480
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
movq %r12, %rdi
callq 0xb290
incl %r13d
movq 0x8(%rsp), %rdi
jmp 0x5026f
leaq 0xb3032(%rip), %rsi     # 0x10339e
movq (%rsp), %rdi
callq 0x4480
leaq 0xb2202(%rip), %rsi     # 0x10257e
movq %rax, %rdi
callq 0x4480
leaq 0x60(%r14), %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0xe0(%rsp), %r15
leaq 0xc8(%rsp), %r13
leaq 0xb416c(%rip), %rbx     # 0x104512
movl %ebp, %ebp
movq 0x68(%r14), %rax
subq 0x60(%r14), %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %rbp, %rax
jbe 0x505b2
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0xa822
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x40896
movslq 0x60(%rsp), %rsi
movq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xa848
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xa86a
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movq %r15, %rdi
callq 0x63c46
movslq 0x64(%rsp), %rsi
movq %r12, %rdi
callq 0xa848
leaq 0x88(%rsp), %rdi
movq %rax, %rsi
callq 0xa86a
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x98(%rsp), %xmm2
movq %r13, %rdi
callq 0x63c46
cvtsi2sdl 0x70(%rsp), %xmm0
cvtsi2sdl 0x74(%rsp), %xmm1
cvtsi2sdl 0x78(%rsp), %xmm2
movq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0x3f81c
movq (%rsp), %rdi
leaq 0xb00b2(%rip), %rsi     # 0x100530
callq 0x4480
movq %rax, %r12
movq %r15, %rdi
xorl %esi, %esi
callq 0x63c78
movsd (%rax), %xmm0
movq %r12, %rdi
callq 0x46c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
movq %rax, %r12
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0x63c78
movsd (%rax), %xmm0
movq %r12, %rdi
callq 0x46c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
movq %rax, %r12
movq %r15, %rdi
pushq $0x2
popq %rsi
callq 0x63c78
movsd (%rax), %xmm0
movq %r12, %rdi
callq 0x46c0
movq %rax, %rdi
leaq 0xb0038(%rip), %rsi     # 0x100528
callq 0x4480
movq %rax, %rdi
leaq 0xb2e7b(%rip), %rsi     # 0x10337a
callq 0x4480
movq %rax, %r12
movq %r13, %rdi
xorl %esi, %esi
callq 0x63c78
movsd (%rax), %xmm0
movq %r12, %rdi
callq 0x46c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
movq %rax, %r12
movq %r13, %rdi
pushq $0x1
popq %rsi
callq 0x63c78
movsd (%rax), %xmm0
movq %r12, %rdi
callq 0x46c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4480
movq %rax, %r12
movq %r13, %rdi
pushq $0x2
popq %rsi
callq 0x63c78
movsd (%rax), %xmm0
movq %r12, %rdi
callq 0x46c0
movq %rax, %rdi
leaq 0xb2d6d(%rip), %rsi     # 0x1032de
callq 0x4480
movq %rax, %rdi
leaq 0xb2d5e(%rip), %rsi     # 0x1032de
callq 0x4480
movq %rax, %rdi
leaq 0xb1fef(%rip), %rsi     # 0x10257e
callq 0x4480
leaq 0xa8(%rsp), %rdi
callq 0xb290
leaq 0x40(%rsp), %rdi
callq 0xb290
incl %ebp
jmp 0x503a6
leaq 0xb2d25(%rip), %rsi     # 0x1032de
movq (%rsp), %rdi
callq 0x4480
leaq 0xb1fb5(%rip), %rsi     # 0x10257e
movq %rax, %rdi
callq 0x4480
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x505e5
movq %rax, %rbx
jmp 0x50602
movq %rax, %rbx
movq %r12, %rdi
jmp 0x50607
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xb290
leaq 0x40(%rsp), %rdi
callq 0xb290
movq %rbx, %rdi
callq 0x4780