// File: Pyboon[P]sage/./Eigen/src/Core/products/GeneralBlockPanelKernel.h
// Function: Eigen::internal::gemm_pack_lhs<std::complex<double>, long, Eigen::internal::const_blas_data_mapper<std::complex<double>, long, 0>, 1, 1, 0, false, false>::operator()(std::complex<double>*, Eigen::internal::const_blas_data_mapper<std::complex<double>, long, 0> const&, long, long, long, long)
EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, ColMajor, Conjugate, PanelMode>
  ::operator()(Scalar* blockA, const DataMapper& lhs, Index depth, Index rows, Index stride, Index offset)
{
  typedef typename packet_traits<Scalar>::type Packet;
  enum { PacketSize = packet_traits<Scalar>::size };

  EIGEN_ASM_COMMENT("EIGEN PRODUCT PACK LHS");
  EIGEN_UNUSED_VARIABLE(stride);
  EIGEN_UNUSED_VARIABLE(offset);
  eigen_assert(((!PanelMode) && stride==0 && offset==0) || (PanelMode && stride>=depth && offset<=stride));
  eigen_assert( ((Pack1%PacketSize)==0 && Pack1<=4*PacketSize) || (Pack1<=4) );
  conj_if<NumTraits<Scalar>::IsComplex && Conjugate> cj;
  Index count = 0;

  const Index peeled_mc3 = Pack1>=3*PacketSize ? (rows/(3*PacketSize))*(3*PacketSize) : 0;
  const Index peeled_mc2 = Pack1>=2*PacketSize ? peeled_mc3+((rows-peeled_mc3)/(2*PacketSize))*(2*PacketSize) : 0;
  const Index peeled_mc1 = Pack1>=1*PacketSize ? (rows/(1*PacketSize))*(1*PacketSize) : 0;
  const Index peeled_mc0 = Pack2>=1*PacketSize ? peeled_mc1
                         : Pack2>1             ? (rows/Pack2)*Pack2 : 0;

  Index i=0;

  // Pack 3 packets
  if(Pack1>=3*PacketSize)
  {
    for(; i<peeled_mc3; i+=3*PacketSize)
    {
      if(PanelMode) count += (3*PacketSize) * offset;

      for(Index k=0; k<depth; k++)
      {
        Packet A, B, C;
        A = lhs.loadPacket(i+0*PacketSize, k);
        B = lhs.loadPacket(i+1*PacketSize, k);
        C = lhs.loadPacket(i+2*PacketSize, k);
        pstore(blockA+count, cj.pconj(A)); count+=PacketSize;
        pstore(blockA+count, cj.pconj(B)); count+=PacketSize;
        pstore(blockA+count, cj.pconj(C)); count+=PacketSize;
      }
      if(PanelMode) count += (3*PacketSize) * (stride-offset-depth);
    }
  }
  // Pack 2 packets
  if(Pack1>=2*PacketSize)
  {
    for(; i<peeled_mc2; i+=2*PacketSize)
    {
      if(PanelMode) count += (2*PacketSize) * offset;

      for(Index k=0; k<depth; k++)
      {
        Packet A, B;
        A = lhs.loadPacket(i+0*PacketSize, k);
        B = lhs.loadPacket(i+1*PacketSize, k);
        pstore(blockA+count, cj.pconj(A)); count+=PacketSize;
        pstore(blockA+count, cj.pconj(B)); count+=PacketSize;
      }
      if(PanelMode) count += (2*PacketSize) * (stride-offset-depth);
    }
  }
  // Pack 1 packets
  if(Pack1>=1*PacketSize)
  {
    for(; i<peeled_mc1; i+=1*PacketSize)
    {
      if(PanelMode) count += (1*PacketSize) * offset;

      for(Index k=0; k<depth; k++)
      {
        Packet A;
        A = lhs.loadPacket(i+0*PacketSize, k);
        pstore(blockA+count, cj.pconj(A));
        count+=PacketSize;
      }
      if(PanelMode) count += (1*PacketSize) * (stride-offset-depth);
    }
  }
  // Pack scalars
  if(Pack2<PacketSize && Pack2>1)
  {
    for(; i<peeled_mc0; i+=Pack2)
    {
      if(PanelMode) count += Pack2 * offset;

      for(Index k=0; k<depth; k++)
        for(Index w=0; w<Pack2; w++)
          blockA[count++] = cj(lhs(i+w, k));

      if(PanelMode) count += Pack2 * (stride-offset-depth);
    }
  }
  for(; i<rows; i++)
  {
    if(PanelMode) count += offset;
    for(Index k=0; k<depth; k++)
      blockA[count++] = cj(lhs(i, k));
    if(PanelMode) count += (stride-offset-depth);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq 0x10(%rbp), %rax
movq %rdi, -0x88(%rbp)
movq %rsi, -0x90(%rbp)
movq %rdx, -0x98(%rbp)
movq %rcx, -0xa0(%rbp)
movq %r8, -0xa8(%rbp)
movq %r9, -0xb0(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x3df20
leaq 0x10(%rbp), %rdi
callq 0x3df20
cmpq $0x0, -0xb0(%rbp)
jne 0x54117
movb $0x1, %al
cmpq $0x0, 0x10(%rbp)
movb %al, -0x119(%rbp)
je 0x54121
xorl %eax, %eax
movb %al, -0x119(%rbp)
jmp 0x54121
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0x5412d
jmp 0x5412f
jmp 0x5414e
leaq 0x23993(%rip), %rdi     # 0x77ac9
leaq 0x239e7(%rip), %rsi     # 0x77b24
movl $0x6a9, %edx            # imm = 0x6A9
leaq 0x297f4(%rip), %rcx     # 0x7d93d
callq 0x94c0
movq $0x0, -0xc0(%rbp)
movq $0x0, -0xc8(%rbp)
movq $0x0, -0xd0(%rbp)
movq -0xa8(%rbp), %rax
movl $0x1, %ecx
cqto
idivq %rcx
shlq $0x0, %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq $0x0, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jge 0x54303
movq $0x0, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jge 0x542ea
leaq -0x100(%rbp), %rdi
callq 0x35d80
movq -0x98(%rbp), %rdx
movq -0xe8(%rbp), %rcx
addq $0x0, %rcx
movq -0xf0(%rbp), %rax
movq %rdx, -0x58(%rbp)
movq %rcx, -0x60(%rbp)
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rdx, -0x8(%rbp)
movq %rcx, -0x10(%rbp)
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq (%rsi), %rax
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdx
imulq 0x8(%rsi), %rdx
addq %rdx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x15310
movapd %xmm0, -0x30(%rbp)
movapd -0x30(%rbp), %xmm0
movapd %xmm0, -0x50(%rbp)
movapd -0x50(%rbp), %xmm0
movapd %xmm0, -0x110(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x90(%rbp), %rax
movq -0xc0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
leaq -0xb1(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x428e0
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x15210
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
jmp 0x541c3
jmp 0x542ec
movq -0xe8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe8(%rbp)
jmp 0x541a4
jmp 0x54305
movq -0xe8(%rbp), %rax
cmpq -0xa8(%rbp), %rax
jge 0x543e7
movq $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
cmpq -0xa0(%rbp), %rax
jge 0x543ce
movq -0x98(%rbp), %rdx
movq -0xe8(%rbp), %rcx
movq -0x118(%rbp), %rax
movq %rdx, -0x70(%rbp)
movq %rcx, -0x78(%rbp)
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rdx
movq (%rdx), %rsi
movq -0x78(%rbp), %rax
movq -0x80(%rbp), %rcx
imulq 0x8(%rdx), %rcx
addq %rcx, %rax
shlq $0x4, %rax
addq %rax, %rsi
leaq -0xb1(%rbp), %rdi
callq 0x42900
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq -0xc0(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0xc0(%rbp)
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x54324
jmp 0x543d0
movq -0xe8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe8(%rbp)
jmp 0x54305
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq