// File: /workspace/github_cpp_makefile_star2_O1/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, 0x28(%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, 0x20(%rsp)
testl %eax, %eax
jle 0x5e3a6
movq %rsi, %r14
movq 0x28(%rsp), %rax
addq $0x2f0, %rax            # imm = 0x2F0
movq %rax, 0xd8(%rsp)
movq 0x20(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
leaq 0xb8(%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 0x5e3d5
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, 0x30(%rsp)
testl %ecx, %ecx
jle 0x5e398
movq 0x30(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x30(%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 0x5e3d5
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 0x5dfb3
movl %esi, %r9d
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movq %rsi, %r10
negq %r10
movl $0x1, %r11d
leaq (%r10,%r11), %rdi
cmpq $0x1, %rdi
je 0x5e3b8
movl -0x4(%r8,%r11,4), %r12d
cmpq %r12, %rbx
sete %dil
cmpq %r9, %r11
jae 0x5dfb5
incq %r11
cmpq %r12, %rbx
jne 0x5df8a
jmp 0x5dfb5
xorl %edi, %edi
subq %rcx, %rdx
sarq $0x2, %rdx
xorl %r9d, %r9d
testl %edx, %edx
jle 0x5e00c
testb %dil, %dil
jne 0x5e00c
movl %edx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rdx, %r8
negq %r8
movl $0x1, %r10d
leaq (%r8,%r10), %r9
cmpq $0x1, %r9
je 0x5e3c4
movl -0x4(%rcx,%r10,4), %r9d
cmpq %r9, %rbx
sete %r9b
cmpq %rsi, %r10
setae %r11b
orb %dil, %r11b
orb %r9b, %r11b
incq %r10
testb $0x1, %r11b
je 0x5dfdc
orb %r9b, %dil
testb $0x1, %dil
jne 0x5e38a
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 0x5e3e1
leaq (%rbx,%rbx,2), %rax
movsd (%rcx,%rax,8), %xmm0
movsd 0x8(%rcx,%rax,8), %xmm1
movsd 0x10(%rcx,%rax,8), %xmm2
leaq 0x110(%rsp), %rdi
movq 0x28(%rsp), %rsi
movsd %xmm0, 0xf0(%rsp)
movsd %xmm1, 0xe8(%rsp)
movsd %xmm2, 0xe0(%rsp)
callq 0x53240
movq 0x120(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x110(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x128(%rsp), %rdi
callq 0x84ece
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 0x5e3d5
movq 0x18(%rcx,%r13), %rax
movq 0x20(%rcx,%r13), %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
jbe 0x5e3e1
movq %rbx, %r12
shlq $0x5, %r12
leaq 0x48(%rsp), %rcx
movq %rcx, 0x38(%rsp)
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0xf32a
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 0x5e3f0
movq 0x30(%rax,%r13), %rcx
movq 0x38(%rax,%r13), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
jbe 0x5e3ed
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq (%rcx,%r12), %rsi
movq 0x8(%rcx,%r12), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0xf32a
movsd 0xf0(%rsp), %xmm0
movsd %xmm0, 0xf8(%rsp)
movsd 0xe8(%rsp), %xmm0
movsd %xmm0, 0x100(%rsp)
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x108(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0xf32a
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0xf32a
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %r12
movq %r15, %rdi
callq 0xf32a
movq %r12, %rdi
movl $0x1, %esi
callq 0x21e42
movq 0x108(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xf8(%rsp), %xmm1
movups %xmm1, (%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x517a2
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x5e27f
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x5e2a1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x5e2c6
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4470
movsd 0x128(%rsp), %xmm0
movsd %xmm0, 0x158(%rsp)
movups 0x130(%rsp), %xmm0
movups %xmm0, 0x160(%rsp)
movq 0xd8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0xe936
movq 0x28(%rsp), %rax
incl 0x110(%rax)
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x5e32d
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x5e352
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x5e36e
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x5e38a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4470
incq %rbx
cmpq 0x30(%rsp), %rbx
jne 0x5df30
incq %rbp
cmpq 0x20(%rsp), %rbp
jne 0x5decb
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf12e6(%rip), %rdi     # 0x14f6a5
movq %rsi, %rdx
jmp 0x5e3ce
leaq 0xf12da(%rip), %rdi     # 0x14f6a5
movq %rdx, %rsi
xorl %eax, %eax
callq 0x4630
leaq 0xf12c9(%rip), %rdi     # 0x14f6a5
movq %rbp, %rsi
jmp 0x5e3ce
leaq 0xf12bd(%rip), %rdi     # 0x14f6a5
movq %rbx, %rsi
jmp 0x5e3ce
movq %rbx, %rbp
leaq 0xf12ae(%rip), %rdi     # 0x14f6a5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x4630
movq %rax, %rbx
jmp 0x5e457
movq %rax, %rbx
jmp 0x5e49e
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x2f814
jmp 0x5e49e
movq %rax, %rbx
jmp 0x5e479
jmp 0x5e427
movq %rax, %rbx
jmp 0x5e4ba
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x5e457
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x5e479
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x5e49e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x5e4ba
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x5e4d6
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780