// File: /workspace/github_cpp_makefile_star2_O1/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 0xe6173(%rip), %rsi     # 0x1534ed
movl $0x10, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe81a0(%rip), %rsi     # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
movq 0x48(%r14), %rax
cmpq %rax, 0x50(%r14)
je 0x6d523
movl $0x1, %ebp
xorl %r13d, %r13d
leaq 0xea0ce(%rip), %r12     # 0x157486
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 0xe886
movb 0x18(%r15), %al
movb %al, 0x48(%rsp)
movl $0x13, %edx
movq %rbx, %rdi
leaq 0xe8e9b(%rip), %rsi     # 0x15629e
callq 0x44e0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x42b0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0xe8e67(%rip), %rsi     # 0x15628c
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe80f5(%rip), %rsi     # 0x15552e
callq 0x44e0
movl $0x9, %edx
movq %r15, %rdi
leaq 0xe5fe6(%rip), %rsi     # 0x153433
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 0xe8dfe(%rip), %rsi     # 0x1562b2
callq 0x44e0
movq %r15, %rdi
movq %r13, %rsi
callq 0x42b0
movq %rax, %r15
movl $0x20, %edx
movq %rax, %rdi
leaq 0xe8df1(%rip), %rsi     # 0x1562c7
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe8044(%rip), %rsi     # 0x15552e
callq 0x44e0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x6d506
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 0x6d3b8
leaq 0xe8e24(%rip), %rsi     # 0x15634e
movl $0x18, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe7ff0(%rip), %rsi     # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
movq 0x60(%r14), %rax
cmpq %rax, 0x68(%r14)
je 0x6d881
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 0x5552c
movslq 0xa0(%rsp), %rsi
movq 0x48(%r15), %rax
movq 0x50(%r15), %rdx
subq %rax, %rdx
sarq $0x6, %rdx
cmpq %rsi, %rdx
jbe 0x6d8cc
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 0xe886
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 0x85436
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 0x6d8bb
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 0xe886
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 0x85436
movq %r13, %rbp
movq %rbx, %r13
movq %r14, %rbx
leaq 0xe9df5(%rip), %r14     # 0x157486
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 0x53c58
movl $0x7, %edx
movq %rbx, %rdi
leaq 0xe5e3f(%rip), %rsi     # 0x153510
callq 0x44e0
movq %rbp, %rdi
xorl %esi, %esi
callq 0x85478
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 0x85478
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 0x85478
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0xe5db2(%rip), %rsi     # 0x153508
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe8bc0(%rip), %rsi     # 0x15632a
callq 0x44e0
movq %r13, %rdi
xorl %esi, %esi
callq 0x85478
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 0x85478
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 0x85478
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe8a9f(%rip), %rsi     # 0x15628e
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe8a8b(%rip), %rsi     # 0x15628e
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe7d17(%rip), %rsi     # 0x15552e
callq 0x44e0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x6d839
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %r14
je 0x6d855
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 0x6d576
leaq 0xe8a06(%rip), %rsi     # 0x15628e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe7c92(%rip), %rsi     # 0x15552e
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 0xe1de3(%rip), %rdi     # 0x14f6a5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xe1dd2(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
jmp 0x6d8e0
jmp 0x6d8e0
jmp 0x6d8e0
movq %rax, %rbx
jmp 0x6d905
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x6d905
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x6d91c
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780