// File: /workspace/github_cpp_makefile_star2_O3/Kingsford-Group[P]ghost2/include/Eigen/src/Jacobi/Jacobi.h
// Function: void Eigen::internal::apply_rotation_in_the_plane<Eigen::Block<Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0>>, -1, 1, true>, Eigen::Block<Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0>>, -1, 1, true>, double>(Eigen::Block<Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0>>, -1, 1, true>&, Eigen::Block<Eigen::Map<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0>>, -1, 1, true>&, Eigen::JacobiRotation<double> const&)
void /*EIGEN_DONT_INLINE*/ apply_rotation_in_the_plane(VectorX& _x, VectorY& _y, const JacobiRotation<OtherScalar>& j)
{
  typedef typename VectorX::Index Index;
  typedef typename VectorX::Scalar Scalar;
  enum { PacketSize = packet_traits<Scalar>::size };
  typedef typename packet_traits<Scalar>::type Packet;
  eigen_assert(_x.size() == _y.size());
  Index size = _x.size();
  Index incrx = _x.innerStride();
  Index incry = _y.innerStride();

  Scalar* EIGEN_RESTRICT x = &_x.coeffRef(0);
  Scalar* EIGEN_RESTRICT y = &_y.coeffRef(0);
  
  OtherScalar c = j.c();
  OtherScalar s = j.s();
  if (c==OtherScalar(1) && s==OtherScalar(0))
    return;

  /*** dynamic-size vectorized paths ***/

  if(VectorX::SizeAtCompileTime == Dynamic &&
    (VectorX::Flags & VectorY::Flags & PacketAccessBit) &&
    ((incrx==1 && incry==1) || PacketSize == 1))
  {
    // both vectors are sequentially stored in memory => vectorization
    enum { Peeling = 2 };

    Index alignedStart = internal::first_aligned(y, size);
    Index alignedEnd = alignedStart + ((size-alignedStart)/PacketSize)*PacketSize;

    const Packet pc = pset1<Packet>(c);
    const Packet ps = pset1<Packet>(s);
    conj_helper<Packet,Packet,NumTraits<Scalar>::IsComplex,false> pcj;

    for(Index i=0; i<alignedStart; ++i)
    {
      Scalar xi = x[i];
      Scalar yi = y[i];
      x[i] =  c * xi + numext::conj(s) * yi;
      y[i] = -s * xi + numext::conj(c) * yi;
    }

    Scalar* EIGEN_RESTRICT px = x + alignedStart;
    Scalar* EIGEN_RESTRICT py = y + alignedStart;

    if(internal::first_aligned(x, size)==alignedStart)
    {
      for(Index i=alignedStart; i<alignedEnd; i+=PacketSize)
      {
        Packet xi = pload<Packet>(px);
        Packet yi = pload<Packet>(py);
        pstore(px, padd(pmul(pc,xi),pcj.pmul(ps,yi)));
        pstore(py, psub(pcj.pmul(pc,yi),pmul(ps,xi)));
        px += PacketSize;
        py += PacketSize;
      }
    }
    else
    {
      Index peelingEnd = alignedStart + ((size-alignedStart)/(Peeling*PacketSize))*(Peeling*PacketSize);
      for(Index i=alignedStart; i<peelingEnd; i+=Peeling*PacketSize)
      {
        Packet xi   = ploadu<Packet>(px);
        Packet xi1  = ploadu<Packet>(px+PacketSize);
        Packet yi   = pload <Packet>(py);
        Packet yi1  = pload <Packet>(py+PacketSize);
        pstoreu(px, padd(pmul(pc,xi),pcj.pmul(ps,yi)));
        pstoreu(px+PacketSize, padd(pmul(pc,xi1),pcj.pmul(ps,yi1)));
        pstore (py, psub(pcj.pmul(pc,yi),pmul(ps,xi)));
        pstore (py+PacketSize, psub(pcj.pmul(pc,yi1),pmul(ps,xi1)));
        px += Peeling*PacketSize;
        py += Peeling*PacketSize;
      }
      if(alignedEnd!=peelingEnd)
      {
        Packet xi = ploadu<Packet>(x+peelingEnd);
        Packet yi = pload <Packet>(y+peelingEnd);
        pstoreu(x+peelingEnd, padd(pmul(pc,xi),pcj.pmul(ps,yi)));
        pstore (y+peelingEnd, psub(pcj.pmul(pc,yi),pmul(ps,xi)));
      }
    }

    for(Index i=alignedEnd; i<size; ++i)
    {
      Scalar xi = x[i];
      Scalar yi = y[i];
      x[i] =  c * xi + numext::conj(s) * yi;
      y[i] = -s * xi + numext::conj(c) * yi;
    }
  }

  /*** fixed-size vectorized path ***/
  else if(VectorX::SizeAtCompileTime != Dynamic &&
          (VectorX::Flags & VectorY::Flags & PacketAccessBit) &&
          (VectorX::Flags & VectorY::Flags & AlignedBit))
  {
    const Packet pc = pset1<Packet>(c);
    const Packet ps = pset1<Packet>(s);
    conj_helper<Packet,Packet,NumTraits<Scalar>::IsComplex,false> pcj;
    Scalar* EIGEN_RESTRICT px = x;
    Scalar* EIGEN_RESTRICT py = y;
    for(Index i=0; i<size; i+=PacketSize)
    {
      Packet xi = pload<Packet>(px);
      Packet yi = pload<Packet>(py);
      pstore(px, padd(pmul(pc,xi),pcj.pmul(ps,yi)));
      pstore(py, psub(pcj.pmul(pc,yi),pmul(ps,xi)));
      px += PacketSize;
      py += PacketSize;
    }
  }

  /*** non-vectorized path ***/
  else
  {
    for(Index i=0; i<size; ++i)
    {
      Scalar xi = *x;
      Scalar yi = *y;
      *x =  c * xi + numext::conj(s) * yi;
      *y = -s * xi + numext::conj(c) * yi;
      x += incrx;
      y += incry;
    }
  }
}

