// File: /workspace/github_cpp_makefile_star2_O1/Pyboon[P]sage/./Eigen/src/Core/products/GeneralBlockPanelKernel.h
// Function: Eigen::internal::gemm_pack_rhs<std::complex<double>, long, Eigen::internal::blas_data_mapper<std::complex<double>, long, 0, 0>, 4, 0, false, true>::operator()(std::complex<double>*, Eigen::internal::blas_data_mapper<std::complex<double>, long, 0, 0> const&, long, long, long, long)
EIGEN_DONT_INLINE void gemm_pack_rhs<Scalar, Index, DataMapper, nr, ColMajor, Conjugate, PanelMode>
  ::operator()(Scalar* blockB, const DataMapper& rhs, Index depth, Index cols, Index stride, Index offset)
{
  EIGEN_ASM_COMMENT("EIGEN PRODUCT PACK RHS COLMAJOR");
  EIGEN_UNUSED_VARIABLE(stride);
  EIGEN_UNUSED_VARIABLE(offset);
  eigen_assert(((!PanelMode) && stride==0 && offset==0) || (PanelMode && stride>=depth && offset<=stride));
  conj_if<NumTraits<Scalar>::IsComplex && Conjugate> cj;
  Index packet_cols8 = nr>=8 ? (cols/8) * 8 : 0;
  Index packet_cols4 = nr>=4 ? (cols/4) * 4 : 0;
  Index count = 0;
  const Index peeled_k = (depth/PacketSize)*PacketSize;
//   if(nr>=8)
//   {
//     for(Index j2=0; j2<packet_cols8; j2+=8)
//     {
//       // skip what we have before
//       if(PanelMode) count += 8 * offset;
//       const Scalar* b0 = &rhs[(j2+0)*rhsStride];
//       const Scalar* b1 = &rhs[(j2+1)*rhsStride];
//       const Scalar* b2 = &rhs[(j2+2)*rhsStride];
//       const Scalar* b3 = &rhs[(j2+3)*rhsStride];
//       const Scalar* b4 = &rhs[(j2+4)*rhsStride];
//       const Scalar* b5 = &rhs[(j2+5)*rhsStride];
//       const Scalar* b6 = &rhs[(j2+6)*rhsStride];
//       const Scalar* b7 = &rhs[(j2+7)*rhsStride];
//       Index k=0;
//       if(PacketSize==8) // TODO enbale vectorized transposition for PacketSize==4
//       {
//         for(; k<peeled_k; k+=PacketSize) {
//           PacketBlock<Packet> kernel;
//           for (int p = 0; p < PacketSize; ++p) {
//             kernel.packet[p] = ploadu<Packet>(&rhs[(j2+p)*rhsStride+k]);
//           }
//           ptranspose(kernel);
//           for (int p = 0; p < PacketSize; ++p) {
//             pstoreu(blockB+count, cj.pconj(kernel.packet[p]));
//             count+=PacketSize;
//           }
//         }
//       }
//       for(; k<depth; k++)
//       {
//         blockB[count+0] = cj(b0[k]);
//         blockB[count+1] = cj(b1[k]);
//         blockB[count+2] = cj(b2[k]);
//         blockB[count+3] = cj(b3[k]);
//         blockB[count+4] = cj(b4[k]);
//         blockB[count+5] = cj(b5[k]);
//         blockB[count+6] = cj(b6[k]);
//         blockB[count+7] = cj(b7[k]);
//         count += 8;
//       }
//       // skip what we have after
//       if(PanelMode) count += 8 * (stride-offset-depth);
//     }
//   }

  if(nr>=4)
  {
    for(Index j2=packet_cols8; j2<packet_cols4; j2+=4)
    {
      // skip what we have before
      if(PanelMode) count += 4 * offset;
      const LinearMapper dm0 = rhs.getLinearMapper(0, j2 + 0);
      const LinearMapper dm1 = rhs.getLinearMapper(0, j2 + 1);
      const LinearMapper dm2 = rhs.getLinearMapper(0, j2 + 2);
      const LinearMapper dm3 = rhs.getLinearMapper(0, j2 + 3);

      Index k=0;
      if((PacketSize%4)==0) // TODO enable vectorized transposition for PacketSize==2 ??
      {
        for(; k<peeled_k; k+=PacketSize) {
          PacketBlock<Packet,(PacketSize%4)==0?4:PacketSize> kernel;
          kernel.packet[0] = dm0.loadPacket(k);
          kernel.packet[1%PacketSize] = dm1.loadPacket(k);
          kernel.packet[2%PacketSize] = dm2.loadPacket(k);
          kernel.packet[3%PacketSize] = dm3.loadPacket(k);
          ptranspose(kernel);
          pstoreu(blockB+count+0*PacketSize, cj.pconj(kernel.packet[0]));
          pstoreu(blockB+count+1*PacketSize, cj.pconj(kernel.packet[1%PacketSize]));
          pstoreu(blockB+count+2*PacketSize, cj.pconj(kernel.packet[2%PacketSize]));
          pstoreu(blockB+count+3*PacketSize, cj.pconj(kernel.packet[3%PacketSize]));
          count+=4*PacketSize;
        }
      }
      for(; k<depth; k++)
      {
        blockB[count+0] = cj(dm0(k));
        blockB[count+1] = cj(dm1(k));
        blockB[count+2] = cj(dm2(k));
        blockB[count+3] = cj(dm3(k));
        count += 4;
      }
      // skip what we have after
      if(PanelMode) count += 4 * (stride-offset-depth);
    }
  }

  // copy the remaining columns one at a time (nr==1)
  for(Index j2=packet_cols4; j2<cols; ++j2)
  {
    if(PanelMode) count += offset;
    const LinearMapper dm0 = rhs.getLinearMapper(0, j2);
    for(Index k=0; k<depth; k++)
    {
      blockB[count] = cj(dm0(k));
      count += 1;
    }
    if(PanelMode) count += (stride-offset-depth);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpq %rcx, %r9
jl 0x172f5
movq 0x90(%rsp), %rdi
cmpq %r9, %rdi
jg 0x172f5
leaq 0x3(%r8), %r10
testq %r8, %r8
cmovnsq %r8, %r10
movq %r10, 0x8(%rsp)
andq $-0x4, %r10
movq %r8, 0x18(%rsp)
cmpq $0x4, %r8
movq %r9, 0x20(%rsp)
movq %rsi, 0x10(%rsp)
jl 0x17265
leaq (,%rdi,4), %rax
movq %rax, 0x28(%rsp)
subq %rcx, %r9
subq %rdi, %r9
shlq $0x2, %r9
movq %r9, 0x50(%rsp)
movq %rdi, %rax
shlq $0x6, %rax
addq %rsi, %rax
addq $0x30, %rax
movq %rax, 0x38(%rsp)
leaq (,%rcx,4), %rax
leaq (%rax,%rdi,4), %rax
movq %rax, 0x30(%rsp)
movl $0x30, %r13d
movl $0x20, %ebp
movl $0x10, %eax
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r11d, %r11d
movq %rcx, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
testq %rcx, %rcx
jle 0x17236
movq (%rdx), %rsi
movq 0x8(%rdx), %r14
movq %r14, %r8
imulq %r13, %r8
addq %rsi, %r8
movq %r14, %r9
imulq %rbp, %r9
addq %rsi, %r9
movq %r14, %r12
imulq %rax, %r12
addq %rsi, %r12
imulq %rbx, %r14
addq %rsi, %r14
movq 0x30(%rsp), %rdx
leaq (%rdx,%r11), %rsi
shlq $0x4, %r11
addq 0x38(%rsp), %r11
xorl %edi, %edi
movups (%r14,%rdi), %xmm0
movups %xmm0, -0x30(%r11,%rdi,4)
movups (%r12,%rdi), %xmm0
movups %xmm0, -0x20(%r11,%rdi,4)
movups (%r9,%rdi), %xmm0
movups %xmm0, -0x10(%r11,%rdi,4)
movups (%r8,%rdi), %xmm0
movups %xmm0, (%r11,%rdi,4)
addq $0x10, %rdi
decq %rcx
jne 0x171f6
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rdx
jmp 0x1723e
addq 0x28(%rsp), %r11
movq %r11, %rsi
addq 0x50(%rsp), %rsi
addq $0x4, %r15
addq $0x40, %r13
addq $0x40, %rbp
addq $0x40, %rax
addq $0x40, %rbx
movq %rsi, %r11
cmpq %r10, %r15
jl 0x171ad
jmp 0x17267
xorl %esi, %esi
movq 0x18(%rsp), %rbx
cmpq %rbx, %r10
movq 0x20(%rsp), %r11
movq 0x10(%rsp), %r15
movq 0x90(%rsp), %r12
movq 0x8(%rsp), %r13
jge 0x172e6
sarq $0x2, %r13
subq %rcx, %r11
subq %r12, %r11
movq %rcx, %rax
negq %rax
shlq $0x6, %r13
addq %r12, %rsi
testq %rcx, %rcx
jle 0x172d7
movq 0x8(%rdx), %r8
imulq %r13, %r8
addq (%rdx), %r8
movq %rsi, %r9
shlq $0x4, %r9
addq %r15, %r9
xorl %edi, %edi
xorl %r14d, %r14d
movups (%r8,%rdi), %xmm0
movups %xmm0, (%r9,%rdi)
decq %r14
addq $0x10, %rdi
cmpq %r14, %rax
jne 0x172be
subq %r14, %rsi
addq %r11, %rsi
incq %r10
addq $0x10, %r13
cmpq %rbx, %r10
jne 0x1729c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb863(%rip), %rdi      # 0x22b5f
leaq 0xb8b7(%rip), %rsi      # 0x22bba
leaq 0xeca9(%rip), %rcx      # 0x25fb3
movl $0x772, %edx            # imm = 0x772
callq 0x31b0