// File: /workspace/github_cpp_makefile_star2_O3/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:
movslq 0x325ed62(%rip), %rax   # 0x3261bc0
testq %rax, %rax
jle 0x2fb9
pushq %r15
pushq %r14
pushq %rbx
vmovsd 0x21b4(%rip), %xmm0     # 0x5028
vmovsd 0x21b4(%rip), %xmm1     # 0x5030
vmovsd 0x21b4(%rip), %xmm2     # 0x5038
vmovsd 0x21b4(%rip), %xmm3     # 0x5040
leaq 0x18acfd(%rip), %rdx    # 0x18db90
leaq 0x325ed36(%rip), %rsi   # 0x3261bd0
leaq 0x8f72f2f(%rip), %rdi   # 0x8f75dd0
leaq 0x90f9928(%rip), %r8    # 0x90fc7d0
vxorpd %xmm4, %xmm4, %xmm4
leaq 0xdbfcdd(%rip), %r9     # 0xdc2b90
xorl %ecx, %ecx
movslq (%rsi,%rcx,4), %r11
movq %rcx, %r10
shlq $0x5, %r10
testq %r11, %r11
jle 0x2f86
vmovapd (%r10,%rdx), %xmm7
vmovsd 0x10(%r10,%rdx), %xmm8
movslq (%rdi,%rcx,4), %rbx
vxorpd %xmm6, %xmm6, %xmm6
vxorpd %xmm5, %xmm5, %xmm5
xorl %r14d, %r14d
leaq (%r8,%rbx,4), %rbx
movslq (%rbx,%r14,4), %r15
vmovapd %xmm0, %xmm13
incq %r14
shlq $0x5, %r15
vmovapd (%r15,%rdx), %xmm9
vmovsd 0x10(%r15,%rdx), %xmm10
vsubpd %xmm7, %xmm9, %xmm9
vsubsd %xmm8, %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, %xmm5 # xmm5 = (xmm10 * xmm12) + xmm5
vfmadd231pd %xmm9, %xmm11, %xmm6 # xmm6 = (xmm11 * xmm9) + xmm6
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)
cmpq %r14, %r11
jne 0x2ee9
jmp 0x2f8e
vxorpd %xmm6, %xmm6, %xmm6
vxorpd %xmm5, %xmm5, %xmm5
vaddpd (%r10,%r9), %xmm6, %xmm6
incq %rcx
vmovapd %xmm6, (%r10,%r9)
vaddsd 0x10(%r10,%r9), %xmm5, %xmm5
vmovsd %xmm5, 0x10(%r10,%r9)
cmpq %rax, %rcx
jne 0x2eb5
popq %rbx
popq %r14
popq %r15
retq