// File: /workspace/github_cpp_makefile_star2_O1/icemiliang[P]vot/src/vot/../../include/Eigen/src/SparseCore/SparseMatrix.h
// Function: Eigen::SparseMatrix<double, 0, int>::insert(long, long)
typename SparseMatrix<_Scalar,_Options,_StorageIndex>::Scalar& SparseMatrix<_Scalar,_Options,_StorageIndex>::insert(Index row, Index col)
{
  eigen_assert(row>=0 && row<rows() && col>=0 && col<cols());
  
  const Index outer = IsRowMajor ? row : col;
  const Index inner = IsRowMajor ? col : row;
  
  if(isCompressed())
  {
    if(nonZeros()==0)
    {
      // reserve space if not already done
      if(m_data.allocatedSize()==0)
        m_data.reserve(2*m_innerSize);
      
      // turn the matrix into non-compressed mode
      m_innerNonZeros = static_cast<StorageIndex*>(std::malloc(m_outerSize * sizeof(StorageIndex)));
      if(!m_innerNonZeros) internal::throw_std_bad_alloc();
      
      memset(m_innerNonZeros, 0, (m_outerSize)*sizeof(StorageIndex));
      
      // pack all inner-vectors to the end of the pre-allocated space
      // and allocate the entire free-space to the first inner-vector
      StorageIndex end = convert_index(m_data.allocatedSize());
      for(Index j=1; j<=m_outerSize; ++j)
        m_outerIndex[j] = end;
    }
    else
    {
      // turn the matrix into non-compressed mode
      m_innerNonZeros = static_cast<StorageIndex*>(std::malloc(m_outerSize * sizeof(StorageIndex)));
      if(!m_innerNonZeros) internal::throw_std_bad_alloc();
      for(Index j=0; j<m_outerSize; ++j)
        m_innerNonZeros[j] = m_outerIndex[j+1]-m_outerIndex[j];
    }
  }
  
  // check whether we can do a fast "push back" insertion
  Index data_end = m_data.allocatedSize();
  
  // First case: we are filling a new inner vector which is packed at the end.
  // We assume that all remaining inner-vectors are also empty and packed to the end.
  if(m_outerIndex[outer]==data_end)
  {
    eigen_internal_assert(m_innerNonZeros[outer]==0);
    
    // pack previous empty inner-vectors to end of the used-space
    // and allocate the entire free-space to the current inner-vector.
    StorageIndex p = convert_index(m_data.size());
    Index j = outer;
    while(j>=0 && m_innerNonZeros[j]==0)
      m_outerIndex[j--] = p;
    
    // push back the new element
    ++m_innerNonZeros[outer];
    m_data.append(Scalar(0), inner);
    
    // check for reallocation
    if(data_end != m_data.allocatedSize())
    {
      // m_data has been reallocated
      //  -> move remaining inner-vectors back to the end of the free-space
      //     so that the entire free-space is allocated to the current inner-vector.
      eigen_internal_assert(data_end < m_data.allocatedSize());
      StorageIndex new_end = convert_index(m_data.allocatedSize());
      for(Index k=outer+1; k<=m_outerSize; ++k)
        if(m_outerIndex[k]==data_end)
          m_outerIndex[k] = new_end;
    }
    return m_data.value(p);
  }
  
  // Second case: the next inner-vector is packed to the end
  // and the current inner-vector end match the used-space.
  if(m_outerIndex[outer+1]==data_end && m_outerIndex[outer]+m_innerNonZeros[outer]==m_data.size())
  {
    eigen_internal_assert(outer+1==m_outerSize || m_innerNonZeros[outer+1]==0);
    
    // add space for the new element
    ++m_innerNonZeros[outer];
    m_data.resize(m_data.size()+1);
    
    // check for reallocation
    if(data_end != m_data.allocatedSize())
    {
      // m_data has been reallocated
      //  -> move remaining inner-vectors back to the end of the free-space
      //     so that the entire free-space is allocated to the current inner-vector.
      eigen_internal_assert(data_end < m_data.allocatedSize());
      StorageIndex new_end = convert_index(m_data.allocatedSize());
      for(Index k=outer+1; k<=m_outerSize; ++k)
        if(m_outerIndex[k]==data_end)
          m_outerIndex[k] = new_end;
    }
    
    // and insert it at the right position (sorted insertion)
    Index startId = m_outerIndex[outer];
    Index p = m_outerIndex[outer]+m_innerNonZeros[outer]-1;
    while ( (p > startId) && (m_data.index(p-1) > inner) )
    {
      m_data.index(p) = m_data.index(p-1);
      m_data.value(p) = m_data.value(p-1);
      --p;
    }
    
    m_data.index(p) = convert_index(inner);
    return (m_data.value(p) = 0);
  }
  
  if(m_data.size() != m_data.allocatedSize())
  {
    // make sure the matrix is compatible to random un-compressed insertion:
    m_data.resize(m_data.allocatedSize());
    this->reserveInnerVectors(Array<StorageIndex,Dynamic,1>::Constant(m_outerSize, 2));
  }
  
  return insertUncompressed(row,col);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rsi, %rsi
js 0x159bb
movq %rdx, %r15
testq %rdx, %rdx
js 0x159bb
movq %rsi, %r14
movq %rdi, %rbx
cmpq %rsi, 0x10(%rdi)
jle 0x159bb
movq 0x8(%rbx), %rax
cmpq %r15, %rax
jle 0x159bb
cmpq $0x0, 0x20(%rbx)
je 0x15893
leaq 0x28(%rbx), %rdi
movq 0x18(%rbx), %rax
movq 0x40(%rbx), %r12
movslq (%rax,%r15,4), %rcx
cmpq %rcx, %r12
jne 0x157d8
movq 0x38(%rbx), %r13
testq %r15, %r15
js 0x15772
movq 0x20(%rbx), %rcx
leaq 0x1(%r15), %rdx
cmpl $0x0, -0x4(%rcx,%rdx,4)
jne 0x15772
movl %r13d, -0x4(%rax,%rdx,4)
decq %rdx
testq %rdx, %rdx
jg 0x1575e
movq 0x20(%rbx), %rax
incl (%rax,%r15,4)
leaq 0x1(%r13), %rsi
movsd 0x353d2(%rip), %xmm0    # 0x4ab58
callq 0x153b8
movq 0x28(%rbx), %rax
movq $0x0, (%rax,%r13,8)
movq 0x30(%rbx), %rcx
movl %r14d, (%rcx,%r13,4)
movq 0x40(%rbx), %rcx
cmpq %rcx, %r12
je 0x157cc
movq 0x8(%rbx), %rdx
cmpq %r15, %rdx
jle 0x157cc
movq 0x18(%rbx), %rsi
movslq 0x4(%rsi,%r15,4), %rdi
cmpq %rdi, %r12
jne 0x157c4
movl %ecx, 0x4(%rsi,%r15,4)
incq %r15
cmpq %r15, %rdx
jne 0x157b5
movslq %r13d, %rcx
leaq (%rax,%rcx,8), %rax
jmp 0x159ad
movslq 0x4(%rax,%r15,4), %rax
cmpq %rax, %r12
jne 0x1590a
movq 0x20(%rbx), %rax
movq 0x38(%rbx), %rsi
movslq (%rax,%r15,4), %rdx
addq %rdx, %rcx
cmpq %rcx, %rsi
jne 0x1590a
incl %edx
movl %edx, (%rax,%r15,4)
incq %rsi
xorps %xmm0, %xmm0
callq 0x153b8
movq 0x40(%rbx), %rax
cmpq %rax, %r12
je 0x1583e
movq 0x8(%rbx), %rcx
cmpq %r15, %rcx
jle 0x1583e
movq 0x18(%rbx), %rdx
movq %r15, %rsi
movslq 0x4(%rdx,%rsi,4), %rdi
cmpq %rdi, %r12
jne 0x15836
movl %eax, 0x4(%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x15828
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
movslq (%rax,%r15,4), %rax
movl (%rcx,%r15,4), %ecx
addl %eax, %ecx
decl %ecx
movslq %ecx, %rcx
cmpl %eax, %ecx
jle 0x15993
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdi
movslq -0x4(%rdi,%rcx,4), %r8
cmpq %r14, %r8
jle 0x15993
leaq -0x1(%rcx), %rdx
movl %r8d, (%rdi,%rcx,4)
movsd -0x8(%rsi,%rcx,8), %xmm0
movsd %xmm0, (%rsi,%rcx,8)
movq %rdx, %rcx
cmpq %rax, %rdx
jg 0x15865
jmp 0x15996
movq 0x18(%rbx), %rcx
movl (%rcx,%rax,4), %eax
cmpl (%rcx), %eax
jne 0x1594f
cmpq $0x0, 0x40(%rbx)
jne 0x158b9
leaq 0x28(%rbx), %rdi
movq 0x10(%rbx), %rsi
addq %rsi, %rsi
callq 0x152cc
movq 0x8(%rbx), %r13
leaq (,%r13,4), %r12
movq %r12, %rdi
callq 0x74b0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x159da
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x71e0
testq %r13, %r13
jle 0x15734
movl 0x40(%rbx), %eax
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movl %eax, 0x4(%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %r13
jne 0x158f9
jmp 0x15734
cmpq %r12, 0x38(%rbx)
je 0x1593f
xorps %xmm0, %xmm0
movq %r12, %rsi
callq 0x153b8
movq 0x8(%rbx), %rax
movq %rax, (%rsp)
movl $0x2, 0xc(%rsp)
testq %rax, %rax
js 0x15a08
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x15a28
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x15d48
jmp 0x159ad
movq 0x8(%rbx), %r12
leaq (,%r12,4), %rdi
callq 0x74b0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x159da
testq %r12, %r12
jle 0x15734
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movl 0x4(%rcx,%rdx,4), %esi
subl (%rcx,%rdx,4), %esi
movl %esi, (%rax,%rdx,4)
leaq 0x1(%rdx), %rsi
movq %rsi, %rdx
cmpq %rsi, %r12
jne 0x15978
jmp 0x15734
movq %rcx, %rdx
movq 0x30(%rbx), %rax
movl %r14d, (%rax,%rdx,4)
movq 0x28(%rbx), %rax
leaq (%rax,%rdx,8), %rax
movq $0x0, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x36342(%rip), %rdi     # 0x4bd04
leaq 0x3545b(%rip), %rsi     # 0x4ae24
leaq 0x3641a(%rip), %rcx     # 0x4bdea
movl $0x46b, %edx            # imm = 0x46B
callq 0x7240
movl $0x8, %edi
callq 0x71b0
movq 0x4c595(%rip), %rcx     # 0x61f80
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x4c5a7(%rip), %rsi     # 0x61fa0
movq 0x4c558(%rip), %rdx     # 0x61f58
movq %rax, %rdi
callq 0x7680
leaq 0x357cd(%rip), %rdi     # 0x4b1dc
leaq 0x3585b(%rip), %rsi     # 0x4b271
leaq 0x36582(%rip), %rcx     # 0x4bf9f
movl $0x4a, %edx
callq 0x7240
nop