// File: Kingsford-Group[P]ghost2/include/Eigen/src/Eigenvalues/Tridiagonalization.h
// Function: void Eigen::internal::tridiagonalization_inplace<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>>(Eigen::Matrix<double, -1, -1, 0, -1, -1>&, Eigen::Matrix<double, -1, 1, 0, -1, 1>&)
void tridiagonalization_inplace(MatrixType& matA, CoeffVectorType& hCoeffs)
{
  using numext::conj;
  typedef typename MatrixType::Index Index;
  typedef typename MatrixType::Scalar Scalar;
  typedef typename MatrixType::RealScalar RealScalar;
  Index n = matA.rows();
  eigen_assert(n==matA.cols());
  eigen_assert(n==hCoeffs.size()+1 || n==1);
  
  for (Index i = 0; i<n-1; ++i)
  {
    Index remainingSize = n-i-1;
    RealScalar beta;
    Scalar h;
    matA.col(i).tail(remainingSize).makeHouseholderInPlace(h, beta);

    // Apply similarity transformation to remaining columns,
    // i.e., A = H A H' where H = I - h v v' and v = matA.col(i).tail(n-i-1)
    matA.col(i).coeffRef(i+1) = 1;

    hCoeffs.tail(n-i-1).noalias() = (matA.bottomRightCorner(remainingSize,remainingSize).template selfadjointView<Lower>()
                                  * (conj(h) * matA.col(i).tail(remainingSize)));

    hCoeffs.tail(n-i-1) += (conj(h)*Scalar(-0.5)*(hCoeffs.tail(remainingSize).dot(matA.col(i).tail(remainingSize)))) * matA.col(i).tail(n-i-1);

    matA.bottomRightCorner(remainingSize, remainingSize).template selfadjointView<Lower>()
      .rankUpdate(matA.col(i).tail(remainingSize), hCoeffs.tail(remainingSize), -1);

    matA.col(i).coeffRef(i+1) = beta;
    hCoeffs.coeffRef(i) = h;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5d0, %rsp            # imm = 0x5D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x24690
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x558(%rbp)
movq -0x8(%rbp), %rdi
callq 0x286d0
movq %rax, %rcx
movq -0x558(%rbp), %rax
cmpq %rcx, %rax
jne 0x6aaf5
jmp 0x6ab14
leaq 0x5eddc(%rip), %rdi     # 0xc98d8
leaq 0x5ecb0(%rip), %rsi     # 0xc97b3
movl $0x161, %edx            # imm = 0x161
leaq 0x5edd8(%rip), %rcx     # 0xc98e7
callq 0x104a0
movq -0x18(%rbp), %rax
movq %rax, -0x568(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4af00
movq -0x568(%rbp), %rcx
movq %rax, %rdx
addq $0x1, %rdx
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x559(%rbp)
je 0x6ab51
cmpq $0x1, -0x18(%rbp)
sete %al
movb %al, -0x559(%rbp)
movb -0x559(%rbp), %al
testb $0x1, %al
jne 0x6ab5d
jmp 0x6ab5f
jmp 0x6ab7e
leaq 0x5ee30(%rip), %rdi     # 0xc9996
leaq 0x5ec46(%rip), %rsi     # 0xc97b3
movl $0x162, %edx            # imm = 0x162
leaq 0x5ed6e(%rip), %rcx     # 0xc98e7
callq 0x104a0
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jge 0x6af92
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
notq %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x5b0(%rbp)
callq 0x4de50
movq -0x5b0(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x80(%rbp), %rdi
movq %rdi, -0x5a8(%rbp)
callq 0x4dea0
movq -0x5a8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq %rsi, -0x590(%rbp)
leaq -0x30(%rbp), %rdx
callq 0x6b190
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x5a0(%rbp)
callq 0x4de50
movq -0x5a0(%rbp), %rdi
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x6b210
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq -0x1a8(%rbp), %rdi
movq %rdi, -0x598(%rbp)
movq %rcx, %rdx
callq 0x6b260
movq -0x598(%rbp), %rsi
leaq -0x180(%rbp), %rdi
movq %rdi, -0x578(%rbp)
callq 0x6b2e0
movq -0x590(%rbp), %rdi
callq 0x4df90
movsd %xmm0, -0x200(%rbp)
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x270(%rbp), %rdi
movq %rdi, -0x588(%rbp)
callq 0x4de50
movq -0x588(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x248(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x4dea0
movq -0x580(%rbp), %rdx
leaq -0x1f8(%rbp), %rdi
movq %rdi, -0x570(%rbp)
leaq -0x200(%rbp), %rsi
callq 0x6b370
movq -0x578(%rbp), %rsi
movq -0x570(%rbp), %rdx
leaq -0x158(%rbp), %rdi
callq 0x6b320
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rdx
notq %rdx
addq %rax, %rdx
leaq -0x2a0(%rbp), %rdi
callq 0x6b3b0
jmp 0x6ad19
leaq -0x2a0(%rbp), %rdi
callq 0x6b410
movq %rax, -0x5b8(%rbp)
jmp 0x6ad2e
movq -0x5b8(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x6b440
jmp 0x6ad51
leaq -0x158(%rbp), %rdi
callq 0x6b480
leaq -0x38(%rbp), %rdi
callq 0x4df90
movsd 0x513a2(%rip), %xmm1    # 0xbc110
mulsd %xmm1, %xmm0
movsd %xmm0, -0x5d0(%rbp)
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x330(%rbp), %rdi
callq 0x6b3b0
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x3a0(%rbp), %rdi
callq 0x4de50
movq -0x28(%rbp), %rdx
leaq -0x378(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x4dea0
leaq -0x330(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x6b4a0
movaps %xmm0, %xmm1
movsd -0x5d0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x308(%rbp)
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x410(%rbp), %rdi
callq 0x4de50
movq -0x18(%rbp), %rdx
subq -0x20(%rbp), %rdx
subq $0x1, %rdx
leaq -0x3e8(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x4dea0
leaq -0x300(%rbp), %rdi
leaq -0x308(%rbp), %rsi
leaq -0x3e8(%rbp), %rdx
callq 0x6b370
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
subq -0x20(%rbp), %rdx
subq $0x1, %rdx
leaq -0x438(%rbp), %rdi
callq 0x6b3b0
leaq -0x438(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x6b510
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x488(%rbp), %rdi
callq 0x6b260
leaq -0x460(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x6b2e0
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x4f8(%rbp), %rdi
callq 0x4de50
movq -0x28(%rbp), %rdx
leaq -0x4d0(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x4dea0
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x520(%rbp), %rdi
callq 0x6b3b0
movsd 0x511a7(%rip), %xmm0    # 0xbc078
movsd %xmm0, -0x528(%rbp)
leaq -0x460(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
leaq -0x520(%rbp), %rdx
leaq -0x528(%rbp), %rcx
callq 0x6b570
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x5c8(%rbp)
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x550(%rbp), %rdi
callq 0x4de50
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
leaq -0x550(%rbp), %rdi
callq 0x6b210
movsd -0x5c8(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x5c0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4afd0
movsd -0x5c0(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6ab86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x6b480
jmp 0x6af9b
addq $0x5d0, %rsp            # imm = 0x5D0
popq %rbp
retq
movq -0x2a8(%rbp), %rdi
callq 0x10cc0
nopw (%rax,%rax)