// File: 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
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq 0xb4e8c0(%rax), %rax
movl 0x3208(%rax), %eax
movl %eax, -0xc(%rbp)
movl $0x0, -0x194(%rbp)
movl -0x194(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x7b2d
movl $0x0, -0x198(%rbp)
cmpl $0xd, -0x198(%rbp)
jge 0x7854
movq -0x1b0(%rbp), %rax
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movslq -0x198(%rbp), %rdx
movsd 0x5e8(%rcx,%rdx,8), %xmm0
movslq -0x198(%rbp), %rcx
movsd %xmm0, -0x80(%rbp,%rcx,8)
movq 0xb4e8b8(%rax), %rax
movslq -0x194(%rbp), %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movslq -0x198(%rbp), %rcx
movsd 0x650(%rax,%rcx,8), %xmm0
movslq -0x198(%rbp), %rax
movsd %xmm0, -0xf0(%rbp,%rax,8)
movl $0x0, -0x19c(%rbp)
movq -0x1b0(%rbp), %rcx
movl -0x19c(%rbp), %eax
movq 0xb4e8b8(%rcx), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
cmpl 0x550(%rcx), %eax
jge 0x7740
movq -0x1b0(%rbp), %rcx
movq 0xb4e8b8(%rcx), %rax
movq 0xb4e8b8(%rcx), %rdx
movslq -0x194(%rbp), %rsi
imulq $0x870, %rsi, %rsi      # imm = 0x870
addq %rsi, %rdx
movslq -0x19c(%rbp), %rsi
movslq 0xa0(%rdx,%rsi,4), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rax
movslq -0x198(%rbp), %rdx
movsd 0x5e8(%rax,%rdx,8), %xmm0
movslq -0x198(%rbp), %rax
addsd -0x80(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x80(%rbp,%rax,8)
movq 0xb4e8b8(%rcx), %rax
movq 0xb4e8b8(%rcx), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movslq -0x19c(%rbp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movslq -0x198(%rbp), %rcx
movsd 0x650(%rax,%rcx,8), %xmm0
movslq -0x198(%rbp), %rax
addsd -0xf0(%rbp,%rax,8), %xmm0
movsd %xmm0, -0xf0(%rbp,%rax,8)
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0x7638
movq -0x1b0(%rbp), %rax
movslq -0x198(%rbp), %rcx
movsd -0x80(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movl 0x550(%rcx), %ecx
addl $0x1, %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movslq -0x198(%rbp), %rcx
movsd %xmm0, -0x80(%rbp,%rcx,8)
movslq -0x198(%rbp), %rcx
movsd -0xf0(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movl 0x550(%rcx), %ecx
addl $0x1, %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movslq -0x198(%rbp), %rcx
movsd %xmm0, -0xf0(%rbp,%rcx,8)
movslq -0x198(%rbp), %rcx
movsd -0x80(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movslq -0x198(%rbp), %rdx
movsd %xmm0, 0x748(%rcx,%rdx,8)
movslq -0x198(%rbp), %rcx
movsd -0xf0(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rax
movslq -0x194(%rbp), %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movslq -0x198(%rbp), %rcx
movsd %xmm0, 0x7b0(%rax,%rcx,8)
movl -0x198(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
jmp 0x75ad
movl $0x0, -0x1a0(%rbp)
cmpl $0x9, -0x1a0(%rbp)
jge 0x7b17
movq -0x1b0(%rbp), %rax
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movslq -0x1a0(%rbp), %rdx
movsd 0x558(%rcx,%rdx,8), %xmm0
movslq -0x1a0(%rbp), %rcx
movsd %xmm0, -0x140(%rbp,%rcx,8)
movq 0xb4e8b8(%rax), %rax
movslq -0x194(%rbp), %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movslq -0x1a0(%rbp), %rcx
movsd 0x5a0(%rax,%rcx,8), %xmm0
movslq -0x1a0(%rbp), %rax
movsd %xmm0, -0x190(%rbp,%rax,8)
movl $0x0, -0x1a4(%rbp)
movq -0x1b0(%rbp), %rcx
movl -0x1a4(%rbp), %eax
movq 0xb4e8b8(%rcx), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
cmpl 0x550(%rcx), %eax
jge 0x79fa
movq -0x1b0(%rbp), %rcx
movq 0xb4e8b8(%rcx), %rax
movq 0xb4e8b8(%rcx), %rdx
movslq -0x194(%rbp), %rsi
imulq $0x870, %rsi, %rsi      # imm = 0x870
addq %rsi, %rdx
movslq -0x1a4(%rbp), %rsi
movslq 0xa0(%rdx,%rsi,4), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rax
movslq -0x1a0(%rbp), %rdx
movsd 0x558(%rax,%rdx,8), %xmm0
movslq -0x1a0(%rbp), %rax
addsd -0x140(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x140(%rbp,%rax,8)
movq 0xb4e8b8(%rcx), %rax
movq 0xb4e8b8(%rcx), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movslq -0x1a4(%rbp), %rdx
movslq 0xa0(%rcx,%rdx,4), %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movslq -0x1a0(%rbp), %rcx
movsd 0x5a0(%rax,%rcx,8), %xmm0
movslq -0x1a0(%rbp), %rax
addsd -0x190(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x190(%rbp,%rax,8)
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
jmp 0x78ec
movq -0x1b0(%rbp), %rax
movslq -0x1a0(%rbp), %rcx
movsd -0x140(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movl 0x550(%rcx), %ecx
addl $0x1, %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movslq -0x1a0(%rbp), %rcx
movsd %xmm0, -0x140(%rbp,%rcx,8)
movslq -0x1a0(%rbp), %rcx
movsd -0x190(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movl 0x550(%rcx), %ecx
addl $0x1, %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movslq -0x1a0(%rbp), %rcx
movsd %xmm0, -0x190(%rbp,%rcx,8)
movslq -0x1a0(%rbp), %rcx
movsd -0x140(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0x194(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movslq -0x1a0(%rbp), %rdx
movsd %xmm0, 0x6b8(%rcx,%rdx,8)
movslq -0x1a0(%rbp), %rcx
movsd -0x190(%rbp,%rcx,8), %xmm0
movq 0xb4e8b8(%rax), %rax
movslq -0x194(%rbp), %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movslq -0x1a0(%rbp), %rcx
movsd %xmm0, 0x700(%rax,%rcx,8)
movl -0x1a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a0(%rbp)
jmp 0x785e
jmp 0x7b19
movl -0x194(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x194(%rbp)
jmp 0x7594
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)