// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/./Eigen/src/LU/FullPivLU.h
// Function: Eigen::FullPivLU<Eigen::Matrix<double, -1, -1, 0, -1, -1>>::computeInPlace()
void FullPivLU<MatrixType>::computeInPlace()
{
  check_template_parameters();

  // the permutations are stored as int indices, so just to be sure:
  eigen_assert(m_lu.rows()<=NumTraits<int>::highest() && m_lu.cols()<=NumTraits<int>::highest());

  m_l1_norm = m_lu.cwiseAbs().colwise().sum().maxCoeff();

  const Index size = m_lu.diagonalSize();
  const Index rows = m_lu.rows();
  const Index cols = m_lu.cols();

  // will store the transpositions, before we accumulate them at the end.
  // can't accumulate on-the-fly because that will be done in reverse order for the rows.
  m_rowsTranspositions.resize(m_lu.rows());
  m_colsTranspositions.resize(m_lu.cols());
  Index number_of_transpositions = 0; // number of NONTRIVIAL transpositions, i.e. m_rowsTranspositions[i]!=i

  m_nonzero_pivots = size; // the generic case is that in which all pivots are nonzero (invertible case)
  m_maxpivot = RealScalar(0);

  for(Index k = 0; k < size; ++k)
  {
    // First, we need to find the pivot.

    // biggest coefficient in the remaining bottom-right corner (starting at row k, col k)
    Index row_of_biggest_in_corner, col_of_biggest_in_corner;
    typedef internal::scalar_score_coeff_op<Scalar> Scoring;
    typedef typename Scoring::result_type Score;
    Score biggest_in_corner;
    biggest_in_corner = m_lu.bottomRightCorner(rows-k, cols-k)
                        .unaryExpr(Scoring())
                        .maxCoeff(&row_of_biggest_in_corner, &col_of_biggest_in_corner);
    row_of_biggest_in_corner += k; // correct the values! since they were computed in the corner,
    col_of_biggest_in_corner += k; // need to add k to them.

    if(biggest_in_corner==Score(0))
    {
      // before exiting, make sure to initialize the still uninitialized transpositions
      // in a sane state without destroying what we already have.
      m_nonzero_pivots = k;
      for(Index i = k; i < size; ++i)
      {
        m_rowsTranspositions.coeffRef(i) = i;
        m_colsTranspositions.coeffRef(i) = i;
      }
      break;
    }

    RealScalar abs_pivot = internal::abs_knowing_score<Scalar>()(m_lu(row_of_biggest_in_corner, col_of_biggest_in_corner), biggest_in_corner);
    if(abs_pivot > m_maxpivot) m_maxpivot = abs_pivot;

    // Now that we've found the pivot, we need to apply the row/col swaps to
    // bring it to the location (k,k).

    m_rowsTranspositions.coeffRef(k) = row_of_biggest_in_corner;
    m_colsTranspositions.coeffRef(k) = col_of_biggest_in_corner;
    if(k != row_of_biggest_in_corner) {
      m_lu.row(k).swap(m_lu.row(row_of_biggest_in_corner));
      ++number_of_transpositions;
    }
    if(k != col_of_biggest_in_corner) {
      m_lu.col(k).swap(m_lu.col(col_of_biggest_in_corner));
      ++number_of_transpositions;
    }

    // Now that the pivot is at the right location, we update the remaining
    // bottom-right corner by Gaussian elimination.

    if(k<rows-1)
      m_lu.col(k).tail(rows-k-1) /= m_lu.coeff(k,k);
    if(k<size-1)
      m_lu.block(k+1,k+1,rows-k-1,cols-k-1).noalias() -= m_lu.col(k).tail(rows-k-1) * m_lu.row(k).tail(cols-k-1);
  }

  // the main loop is over, we still have to accumulate the transpositions to find the
  // permutations P and Q

  m_p.setIdentity(rows);
  for(Index k = size-1; k >= 0; --k)
    m_p.applyTranspositionOnTheRight(k, m_rowsTranspositions.coeff(k));

  m_q.setIdentity(cols);
  for(Index k = 0; k < size; ++k)
    m_q.applyTranspositionOnTheRight(k, m_colsTranspositions.coeff(k));

  m_det_pq = (number_of_transpositions%2) ? -1 : 1;

  m_isInitialized = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
cmpq $0x7fffffff, 0x8(%rdi)  # imm = 0x7FFFFFFF
jg 0x1aaca
movq %rdi, %rbx
movl $0x80000000, %eax       # imm = 0x80000000
cmpq %rax, 0x10(%rdi)
jge 0x1aaca
leaq 0xd0(%rsp), %rdi
movq %rbx, 0x8(%rdi)
callq 0x1aca8
movsd %xmm0, 0x60(%rbx)
movq 0x8(%rbx), %r13
movq 0x10(%rbx), %r14
cmpq %r13, %r14
movq %r13, %r12
cmovlq %r14, %r12
leaq 0x38(%rbx), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x1abac
leaq 0x48(%rbx), %rdi
movq 0x10(%rbx), %rsi
movq %rdi, 0x28(%rsp)
callq 0x1ac3e
movq %r12, 0x58(%rbx)
andq $0x0, 0x68(%rbx)
leaq -0x1(%r13), %rax
movq %rax, 0x58(%rsp)
leaq -0x1(%r12), %rax
movq %rax, 0x50(%rsp)
xorl %ebp, %ebp
testq %r12, %r12
movl $0x0, %eax
cmovgq %r12, %rax
movq %rax, 0x30(%rsp)
movq %r14, 0x48(%rsp)
movq %r13, 0x40(%rsp)
movq $0x0, 0x18(%rsp)
movq %r15, 0x20(%rsp)
cmpq %rbp, 0x30(%rsp)
je 0x1aa37
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x13406
movq 0x98(%rsp), %rax
movq %rax, 0x100(%rsp)
movupd 0x68(%rsp), %xmm0
movups 0x78(%rsp), %xmm1
movups 0x88(%rsp), %xmm2
movaps %xmm2, 0xf0(%rsp)
movaps %xmm1, 0xe0(%rsp)
movapd %xmm0, 0xd0(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x1acb6
movq 0x10(%rsp), %rsi
addq %rbp, %rsi
movq %rsi, 0x10(%rsp)
movq 0x8(%rsp), %rdx
addq %rbp, %rdx
movq %rdx, 0x8(%rsp)
ucomisd 0x36bf2(%rip), %xmm0    # 0x51408
jne 0x1a81e
jnp 0x1aa19
movq %rbx, %rdi
movsd %xmm0, (%rsp)
callq 0x1acf6
movsd (%rsp), %xmm0
ucomisd 0x68(%rbx), %xmm0
jbe 0x1a83c
movsd %xmm0, 0x68(%rbx)
movq 0x10(%rsp), %rax
movq (%r15), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movq %rax, (%rcx,%rbp,8)
cmpq 0x10(%rsp), %rbp
movq %r13, (%rsp)
movq %r14, 0x38(%rsp)
je 0x1a8a9
leaq 0xd0(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x154fe
movq 0x10(%rsp), %rdx
leaq 0x68(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x154fe
movq %r13, %rdi
movq %r14, %rsi
callq 0x1ad40
incq 0x18(%rsp)
movq 0x8(%rsp), %rax
cmpq %rax, %rbp
je 0x1a8e9
leaq 0xd0(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x147ac
movq 0x8(%rsp), %rdx
leaq 0x68(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x147ac
movq %r13, %rdi
movq %r14, %rsi
callq 0x1ad76
incq 0x18(%rsp)
movq (%rsp), %r13
cmpq 0x58(%rsp), %rbp
jge 0x1a945
movq 0x8(%rbx), %rax
imulq %rbp, %rax
shlq $0x3, %rax
addq (%rbx), %rax
leaq (%rax,%rbp,8), %r15
leaq 0x68(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x147ac
leaq -0x1(%r13), %rdx
leaq 0xd0(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x1adac
movq %r13, %rdi
movq (%rsp), %r13
movq %r15, %rsi
movq 0x20(%rsp), %r15
callq 0x1adc4
cmpq 0x50(%rsp), %rbp
jge 0x1aa06
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x147ac
leaq -0x1(%r13), %r15
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1adac
leaq 0x248(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x154fe
movq 0x38(%rsp), %rax
leaq -0x1(%rax), %r14
leaq 0x1a8(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x1ae00
leaq 0xd0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x1a8(%rsp), %rdx
callq 0x1b742
leaq 0x1(%rbp), %rcx
leaq 0x210(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %rcx, %rdx
movq %r15, %r8
movq 0x20(%rsp), %r15
movq %r14, %r9
callq 0x14400
movq %r13, 0x60(%rsp)
movq (%rsp), %r13
leaq 0x60(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x1ae18
incq %rbp
decq %r13
movq 0x38(%rsp), %r14
decq %r14
jmp 0x1a783
movq %rbp, 0x58(%rbx)
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rcx
cmpq %rbp, %r12
je 0x1aa37
movq %rbp, (%rax,%rbp,8)
movq %rbp, (%rcx,%rbp,8)
incq %rbp
jmp 0x1aa25
movq 0x18(%rsp), %rbp
leaq 0x18(%rbx), %r14
movq %r14, %rdi
movq 0x40(%rsp), %rsi
callq 0x1ae36
movq 0x30(%rsp), %r13
testq %r12, %r12
jle 0x1aa6f
movq (%r15), %rax
movq -0x8(%rax,%r12,8), %rdx
decq %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x1ae48
jmp 0x1aa52
leaq 0x28(%rbx), %r14
movq %r14, %rdi
movq 0x48(%rsp), %rsi
callq 0x1ae36
xorl %r15d, %r15d
movq 0x28(%rsp), %r12
cmpq %r15, %r13
je 0x1aaa5
movq (%r12), %rax
movq (%rax,%r15,8), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1ae48
incq %r15
jmp 0x1aa88
andb $0x1, %bpl
negb %bpl
orb $0x1, %bpl
movb %bpl, 0x78(%rbx)
movb $0x1, 0x79(%rbx)
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3db8c(%rip), %rdi     # 0x5865d
leaq 0x3dbd6(%rip), %rsi     # 0x586ae
leaq 0x3dbea(%rip), %rcx     # 0x586c9
movl $0x1ef, %edx            # imm = 0x1EF
callq 0x9210
nop