// File: /workspace/github_cpp_makefile_star2_O3/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, 0x30(%rsp)
movsd 0x40(%rsi), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x48(%rsi), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x50(%rsi), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x58(%rsi), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x60(%rsi), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x68(%rsi), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x70(%rsi), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x78(%rsi), %xmm0
movsd %xmm0, 0x78(%rsp)
addq $0x10, %rbx
leaq 0xe8192(%rip), %rsi     # 0x154409
movl $0x12, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe7393(%rip), %r14     # 0x15361e
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44e0
leaq 0xe817a(%rip), %rsi     # 0x15441c
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 0x506b0
leaq 0x12c(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x506b0
leaq 0x138(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x506b0
leaq 0xf0(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x506b0
leaq 0xfc(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x506b0
leaq 0x108(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x506b0
movq %r14, 0x58(%rsp)
leaq (,%r14,4), %rax
leaq (%rax,%rax,2), %rax
movl 0xf0(%rsp,%rax), %ecx
movl %ecx, 0x14(%rsp)
movl 0xf4(%rsp,%rax), %ecx
movl %ecx, 0x10(%rsp)
movl 0xf8(%rsp,%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x120(%rsp,%rax), %xmm0
movsd %xmm0, 0xa0(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x124(%rsp,%rax), %xmm0
movsd %xmm0, 0x98(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x128(%rsp,%rax), %xmm0
movsd %xmm0, 0x90(%rsp)
movb $0x1, %al
xorl %ecx, %ecx
movl %eax, 0xc(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
xorl %eax, %eax
movsd 0x30(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x68(%rsp)
movsd 0x28(%rsp), %xmm1
movsd %xmm0, 0x70(%rsp)
mulsd %xmm0, %xmm1
movsd %xmm1, 0x60(%rsp)
movb $0x1, %sil
movl %ecx, 0x18(%rsp)
movl %esi, 0x1c(%rsp)
cmpl %ecx, 0x14(%rsp)
setl %cl
cmpl %eax, 0x10(%rsp)
setl %r14b
orb %cl, %r14b
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x48(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x68(%rsp), %xmm1
movsd %xmm1, 0xb8(%rsp)
movsd 0x40(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd 0x60(%rsp), %xmm1
movsd %xmm1, 0xb0(%rsp)
mulsd 0x38(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
mulsd 0x70(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0xa8(%rsp)
movb $0x1, %r15b
xorl %eax, %eax
cmpl %eax, %ebx
setl %cl
orb %r14b, %cl
jne 0x6c6d8
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x88(%rsp), %xmm2
movapd %xmm2, %xmm1
mulsd %xmm0, %xmm1
addsd 0xb8(%rsp), %xmm1
movapd %xmm1, %xmm6
movsd %xmm1, 0xc0(%rsp)
movsd 0x80(%rsp), %xmm3
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
addsd 0xb0(%rsp), %xmm1
movapd %xmm1, %xmm8
movsd %xmm1, 0xc8(%rsp)
movsd 0x78(%rsp), %xmm4
mulsd %xmm4, %xmm0
addsd 0xa8(%rsp), %xmm0
movapd %xmm0, %xmm7
movsd %xmm0, 0xd0(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0xa0(%rsp), %xmm5
mulsd %xmm5, %xmm0
addsd %xmm6, %xmm0
movsd 0x48(%rsp), %xmm1
movsd 0x98(%rsp), %xmm6
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
movapd %xmm2, %xmm0
movsd 0x90(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0x28(%rsp), %xmm0
mulsd %xmm5, %xmm0
addsd %xmm8, %xmm0
movsd 0x40(%rsp), %xmm1
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
movsd %xmm3, 0xe0(%rsp)
movsd 0x50(%rsp), %xmm0
mulsd %xmm5, %xmm0
addsd %xmm7, %xmm0
movsd 0x38(%rsp), %xmm1
mulsd %xmm6, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm2, %xmm4
addsd %xmm1, %xmm4
movsd %xmm4, 0xe8(%rsp)
movl $0x6, %edx
movq 0x20(%rsp), %r13
movq %r13, %rdi
leaq 0xe7e86(%rip), %rsi     # 0x154437
callq 0x44e0
movl $0x1, %edx
movq %r13, %rdi
leaq 0xe7e55(%rip), %r12     # 0x15441a
movq %r12, %rsi
callq 0x44e0
movq %r13, %rdi
movsd 0xc0(%rsp), %xmm0
callq 0x46b0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe8fe6(%rip), %rbp     # 0x1555d6
movq %rbp, %rsi
callq 0x44e0
movq %r13, %rdi
movsd 0xc8(%rsp), %xmm0
callq 0x46b0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x44e0
movq %r13, %rdi
movsd 0xd0(%rsp), %xmm0
callq 0x46b0
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0xe4f59(%rip), %rsi     # 0x151598
callq 0x44e0
movl $0x1, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x44e0
movq %r13, %rdi
movsd 0xd8(%rsp), %xmm0
callq 0x46b0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x44e0
movq %r13, %rdi
movsd 0xe0(%rsp), %xmm0
callq 0x46b0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x44e0
movq %r13, %rdi
movsd 0xe8(%rsp), %xmm0
callq 0x46b0
movq %rax, %r13
movl $0x3, %edx
movq %rax, %rdi
leaq 0xe4ee9(%rip), %rsi     # 0x1515a8
callq 0x44e0
movl $0x1, %edx
movq %r13, %rdi
leaq 0xe6f4b(%rip), %rsi     # 0x15361e
callq 0x44e0
movl $0x1, %eax
testb $0x1, %r15b
movl $0x0, %r15d
jne 0x6c472
testb $0x1, 0x1c(%rsp)
movl $0x0, %esi
movl 0x18(%rsp), %ecx
jne 0x6c3ff
movl $0x1, %ecx
testb $0x1, 0xc(%rsp)
movl $0x0, %eax
jne 0x6c3c5
movq 0x58(%rsp), %r14
incq %r14
cmpq $0x3, %r14
jne 0x6c354
leaq 0xe7c4f(%rip), %rsi     # 0x15437e
movl $0x1, %edx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x44e0
leaq 0xe6ed6(%rip), %rsi     # 0x15361e
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