// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, %rbx
andl $0x0, 0x110(%rdi)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
movl $0xa8, %ecx
cqto
idivq %rcx
movq %rdi, 0x18(%rsp)
leaq 0x2f0(%rdi), %rcx
movq %rcx, 0x28(%rsp)
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
cmpq 0x20(%rsp), %r12
je 0x4587e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
movq %rcx, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
movq %rax, %rcx
testl %ecx, %ecx
movl $0x0, %eax
cmovlel %eax, %ecx
movq %rcx, 0x30(%rsp)
xorl %r15d, %r15d
cmpq 0x30(%rsp), %r15
je 0x45876
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
movq 0x50(%rax), %r14
subq 0x48(%rax), %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
movq 0x68(%rax), %rcx
subq 0x60(%rax), %rcx
movq %rcx, 0x38(%rsp)
shrq $0x2, %r14
movslq %r14d, %rbp
xorl %r14d, %r14d
xorl %r13d, %r13d
cmpq %rbp, %r14
jge 0x45686
testb $0x1, %r13b
jne 0x45686
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
leaq 0x48(%rax), %rdi
movq %r14, %rsi
callq 0xac00
movl (%rax), %eax
cmpq %rax, %r15
sete %r13b
incq %r14
jmp 0x45656
movq 0x38(%rsp), %rax
shrq $0x2, %rax
movslq %eax, %rbp
xorl %r14d, %r14d
xorl %eax, %eax
cmpq %rbp, %r14
setge %cl
orb %r13b, %al
orb %al, %cl
testb $0x1, %cl
jne 0x456cb
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
leaq 0x60(%rax), %rdi
movq %r14, %rsi
callq 0xac00
movl (%rax), %eax
cmpq %rax, %r15
sete %al
incq %r14
jmp 0x45697
testb $0x1, %al
leaq 0x110(%rsp), %r14
jne 0x4586e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b6d6
movups (%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
leaq 0x98(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x3e082
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x98(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x60(%rsp), %rdi
callq 0x637df
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
leaq 0x18(%rax), %rdi
movq %r15, %rsi
callq 0x4bb9a
movq %r14, %rdi
movq %rax, %rsi
callq 0x45d0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4b9e8
addq $0x30, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x4bb9a
leaq 0x78(%rsp), %rdi
movq %rax, %rsi
callq 0x45d0
leaq 0xf0(%rsp), %rdi
movq %r14, %rsi
callq 0x45d0
leaq 0xd0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x45d0
movq %r14, %rsi
leaq 0xb0(%rsp), %r13
movq %r13, %rdi
callq 0x45d0
movq %r13, %rdi
pushq $0x1
popq %rsi
callq 0x1b1bb
leaq 0x130(%rsp), %r13
leaq 0xf0(%rsp), %rbp
leaq 0xd0(%rsp), %r14
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm1
movups %xmm1, (%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x3dd86
leaq 0xb0(%rsp), %rdi
callq 0x4210
movq %r14, %rdi
callq 0x4210
movq %rbp, %rdi
callq 0x4210
movaps 0x60(%rsp), %xmm0
movups %xmm0, 0x148(%rsp)
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x158(%rsp)
movq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0xa7d8
movq 0x18(%rsp), %rax
incl 0x110(%rax)
movq %r13, %rdi
callq 0xa808
leaq 0x78(%rsp), %rdi
callq 0x4210
leaq 0x110(%rsp), %rdi
callq 0x4210
incq %r15
jmp 0x45613
incq %r12
jmp 0x455d6
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x458db
movq %rax, %rbx
jmp 0x458c1
movq %rax, %rbx
jmp 0x458ce
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0xa808
jmp 0x458db
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x4210
leaq 0xd0(%rsp), %rdi
callq 0x4210
leaq 0xf0(%rsp), %rdi
callq 0x4210
leaq 0x78(%rsp), %rdi
callq 0x4210
jmp 0x458ea
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x4210
movq %rbx, %rdi
callq 0x4780