// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]lj_simd/force_soa.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[X][i];
    const double qiy = q[Y][i];
    const double qiz = q[Z][i];
    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[X][j] - qix;
      double dy = q[Y][j] - qiy;
      double dz = q[Z][j] - qiz;
      double r2 = (dx * dx + dy * dy + dz * dz);
      //if (r2 > CL2) continue;
      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[X][j] -= df * dx;
      p[Y][j] -= df * dy;
      p[Z][j] -= df * dz;
    }
    p[X][i] += pfx;
    p[Y][i] += pfy;
    p[Z][i] += pfz;
  }
}

// Assembly:
pushq %r14
pushq %rbx
vmovsd 0x2451(%rip), %xmm0     # 0x4028
vmovsd 0x2451(%rip), %xmm1     # 0x4030
vmovsd 0x2451(%rip), %xmm2     # 0x4038
vmovsd 0x2451(%rip), %xmm3     # 0x4040
movl 0x19f4f1b(%rip), %eax   # 0x19f6b10
leaq 0x18af14(%rip), %rdx    # 0x18cb10
leaq 0x19f4f1d(%rip), %rsi   # 0x19f6b20
leaq 0x7709116(%rip), %rdi   # 0x770ad20
leaq 0x7a1650f(%rip), %r8    # 0x7a18120
leaq 0xdbfef8(%rip), %r9     # 0xdc1b10
vxorpd %xmm4, %xmm4, %xmm4
movl %eax, %ecx
sarl $0x1f, %ecx
andnl %eax, %ecx, %eax
xorl %ecx, %ecx
cmpq %rax, %rcx
je 0x1d70
vmovsd (%rdx,%rcx,8), %xmm5
vmovsd 0x30d400(%rdx,%rcx,8), %xmm6
vmovsd 0x61a800(%rdx,%rcx,8), %xmm7
movslq (%rdi,%rcx,4), %r11
movl (%rsi,%rcx,4), %r10d
vxorpd %xmm8, %xmm8, %xmm8
vxorpd %xmm9, %xmm9, %xmm9
vxorpd %xmm10, %xmm10, %xmm10
movl %r10d, %ebx
sarl $0x1f, %ebx
leaq (%r8,%r11,4), %r11
andnl %r10d, %ebx, %r10d
xorl %ebx, %ebx
cmpq %rbx, %r10
je 0x1d34
movslq (%r11,%rbx,4), %r14
vmovapd %xmm0, %xmm16
incq %rbx
vmovsd 0x30d400(%rdx,%r14,8), %xmm12
vmovsd (%rdx,%r14,8), %xmm11
vmovsd 0x61a800(%rdx,%r14,8), %xmm13
vsubsd %xmm6, %xmm12, %xmm12
vsubsd %xmm5, %xmm11, %xmm11
vsubsd %xmm7, %xmm13, %xmm13
vmulsd %xmm12, %xmm12, %xmm14
vfmadd231sd %xmm11, %xmm11, %xmm14 # xmm14 = (xmm11 * xmm11) + xmm14
vfmadd231sd %xmm13, %xmm13, %xmm14 # xmm14 = (xmm13 * xmm13) + xmm14
vmulsd %xmm14, %xmm14, %xmm15
vcmpgtsd %xmm3, %xmm14, %k1
vmulsd %xmm15, %xmm14, %xmm15
vfmadd213sd %xmm1, %xmm15, %xmm16 # xmm16 = (xmm15 * xmm16) + xmm1
vmulsd %xmm15, %xmm15, %xmm15
vmulsd %xmm15, %xmm14, %xmm15
vdivsd %xmm15, %xmm16, %xmm15
vmulsd %xmm2, %xmm15, %xmm15
vmovsd %xmm4, %xmm15, %xmm15 {%k1}
vfmadd231sd %xmm11, %xmm15, %xmm10 # xmm10 = (xmm15 * xmm11) + xmm10
vfnmadd213sd (%r9,%r14,8), %xmm15, %xmm11 # xmm11 = -(xmm15 * xmm11) + mem
vfmadd231sd %xmm12, %xmm15, %xmm9 # xmm9 = (xmm15 * xmm12) + xmm9
vfmadd231sd %xmm15, %xmm13, %xmm8 # xmm8 = (xmm13 * xmm15) + xmm8
vmovsd %xmm11, (%r9,%r14,8)
vfnmadd213sd 0x30d400(%r9,%r14,8), %xmm15, %xmm12 # xmm12 = -(xmm15 * xmm12) + mem
vmovsd %xmm12, 0x30d400(%r9,%r14,8)
vfnmadd213sd 0x61a800(%r9,%r14,8), %xmm15, %xmm13 # xmm13 = -(xmm15 * xmm13) + mem
vmovsd %xmm13, 0x61a800(%r9,%r14,8)
jmp 0x1c70
vaddsd (%r9,%rcx,8), %xmm10, %xmm5
vmovsd %xmm5, (%r9,%rcx,8)
vaddsd 0x30d400(%r9,%rcx,8), %xmm9, %xmm5
vmovsd %xmm5, 0x30d400(%r9,%rcx,8)
vaddsd 0x61a800(%r9,%rcx,8), %xmm8, %xmm5
vmovsd %xmm5, 0x61a800(%r9,%rcx,8)
incq %rcx
jmp 0x1c28
popq %rbx
popq %r14
retq