// File: /workspace/github_cpp_makefile_star2_O1/Pyboon[P]sage/./Eigen/src/LU/PartialPivLU.h
// Function: Eigen::internal::partial_lu_impl<std::complex<double>, 0, int>::unblocked_lu(Eigen::Block<Eigen::Map<Eigen::Matrix<std::complex<double>, -1, -1, 0, -1, -1>, 0, Eigen::Stride<0, 0>>, -1, -1, false>&, int*, int&)
static Index unblocked_lu(MatrixType& lu, PivIndex* row_transpositions, PivIndex& nb_transpositions)
  {
    typedef scalar_score_coeff_op<Scalar> Scoring;
    typedef typename Scoring::result_type Score;
    const Index rows = lu.rows();
    const Index cols = lu.cols();
    const Index size = (std::min)(rows,cols);
    nb_transpositions = 0;
    Index first_zero_pivot = -1;
    for(Index k = 0; k < size; ++k)
    {
      Index rrows = rows-k-1;
      Index rcols = cols-k-1;

      Index row_of_biggest_in_col;
      Score biggest_in_corner
        = lu.col(k).tail(rows-k).unaryExpr(Scoring()).maxCoeff(&row_of_biggest_in_col);
      row_of_biggest_in_col += k;

      row_transpositions[k] = PivIndex(row_of_biggest_in_col);

      if(biggest_in_corner != Score(0))
      {
        if(k != row_of_biggest_in_col)
        {
          lu.row(k).swap(lu.row(row_of_biggest_in_col));
          ++nb_transpositions;
        }

        // FIXME shall we introduce a safe quotient expression in cas 1/lu.coeff(k,k)
        // overflow but not the actual quotient?
        lu.col(k).tail(rrows) /= lu.coeff(k,k);
      }
      else if(first_zero_pivot==-1)
      {
        // the pivot is exactly zero, we record the index of the first pivot which is exactly 0,
        // and continue the factorization such we still have A = PLU
        first_zero_pivot = k;
      }

      if(k<rows-1)
        lu.bottomRightCorner(rrows,rcols).noalias() -= lu.col(k).tail(rrows) * lu.row(k).tail(rcols);
    }
    return first_zero_pivot;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rsi, 0x70(%rsp)
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %rax
cmpq %r14, %rax
movq %r14, %rcx
movq %rax, 0x58(%rsp)
cmovlq %rax, %rcx
movq %rdx, 0x40(%rsp)
movl $0x0, (%rdx)
movq %rcx, 0x68(%rsp)
testq %rcx, %rcx
jle 0x15bf7
movq %rdi, %r15
leaq 0x18(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x38(%rdi), %r9
leaq -0x1(%r14), %r12
movl $0x1, %eax
subq %r14, %rax
movq %rax, 0x38(%rsp)
movq $-0x1, 0x18(%rsp)
movq $0x0, 0x30(%rsp)
movq %r12, 0x28(%rsp)
xorl %ebp, %ebp
movq %r14, 0x50(%rsp)
movq %r9, 0x10(%rsp)
movq %r12, 0x48(%rsp)
movq (%r15), %rax
movq 0x8(%r15), %rcx
testq %rax, %rax
sete %dl
testq %rcx, %rcx
setns %sil
orb %dl, %sil
je 0x15c17
cmpq %rbp, 0x10(%r15)
jle 0x15c31
movq %r14, %rsi
subq %rbp, %rsi
testq %rax, %rax
sete %dl
testq %rsi, %rsi
setns %dil
orb %dl, %dil
je 0x15c48
movq %rcx, %rdx
subq %rsi, %rdx
movq %rdx, %rdi
orq %rsi, %rdi
js 0x15c62
movq %rbp, %rbx
notq %rbx
leaq (%r14,%rbx), %r13
movq 0x48(%r15), %rdi
imulq %rbp, %rdi
shlq $0x4, %rdi
addq %rdi, %rax
movq 0x48(%r15), %rdi
movq %rdx, %r8
shlq $0x4, %r8
addq %rax, %r8
movq %r8, 0xf8(%rsp)
movq %rsi, 0x100(%rsp)
movq %rax, 0x110(%rsp)
movq %rcx, 0x118(%rsp)
movq 0x10(%r15), %rax
leaq 0x128(%rsp), %rsi
movq %rax, 0x10(%rsi)
movups (%r15), %xmm0
movups %xmm0, (%rsi)
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x28(%rsi)
movups (%rcx), %xmm0
movups %xmm0, 0x18(%rsi)
movups (%r9), %xmm0
movups %xmm0, 0x38(%rsi)
movq %rdi, 0x170(%rsp)
movq $0x0, 0x178(%rsp)
movq %rbp, 0x180(%rsp)
movq %rdi, 0x188(%rsp)
movq %rdx, 0x190(%rsp)
movq %rdi, 0x1a0(%rsp)
leaq 0xf8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x15e66
movq 0x78(%rsp), %rcx
movsd 0x88(%rsp), %xmm0
leaq (%rcx,%rbp), %rax
movq 0x70(%rsp), %rdx
movl %eax, (%rdx,%rbp,4)
ucomisd 0x7d62(%rip), %xmm0     # 0x1d3f8
jne 0x1569e
jnp 0x158e1
testq %rcx, %rcx
movq %r13, %r10
je 0x157f0
movq (%r15), %rcx
movq 0x10(%r15), %rdx
movq %rbp, %rsi
shlq $0x4, %rsi
addq %rcx, %rsi
movq %rsi, 0xf8(%rsp)
movq %rdx, 0x108(%rsp)
testq %rcx, %rcx
sete %sil
testq %rdx, %rdx
setns %dil
orb %sil, %dil
movq 0x10(%rsp), %r9
je 0x15ca0
movq 0x10(%r15), %rsi
leaq 0x128(%rsp), %rdi
movq %rsi, -0x8(%rdi)
movups (%r15), %xmm0
movups %xmm0, -0x18(%rdi)
movq 0x20(%rsp), %r8
movq 0x10(%r8), %rsi
movq %rsi, 0x10(%rdi)
movups (%r8), %xmm0
movups %xmm0, (%rdi)
movq 0x10(%r9), %rsi
movq %rsi, 0x30(%rdi)
movupd (%r9), %xmm0
movupd %xmm0, 0x20(%rdi)
movq %rbp, 0x160(%rsp)
movq $0x0, 0x168(%rsp)
movq $0x1, 0x170(%rsp)
movq 0x8(%r15), %rsi
cmpq %rbp, %rsi
jle 0x15c81
movq %rax, %rdi
shlq $0x4, %rdi
addq %rdi, %rcx
movq %rcx, 0x78(%rsp)
movq %rdx, 0x88(%rsp)
movq 0x10(%r15), %rcx
leaq 0x90(%rsp), %rdx
movq %rcx, 0x10(%rdx)
movups (%r15), %xmm0
movups %xmm0, (%rdx)
movq 0x10(%r8), %rcx
movq %rcx, 0x28(%rdx)
movups (%r8), %xmm0
movups %xmm0, 0x18(%rdx)
movq 0x10(%r9), %rcx
movq %rcx, 0x48(%rdx)
movupd (%r9), %xmm0
movupd %xmm0, 0x38(%rdx)
movq %rax, 0xe0(%rsp)
movq $0x0, 0xe8(%rsp)
movq $0x1, 0xf0(%rsp)
testq %rax, %rax
js 0x15c81
cmpq %rax, %rsi
jle 0x15c81
leaq 0xf8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x15dcc
movq 0x40(%rsp), %rax
incl (%rax)
movq %r13, %r10
movq (%r15), %rax
movq 0x8(%r15), %rcx
testq %rax, %rax
sete %dl
testq %rcx, %rcx
setns %sil
orb %dl, %sil
movq 0x10(%rsp), %r9
je 0x15c17
cmpq %rbp, 0x10(%r15)
movapd 0x7c02(%rip), %xmm5     # 0x1d420
jle 0x15c31
movq 0x48(%r15), %rdx
movq %rdx, %rsi
imulq %rbp, %rsi
shlq $0x4, %rsi
addq %rax, %rsi
sete %dil
testq %r10, %r10
setns %r8b
orb %dil, %r8b
je 0x15c48
movq %rcx, %rdi
subq %r10, %rdi
orq %r10, %rdi
js 0x15c62
movq %rbp, %rdi
shlq $0x4, %rdi
addq %rdi, %rsi
testq %r10, %r10
js 0x15cb7
je 0x158fb
movupd (%rsi), %xmm0
movapd %xmm0, %xmm1
shufpd $0x1, %xmm0, %xmm1      # xmm1 = xmm1[1],xmm0[0]
movapd %xmm0, %xmm3
mulpd %xmm0, %xmm3
movapd %xmm3, %xmm2
shufpd $0x1, %xmm3, %xmm2      # xmm2 = xmm2[1],xmm3[0]
addpd %xmm3, %xmm2
imulq 0x30(%rsp), %rdx
addq 0x38(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq %rdx, %rax
movq 0x28(%rsp), %rcx
movupd (%rax), %xmm3
movapd %xmm3, %xmm4
unpcklpd %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0]
mulpd %xmm0, %xmm4
xorpd %xmm5, %xmm4
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
mulpd %xmm1, %xmm3
addpd %xmm4, %xmm3
divpd %xmm2, %xmm3
movupd %xmm3, (%rax)
addq $0x10, %rax
decq %rcx
jne 0x158ae
jmp 0x158fb
movq 0x18(%rsp), %rax
cmpq $-0x1, %rax
cmoveq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %r9
movq %r13, %r10
cmpq %r12, %rbp
jge 0x15bd7
movq (%r15), %rcx
movq 0x8(%r15), %rdi
testq %rcx, %rcx
sete %al
testq %rdi, %rdi
setns %dl
orb %al, %dl
je 0x15c17
movq 0x10(%r15), %rsi
cmpq %rbp, %rsi
jle 0x15c31
testq %rcx, %rcx
sete %al
testq %r10, %r10
setns %dl
orb %al, %dl
je 0x15c48
movq %rdi, %rax
subq %r10, %rax
movq %rax, %rdx
orq %r10, %rdx
js 0x15c62
testq %rcx, %rcx
sete %dl
testq %rsi, %rsi
setns %r8b
orb %dl, %r8b
je 0x15ca0
cmpq %rbp, %rdi
jle 0x15c81
addq 0x58(%rsp), %rbx
testq %rcx, %rcx
sete %dl
testq %rbx, %rbx
setns %r8b
orb %dl, %r8b
je 0x15cd6
movq %rsi, %rdx
subq %rbx, %rdx
movq %rdx, %r8
orq %rbx, %r8
js 0x15d0c
movq 0x48(%r15), %r8
movq %r8, %r11
imulq %rbp, %r11
shlq $0x4, %r11
addq %rcx, %r11
movq 0x48(%r15), %r9
movq %rax, %r10
shlq $0x4, %r10
leaq (%r11,%r10), %r12
movq %r12, 0xf8(%rsp)
movq %r13, 0x60(%rsp)
movq %r13, 0x100(%rsp)
movq %r11, 0x110(%rsp)
movq %rbp, %r11
shlq $0x4, %r11
addq %rcx, %r11
movq %rdi, 0x118(%rsp)
movq 0x10(%r15), %rdi
leaq 0x128(%rsp), %r13
movq %rdi, 0x10(%r13)
movups (%r15), %xmm0
movups %xmm0, (%r13)
movq 0x20(%rsp), %r12
movq 0x10(%r12), %rdi
movq %rdi, 0x28(%r13)
movq %rdx, %rdi
imulq %r9, %rdi
shlq $0x4, %rdi
addq %r11, %rdi
movups (%r12), %xmm0
movups %xmm0, 0x18(%r13)
movq 0x10(%rsp), %r14
movups (%r14), %xmm0
movups %xmm0, 0x38(%r13)
movq %r9, 0x170(%rsp)
xorl %r14d, %r14d
movq %r14, 0x178(%rsp)
movq %rbp, 0x180(%rsp)
movq %r9, 0x188(%rsp)
movq %rax, 0x190(%rsp)
movq %r9, 0x1a0(%rsp)
movq %rdi, 0x1a8(%rsp)
movq %rbx, 0x1b8(%rsp)
movq %r11, 0x1c0(%rsp)
movq %rsi, 0x1d0(%rsp)
movq 0x10(%r15), %rsi
movq %rsi, 0xc0(%r13)
movups (%r15), %xmm0
movups %xmm0, 0xb0(%r13)
movq 0x10(%r12), %rsi
movq %rsi, 0xd8(%r13)
testq %rcx, %rcx
sete %sil
addq %rcx, %r10
imulq %rdx, %r8
shlq $0x4, %r8
addq %r10, %r8
movq 0x10(%rsp), %r14
movups (%r12), %xmm0
movups %xmm0, 0xc8(%r13)
movupd (%r14), %xmm0
movq %r8, 0x78(%rsp)
movq 0x60(%rsp), %rcx
movq %rcx, 0x80(%rsp)
movq %rbx, 0x88(%rsp)
orq %rcx, %rbx
movupd %xmm0, 0xe8(%r13)
movq %r9, 0x220(%rsp)
setns %cl
orb %sil, %cl
movq %rbp, 0x228(%rsp)
movl $0x0, %ecx
movq %rcx, 0x230(%rsp)
movl $0x1, %ecx
movq %rcx, 0x238(%rsp)
movq %rdx, 0x248(%rsp)
movq %rcx, 0x250(%rsp)
je 0x15ced
movq 0x10(%r15), %rcx
leaq 0x90(%rsp), %rsi
movq %rcx, 0x10(%rsi)
movups (%r15), %xmm0
movups %xmm0, (%rsi)
movq 0x10(%r12), %rcx
movq %rcx, 0x28(%rsi)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rsi)
movq 0x10(%r14), %rcx
movq %rcx, 0x48(%rsi)
movupd (%r14), %xmm0
movupd %xmm0, 0x38(%rsi)
movq %rax, 0xe0(%rsp)
movq %rdx, 0xe8(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0x1a8(%rsp), %rdx
leaq 0xf(%rsp), %rcx
leaq 0xe(%rsp), %r8
callq 0x15ee5
movq 0x10(%rsp), %r9
movq 0x50(%rsp), %r14
movq 0x48(%rsp), %r12
incq %rbp
decq 0x28(%rsp)
addq $0x10, 0x30(%rsp)
incq 0x38(%rsp)
cmpq 0x68(%rsp), %rbp
jne 0x1555f
jmp 0x15c00
movq $-0x1, 0x18(%rsp)
movq 0x18(%rsp), %rax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8464(%rip), %rdi      # 0x1e082
leaq 0x8507(%rip), %rsi      # 0x1e12c
leaq 0xeaa9(%rip), %rcx      # 0x246d5
jmp 0x15d02
leaq 0x82c9(%rip), %rdi      # 0x1df01
leaq 0x8369(%rip), %rsi      # 0x1dfa8
leaq 0xe991(%rip), %rcx      # 0x245d7
jmp 0x15c96
leaq 0x8433(%rip), %rdi      # 0x1e082
leaq 0x84d6(%rip), %rsi      # 0x1e12c
leaq 0xeccc(%rip), %rcx      # 0x24929
jmp 0x15d02
leaq 0xd39c(%rip), %rdi      # 0x23005
leaq 0x8338(%rip), %rsi      # 0x1dfa8
leaq 0xeb6e(%rip), %rcx      # 0x247e5
movl $0x93, %edx
callq 0x31b0
leaq 0x8279(%rip), %rdi      # 0x1df01
leaq 0x8319(%rip), %rsi      # 0x1dfa8
leaq 0xedcd(%rip), %rcx      # 0x24a63
movl $0x7a, %edx
callq 0x31b0
leaq 0x83db(%rip), %rdi      # 0x1e082
leaq 0x847e(%rip), %rsi      # 0x1e12c
leaq 0xeea3(%rip), %rcx      # 0x24b58
jmp 0x15d02
leaq 0x662e(%rip), %rdi      # 0x1c2ec
leaq 0x66bc(%rip), %rsi      # 0x1c381
leaq 0xf114(%rip), %rcx      # 0x24de0
movl $0x4a, %edx
callq 0x31b0
leaq 0x83a5(%rip), %rdi      # 0x1e082
leaq 0x8448(%rip), %rsi      # 0x1e12c
leaq 0xf350(%rip), %rcx      # 0x2503b
jmp 0x15d02
leaq 0x838e(%rip), %rdi      # 0x1e082
leaq 0x8431(%rip), %rsi      # 0x1e12c
leaq 0xfb98(%rip), %rcx      # 0x2589a
movl $0xaf, %edx
callq 0x31b0
leaq 0xd2f2(%rip), %rdi      # 0x23005
leaq 0x828e(%rip), %rsi      # 0x1dfa8
leaq 0xf1ee(%rip), %rcx      # 0x24f0f
jmp 0x15c77