// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/networkstorage.cc
// Function: write_vertices(_IO_FILE*, ATOM_NETWORK*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, bool)
void write_vertices(FILE *orig_v, ATOM_NETWORK *cell, string name, bool rename_vertices_by_connectivity, bool is_net) {
  //printf("DEBUG: called write_vertices()\n");
  //For each vertex in abc, get the coords in xyz
  vector<XYZ> vertices; XYZ p;
  //assign vertices names based on their connectivity, if desired
  if(rename_vertices_by_connectivity) {
    for(int i=0; i<cell->vertices.size(); i++) {
      char* temp_name = new char[100];
      sprintf(temp_name, "%d", cell->vertices.at(i).expected_edges);
//printf("renaming vertex: %s to %s\n", cell->vertices.at(i).name.c_str(), temp_name);
      cell->vertices.at(i).name = temp_name;
      delete[] temp_name;
    }
  }
  for(int i=0; i<cell->vertices.size(); i++) {
    p = cell->abc_to_xyz_returning_XYZ(cell->vertices.at(i).abc);
    vertices.push_back(p);
  }
  // Write header, and vertex coords
  int num_v = vertices.size();
  double radius = 1.0; //give particles a dummy radius
  fprintf(orig_v, "%d\n%s", num_v, name.c_str());
  if(is_net) fprintf(orig_v, " - xyz format representation of original vertices\n"); else fprintf(orig_v, " - xyz format representation of structure\n");
  for(int i=0; i<num_v; i++) fprintf(orig_v, "%s %.3f %.3f %.3f %.3f\n", cell->vertices.at(i).name.c_str(), vertices.at(i)[0], vertices.at(i)[1], vertices.at(i)[2], radius);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r8d, %r15d
movl %ecx, %ebp
movq %rdx, 0x38(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x50(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x84364
movq %r14, 0x48(%rsp)
testb %bpl, %bpl
movq %rbx, 0x8(%rsp)
movl %r15d, 0x44(%rsp)
je 0x65de6
movq 0x3c0(%rbx), %r14
movq 0x3c8(%rbx), %rax
cmpq %r14, %rax
je 0x65df4
movl $0x50, %ebx
xorl %r12d, %r12d
movl $0x64, %edi
callq 0x4030
movq %rax, %rbp
movl -0x38(%r14,%rbx), %edx
movq %rax, %rdi
leaq 0xf8645(%rip), %rsi     # 0x15e38b
xorl %eax, %eax
callq 0x40e0
movq 0x8(%rsp), %rax
movq 0x3c0(%rax), %r15
movq 0x3c8(%rax), %rdx
subq %r15, %rdx
sarq $0x4, %rdx
movabsq $0x6db6db6db6db6db7, %rax # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rdx
cmpq %r12, %rdx
jbe 0x6608c
movq 0x8(%r15,%rbx), %r13
addq %rbx, %r15
movq %rbp, %rdi
callq 0x41e0
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rbp, %rcx
movq %rax, %r8
callq 0x4670
movq %rbp, %rdi
callq 0x4570
incq %r12
movq 0x8(%rsp), %rax
movq 0x3c0(%rax), %r14
movq 0x3c8(%rax), %rax
movq %rax, %rcx
subq %r14, %rcx
sarq $0x4, %rcx
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %rcx
addq $0x70, %rbx
cmpq %r12, %rcx
ja 0x65d2a
jmp 0x65df4
movq 0x3c0(%rbx), %r14
movq 0x3c8(%rbx), %rax
cmpq %r14, %rax
movq 0x8(%rsp), %rsi
je 0x65eb4
movl $0x10, %ebx
xorl %r15d, %r15d
leaq 0x70(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x50(%rsp), %rbp
movsd -0x10(%r14,%rbx), %xmm0
movsd -0x8(%r14,%rbx), %xmm1
movsd (%r14,%rbx), %xmm2
movq %r12, %rdi
callq 0x52dd8
movq 0x80(%rsp), %rax
movq %rax, 0x60(%rsp)
movups 0x70(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x65e71
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsi)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x18(%rsp)
jmp 0x65e7c
movq %r13, %rdi
movq %rbp, %rdx
callq 0x69b82
incq %r15
movq 0x8(%rsp), %rsi
movq 0x3c0(%rsi), %r14
movq 0x3c8(%rsi), %rax
subq %r14, %rax
sarq $0x4, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
addq $0x70, %rbx
cmpq %r15, %rax
ja 0x65e19
movq 0x18(%rsp), %rdx
subq 0x10(%rsp), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r13, %rdx
movq 0x38(%rsp), %rax
movq (%rax), %rcx
leaq 0xedea7(%rip), %rsi     # 0x153d86
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %rdx, 0x30(%rsp)
xorl %eax, %eax
callq 0x45f0
cmpb $0x0, 0x44(%rsp)
je 0x65f08
leaq 0xede8b(%rip), %rdi     # 0x153d8c
movl $0x32, %esi
jmp 0x65f14
leaq 0xedeb0(%rip), %rdi     # 0x153dbf
movl $0x2a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x4850
movq 0x8(%rsp), %rbx
cmpl $0x0, 0x30(%rsp)
jle 0x66052
movq 0x30(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x30(%rsp)
movl $0x50, %r14d
xorl %r12d, %r12d
xorl %r15d, %r15d
movq 0x3c0(%rbx), %rax
movq 0x3c8(%rbx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rdx
cmpq %r15, %rdx
jbe 0x6607b
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r15, %rdx
jbe 0x6607b
movq (%rax,%r14), %rbp
addq %r12, %rdi
xorl %esi, %esi
callq 0x845b8
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r15, %rdx
jbe 0x6607b
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
addq %r12, %rdi
movl $0x1, %esi
callq 0x845b8
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r15, %rdx
jbe 0x6607b
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
addq %r12, %rdi
movl $0x2, %esi
callq 0x845b8
movsd (%rax), %xmm2
movq 0x48(%rsp), %rdi
leaq 0xeddcc(%rip), %rsi     # 0x153dea
movq %rbp, %rdx
movsd 0x8(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0xe7023(%rip), %xmm3    # 0x14d058
movb $0x4, %al
callq 0x45f0
incq %r15
addq $0x18, %r12
addq $0x70, %r14
cmpq %r15, 0x30(%rsp)
jne 0x65f4c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x66069
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe7673(%rip), %rdi     # 0x14d6f5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xe7662(%rip), %rdi     # 0x14d6f5
movq %r12, %rsi
xorl %eax, %eax
callq 0x4630
jmp 0x660a9
jmp 0x660a9
jmp 0x660a9
jmp 0x660a9
jmp 0x660a9
jmp 0x660a9
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x660c3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780