// File: /workspace/github_cpp_makefile_star2_O1/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 $0x148, %rsp            # imm = 0x148
movq %r8, 0x28(%rsp)
movq %rdx, %r13
movl %esi, %r14d
movq %rdi, %rbx
leal 0x2(%r14), %eax
movslq %eax, %rsi
movq (%rdi), %rdi
movq 0x8(%rbx), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq %rsi, %rdx
jbe 0x62367
movq %r9, %r15
movq %rcx, %r12
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a8cf
movsd %xmm0, 0x20(%rsp)
leal 0x3(%r14), %eax
movslq %eax, %rsi
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq %rsi, %rdx
jbe 0x62367
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a8cf
movsd %xmm0, 0x18(%rsp)
leal 0x4(%r14), %eax
movslq %eax, %rsi
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq %rsi, %rdx
jbe 0x62367
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a8cf
movaps %xmm0, %xmm2
leaq 0xd8(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x9f1d4
incl %r14d
movslq %r14d, %rsi
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq %rsi, %rdx
jbe 0x62375
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a992
movl %eax, 0xf0(%rsp)
testl %eax, %eax
jle 0x62210
movq %r13, 0x68(%rsp)
movq %r12, 0x70(%rsp)
leaq 0x98(%rsp), %r14
leaq 0x30(%rsp), %rbx
leaq 0x48(%rsp), %r12
movq %rsp, %rbp
xorl %r13d, %r13d
movq %r15, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq 0x180(%rsp), %rdx
callq 0x4690
testq %rax, %rax
je 0x61fdd
movq 0x28(%rsp), %rax
incl (%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2f6b2
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %r12, %rdi
leaq 0xedea8(%rip), %rsi     # 0x14fd2e
leaq 0xedea6(%rip), %rdx     # 0x14fd33
callq 0x2263c
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4a6d4
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x61ebc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x61ee1
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4470
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x62303
leaq 0xfe615(%rip), %rsi     # 0x16050c
callq 0x4170
testl %eax, %eax
je 0x61f23
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x62303
leaq 0xf3700(%rip), %rsi     # 0x155616
callq 0x4170
testl %eax, %eax
jne 0x62336
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jbe 0x62323
addq $0x40, %rdi
callq 0x4a8cf
movsd %xmm0, 0x20(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x4, %rdx
jb 0x6231c
addq $0x60, %rdi
callq 0x4a8cf
movsd %xmm0, 0x18(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x5, %rdx
jb 0x62315
subq $-0x80, %rdi
callq 0x4a8cf
movsd 0x18(%rsp), %xmm1
movaps %xmm0, %xmm2
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x85982
movq 0x100(%rsp), %rsi
cmpq 0x108(%rsp), %rsi
je 0x61ff8
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x100(%rsp)
jmp 0x62008
movl 0xf0(%rsp), %esi
leal 0x1(%r13), %edx
leaq 0xf35cb(%rip), %rdi     # 0x1555ba
xorl %eax, %eax
callq 0x4060
jmp 0x62010
leaq 0xf8(%rsp), %rdi
movq %rbx, %rdx
callq 0x6a5be
movq %rbp, %rdi
callq 0x2f6f0
incl %r13d
movl 0xf0(%rsp), %eax
cmpl %eax, %r13d
jl 0x61e3f
cmpl $0x2, %eax
movq 0x70(%rsp), %r12
movq 0x68(%rsp), %r13
jne 0x62210
movq %r15, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq 0x180(%rsp), %rdx
callq 0x4690
testq %rax, %rax
je 0x621e2
movq 0x28(%rsp), %rax
incl (%rax)
leaq 0xb8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq %r15, %rsi
callq 0x2f6b2
leaq 0x88(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xedcab(%rip), %rsi     # 0x14fd2e
leaq 0xedca9(%rip), %rdx     # 0x14fd33
leaq 0x78(%rsp), %rdi
callq 0x2263c
movq %rsp, %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x4a6d4
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x620c3
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x620e4
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4470
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x62383
leaq 0xf350b(%rip), %rsi     # 0x155605
callq 0x4170
testl %eax, %eax
je 0x62126
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x62383
leaq 0xf34f7(%rip), %rsi     # 0x155610
callq 0x4170
testl %eax, %eax
jne 0x623b6
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x3, %rdx
jb 0x62395
addq $0x40, %rdi
callq 0x4a8cf
movsd %xmm0, 0x20(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x4, %rdx
jb 0x6239c
addq $0x60, %rdi
callq 0x4a8cf
movsd %xmm0, 0x18(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x4, %rdx
jbe 0x623a3
subq $-0x80, %rdi
callq 0x4a8cf
movsd 0x18(%rsp), %xmm1
movaps %xmm0, %xmm2
leaq 0x30(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
callq 0x85982
movq 0x118(%rsp), %rsi
cmpq 0x120(%rsp), %rsi
je 0x621f6
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x118(%rsp)
jmp 0x62208
movl (%r12), %esi
leaq 0xf34b0(%rip), %rdi     # 0x15569d
xorl %eax, %eax
callq 0x4060
jmp 0x62210
leaq 0x110(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x6a5be
movq %rsp, %rdi
callq 0x2f6f0
leaq 0x3c0(%r13), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x68242
movl $0x0, (%rsp)
movq 0x428(%r13), %rsi
cmpq 0x430(%r13), %rsi
je 0x6224e
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x428(%r13)
jmp 0x6225d
leaq 0x420(%r13), %rdi
movq %rsp, %rdx
callq 0x1422c
movq 0x410(%r13), %rsi
cmpq 0x418(%r13), %rsi
je 0x62280
movl (%r12), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x410(%r13)
jmp 0x62292
addq $0x408, %r13            # imm = 0x408
movq %r13, %rdi
movq %r12, %rdx
callq 0xf7b4
incl (%r12)
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x622b7
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x622d4
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x622f1
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xed39b(%rip), %rdi     # 0x14f6a5
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4630
movl $0x4, %esi
jmp 0x62328
movl $0x3, %esi
jmp 0x62328
movl $0x2, %esi
leaq 0xed376(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
movl 0xf0(%rsp), %ebx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x680bc
movq (%rax), %rdx
leaq 0xf31fd(%rip), %rdi     # 0x15554e
movl %ebx, %esi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x4060
movl $0x1, %edi
callq 0x710c
leaq 0xed337(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
leaq 0xed329(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
leaq 0xed31b(%rip), %rdi     # 0x14f6a5
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4630
movl $0x2, %esi
jmp 0x623a8
movl $0x3, %esi
jmp 0x623a8
movl $0x4, %esi
leaq 0xed2f6(%rip), %rdi     # 0x14f6a5
xorl %eax, %eax
callq 0x4630
movl (%r12), %ebx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x680bc
movq (%rax), %rdx
leaq 0xf324d(%rip), %rdi     # 0x15561b
movl %ebx, %esi
xorl %eax, %eax
callq 0x4060
jmp 0x6235d
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x623fb
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x623fb
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6247f
movq 0xc8(%rsp), %rsi
jmp 0x62466
jmp 0x62420
jmp 0x62420
jmp 0x62474
jmp 0x62474
jmp 0x62420
movq %rax, %rbx
jmp 0x6247f
movq %rax, %rbx
jmp 0x62449
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x62449
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x6247f
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x6247f
jmp 0x62474
jmp 0x62474
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2f6f0
leaq 0xd8(%rsp), %rdi
callq 0x679f6
movq %rbx, %rdi
callq 0x4780