// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/voronoicell.cc
// Function: writeVMDUC(std::basic_fstream<char, std::char_traits<char>>&, ATOM_NETWORK*)
void writeVMDUC(fstream &output, ATOM_NETWORK *atmnet){
  XYZ v_a = atmnet->v_a;
  XYZ v_b = atmnet->v_b;
  XYZ v_c = atmnet->v_c;
  
  output << "set unitcells(0) {" << "\n"
	 << "{color $unitcellColors(0)}" << "\n";
  DELTA_POS directions [3] = {DELTA_POS(1,0,0), DELTA_POS(0,1,0), DELTA_POS(0,0,1)};
  DELTA_POS limits [3] = {DELTA_POS(0,1,1), DELTA_POS(1,0,1), DELTA_POS(1,1,0)};
  for(unsigned int i = 0; i < 3; i++){
    DELTA_POS direction = directions[i];
    DELTA_POS limit = limits[i];
    for(int a = 0; a < 2; a++){
      for(int b = 0; b < 2; b++){
	for(int c = 0; c < 2; c++){
	  if((limit.x < a) || (limit.y < b) || (limit.z < c))
	    continue;
	  
	  // Calculate starting coordinate
	  double x1 = v_a.x *a + v_b.x*b + v_c.x*c;
	  double y1 = v_a.y *a + v_b.y*b + v_c.y*c;
	  double z1 = v_a.z *a + v_b.z*b + v_c.z*c;
	  
	  // Calculate ending coordinate
	  double x2 = x1 + v_a.x*direction.x + v_b.x*direction.y + v_c.x*direction.z;
	  double y2 = y1 + v_a.y*direction.x + v_b.y*direction.y + v_c.y*direction.z;
	  double z2 = z1 + v_a.z*direction.x + v_b.z*direction.y + v_c.z*direction.z;

	  output << "{line "
		 << "{" << x1 << " " << y1 << " " << z1 << "} "
		 << "{" << x2 << " " << y2 << " " << z2 << "} }" << "\n";
	}
      }
    }
  }
  output << "}" << "\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %rbx
movsd 0x38(%rsi), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x40(%rsi), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x48(%rsi), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x50(%rsi), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x58(%rsi), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x60(%rsi), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x68(%rsi), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x70(%rsi), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x78(%rsi), %xmm0
movsd %xmm0, 0x70(%rsp)
addq $0x10, %rbx
leaq 0xe94e5(%rip), %rsi     # 0x156319
movl $0x12, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe86e6(%rip), %r14     # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44e0
leaq 0xe94cd(%rip), %rsi     # 0x15632c
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x44e0
movl $0x1, %edx
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44e0
leaq 0x120(%rsp), %rdi
xorl %r14d, %r14d
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x509d8
leaq 0x12c(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x509d8
leaq 0x138(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x509d8
leaq 0xf0(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x509d8
leaq 0xfc(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x509d8
leaq 0x108(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x509d8
movsd 0xe213f(%rip), %xmm1    # 0x14f058
movq %r14, 0x58(%rsp)
leaq (,%r14,4), %rax
leaq (%rax,%rax,2), %rax
movl 0xf0(%rsp,%rax), %ecx
movl %ecx, 0x1c(%rsp)
movl 0xf4(%rsp,%rax), %ecx
movl %ecx, 0x18(%rsp)
movl 0xf8(%rsp,%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x120(%rsp,%rax), %xmm0
movsd %xmm0, 0x98(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x124(%rsp,%rax), %xmm0
movsd %xmm0, 0x90(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x128(%rsp,%rax), %xmm0
movsd %xmm0, 0x88(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
xorl %edx, %edx
xorpd %xmm2, %xmm2
movq 0x8(%rsp), %rax
cmpl %eax, 0x1c(%rsp)
setl %al
movq %rdx, 0x60(%rsp)
cmpl %edx, 0x18(%rsp)
setl %r14b
orb %al, %r14b
movsd 0x38(%rsp), %xmm0
mulsd %xmm2, %xmm0
movsd 0x50(%rsp), %xmm4
movapd %xmm2, %xmm3
movsd 0x10(%rsp), %xmm2
mulsd %xmm2, %xmm4
addsd %xmm0, %xmm4
movsd %xmm4, 0xb0(%rsp)
movsd 0x30(%rsp), %xmm0
mulsd %xmm3, %xmm0
movsd 0x48(%rsp), %xmm4
mulsd %xmm2, %xmm4
addsd %xmm0, %xmm4
movsd %xmm4, 0xa8(%rsp)
movsd 0x28(%rsp), %xmm0
movsd %xmm3, 0x68(%rsp)
mulsd %xmm3, %xmm0
movsd 0x40(%rsp), %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, 0xa0(%rsp)
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
cmpl %r12d, %ebx
setl %al
orb %r14b, %al
jne 0x6d2b0
movsd 0x80(%rsp), %xmm2
movapd %xmm2, %xmm1
mulsd %xmm0, %xmm1
addsd 0xb0(%rsp), %xmm1
movapd %xmm1, %xmm6
movsd %xmm1, 0xb8(%rsp)
movsd 0x78(%rsp), %xmm3
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
addsd 0xa8(%rsp), %xmm1
movapd %xmm1, %xmm8
movsd %xmm1, 0xc0(%rsp)
movsd 0x70(%rsp), %xmm4
movapd %xmm4, %xmm1
mulsd %xmm0, %xmm1
addsd 0xa0(%rsp), %xmm1
movapd %xmm1, %xmm7
movsd %xmm1, 0xc8(%rsp)
movsd %xmm0, 0xe8(%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x98(%rsp), %xmm5
mulsd %xmm5, %xmm0
addsd %xmm6, %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x90(%rsp), %xmm6
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
movapd %xmm2, %xmm0
movsd 0x88(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0x48(%rsp), %xmm0
mulsd %xmm5, %xmm0
addsd %xmm8, %xmm0
movsd 0x30(%rsp), %xmm1
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
movsd %xmm3, 0xd8(%rsp)
movsd 0x40(%rsp), %xmm0
mulsd %xmm5, %xmm0
addsd %xmm7, %xmm0
movsd 0x28(%rsp), %xmm1
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm2, %xmm4
addsd %xmm1, %xmm4
movsd %xmm4, 0xe0(%rsp)
movl $0x6, %edx
movq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0xe91cf(%rip), %rsi     # 0x156347
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe919e(%rip), %r13     # 0x15632a
movq %r13, %rsi
callq 0x44e0
movq %r15, %rdi
movsd 0xb8(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xea2cf(%rip), %rbp     # 0x157486
movq %rbp, %rsi
callq 0x44e0
movq %r15, %rdi
movsd 0xc0(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x44e0
movq %r15, %rdi
movsd 0xc8(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
leaq 0xe6302(%rip), %rsi     # 0x153508
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x44e0
movq %r15, %rdi
movsd 0xd0(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x44e0
movq %r15, %rdi
movsd 0xd8(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x44e0
movq %r15, %rdi
movsd 0xe0(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0xe6292(%rip), %rsi     # 0x153518
callq 0x44e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0xe8294(%rip), %rsi     # 0x15552e
callq 0x44e0
movsd 0xe8(%rsp), %xmm0
movsd 0xe1da8(%rip), %xmm1    # 0x14f058
addsd %xmm1, %xmm0
incl %r12d
cmpl $0x1, %r12d
je 0x6d035
movsd 0x68(%rsp), %xmm2
addsd %xmm1, %xmm2
movq 0x60(%rsp), %rdx
leal 0x1(%rdx), %eax
testl %edx, %edx
movl %eax, %edx
je 0x6cf9f
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rdx
leal 0x1(%rdx), %eax
testl %edx, %edx
movq %rax, 0x8(%rsp)
je 0x6cf99
movq 0x58(%rsp), %r14
incq %r14
cmpq $0x3, %r14
jne 0x6cf19
leaq 0xe8f73(%rip), %rsi     # 0x15628e
movl $0x1, %edx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe81fa(%rip), %rsi     # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq