// File: Luthaf[P]zeopp/voronoicell.cc
// Function: writeVMDAtomsAndNodes(std::basic_fstream<char, std::char_traits<char>>&, ATOM_NETWORK*, VORONOI_NETWORK*)
void writeVMDAtomsAndNodes(fstream &output, ATOM_NETWORK *atmnet, VORONOI_NETWORK *vornet){
  // Iterate over all atoms. Set the radius of the atom to its actual value
  for(unsigned int i = 0; i < atmnet->atoms.size(); i++){
    ATOM curAtom = atmnet->atoms.at(i);
    output << "set atoms(" << i << ") {" << "\n"
	       << "{color $atomColors(" << i << ") }" << "\n"
	       << "{sphere {" << curAtom.x << " " << curAtom.y << " " << curAtom.z 
	       << "} radius $atomRadii(" << i << ") resolution $sphere_resolution}" 
	       << "\n" << "}" << "\n";
    output << "set atomRadii(" << i << ") " << curAtom.radius << "\n";
  }

  // Iterate over all nodes. Set the radius of the node to that of the maximum static sphere
  for(unsigned int i = 0; i < vornet->nodes.size(); i++){
    VOR_NODE curNode = vornet->nodes.at(i);
    output << "set nodes(" << i << ") {" << "\n"
	   << "{color $nodeColors("<< i << ") }" << "\n"
	   << "{sphere {" << curNode.x << " " << curNode.y << " " << curNode.z 
	   << "} radius $nodeRadii(" << i <<  ") resolution $sphere_resolution}" << "\n"
	   << "}" << "\n";
    output << "set nodeRadii(" << i << ") " << curNode.rad_stat_sphere << "\n";
  }    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x110(%rbp)
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
callq 0xf060
movq %rax, %rcx
movq -0x110(%rbp), %rax
cmpq %rcx, %rax
jae 0xbe8a0
movq -0x10(%rbp), %rdi
addq $0x2f0, %rdi            # imm = 0x2F0
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0xf090
movq %rax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0xf0d0
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x13cb06(%rip), %rsi    # 0x1fb0d4
callq 0x5540
movq %rax, -0x118(%rbp)
jmp 0xbe5dc
movq -0x118(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x56f0
movq %rax, -0x120(%rbp)
jmp 0xbe5f4
movq -0x120(%rbp), %rdi
leaq 0x13ca93(%rip), %rsi    # 0x1fb095
callq 0x5540
movq %rax, -0x128(%rbp)
jmp 0xbe610
movq -0x128(%rbp), %rdi
leaq 0x13b007(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x130(%rbp)
jmp 0xbe62c
movq -0x130(%rbp), %rdi
leaq 0x13caa5(%rip), %rsi    # 0x1fb0df
callq 0x5540
movq %rax, -0x138(%rbp)
jmp 0xbe648
movq -0x138(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x56f0
movq %rax, -0x140(%rbp)
jmp 0xbe660
movq -0x140(%rbp), %rdi
leaq 0x13c98b(%rip), %rsi    # 0x1faff9
callq 0x5540
movq %rax, -0x148(%rbp)
jmp 0xbe67c
movq -0x148(%rbp), %rdi
leaq 0x13af9b(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x150(%rbp)
jmp 0xbe698
movq -0x150(%rbp), %rdi
leaq 0x137e35(%rip), %rsi    # 0x1f64db
callq 0x5540
movq %rax, -0x158(%rbp)
jmp 0xbe6b4
movq -0x158(%rbp), %rdi
movsd -0xb8(%rbp), %xmm0
callq 0x5980
movq %rax, -0x160(%rbp)
jmp 0xbe6d1
movq -0x160(%rbp), %rdi
leaq 0x13dbcf(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, -0x168(%rbp)
jmp 0xbe6ed
movq -0x168(%rbp), %rdi
movsd -0xb0(%rbp), %xmm0
callq 0x5980
movq %rax, -0x170(%rbp)
jmp 0xbe70a
movq -0x170(%rbp), %rdi
leaq 0x13db96(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, -0x178(%rbp)
jmp 0xbe726
movq -0x178(%rbp), %rdi
movsd -0xa8(%rbp), %xmm0
callq 0x5980
movq %rax, -0x180(%rbp)
jmp 0xbe743
movq -0x180(%rbp), %rdi
leaq 0x13c9a2(%rip), %rsi    # 0x1fb0f3
callq 0x5540
movq %rax, -0x188(%rbp)
jmp 0xbe75f
movq -0x188(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x56f0
movq %rax, -0x190(%rbp)
jmp 0xbe777
movq -0x190(%rbp), %rdi
leaq 0x13c8af(%rip), %rsi    # 0x1fb034
callq 0x5540
movq %rax, -0x198(%rbp)
jmp 0xbe793
movq -0x198(%rbp), %rdi
leaq 0x13ae84(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x1a0(%rbp)
jmp 0xbe7af
movq -0x1a0(%rbp), %rdi
leaq 0x13c83e(%rip), %rsi    # 0x1faffb
callq 0x5540
movq %rax, -0x1a8(%rbp)
jmp 0xbe7cb
movq -0x1a8(%rbp), %rdi
leaq 0x13ae4c(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xbe7e0
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x13c919(%rip), %rsi    # 0x1fb108
callq 0x5540
movq %rax, -0x1b0(%rbp)
jmp 0xbe7fd
movq -0x1b0(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x56f0
movq %rax, -0x1b8(%rbp)
jmp 0xbe815
movq -0x1b8(%rbp), %rdi
leaq 0x13d1ad(%rip), %rsi    # 0x1fb9d0
callq 0x5540
movq %rax, -0x1c0(%rbp)
jmp 0xbe831
movq -0x1c0(%rbp), %rdi
movsd -0x88(%rbp), %xmm0
callq 0x5980
movq %rax, -0x1c8(%rbp)
jmp 0xbe84e
movq -0x1c8(%rbp), %rdi
leaq 0x13adc9(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xbe863
leaq -0xb8(%rbp), %rdi
callq 0xf200
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xbe56e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xf200
jmp 0xbebf4
movl $0x0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movq %rax, -0x1d0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
callq 0xf270
movq %rax, %rcx
movq -0x1d0(%rbp), %rax
cmpq %rcx, %rax
jae 0xbebeb
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
movl -0xc8(%rbp), %eax
movl %eax, %esi
callq 0xf390
movq %rax, %rsi
leaq -0x108(%rbp), %rdi
callq 0xf3d0
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x13c80d(%rip), %rsi    # 0x1fb117
callq 0x5540
movq %rax, -0x1d8(%rbp)
jmp 0xbe918
movq -0x1d8(%rbp), %rdi
movl -0xc8(%rbp), %esi
callq 0x56f0
movq %rax, -0x1e0(%rbp)
jmp 0xbe933
movq -0x1e0(%rbp), %rdi
leaq 0x13c754(%rip), %rsi    # 0x1fb095
callq 0x5540
movq %rax, -0x1e8(%rbp)
jmp 0xbe94f
movq -0x1e8(%rbp), %rdi
leaq 0x13acc8(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x1f0(%rbp)
jmp 0xbe96b
movq -0x1f0(%rbp), %rdi
leaq 0x13c692(%rip), %rsi    # 0x1fb00b
callq 0x5540
movq %rax, -0x1f8(%rbp)
jmp 0xbe987
movq -0x1f8(%rbp), %rdi
movl -0xc8(%rbp), %esi
callq 0x56f0
movq %rax, -0x200(%rbp)
jmp 0xbe9a2
movq -0x200(%rbp), %rdi
leaq 0x13c649(%rip), %rsi    # 0x1faff9
callq 0x5540
movq %rax, -0x208(%rbp)
jmp 0xbe9be
movq -0x208(%rbp), %rdi
leaq 0x13ac59(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x210(%rbp)
jmp 0xbe9da
movq -0x210(%rbp), %rdi
leaq 0x137af3(%rip), %rsi    # 0x1f64db
callq 0x5540
movq %rax, -0x218(%rbp)
jmp 0xbe9f6
movq -0x218(%rbp), %rdi
movsd -0x108(%rbp), %xmm0
callq 0x5980
movq %rax, -0x220(%rbp)
jmp 0xbea13
movq -0x220(%rbp), %rdi
leaq 0x13d88d(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, -0x228(%rbp)
jmp 0xbea2f
movq -0x228(%rbp), %rdi
movsd -0x100(%rbp), %xmm0
callq 0x5980
movq %rax, -0x230(%rbp)
jmp 0xbea4c
movq -0x230(%rbp), %rdi
leaq 0x13d854(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, -0x238(%rbp)
jmp 0xbea68
movq -0x238(%rbp), %rdi
movsd -0xf8(%rbp), %xmm0
callq 0x5980
movq %rax, -0x240(%rbp)
jmp 0xbea85
movq -0x240(%rbp), %rdi
leaq 0x13c58c(%rip), %rsi    # 0x1fb01f
callq 0x5540
movq %rax, -0x248(%rbp)
jmp 0xbeaa1
movq -0x248(%rbp), %rdi
movl -0xc8(%rbp), %esi
callq 0x56f0
movq %rax, -0x250(%rbp)
jmp 0xbeabc
movq -0x250(%rbp), %rdi
leaq 0x13c56a(%rip), %rsi    # 0x1fb034
callq 0x5540
movq %rax, -0x258(%rbp)
jmp 0xbead8
movq -0x258(%rbp), %rdi
leaq 0x13ab3f(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, -0x260(%rbp)
jmp 0xbeaf4
movq -0x260(%rbp), %rdi
leaq 0x13c4f9(%rip), %rsi    # 0x1faffb
callq 0x5540
movq %rax, -0x268(%rbp)
jmp 0xbeb10
movq -0x268(%rbp), %rdi
leaq 0x13ab07(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xbeb25
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x13c5ee(%rip), %rsi    # 0x1fb122
callq 0x5540
movq %rax, -0x270(%rbp)
jmp 0xbeb42
movq -0x270(%rbp), %rdi
movl -0xc8(%rbp), %esi
callq 0x56f0
movq %rax, -0x278(%rbp)
jmp 0xbeb5d
movq -0x278(%rbp), %rdi
leaq 0x13ce65(%rip), %rsi    # 0x1fb9d0
callq 0x5540
movq %rax, -0x280(%rbp)
jmp 0xbeb79
movq -0x280(%rbp), %rdi
movsd -0xf0(%rbp), %xmm0
callq 0x5980
movq %rax, -0x288(%rbp)
jmp 0xbeb96
movq -0x288(%rbp), %rdi
leaq 0x13aa81(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0xbebab
leaq -0x108(%rbp), %rdi
callq 0xf5c0
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0xbe8aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xf5c0
jmp 0xbebf4
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
movq -0xc0(%rbp), %rdi
callq 0x58f0