// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]lj_simd/force_aos.cpp
// Function: force_sorted()
void
force_sorted(void) {
  const int pn = particle_number;
  const int *__restrict sorted_list2 = sorted_list;
  for (int i = 0; i < pn; i++) {
    const double qix = q[i][X];
    const double qiy = q[i][Y];
    const double qiz = q[i][Z];
    const int np = number_of_partners[i];
    double pfx = 0;
    double pfy = 0;
    double pfz = 0;
    const int kp = pointer[i];
    for (int k = 0; k < np; k++) {
      const int j = sorted_list2[kp + k];
      double dx = q[j][X] - qix;
      double dy = q[j][Y] - qiy;
      double dz = q[j][Z] - qiz;
      double r2 = (dx * dx + dy * dy + dz * dz);
      double r6 = r2 * r2 * r2;
      double df = ((24.0 * r6 - 48.0) / (r6 * r6 * r2)) * dt;
      if (r2 > CL2) df = 0.0;
      pfx += df * dx;
      pfy += df * dy;
      pfz += df * dz;
      p[j][X] -= df * dx;
      p[j][Y] -= df * dy;
      p[j][Z] -= df * dz;
    }
    p[i][X] += pfx;
    p[i][Y] += pfy;
    p[i][Z] += pfz;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
vmovsd 0x23d4(%rip), %xmm0     # 0x4028
vmovsd 0x23d4(%rip), %xmm1     # 0x4030
vmovsd 0x23d4(%rip), %xmm2     # 0x4038
vmovsd 0x23d4(%rip), %xmm3     # 0x4040
movl 0x325ef0e(%rip), %eax   # 0x3260b80
leaq 0x18aed7(%rip), %rdx    # 0x18cb50
leaq 0x325ef10(%rip), %rsi   # 0x3260b90
leaq 0x8f73109(%rip), %rdi   # 0x8f74d90
leaq 0x90f9b02(%rip), %r8    # 0x90fb790
leaq 0xdbfebb(%rip), %r9     # 0xdc1b50
vxorpd %xmm4, %xmm4, %xmm4
movl %eax, %ecx
sarl $0x1f, %ecx
andnl %eax, %ecx, %eax
xorl %ecx, %ecx
cmpq %rax, %rcx
je 0x1da6
movq %rcx, %r10
shlq $0x5, %r10
movslq (%rdi,%rcx,4), %rbx
movl (%rsi,%rcx,4), %r11d
vxorpd %xmm8, %xmm8, %xmm8
vxorpd %xmm7, %xmm7, %xmm7
xorl %r14d, %r14d
vmovapd (%r10,%rdx), %xmm5
vmovsd 0x10(%r10,%rdx), %xmm6
movl %r11d, %ebp
sarl $0x1f, %ebp
leaq (%r8,%rbx,4), %rbx
andnl %r11d, %ebp, %r11d
cmpq %r14, %r11
je 0x1d84
movslq (%rbx,%r14,4), %r15
vmovapd %xmm0, %xmm13
incq %r14
shlq $0x5, %r15
vmovapd (%r15,%rdx), %xmm9
vmovsd 0x10(%r15,%rdx), %xmm10
vsubpd %xmm5, %xmm9, %xmm9
vsubsd %xmm6, %xmm10, %xmm10
vmulpd %xmm9, %xmm9, %xmm11
vshufpd $0x1, %xmm11, %xmm11, %xmm11 # xmm11 = xmm11[1,0]
vfmadd231sd %xmm9, %xmm9, %xmm11 # xmm11 = (xmm9 * xmm9) + xmm11
vfmadd231sd %xmm10, %xmm10, %xmm11 # xmm11 = (xmm10 * xmm10) + xmm11
vmulsd %xmm11, %xmm11, %xmm12
vcmpgtsd %xmm3, %xmm11, %k1
vmulsd %xmm12, %xmm11, %xmm12
vfmadd213sd %xmm1, %xmm12, %xmm13 # xmm13 = (xmm12 * xmm13) + xmm1
vmulsd %xmm12, %xmm12, %xmm12
vmulsd %xmm12, %xmm11, %xmm12
vdivsd %xmm12, %xmm13, %xmm12
vmulsd %xmm2, %xmm12, %xmm12
vmovsd %xmm4, %xmm12, %xmm12 {%k1}
vmovddup %xmm12, %xmm11          # xmm11 = xmm12[0,0]
vfmadd231sd %xmm12, %xmm10, %xmm7 # xmm7 = (xmm10 * xmm12) + xmm7
vfmadd231pd %xmm9, %xmm11, %xmm8 # xmm8 = (xmm11 * xmm9) + xmm8
vfnmadd213pd (%r15,%r9), %xmm11, %xmm9 # xmm9 = -(xmm11 * xmm9) + mem
vmovapd %xmm9, (%r15,%r9)
vfnmadd213sd 0x10(%r15,%r9), %xmm12, %xmm10 # xmm10 = -(xmm12 * xmm10) + mem
vmovsd %xmm10, 0x10(%r15,%r9)
jmp 0x1ce5
vaddpd (%r10,%r9), %xmm8, %xmm5
incq %rcx
vmovapd %xmm5, (%r10,%r9)
vaddsd 0x10(%r10,%r9), %xmm7, %xmm5
vmovsd %xmm5, 0x10(%r10,%r9)
jmp 0x1ca5
popq %rbx
popq %r14
popq %r15
popq %rbp
retq