// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %r9, %rax
subq %rcx, %rax
movq %rax, 0x28(%rsp)
jl 0x15350
movq 0x80(%rsp), %r11
cmpq %r9, %r11
jg 0x15350
movq %rdx, %r10
pushq $0x4
popq %rdi
movq %r8, 0x20(%rsp)
movq %r8, %rax
cqto
idivq %rdi
xorl %r8d, %r8d
testq %rcx, %rcx
movl $0x0, %edi
cmovgq %rcx, %rdi
movq %rax, 0x10(%rsp)
leaq (,%rax,4), %rax
movq %rax, 0x8(%rsp)
shlq $0x2, %r9
shlq $0x2, %rcx
subq %rcx, %r9
movq %r11, %rcx
shlq $0x6, %rcx
movq %rsi, 0x18(%rsp)
leaq (%rcx,%rsi), %rax
addq $0x30, %rax
movq %rax, 0x30(%rsp)
pushq $0x10
popq %r12
pushq $0x20
popq %r13
pushq $0x30
popq %rbp
xorl %esi, %esi
xorl %r11d, %r11d
movq %r10, 0x40(%rsp)
movq %r9, 0x38(%rsp)
cmpq 0x8(%rsp), %r11
jge 0x152d1
movq (%r10), %rdx
movq 0x8(%r10), %r14
leaq (%r9,%rsi), %rax
shlq $0x4, %rsi
movq %rsi, %rcx
addq 0x30(%rsp), %rcx
movq %r14, %r10
movq %r8, %r9
imulq %r8, %r10
addq %rdx, %r10
movq %r14, %r8
imulq %r12, %r8
addq %rdx, %r8
movq %r14, %r15
imulq %r13, %r15
addq %rdx, %r15
imulq %rbp, %r14
addq %rdx, %r14
movq %rdi, %rdx
xorl %ebx, %ebx
movq %rax, %rsi
subq $0x1, %rdx
jb 0x152ab
movups (%r10,%rbx), %xmm0
movups %xmm0, -0x30(%rcx,%rbx,4)
movups (%r8,%rbx), %xmm0
movups %xmm0, -0x20(%rcx,%rbx,4)
movups (%r15,%rbx), %xmm0
movups %xmm0, -0x10(%rcx,%rbx,4)
movups (%r14,%rbx), %xmm0
movups %xmm0, (%rcx,%rbx,4)
addq $0x4, %rsi
addq $0x10, %rbx
jmp 0x15274
addq $0x4, %r11
movq %r9, %r8
addq $0x40, %r8
addq $0x40, %r12
addq $0x40, %r13
addq $0x40, %rbp
movq 0x40(%rsp), %r10
movq 0x38(%rsp), %r9
jmp 0x15222
negq %rdi
movq 0x10(%rsp), %r15
shlq $0x6, %r15
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %r11
movq 0x28(%rsp), %rbx
movq 0x80(%rsp), %r14
movq 0x8(%rsp), %r12
cmpq %rax, %r12
jge 0x15341
leaq (%rsi,%r14), %rcx
shlq $0x4, %rcx
addq %r11, %rcx
movq 0x8(%r10), %rdx
imulq %r15, %rdx
addq (%r10), %rdx
xorl %r9d, %r9d
xorl %r8d, %r8d
cmpq %r8, %rdi
je 0x15332
movups (%rdx,%r9), %xmm0
movups %xmm0, (%rcx,%r9)
decq %r8
addq $0x10, %r9
jmp 0x1531a
addq %rbx, %rsi
subq %r8, %rsi
incq %r12
addq $0x10, %r15
jmp 0x152f9
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe940(%rip), %rdi      # 0x23c97
leaq 0xe994(%rip), %rsi      # 0x23cf2
leaq 0x13072(%rip), %rcx     # 0x283d7
movl $0x772, %edx            # imm = 0x772
callq 0x31a0
nop