// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/networkstorage.cc
// Function: parse_atom(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*, int, ATOM_NETWORK*, int*, int*, char*, _IO_FILE*)
void parse_atom(vector<string> *token, int first_index, ATOM_NETWORK *cell, int *atom_index, int *line_num, char *line, FILE *cgd) {
  bool verbose = false;
  VERTEX v(convertToDouble(token->at(first_index+2)), convertToDouble(token->at(first_index+3)), convertToDouble(token->at(first_index+4)));
  if(verbose) printf("parsed atom labelled %d at %.3f %.3f %.3f\n", convertToInt(token->at(first_index+0)), v.abc.x, v.abc.y, v.abc.z);
  v.expected_edges = convertToInt(token->at(first_index+1)); //now parse the edges
  for(int i=0; i<v.expected_edges; i++) {
    if(fgets(line, maxline, cgd)!=NULL) {
      (*line_num)++;
      vector<string> local_token = split(string(line)," ()\r\t");
      if(local_token.at(0)=="edge" || local_token.at(0)=="EDGE") {
        XYZ e(convertToDouble(local_token.at(2)), convertToDouble(local_token.at(3)), convertToDouble(local_token.at(4)));
        v.edges.push_back(e);
        if(verbose) printf("parsed edge labelled %d at %.3f %.3f %.3f\n", convertToInt(local_token.at(1)), e.x, e.y, e.z);
      }
      else {
        printf("NET ERROR: atom with %d edges was declared but the string \"%s\" was read instead of the data for edge ID %d\n", v.expected_edges, local_token.at(0).c_str(), i);
        exit(EXIT_FAILURE);
      }
    } else {
      printf("NET WARNING: %d edges were expected but file ended after reading %d edges\n", v.expected_edges, i+1);
      //exit(EXIT_FAILURE);
    }
  }
  //here we can now explicitly read in dummy edges, if we read a 2c vertex
  if(v.expected_edges==2) { //i.e., if 2c
    if(fgets(line, maxline, cgd)!=NULL) {
      (*line_num)++;
      vector<string> local_token = split(string(line)," ()\r\t");
      if(local_token.at(0)=="dummy_edge" || local_token.at(0)=="DUMMY_EDGE") {
        XYZ e(convertToDouble(local_token.at(2)), convertToDouble(local_token.at(3)), convertToDouble(local_token.at(4)));
        v.dummy_edges.push_back(e);
        if(verbose) printf("parsed dummy edge labelled %d at %.3f %.3f %.3f\n", convertToInt(local_token.at(1)), e.x, e.y, e.z);
      }
      else {
        printf("NET ERROR: dummy edge for 2c atom with index %d was declared but the string \"%s\" was read instead of the data for the dummy edge\n", (*atom_index), local_token.at(0).c_str());
        exit(EXIT_FAILURE);
      }
    } else {
      printf("NET WARNING: dummy edge was expected for 2c atom with index %d, but file ended instead\n", (*atom_index));
      //exit(EXIT_FAILURE);
    }    
  }
  cell->vertices.push_back(v);
  cell->vertex_symmetry_operators.push_back(0); //the vertices read from file are the basic ones, before any symmetry operator (or you could say after operator 0, which does nothing)
  cell->vertex_basic_indices.push_back((*atom_index));
  (*atom_index)++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %r9, %r15
movq %r8, 0x38(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %eax
movslq %eax, %rsi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movsd %xmm0, 0x18(%rsp)
leal 0x3(%r14), %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movsd %xmm0, 0x10(%rsp)
leal 0x4(%r14), %eax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movaps %xmm0, %xmm2
leaq 0xa8(%rsp), %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x75d1c
incl %r14d
movslq %r14d, %rsi
movq %rbx, %rdi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38503
movq %r13, 0x40(%rsp)
movq %r12, 0x48(%rsp)
leaq 0xc8(%rsp), %rcx
movl %eax, -0x8(%rcx)
leaq 0x138(%rsp), %r14
leaq 0x50(%rsp), %rbx
leaq 0x118(%rsp), %r12
leaq 0x20(%rsp), %r13
xorl %ebp, %ebp
cmpl %eax, %ebp
jge 0x47dbd
movq %r15, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq 0x190(%rsp), %rdx
callq 0x4690
testq %rax, %rax
je 0x47d98
movq 0x38(%rsp), %rax
incl (%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1b80e
movq %r12, %rdi
leaq 0xb50e4(%rip), %rsi     # 0xfcd9e
leaq 0xf(%rsp), %rdx
callq 0x1b80e
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x38311
movq %r12, %rdi
callq 0x4210
movq %r14, %rdi
callq 0x4210
movq %r13, %rdi
xorl %esi, %esi
callq 0x4bb9a
movq %rax, %rdi
leaq 0xc75b6(%rip), %rsi     # 0x10f2ac
callq 0x36bf4
testb %al, %al
jne 0x47d20
movq %r13, %rdi
xorl %esi, %esi
callq 0x4bb9a
movq %rax, %rdi
leaq 0xba953(%rip), %rsi     # 0x102666
callq 0x36bf4
testb %al, %al
je 0x47f7d
movq %r13, %rdi
pushq $0x2
popq %rsi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movsd %xmm0, 0x18(%rsp)
movq %r13, %rdi
pushq $0x3
popq %rsi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movsd %xmm0, 0x10(%rsp)
movq %r13, %rdi
pushq $0x4
popq %rsi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movaps %xmm0, %xmm2
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x6402e
leaq 0xc8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4beaa
movq %r13, %rdi
callq 0x244fc
incl %ebp
jmp 0x47db1
movl 0xc0(%rsp), %esi
incl %ebp
leaq 0xba862(%rip), %rdi     # 0x10260a
movl %ebp, %edx
xorl %eax, %eax
callq 0x4050
movl 0xc0(%rsp), %eax
jmp 0x47c75
cmpl $0x2, %eax
movq 0x48(%rsp), %rbx
movq 0x40(%rsp), %r14
jne 0x47f22
movq %r15, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq 0x190(%rsp), %rdx
callq 0x4690
testq %rax, %rax
je 0x47f12
movq 0x38(%rsp), %rax
incl (%rax)
leaq 0x88(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %r15, %rsi
callq 0x1b80e
leaq 0xb4f8d(%rip), %rsi     # 0xfcd9e
leaq 0x68(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1b80e
leaq 0x20(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x38311
leaq 0x68(%rsp), %rdi
callq 0x4210
leaq 0x88(%rsp), %rdi
callq 0x4210
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x4bb9a
leaq 0xba7f4(%rip), %rsi     # 0x102655
movq %rax, %rdi
callq 0x36bf4
testb %al, %al
jne 0x47e90
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x4bb9a
leaq 0xba7e0(%rip), %rsi     # 0x102660
movq %rax, %rdi
callq 0x36bf4
testb %al, %al
je 0x47fad
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movsd %xmm0, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movsd %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x4bb9a
movq %rax, %rdi
callq 0x38473
movaps %xmm0, %xmm2
leaq 0x50(%rsp), %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x6402e
leaq 0xe0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x4beaa
leaq 0x20(%rsp), %rdi
callq 0x244fc
jmp 0x47f22
movl (%rbx), %esi
leaq 0xba7d2(%rip), %rdi     # 0x1026ed
xorl %eax, %eax
callq 0x4050
leaq 0x3c0(%r14), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x4bed0
leaq 0x420(%r14), %rdi
leaq 0x20(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x10324
addq $0x408, %r14            # imm = 0x408
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9434
incl (%rbx)
leaq 0xa8(%rsp), %rdi
callq 0xb1ba
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xc0(%rsp), %ebx
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x4bb9a
movq (%rax), %rdx
leaq 0xba604(%rip), %rdi     # 0x10259e
movl %ebx, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x4050
pushq $0x1
popq %rdi
callq 0x524c
movl (%rbx), %ebx
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x4bb9a
movq (%rax), %rdx
leaq 0xba6a6(%rip), %rdi     # 0x10266b
movl %ebx, %esi
xorl %eax, %eax
callq 0x4050
jmp 0x47fa5
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4210
jmp 0x47fe2
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0x4801a
jmp 0x47ff8
jmp 0x48023
jmp 0x47ff8
jmp 0x48023
jmp 0x47ff8
jmp 0x48023
movq %rax, %rbx
jmp 0x48030
movq %rax, %rbx
jmp 0x48012
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x4210
leaq 0x138(%rsp), %rdi
callq 0x4210
jmp 0x48030
jmp 0x48023
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x244fc
leaq 0xa8(%rsp), %rdi
callq 0xb1ba
movq %rbx, %rdi
callq 0x4780