// Assembly:
pushq %rax
movq 0x8(%rdi), %rax
cmpq 0x8(%rsi), %rax
jne 0x3363e
movq (%rdi), %rcx
movq (%rsi), %rsi
movsd (%rdx), %xmm0
movsd 0x8(%rdx), %xmm1
ucomisd 0x14c5c(%rip), %xmm0    # 0x48060
jne 0x33418
jp 0x33418
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x33418
jnp 0x3363c
movl %esi, %edx
shrl $0x3, %edx
andl $0x1, %edx
cmpq %rax, %rdx
cmovgeq %rax, %rdx
testb $0x7, %sil
cmovneq %rax, %rdx
movq %rax, %r9
subq %rdx, %r9
movq %r9, %r8
shrq $0x3f, %r8
addq %r9, %r8
andq $-0x2, %r8
testq %rdx, %rdx
jle 0x33492
movapd 0x14cf0(%rip), %xmm2    # 0x48140
xorpd %xmm1, %xmm2
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm3
movsd (%rsi,%rdi,8), %xmm4
movapd %xmm1, %xmm5
mulsd %xmm4, %xmm5
movapd %xmm0, %xmm6
mulsd %xmm3, %xmm6
addsd %xmm5, %xmm6
movsd %xmm6, (%rcx,%rdi,8)
mulsd %xmm0, %xmm4
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rdx
jne 0x33456
leaq (%r8,%rdx), %rdi
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movapd %xmm1, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
movl %ecx, %r10d
shrl $0x3, %r10d
andl $0x1, %r10d
cmpq %rax, %r10
cmovgeq %rax, %r10
testb $0x7, %cl
cmovneq %rax, %r10
cmpq %rdx, %r10
jne 0x33510
cmpq $0x2, %r9
jl 0x335ef
movapd (%rcx,%rdx,8), %xmm4
movapd (%rsi,%rdx,8), %xmm5
movapd %xmm2, %xmm6
mulpd %xmm4, %xmm6
movapd %xmm3, %xmm7
mulpd %xmm5, %xmm7
addpd %xmm6, %xmm7
movapd %xmm7, (%rcx,%rdx,8)
mulpd %xmm2, %xmm5
mulpd %xmm3, %xmm4
subpd %xmm4, %xmm5
movapd %xmm5, (%rsi,%rdx,8)
addq $0x2, %rdx
cmpq %rdi, %rdx
jl 0x334ce
jmp 0x335ef
leaq 0x3(%r9), %r11
testq %r9, %r9
cmovnsq %r9, %r11
andq $-0x4, %r11
leaq (%r11,%rdx), %r10
cmpq $0x4, %r9
jl 0x335b2
movupd (%rcx,%rdx,8), %xmm4
movupd 0x10(%rcx,%rdx,8), %xmm5
movapd (%rsi,%rdx,8), %xmm6
movapd 0x10(%rsi,%rdx,8), %xmm7
movapd %xmm2, %xmm8
mulpd %xmm4, %xmm8
movapd %xmm3, %xmm9
mulpd %xmm6, %xmm9
addpd %xmm8, %xmm9
movupd %xmm9, (%rcx,%rdx,8)
movapd %xmm2, %xmm8
mulpd %xmm5, %xmm8
movapd %xmm3, %xmm9
mulpd %xmm7, %xmm9
addpd %xmm8, %xmm9
movupd %xmm9, 0x10(%rcx,%rdx,8)
mulpd %xmm2, %xmm6
mulpd %xmm3, %xmm4
subpd %xmm4, %xmm6
movapd %xmm6, (%rsi,%rdx,8)
mulpd %xmm2, %xmm7
mulpd %xmm3, %xmm5
subpd %xmm5, %xmm7
movapd %xmm7, 0x10(%rsi,%rdx,8)
addq $0x4, %rdx
cmpq %r10, %rdx
jl 0x3352d
cmpq %r11, %r8
je 0x335ef
movupd (%rcx,%r10,8), %xmm4
movapd (%rsi,%r10,8), %xmm5
movapd %xmm2, %xmm6
mulpd %xmm4, %xmm6
movapd %xmm3, %xmm7
mulpd %xmm5, %xmm7
addpd %xmm6, %xmm7
movupd %xmm7, (%rcx,%r10,8)
mulpd %xmm5, %xmm2
mulpd %xmm4, %xmm3
subpd %xmm3, %xmm2
movapd %xmm2, (%rsi,%r10,8)
cmpq %rax, %rdi
jge 0x3363c
movapd 0x14b44(%rip), %xmm2    # 0x48140
xorpd %xmm1, %xmm2
movsd (%rcx,%rdi,8), %xmm3
movsd (%rsi,%rdi,8), %xmm4
movapd %xmm1, %xmm5
mulsd %xmm4, %xmm5
movapd %xmm0, %xmm6
mulsd %xmm3, %xmm6
addsd %xmm5, %xmm6
movsd %xmm6, (%rcx,%rdi,8)
mulsd %xmm0, %xmm4
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, (%rsi,%rdi,8)
incq %rdi
cmpq %rax, %rdi
jl 0x33600
popq %rax
retq
leaq 0x23f65(%rip), %rdi     # 0x575aa
leaq 0x23f75(%rip), %rsi     # 0x575c1
leaq 0x23f90(%rip), %rcx     # 0x575e3
movl $0x133, %edx            # imm = 0x133
callq 0xc340
nop