// File: /workspace/github_cpp_makefile_star2_O3/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 0x61b5a
movq %r9, %r15
movq %rcx, %r12
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a5c7
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 0x61b5a
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a5c7
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 0x61b5a
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a5c7
movaps %xmm0, %xmm2
leaq 0xd8(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x9d5e8
incl %r14d
movslq %r14d, %rsi
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq %rsi, %rdx
jbe 0x61b68
shlq $0x5, %rsi
addq %rsi, %rdi
callq 0x4a68a
movl %eax, 0xf0(%rsp)
testl %eax, %eax
jle 0x619fe
movq %r13, 0x68(%rsp)
movq %r12, 0x70(%rsp)
leaq 0x98(%rsp), %r14
leaq 0x30(%rsp), %rbx
leaq 0x48(%rsp), %r12
movq %rsp, %r13
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq 0x180(%rsp), %rdx
callq 0x4690
testq %rax, %rax
je 0x617cd
movq 0x28(%rsp), %rax
incl (%rax)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2f484
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %r12, %rdi
leaq 0xec728(%rip), %rsi     # 0x14dd9e
leaq 0xec726(%rip), %rdx     # 0x14dda3
callq 0x22538
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4a3cc
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x616ac
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x616d1
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4470
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x61af7
leaq 0xfcd05(%rip), %rsi     # 0x15e3ec
callq 0x4170
testl %eax, %eax
je 0x61713
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x61af7
leaq 0xf2000(%rip), %rsi     # 0x153706
callq 0x4170
testl %eax, %eax
jne 0x61b2a
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x2, %rdx
jbe 0x61b17
addq $0x40, %rdi
callq 0x4a5c7
movsd %xmm0, 0x20(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x4, %rdx
jb 0x61b10
addq $0x60, %rdi
callq 0x4a5c7
movsd %xmm0, 0x18(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x5, %rdx
jb 0x61b09
subq $-0x80, %rdi
callq 0x4a5c7
movsd 0x18(%rsp), %xmm1
movaps %xmm0, %xmm2
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x84364
movq 0x100(%rsp), %rsi
cmpq 0x108(%rsp), %rsi
je 0x617e8
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x100(%rsp)
jmp 0x617f8
movl 0xf0(%rsp), %esi
incl %ebp
leaq 0xf1ecd(%rip), %rdi     # 0x1536aa
movl %ebp, %edx
xorl %eax, %eax
callq 0x4060
jmp 0x61802
leaq 0xf8(%rsp), %rdi
movq %rbx, %rdx
callq 0x69b82
movq %r13, %rdi
callq 0x2f4c2
incl %ebp
movl 0xf0(%rsp), %eax
cmpl %eax, %ebp
jl 0x6162f
cmpl $0x2, %eax
movq 0x70(%rsp), %r12
movq 0x68(%rsp), %r13
jne 0x619fe
movq %r15, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq 0x180(%rsp), %rdx
callq 0x4690
testq %rax, %rax
je 0x619d0
movq 0x28(%rsp), %rax
incl (%rax)
leaq 0xb8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq %r15, %rsi
callq 0x2f484
leaq 0x88(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xec52d(%rip), %rsi     # 0x14dd9e
leaq 0xec52b(%rip), %rdx     # 0x14dda3
leaq 0x78(%rsp), %rdi
callq 0x22538
movq %rsp, %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x4a3cc
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x618b1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x618d2
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4470
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x61b76
leaq 0xf1e0d(%rip), %rsi     # 0x1536f5
callq 0x4170
testl %eax, %eax
je 0x61914
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x61b76
leaq 0xf1df9(%rip), %rsi     # 0x153700
callq 0x4170
testl %eax, %eax
jne 0x61ba9
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x3, %rdx
jb 0x61b88
addq $0x40, %rdi
callq 0x4a5c7
movsd %xmm0, 0x20(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x4, %rdx
jb 0x61b8f
addq $0x60, %rdi
callq 0x4a5c7
movsd %xmm0, 0x18(%rsp)
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
cmpq $0x4, %rdx
jbe 0x61b96
subq $-0x80, %rdi
callq 0x4a5c7
movsd 0x18(%rsp), %xmm1
movaps %xmm0, %xmm2
leaq 0x30(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
callq 0x84364
movq 0x118(%rsp), %rsi
cmpq 0x120(%rsp), %rsi
je 0x619e4
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsi)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x18, 0x118(%rsp)
jmp 0x619f6
movl (%r12), %esi
leaq 0xf1db2(%rip), %rdi     # 0x15378d
xorl %eax, %eax
callq 0x4060
jmp 0x619fe
leaq 0x110(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x69b82
movq %rsp, %rdi
callq 0x2f4c2
leaq 0x3c0(%r13), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x67910
movl $0x0, (%rsp)
movq 0x428(%r13), %rsi
cmpq 0x430(%r13), %rsi
je 0x61a3c
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x428(%r13)
jmp 0x61a4b
leaq 0x420(%r13), %rdi
movq %rsp, %rdx
callq 0x14198
movq 0x410(%r13), %rsi
cmpq 0x418(%r13), %rsi
je 0x61a6e
movl (%r12), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x410(%r13)
jmp 0x61a84
addq $0x408, %r13            # imm = 0x408
movq %r13, %rdi
movq %r12, %rdx
callq 0xf864
movl (%r12), %eax
incl %eax
movl %eax, (%r12)
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61aab
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x61ac8
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x61ae5
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 0xebbf7(%rip), %rdi     # 0x14d6f5
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4630
movl $0x4, %esi
jmp 0x61b1c
movl $0x3, %esi
jmp 0x61b1c
movl $0x2, %esi
leaq 0xebbd2(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
movl 0xf0(%rsp), %ebx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x6778a
movq (%rax), %rdx
leaq 0xf1af9(%rip), %rdi     # 0x15363e
movl %ebx, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x4060
movl $0x1, %edi
callq 0x72bc
leaq 0xebb94(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xebb86(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
leaq 0xebb78(%rip), %rdi     # 0x14d6f5
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4630
movl $0x2, %esi
jmp 0x61b9b
movl $0x3, %esi
jmp 0x61b9b
movl $0x4, %esi
leaq 0xebb53(%rip), %rdi     # 0x14d6f5
xorl %eax, %eax
callq 0x4630
movl (%r12), %ebx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x6778a
movq (%rax), %rdx
leaq 0xf1b4a(%rip), %rdi     # 0x15370b
movl %ebx, %esi
xorl %eax, %eax
callq 0x4060
jmp 0x61b50
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x61bee
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x61bee
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x61c72
movq 0xc8(%rsp), %rsi
jmp 0x61c59
jmp 0x61c13
jmp 0x61c13
jmp 0x61c67
jmp 0x61c67
jmp 0x61c13
movq %rax, %rbx
jmp 0x61c72
movq %rax, %rbx
jmp 0x61c3c
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x61c3c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x61c72
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x61c72
jmp 0x61c67
jmp 0x61c67
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2f4c2
leaq 0xd8(%rsp), %rdi
callq 0x670a4
movq %rbx, %rdi
callq 0x4780