// File: icemiliang[P]vot/src/vot/../../include/Eigen/src/SparseCore/SparseMatrix.h
// Function: Eigen::SparseMatrix<double, 0, int>& Eigen::SparseMatrix<double, 0, int>::operator=<Eigen::SparseMatrix<double, 1, int>>(Eigen::SparseMatrixBase<Eigen::SparseMatrix<double, 1, int>> const&)
EIGEN_DONT_INLINE SparseMatrix<Scalar,_Options,_StorageIndex>& SparseMatrix<Scalar,_Options,_StorageIndex>::operator=(const SparseMatrixBase<OtherDerived>& other)
{
  EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
        YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)

  #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
    EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN
  #endif
      
  const bool needToTranspose = (Flags & RowMajorBit) != (internal::evaluator<OtherDerived>::Flags & RowMajorBit);
  if (needToTranspose)
  {
    #ifdef EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN
      EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN
    #endif
    // two passes algorithm:
    //  1 - compute the number of coeffs per dest inner vector
    //  2 - do the actual copy/eval
    // Since each coeff of the rhs has to be evaluated twice, let's evaluate it if needed
    typedef typename internal::nested_eval<OtherDerived,2,typename internal::plain_matrix_type<OtherDerived>::type >::type OtherCopy;
    typedef typename internal::remove_all<OtherCopy>::type _OtherCopy;
    typedef internal::evaluator<_OtherCopy> OtherCopyEval;
    OtherCopy otherCopy(other.derived());
    OtherCopyEval otherCopyEval(otherCopy);

    SparseMatrix dest(other.rows(),other.cols());
    Eigen::Map<IndexVector> (dest.m_outerIndex,dest.outerSize()).setZero();

    // pass 1
    // FIXME the above copy could be merged with that pass
    for (Index j=0; j<otherCopy.outerSize(); ++j)
      for (typename OtherCopyEval::InnerIterator it(otherCopyEval, j); it; ++it)
        ++dest.m_outerIndex[it.index()];

    // prefix sum
    StorageIndex count = 0;
    IndexVector positions(dest.outerSize());
    for (Index j=0; j<dest.outerSize(); ++j)
    {
      StorageIndex tmp = dest.m_outerIndex[j];
      dest.m_outerIndex[j] = count;
      positions[j] = count;
      count += tmp;
    }
    dest.m_outerIndex[dest.outerSize()] = count;
    // alloc
    dest.m_data.resize(count);
    // pass 2
    for (StorageIndex j=0; j<otherCopy.outerSize(); ++j)
    {
      for (typename OtherCopyEval::InnerIterator it(otherCopyEval, j); it; ++it)
      {
        Index pos = positions[it.index()]++;
        dest.m_data.index(pos) = j;
        dest.m_data.value(pos) = it.value();
      }
    }
    this->swap(dest);
    return *this;
  }
  else
  {
    if(other.isRValue())
    {
      initAssignment(other.derived());
    }
    // there is no special optimization
    return Base::operator=(other.derived());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x148(%rbp)
movb $0x1, -0x11(%rbp)
movq -0x10(%rbp), %rdi
callq 0x28030
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x286a0
movq -0x10(%rbp), %rdi
callq 0x286d0
movq %rax, -0x140(%rbp)
jmp 0x25d5e
movq -0x10(%rbp), %rdi
callq 0x28700
movq %rax, -0x150(%rbp)
jmp 0x25d70
movq -0x150(%rbp), %rdx
movq -0x140(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x21af0
jmp 0x25d89
movq -0x60(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x28730
movq %rax, -0x158(%rbp)
jmp 0x25da6
leaq -0xa2(%rbp), %rdi
callq 0x28750
jmp 0x25db4
movq -0x158(%rbp), %rdx
movq -0x160(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0xa2(%rbp), %rcx
callq 0x28790
jmp 0x25dd7
leaq -0xa0(%rbp), %rdi
callq 0x287f0
jmp 0x25de5
movq $0x0, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x20(%rbp), %rdi
callq 0x25670
movq %rax, %rcx
movq -0x168(%rbp), %rax
cmpq %rcx, %rax
jge 0x25ef3
leaq -0x30(%rbp), %rdi
callq 0x28820
movq %rax, -0x170(%rbp)
jmp 0x25e2c
movq -0x170(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0x28840
jmp 0x25e48
jmp 0x25e4a
leaq -0xd8(%rbp), %rdi
callq 0x28910
movb %al, -0x171(%rbp)
jmp 0x25e5e
movb -0x171(%rbp), %al
testb $0x1, %al
jne 0x25e6a
jmp 0x25eda
movq -0x60(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x28930
movl %eax, -0x178(%rbp)
jmp 0x25e89
movq -0x180(%rbp), %rax
movl -0x178(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
leaq -0xd8(%rbp), %rdi
callq 0x28950
jmp 0x25eb0
jmp 0x25e4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x2621f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x26216
jmp 0x25edc
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb0(%rbp)
jmp 0x25df0
movl $0x0, -0xdc(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x28730
movq %rax, -0x188(%rbp)
jmp 0x25f0f
movq -0x188(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x25690
jmp 0x25f32
movq $0x0, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x28730
movq %rax, -0x190(%rbp)
jmp 0x25f5d
movq -0x198(%rbp), %rax
movq -0x190(%rbp), %rcx
cmpq %rcx, %rax
jge 0x2601c
movq -0x60(%rbp), %rax
movq -0x100(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x104(%rbp)
movl -0xdc(%rbp), %edx
movq -0x60(%rbp), %rax
movq -0x100(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xdc(%rbp), %eax
movl %eax, -0x1a4(%rbp)
movq -0x100(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x28970
movq %rax, -0x1a0(%rbp)
jmp 0x25fc4
movq -0x1a0(%rbp), %rax
movl -0x1a4(%rbp), %ecx
movl %ecx, (%rax)
movl -0x104(%rbp), %eax
addl -0xdc(%rbp), %eax
movl %eax, -0xdc(%rbp)
movq -0x100(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x25f3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x25cf0
jmp 0x26216
movl -0xdc(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x28730
movq %rax, -0x1b0(%rbp)
jmp 0x26045
movq -0x1b8(%rbp), %rax
movq -0x1b0(%rbp), %rcx
movl -0x1bc(%rbp), %edx
movl %edx, (%rax,%rcx,4)
leaq -0x50(%rbp), %rdi
movslq -0xdc(%rbp), %rsi
xorps %xmm0, %xmm0
callq 0x27ee0
jmp 0x26071
movl $0x0, -0x108(%rbp)
movslq -0x108(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x25670
movq %rax, %rcx
movq -0x1c8(%rbp), %rax
cmpq %rcx, %rax
jge 0x261d6
leaq -0x30(%rbp), %rdi
callq 0x28820
movq %rax, -0x1d0(%rbp)
jmp 0x260b7
movq -0x1d0(%rbp), %rsi
movslq -0x108(%rbp), %rdx
leaq -0x130(%rbp), %rdi
callq 0x28840
jmp 0x260d3
jmp 0x260d5
leaq -0x130(%rbp), %rdi
callq 0x28910
movb %al, -0x1d1(%rbp)
jmp 0x260e9
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x260f8
jmp 0x261c0
leaq -0x130(%rbp), %rdi
callq 0x28930
movl %eax, -0x1d8(%rbp)
jmp 0x2610c
movl -0x1d8(%rbp), %eax
movslq %eax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0x28970
movq %rax, -0x1e0(%rbp)
jmp 0x2612a
movq -0x1e0(%rbp), %rcx
movslq (%rcx), %rax
movl %eax, %edx
incl %edx
movl %edx, (%rcx)
movq %rax, -0x138(%rbp)
movl -0x108(%rbp), %eax
movl %eax, -0x1ec(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x27e90
movl -0x1ec(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x130(%rbp), %rdi
callq 0x28a00
movq %rax, -0x1e8(%rbp)
jmp 0x2617a
movq -0x1e8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1f8(%rbp)
leaq -0x78(%rbp), %rdi
addq $0x28, %rdi
movq -0x138(%rbp), %rsi
callq 0x27ec0
movsd -0x1f8(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x130(%rbp), %rdi
callq 0x28950
jmp 0x261bb
jmp 0x260d5
jmp 0x261c2
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0x2607b
movq -0x148(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x28a20
jmp 0x261e8
leaq -0xf0(%rbp), %rdi
callq 0x25cf0
leaq -0x78(%rbp), %rdi
callq 0x22480
leaq -0x30(%rbp), %rdi
callq 0x28ab0
movq -0x148(%rbp), %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x22480
leaq -0x30(%rbp), %rdi
callq 0x28ab0
movq -0x80(%rbp), %rdi
callq 0xa950
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)