// File: /workspace/github_cpp_makefile_star2_O2/WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::calculate_complexQLM()
void CMolecularSystem::calculate_complexQLM()
{
  //nn = number of neighbors
  int nn,nop;
  double realti,imgti;
  double realYLM,imgYLM;
  nop = this->parameter->nop;
  for (int ti= 0;ti<nop;ti++)
  {
    nn = this->molecules[ti].n_neighbors;
    for (int mi = -6;mi < 7;mi++)
    {
      realti = 0.0;
      imgti = 0.0;
      for (int ci = 0;ci<nn;ci++)
      {
        QLM(6,mi,ti,this->molecules[ti].neighbors[ci],realYLM, imgYLM);
	realti += realYLM;
	imgti += imgYLM;
      }
      realti = realti/(double(nn));
      imgti = imgti/(double(nn));
      this->molecules[ti].realQ6[mi+6] = realti;
      this->molecules[ti].imgQ6[mi+6] = imgti;
    }
    for (int mi = -4;mi < 5;mi++)
    {
      realti = 0.0;
      imgti = 0.0;
      for (int ci = 0;ci<nn;ci++)
      {
        QLM(4,mi,ti,this->molecules[ti].neighbors[ci],realYLM, imgYLM);
        realti += realYLM;
        imgti += imgYLM;
      }
      realti = realti/(double(nn));
      imgti = imgti/(double(nn));
      this->molecules[ti].realQ4[mi+4] = realti;
      this->molecules[ti].imgQ4[mi+4] = imgti;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0xb4e8c0(%rdi), %rax
movl 0x3208(%rax), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, -0x68(%rbp)
movl $0xa0, %r12d
xorl %r13d, %r13d
cmpq -0x68(%rbp), %r13
je 0x4b57
movq 0xb4e8b8(%rbx), %rax
imulq $0x870, %r13, %rcx      # imm = 0x870
movq %rcx, -0x58(%rbp)
movl 0x550(%rax,%rcx), %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0x50(%rbp)
testl %ecx, %ecx
movl $0x0, %eax
cmovlel %eax, %ecx
movq %rcx, -0x60(%rbp)
pushq $-0x6
popq %r14
movq %r12, -0x70(%rbp)
cmpq $0x7, %r14
je 0x4aa7
xorpd %xmm1, %xmm1
movq -0x60(%rbp), %r15
xorpd %xmm2, %xmm2
subq $0x1, %r15
jb 0x4a6f
movq 0xb4e8b8(%rbx), %rax
movl (%rax,%r12), %r8d
leaq -0x40(%rbp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
pushq $0x6
popq %rsi
movl %r14d, %edx
movl %r13d, %ecx
leaq -0x48(%rbp), %r9
movsd %xmm1, -0x38(%rbp)
movsd %xmm2, -0x30(%rbp)
callq 0x4746
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
addsd -0x48(%rbp), %xmm1
addsd -0x40(%rbp), %xmm2
addq $0x4, %r12
jmp 0x4a1d
movsd -0x50(%rbp), %xmm0
divsd %xmm0, %xmm1
divsd %xmm0, %xmm2
movq 0xb4e8b8(%rbx), %rax
addq -0x58(%rbp), %rax
movsd %xmm1, 0x618(%rax,%r14,8)
movsd %xmm2, 0x680(%rax,%r14,8)
incq %r14
movq -0x70(%rbp), %r12
jmp 0x4a07
pushq $-0x4
popq %r14
cmpq $0x5, %r14
je 0x4b48
xorpd %xmm1, %xmm1
xorl %r15d, %r15d
xorpd %xmm2, %xmm2
cmpq %r15, -0x60(%rbp)
je 0x4b14
movq 0xb4e8b8(%rbx), %rax
addq %r12, %rax
movl (%rax,%r15,4), %r8d
leaq -0x40(%rbp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
pushq $0x4
popq %rsi
movl %r14d, %edx
movl %r13d, %ecx
leaq -0x48(%rbp), %r9
movsd %xmm1, -0x38(%rbp)
movsd %xmm2, -0x30(%rbp)
callq 0x4746
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
addsd -0x48(%rbp), %xmm1
addsd -0x40(%rbp), %xmm2
incq %r15
jmp 0x4ac0
movsd -0x50(%rbp), %xmm0
divsd %xmm0, %xmm1
divsd %xmm0, %xmm2
movq 0xb4e8b8(%rbx), %rax
addq -0x58(%rbp), %rax
movsd %xmm1, 0x578(%rax,%r14,8)
movsd %xmm2, 0x5c0(%rax,%r14,8)
incq %r14
jmp 0x4aab
incq %r13
addq $0x870, %r12            # imm = 0x870
jmp 0x49c5
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq