// File: /workspace/github_cpp_makefile_star2_O2/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 $0x78, %rsp
movl %r8d, 0x10(%rsp)
movl %ecx, %ebx
movq %rdx, 0x8(%rsp)
movq %rsi, %r12
movq %rdi, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x6402e
testb %bl, %bl
je 0x4a843
leaq 0x3c0(%r12), %rbx
pushq $0x64
popq %r14
leaq 0xc4a74(%rip), %r13     # 0x10f24b
xorl %ebp, %ebp
movq 0x3c8(%r12), %rax
subq 0x3c0(%r12), %rax
cqto
pushq $0x70
popq %rcx
idivq %rcx
cmpq %rbp, %rax
jbe 0x4a843
movq %r14, %rdi
callq 0x4030
movq %rax, %r15
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4b63c
movl 0x18(%rax), %edx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x40d0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4b63c
addq $0x50, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x4810
movq %r15, %rdi
callq 0x4590
incq %rbp
jmp 0x4a7d9
leaq 0x3c0(%r12), %r14
xorl %ebx, %ebx
leaq 0x60(%rsp), %r13
leaq 0x20(%rsp), %rbp
leaq 0x40(%rsp), %r15
movq 0x3c8(%r12), %rax
subq 0x3c0(%r12), %rax
cqto
pushq $0x70
popq %rcx
idivq %rcx
cmpq %rbx, %rax
jbe 0x4a8b6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4b63c
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3f1b2
movq 0x70(%rsp), %rax
movq %rax, 0x50(%rsp)
movups 0x60(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4beaa
incq %rbx
jmp 0x4a85c
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %r12
movq 0x8(%rsp), %rax
movq (%rax), %rcx
leaq 0xb840c(%rip), %rsi     # 0x102ce6
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x4610
cmpb $0x0, 0x10(%rsp)
je 0x4a8fe
leaq 0xb83f2(%rip), %rdi     # 0x102cec
pushq $0x32
jmp 0x4a907
leaq 0xb841a(%rip), %rdi     # 0x102d1f
pushq $0x2a
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x4840
xorl %r15d, %r15d
testl %r12d, %r12d
cmovlel %r15d, %r12d
leaq 0x20(%rsp), %r13
leaq 0xb8421(%rip), %rbp     # 0x102d4a
cmpq %r15, %r12
je 0x4a9c8
movq %r14, %rdi
movq %r15, %rsi
callq 0x4b63c
movq 0x50(%rax), %rbx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4b6d6
movq %rax, %rdi
xorl %esi, %esi
callq 0x6424a
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x4b6d6
movq %rax, %rdi
pushq $0x1
popq %rsi
callq 0x6424a
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x4b6d6
movq %rax, %rdi
pushq $0x2
popq %rsi
callq 0x6424a
movsd (%rax), %xmm2
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0xb169f(%rip), %xmm3    # 0xfc058
movb $0x4, %al
callq 0x4610
incq %r15
jmp 0x4a929
leaq 0x20(%rsp), %rdi
callq 0xb132
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a9e9
jmp 0x4a9e9
jmp 0x4a9e9
jmp 0x4a9e9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xb132
movq %rbx, %rdi
callq 0x4780