// File: /workspace/github_cpp_makefile_star2_O1/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, 0x30(%rsp)
movl %ecx, %ebp
movq %rdx, 0x28(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
callq 0x85982
testb %bpl, %bpl
movq %r14, 0x38(%rsp)
je 0x6673a
movq 0x3c0(%rbx), %r15
cmpq %r15, 0x3c8(%rbx)
je 0x6673a
movl $0x50, %r14d
xorl %r12d, %r12d
movl $0x64, %edi
callq 0x4030
movq %rax, %rbp
movl -0x38(%r15,%r14), %edx
movq %rax, %rdi
leaq 0xf9e02(%rip), %rsi     # 0x1604ab
xorl %eax, %eax
callq 0x40e0
movq 0x3c0(%rbx), %r15
movq 0x3c8(%rbx), %rdx
subq %r15, %rdx
sarq $0x4, %rdx
movabsq $0x6db6db6db6db6db7, %rax # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rdx
cmpq %r12, %rdx
jbe 0x669c5
movq 0x8(%r15,%r14), %r13
addq %r14, %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 0x3c0(%rbx), %r15
movq 0x3c8(%rbx), %rax
subq %r15, %rax
sarq $0x4, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
addq $0x70, %r14
cmpq %r12, %rax
ja 0x6668d
movq 0x3c0(%rbx), %rax
cmpq %rax, 0x3c8(%rbx)
je 0x667fa
movl $0x10, %r14d
xorl %r15d, %r15d
leaq 0x60(%rsp), %r12
movq %rsp, %r13
leaq 0x40(%rsp), %rbp
movsd -0x10(%rax,%r14), %xmm0
movsd -0x8(%rax,%r14), %xmm1
movsd (%rax,%r14), %xmm2
movq %r12, %rdi
movq %rbx, %rsi
callq 0x530d6
movq 0x70(%rsp), %rax
movq %rax, 0x50(%rsp)
movups 0x60(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x667bc
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsi)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x8(%rsp)
jmp 0x667c7
movq %r13, %rdi
movq %rbp, %rdx
callq 0x6a5be
incq %r15
movq 0x3c0(%rbx), %rax
movq 0x3c8(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %rcx
addq $0x70, %r14
cmpq %r15, %rcx
ja 0x66764
movq 0x8(%rsp), %rdx
subq (%rsp), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r13, %rdx
movq 0x28(%rsp), %rax
movq (%rax), %rcx
leaq 0xef472(%rip), %rsi     # 0x155c96
movq 0x38(%rsp), %r14
movq %r14, %rdi
movq %rdx, 0x20(%rsp)
xorl %eax, %eax
callq 0x45f0
cmpb $0x0, 0x30(%rsp)
je 0x6684d
leaq 0xef456(%rip), %rdi     # 0x155c9c
movl $0x32, %esi
jmp 0x66859
leaq 0xef47b(%rip), %rdi     # 0x155ccf
movl $0x2a, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x4850
cmpl $0x0, 0x20(%rsp)
jle 0x6698f
movq 0x20(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x20(%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 0x669b4
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r15, %rdx
jbe 0x669b4
movq (%rax,%r14), %rbp
addq %r12, %rdi
xorl %esi, %esi
callq 0x85d40
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r15, %rdx
jbe 0x669b4
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
addq %r12, %rdi
movl $0x1, %esi
callq 0x85d40
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r15, %rdx
jbe 0x669b4
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
addq %r12, %rdi
movl $0x2, %esi
callq 0x85d40
movsd (%rax), %xmm2
movq 0x38(%rsp), %rdi
leaq 0xef39f(%rip), %rsi     # 0x155cfa
movq %rbp, %rdx
movsd 0x30(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd 0xe86e6(%rip), %xmm3    # 0x14f058
movb $0x4, %al
callq 0x45f0
incq %r15
addq $0x18, %r12
addq $0x70, %r14
cmpq %r15, 0x20(%rsp)
jne 0x6688c
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x669a5
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe8cea(%rip), %rdi     # 0x14f6a5
movq %r15, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xe8cd9(%rip), %rdi     # 0x14f6a5
movq %r12, %rsi
xorl %eax, %eax
callq 0x4630
jmp 0x669e2
jmp 0x669e2
jmp 0x669e2
jmp 0x669e2
jmp 0x669e2
jmp 0x669e2
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x669fb
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780