// File: icemiliang[P]vot/src/vot/../../include/Eigen/src/SparseCore/SparseMatrix.h
// Function: void Eigen::SparseMatrix<double, 1, int>::collapseDuplicates<Eigen::internal::scalar_sum_op<double, double>>(Eigen::internal::scalar_sum_op<double, double>)
void SparseMatrix<Scalar,_Options,_StorageIndex>::collapseDuplicates(DupFunctor dup_func)
{
  eigen_assert(!isCompressed());
  // TODO, in practice we should be able to use m_innerNonZeros for that task
  IndexVector wi(innerSize());
  wi.fill(-1);
  StorageIndex count = 0;
  // for each inner-vector, wi[inner_index] will hold the position of first element into the index/value buffers
  for(Index j=0; j<outerSize(); ++j)
  {
    StorageIndex start   = count;
    Index oldEnd  = m_outerIndex[j]+m_innerNonZeros[j];
    for(Index k=m_outerIndex[j]; k<oldEnd; ++k)
    {
      Index i = m_data.index(k);
      if(wi(i)>=start)
      {
        // we already meet this entry => accumulate it
        m_data.value(wi(i)) = dup_func(m_data.value(wi(i)), m_data.value(k));
      }
      else
      {
        m_data.value(count) = m_data.value(k);
        m_data.index(count) = m_data.index(k);
        wi(i) = count;
        ++count;
      }
    }
    m_outerIndex[j] = start;
  }
  m_outerIndex[m_outerSize] = count;

  // turn the matrix into compressed form
  std::free(m_innerNonZeros);
  m_innerNonZeros = 0;
  m_data.resize(m_outerIndex[m_outerSize]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rsi, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x27d80
xorb $-0x1, %al
testb $0x1, %al
jne 0x259bc
jmp 0x259be
jmp 0x259dd
leaq 0x69295(%rip), %rdi     # 0x8ec5a
leaq 0x686a8(%rip), %rsi     # 0x8e074
movl $0x3fb, %edx            # imm = 0x3FB
leaq 0x69359(%rip), %rcx     # 0x8ed31
callq 0xa330
movq -0x70(%rbp), %rdi
callq 0x28620
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0x80(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x25690
movq -0x80(%rbp), %rdi
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
leaq -0x2c(%rbp), %rsi
callq 0x28640
jmp 0x25a11
movl $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x70(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x25670
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jge 0x25c7f
movq -0x70(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, -0x4c(%rbp)
movq 0x18(%rax), %rcx
movq -0x48(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movq 0x20(%rax), %rdx
movq -0x48(%rbp), %rsi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movq %rcx, -0x58(%rbp)
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x25c5c
movq -0x70(%rbp), %rdi
addq $0x28, %rdi
movq -0x60(%rbp), %rsi
callq 0x27e90
movslq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x25770
movq %rax, -0x90(%rbp)
jmp 0x25aba
movq -0x90(%rbp), %rax
movl (%rax), %eax
cmpl -0x4c(%rbp), %eax
jl 0x25ba2
movq -0x70(%rbp), %rax
addq $0x28, %rax
movq %rax, -0xa0(%rbp)
movq -0x68(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x25770
movq %rax, -0x98(%rbp)
jmp 0x25af1
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rax
movslq (%rax), %rsi
callq 0x27ec0
movq -0x70(%rbp), %rdi
movq %rax, -0xb0(%rbp)
addq $0x28, %rdi
movq -0x60(%rbp), %rsi
callq 0x27ec0
movq -0x78(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq %rax, %rdx
callq 0x28670
movsd %xmm0, -0xa8(%rbp)
jmp 0x25b3c
movq -0x70(%rbp), %rax
addq $0x28, %rax
movq %rax, -0xc0(%rbp)
movq -0x68(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x25770
movq %rax, -0xb8(%rbp)
jmp 0x25b61
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rax
movslq (%rax), %rsi
callq 0x27ec0
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x25c49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x25cf0
jmp 0x25cd5
movq -0x70(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0xd8(%rbp)
movq -0x60(%rbp), %rsi
callq 0x27ec0
movq -0xd8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xe0(%rbp)
movslq -0x40(%rbp), %rsi
callq 0x27ec0
movsd -0xe0(%rbp), %xmm0
movq -0xd8(%rbp), %rdi
movsd %xmm0, (%rax)
movq -0x60(%rbp), %rsi
callq 0x27e90
movq -0xd8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xd0(%rbp)
movslq -0x40(%rbp), %rsi
callq 0x27e90
movl -0xd0(%rbp), %ecx
movl %ecx, (%rax)
movl -0x40(%rbp), %eax
movl %eax, -0xcc(%rbp)
movq -0x68(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x25770
movq %rax, -0xc8(%rbp)
jmp 0x25c31
movq -0xc8(%rbp), %rax
movl -0xcc(%rbp), %ecx
movl %ecx, (%rax)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x25c4b
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x25a7e
movq -0x70(%rbp), %rax
movl -0x4c(%rbp), %edx
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x25a20
movq -0x70(%rbp), %rax
movl -0x40(%rbp), %esi
movq 0x8(%rax), %rdx
movq 0x18(%rax), %rcx
movl %esi, (%rcx,%rdx,4)
movq 0x20(%rax), %rdi
callq 0xa5c0
movq -0x70(%rbp), %rax
movq $0x0, 0x20(%rax)
movq %rax, %rdi
addq $0x28, %rdi
movq 0x8(%rax), %rcx
movq 0x18(%rax), %rax
movslq (%rax,%rcx,4), %rsi
xorps %xmm0, %xmm0
callq 0x27ee0
jmp 0x25cc3
leaq -0x20(%rbp), %rdi
callq 0x25cf0
addq $0xe0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xa950
nop