// File: 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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x40(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x58(%rax), %rcx
movq %rcx, -0x38(%rbp)
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rcx
movq %rcx, -0x58(%rbp)
movq 0x70(%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x78(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x13d670(%rip), %rsi    # 0x1fb086
callq 0x5540
movq %rax, %rdi
leaq 0x13bc00(%rip), %rsi    # 0x1f9625
callq 0x5540
movq %rax, %rdi
leaq 0x13d665(%rip), %rsi    # 0x1fb099
callq 0x5540
movq %rax, %rdi
leaq 0x13bbe2(%rip), %rsi    # 0x1f9625
callq 0x5540
leaq -0x80(%rbp), %rdi
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x94010
leaq -0x80(%rbp), %rdi
addq $0xc, %rdi
xorl %ecx, %ecx
movl $0x1, %edx
movl %ecx, %esi
callq 0x94010
leaq -0x80(%rbp), %rdi
addq $0x18, %rdi
xorl %edx, %edx
movl $0x1, %ecx
movl %edx, %esi
callq 0x94010
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x94010
leaq -0xb0(%rbp), %rdi
addq $0xc, %rdi
movl $0x1, %ecx
xorl %edx, %edx
movl %ecx, %esi
callq 0x94010
leaq -0xb0(%rbp), %rdi
addq $0x18, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x94010
movl $0x0, -0xb4(%rbp)
cmpl $0x3, -0xb4(%rbp)
jae 0xbdeae
movl -0xb4(%rbp), %eax
movl %eax, %ecx
leaq -0x80(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xc0(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0xb8(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, %ecx
leaq -0xb0(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xcc(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0xc4(%rbp)
movl $0x0, -0xd0(%rbp)
cmpl $0x2, -0xd0(%rbp)
jge 0xbde98
movl $0x0, -0xd4(%rbp)
cmpl $0x2, -0xd4(%rbp)
jge 0xbde82
movl $0x0, -0xd8(%rbp)
cmpl $0x2, -0xd8(%rbp)
jge 0xbde6c
movl -0xcc(%rbp), %eax
cmpl -0xd0(%rbp), %eax
jl 0xbdba2
movl -0xc8(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jl 0xbdba2
movl -0xc4(%rbp), %eax
cmpl -0xd8(%rbp), %eax
jge 0xbdba7
jmp 0xbde58
movsd -0x28(%rbp), %xmm1
cvtsi2sdl -0xd0(%rbp), %xmm2
movsd -0x40(%rbp), %xmm0
cvtsi2sdl -0xd4(%rbp), %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
cvtsi2sdl -0xd8(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x20(%rbp), %xmm1
cvtsi2sdl -0xd0(%rbp), %xmm2
movsd -0x38(%rbp), %xmm0
cvtsi2sdl -0xd4(%rbp), %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
cvtsi2sdl -0xd8(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0x18(%rbp), %xmm1
cvtsi2sdl -0xd0(%rbp), %xmm2
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0xd4(%rbp), %xmm3
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
cvtsi2sdl -0xd8(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movsd -0xe0(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
cvtsi2sdl -0xc0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x40(%rbp), %xmm1
cvtsi2sdl -0xbc(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
cvtsi2sdl -0xb8(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0xe8(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
cvtsi2sdl -0xc0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x38(%rbp), %xmm1
cvtsi2sdl -0xbc(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
cvtsi2sdl -0xb8(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0xf0(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
cvtsi2sdl -0xc0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm1
cvtsi2sdl -0xbc(%rbp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
cvtsi2sdl -0xb8(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x13d348(%rip), %rsi    # 0x1fb0b4
callq 0x5540
movq %rax, %rdi
leaq 0x13d31c(%rip), %rsi    # 0x1fb097
callq 0x5540
movq %rax, %rdi
movsd -0xe0(%rbp), %xmm0
callq 0x5980
movq %rax, %rdi
leaq 0x13e514(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, %rdi
movsd -0xe8(%rbp), %xmm0
callq 0x5980
movq %rax, %rdi
leaq 0x13e4f5(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, %rdi
movsd -0xf0(%rbp), %xmm0
callq 0x5980
movq %rax, %rdi
leaq 0x1387d8(%rip), %rsi    # 0x1f65b0
callq 0x5540
movq %rax, %rdi
leaq 0x13d2b0(%rip), %rsi    # 0x1fb097
callq 0x5540
movq %rax, %rdi
movsd -0xf8(%rbp), %xmm0
callq 0x5980
movq %rax, %rdi
leaq 0x13e4a8(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, %rdi
movsd -0x100(%rbp), %xmm0
callq 0x5980
movq %rax, %rdi
leaq 0x13e489(%rip), %rsi    # 0x1fc2ae
callq 0x5540
movq %rax, %rdi
movsd -0x108(%rbp), %xmm0
callq 0x5980
movq %rax, %rdi
leaq 0x13877c(%rip), %rsi    # 0x1f65c0
callq 0x5540
movq %rax, %rdi
leaq 0x13b7d2(%rip), %rsi    # 0x1f9625
callq 0x5540
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0xbdb6b
jmp 0xbde6e
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0xbdb54
jmp 0xbde84
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0xbdb3d
jmp 0xbde9a
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0xbdad7
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x13d13e(%rip), %rsi    # 0x1faffb
callq 0x5540
movq %rax, %rdi
leaq 0x13b759(%rip), %rsi    # 0x1f9625
callq 0x5540
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw (%rax,%rax)