// File: /workspace/github_cpp_makefile_star2_O1/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::calculate_averageComplexQLM()
void CMolecularSystem::calculate_averageComplexQLM()
{
  int nop;
  nop = this->parameter->nop;
  double realNQ6[13],imgNQ6[13];
  double realNQ4[9],imgNQ4[9];

  for (int ti= 0;ti<nop;ti++)
  {
    for (int mi=0;mi<13;mi++)
    {
      realNQ6[mi] = this->molecules[ti].realQ6[mi];
      imgNQ6[mi]  = this->molecules[ti].imgQ6[mi];
      for (int ci = 0;ci<this->molecules[ti].n_neighbors;ci++)
      {
        realNQ6[mi] += this->molecules[this->molecules[ti].neighbors[ci]].realQ6[mi];
        imgNQ6[mi]  += this->molecules[this->molecules[ti].neighbors[ci]].imgQ6[mi];
      }
      realNQ6[mi] = realNQ6[mi]/double(this->molecules[ti].n_neighbors+1);
      imgNQ6[mi]  = imgNQ6[mi]/double(this->molecules[ti].n_neighbors+1);

      this->molecules[ti].arealQ6[mi] = realNQ6[mi];
      this->molecules[ti].aimgQ6[mi] = imgNQ6[mi];
    }

    for (int mi=0;mi<9;mi++)
    {
      realNQ4[mi] = this->molecules[ti].realQ4[mi];
      imgNQ4[mi]  = this->molecules[ti].imgQ4[mi];
      for (int ci = 0;ci<this->molecules[ti].n_neighbors;ci++)
      {
        realNQ4[mi] += this->molecules[this->molecules[ti].neighbors[ci]].realQ4[mi];
        imgNQ4[mi]  += this->molecules[this->molecules[ti].neighbors[ci]].imgQ4[mi];
      }
      realNQ4[mi] = realNQ4[mi]/double(this->molecules[ti].n_neighbors+1);
      imgNQ4[mi]  = imgNQ4[mi]/double(this->molecules[ti].n_neighbors+1);

      this->molecules[ti].arealQ4[mi] = realNQ4[mi];
      this->molecules[ti].aimgQ4[mi] = imgNQ4[mi];
    }

  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xf8, %rsp
movq 0xb4e8c0(%rdi), %rax
movslq 0x3208(%rax), %rax
testq %rax, %rax
jle 0x56bf
movq 0xb4e8b8(%rdi), %rcx
leaq 0xa0(%rcx), %rdx
xorl %esi, %esi
imulq $0x870, %rsi, %r8       # imm = 0x870
movl 0x550(%rcx,%r8), %r9d
leal 0x1(%r9), %edi
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
leaq (%rcx,%r8), %rdi
xorl %r10d, %r10d
movsd 0x5e8(%rdi,%r10,8), %xmm1
movsd %xmm1, -0x180(%rbp,%r10,8)
movsd 0x650(%rdi,%r10,8), %xmm1
movsd %xmm1, -0x110(%rbp,%r10,8)
testl %r9d, %r9d
jle 0x5580
movsd -0x180(%rbp,%r10,8), %xmm2
movsd -0x110(%rbp,%r10,8), %xmm1
xorl %r11d, %r11d
movslq (%rdx,%r11,4), %rbx
imulq $0x870, %rbx, %rbx      # imm = 0x870
addq %rcx, %rbx
addsd 0x5e8(%rbx,%r10,8), %xmm2
addsd 0x650(%rbx,%r10,8), %xmm1
incq %r11
cmpq %r11, %r9
jne 0x5542
movsd %xmm2, -0x180(%rbp,%r10,8)
movsd %xmm1, -0x110(%rbp,%r10,8)
movsd -0x180(%rbp,%r10,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, -0x180(%rbp,%r10,8)
movsd -0x110(%rbp,%r10,8), %xmm2
divsd %xmm0, %xmm2
movsd %xmm2, -0x110(%rbp,%r10,8)
movsd %xmm1, 0x748(%rdi,%r10,8)
movsd %xmm2, 0x7b0(%rdi,%r10,8)
incq %r10
cmpq $0xd, %r10
jne 0x54fe
movl 0x550(%rcx,%r8), %r8d
leal 0x1(%r8), %r9d
xorps %xmm0, %xmm0
cvtsi2sd %r9d, %xmm0
xorl %r9d, %r9d
movsd 0x558(%rdi,%r9,8), %xmm1
movsd %xmm1, -0xa0(%rbp,%r9,8)
movsd 0x5a0(%rdi,%r9,8), %xmm1
movsd %xmm1, -0x50(%rbp,%r9,8)
testl %r8d, %r8d
jle 0x5661
movsd -0xa0(%rbp,%r9,8), %xmm2
movsd -0x50(%rbp,%r9,8), %xmm1
xorl %r10d, %r10d
movslq (%rdx,%r10,4), %r11
imulq $0x870, %r11, %r11      # imm = 0x870
addq %rcx, %r11
addsd 0x558(%r11,%r9,8), %xmm2
addsd 0x5a0(%r11,%r9,8), %xmm1
incq %r10
cmpq %r10, %r8
jne 0x5626
movsd %xmm2, -0xa0(%rbp,%r9,8)
movsd %xmm1, -0x50(%rbp,%r9,8)
movsd -0xa0(%rbp,%r9,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, -0xa0(%rbp,%r9,8)
movsd -0x50(%rbp,%r9,8), %xmm2
divsd %xmm0, %xmm2
movsd %xmm2, -0x50(%rbp,%r9,8)
movsd %xmm1, 0x6b8(%rdi,%r9,8)
movsd %xmm2, 0x700(%rdi,%r9,8)
incq %r9
cmpq $0x9, %r9
jne 0x55e8
incq %rsi
addq $0x870, %rdx            # imm = 0x870
cmpq %rax, %rsi
jne 0x54dd
addq $0xf8, %rsp
popq %rbx
popq %rbp
retq
nop