// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/networkstorage.cc
// Function: put_atoms_in_atom_network(ATOM_NETWORK*, std::vector<MOLECULE, std::allocator<MOLECULE>>*)
void put_atoms_in_atom_network(ATOM_NETWORK *cell, vector<MOLECULE> *assembled_molecules) {
  cell->numAtoms = 0;
  int num_assembled_molecules = assembled_molecules->size();
  for(int i=0; i<num_assembled_molecules; i++) {
    int num_at = assembled_molecules->at(i).atoms_xyz.size();
    for(int j=0; j<num_at; j++) {
      bool is_site = false, is_dummy_site = false;
      int num_sites = assembled_molecules->at(i).sites.size();
      int num_dummy_sites = assembled_molecules->at(i).dummy_sites.size();
      for(int k=0; k<num_sites && !is_site; k++) {
        is_site = (j == assembled_molecules->at(i).sites.at(k));
      }
      for(int k=0; k<num_dummy_sites && !is_dummy_site && !is_site; k++) {
        is_dummy_site = (j == assembled_molecules->at(i).dummy_sites.at(k));
      }
      if(!is_site && !is_dummy_site) { //don't save sites! they are dummy atoms and we don't need them in the ATOM_NETWORK (they will still be accessible in the vector<MOLECULE> assembled_molecules)
        XYZ xyz = assembled_molecules->at(i).atoms_xyz.at(j);
        XYZ abc = trans_to_origuc(cell->xyz_to_abc_returning_XYZ(xyz));
        string name = assembled_molecules->at(i).atoms_type.at(j);
        string label = assembled_molecules->at(i).atoms_label.at(j);
        ATOM a(xyz, name, label, lookupRadius(name, true));
        a.a_coord = abc.x;
        a.b_coord = abc.y;
        a.c_coord = abc.z;
        cell->atoms.push_back(a);
        cell->numAtoms++;
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x20(%rsp)
movl $0x0, 0x110(%rdi)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
sarq $0x3, %rax
movabsq $-0x30c30c30c30c30c3, %rcx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rcx, %rax
movq %rax, 0x18(%rsp)
testl %eax, %eax
jle 0x5dded
movq %rsi, %r14
movq 0x20(%rsp), %rax
addq $0x2f0, %rax            # imm = 0x2F0
movq %rax, 0xd0(%rsp)
movq 0x18(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
leaq 0xb0(%rsp), %r15
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rcx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rcx, %rdx
cmpq %rbp, %rdx
jbe 0x5de1c
imulq $0xa8, %rbp, %r13
movq 0x8(%rax,%r13), %rcx
subq (%rax,%r13), %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
movq %rcx, 0x28(%rsp)
testl %ecx, %ecx
jle 0x5dddf
movq 0x28(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x28(%rsp)
xorl %ebx, %ebx
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rcx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rcx, %rdx
cmpq %rbp, %rdx
jbe 0x5de1c
movq 0x48(%rax,%r13), %r8
movq 0x50(%rax,%r13), %rsi
subq %r8, %rsi
sarq $0x2, %rsi
movq 0x68(%rax,%r13), %rdx
movq 0x60(%rax,%r13), %rcx
testl %esi, %esi
jle 0x5da21
movl %esi, %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movq %rsi, %r10
negq %r10
movl $0x1, %r11d
leaq (%r10,%r11), %rdi
cmpq $0x1, %rdi
je 0x5ddff
movl -0x4(%r8,%r11,4), %r12d
cmpq %r12, %rbx
sete %dil
cmpq %r9, %r11
jae 0x5da23
incq %r11
cmpq %r12, %rbx
jne 0x5d9f8
jmp 0x5da23
xorl %edi, %edi
subq %rcx, %rdx
sarq $0x2, %rdx
xorl %r8d, %r8d
testl %edx, %edx
jle 0x5da71
testb %dil, %dil
jne 0x5da71
movl %edx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rdx, %r9
negq %r9
movl $0x1, %r10d
leaq (%r9,%r10), %r8
cmpq $0x1, %r8
je 0x5de0b
movl -0x4(%rcx,%r10,4), %r11d
cmpq %r11, %rbx
sete %r8b
cmpq %rsi, %r10
jae 0x5da71
incq %r10
cmpq %r11, %rbx
jne 0x5da4a
orb %r8b, %dil
testb $0x1, %dil
jne 0x5ddd1
addq %r13, %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
cmpq %rbx, %rdx
jbe 0x5de28
leaq (%rbx,%rbx,2), %rax
movups (%rcx,%rax,8), %xmm0
movsd 0x10(%rcx,%rax,8), %xmm2
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
leaq 0x128(%rsp), %rdi
movq 0x20(%rsp), %rsi
movaps %xmm0, 0x100(%rsp)
movsd %xmm2, 0xd8(%rsp)
callq 0x52f42
movq 0x138(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x128(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x110(%rsp), %rdi
callq 0x83a19
movq (%r14), %rcx
movq 0x8(%r14), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rax # imm = 0xCF3CF3CF3CF3CF3D
imulq %rax, %rdx
cmpq %rbp, %rdx
jbe 0x5de1c
movq 0x18(%rcx,%r13), %rax
movq 0x20(%rcx,%r13), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
jbe 0x5de28
movq %rbx, %r12
shlq $0x5, %r12
leaq 0x40(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xf3ce
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x30c30c30c30c30c3, %rcx # imm = 0xCF3CF3CF3CF3CF3D
imulq %rcx, %rdx
cmpq %rbp, %rdx
jbe 0x5de37
movq 0x30(%rax,%r13), %rcx
movq 0x38(%rax,%r13), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
jbe 0x5de34
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq (%rcx,%r12), %rsi
movq 0x8(%rcx,%r12), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0xf3ce
movaps 0x100(%rsp), %xmm0
movaps %xmm0, 0xe0(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd %xmm0, 0xf0(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xf3ce
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xf3ce
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %r12
movq %r15, %rdi
callq 0xf3ce
movq %r12, %rdi
movl $0x1, %esi
callq 0x21d5e
movq 0xf0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xe0(%rsp), %xmm1
movups %xmm1, (%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x513cc
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x5dcc6
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x5dce8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x5dd0d
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movaps 0x110(%rsp), %xmm0
movups %xmm0, 0x158(%rsp)
movsd 0x120(%rsp), %xmm0
movsd %xmm0, 0x168(%rsp)
movq 0xd0(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0xe9a8
movq 0x20(%rsp), %rax
incl 0x110(%rax)
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x5dd74
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x5dd99
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x5ddb5
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5ddd1
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4470
incq %rbx
cmpq 0x28(%rsp), %rbx
jne 0x5d99e
incq %rbp
cmpq 0x18(%rsp), %rbp
jne 0x5d939
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xef8ef(%rip), %rdi     # 0x14d6f5
movq %rsi, %rdx
jmp 0x5de15
leaq 0xef8e3(%rip), %rdi     # 0x14d6f5
movq %rdx, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xef8d2(%rip), %rdi     # 0x14d6f5
movq %rbp, %rsi
jmp 0x5de15
leaq 0xef8c6(%rip), %rdi     # 0x14d6f5
movq %rbx, %rsi
jmp 0x5de15
movq %rbx, %rbp
leaq 0xef8b7(%rip), %rdi     # 0x14d6f5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
jmp 0x5de9e
movq %rax, %rbx
jmp 0x5dee5
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x2f5e8
jmp 0x5dee5
movq %rax, %rbx
jmp 0x5dec0
jmp 0x5de6e
movq %rax, %rbx
jmp 0x5df01
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x5de9e
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x5dec0
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x5dee5
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x5df01
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5df1d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780