// File: /workspace/github_cpp_makefile_star2_O1/icemiliang[P]vot/src/vot/../../include/Eigen/src/SparseCore/SparseMatrix.h
// Function: void Eigen::internal::set_from_triplets<__gnu_cxx::__normal_iterator<Eigen::Triplet<double, int>*, std::vector<Eigen::Triplet<double, int>, std::allocator<Eigen::Triplet<double, int>>>>, Eigen::SparseMatrix<double, 0, int>, Eigen::internal::scalar_sum_op<double, double>>(__gnu_cxx::__normal_iterator<Eigen::Triplet<double, int>*, std::vector<Eigen::Triplet<double, int>, std::allocator<Eigen::Triplet<double, int>>>> const&, __gnu_cxx::__normal_iterator<Eigen::Triplet<double, int>*, std::vector<Eigen::Triplet<double, int>, std::allocator<Eigen::Triplet<double, int>>>> const&, Eigen::SparseMatrix<double, 0, int>&, Eigen::internal::scalar_sum_op<double, double>)
void set_from_triplets(const InputIterator& begin, const InputIterator& end, SparseMatrixType& mat, DupFunctor dup_func)
{
  enum { IsRowMajor = SparseMatrixType::IsRowMajor };
  typedef typename SparseMatrixType::Scalar Scalar;
  typedef typename SparseMatrixType::StorageIndex StorageIndex;
  SparseMatrix<Scalar,IsRowMajor?ColMajor:RowMajor,StorageIndex> trMat(mat.rows(),mat.cols());

  if(begin!=end)
  {
    // pass 1: count the nnz per inner-vector
    typename SparseMatrixType::IndexVector wi(trMat.outerSize());
    wi.setZero();
    for(InputIterator it(begin); it!=end; ++it)
    {
      eigen_assert(it->row()>=0 && it->row()<mat.rows() && it->col()>=0 && it->col()<mat.cols());
      wi(IsRowMajor ? it->col() : it->row())++;
    }

    // pass 2: insert all the elements into trMat
    trMat.reserve(wi);
    for(InputIterator it(begin); it!=end; ++it)
      trMat.insertBackUncompressed(it->row(),it->col()) = it->value();

    // pass 3:
    trMat.collapseDuplicates(dup_func);
  }

  // pass 4: transposed copy -> implicit sorting
  mat = trMat;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdx), %rdx
movq 0x10(%rbx), %rsi
leaq 0x20(%rsp), %rdi
movb $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
callq 0x14ed0
movq (%r15), %rax
cmpq (%r14), %rax
je 0x146f0
movq 0x28(%rsp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
testq %r12, %r12
js 0x14788
cmpq %r12, 0x18(%rsp)
je 0x145a9
movq 0x10(%rsp), %rdi
callq 0x7420
testq %r12, %r12
je 0x145a0
movq %r12, %rax
shrq $0x3e, %rax
jne 0x147a7
leaq (,%r12,4), %rdi
callq 0x74b0
cmpq $0x4, %r12
setae %cl
testb $0xf, %al
setne %dl
testb %dl, %cl
jne 0x147f4
testq %rax, %rax
je 0x147a7
movq %rax, 0x10(%rsp)
jmp 0x145a9
movq $0x0, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq 0x10(%rsp), %r13
movabsq $0x7ffffffffffffffc, %rbp # imm = 0x7FFFFFFFFFFFFFFC
andq %r12, %rbp
cmpq $0x3, %r12
jle 0x145e0
leaq -0x4(,%rbp,4), %rdx
andq $-0x10, %rdx
addq $0x10, %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x71e0
cmpq %r12, %rbp
jge 0x14604
shlq $0x2, %r12
movq %r12, %rax
andq $-0x10, %rax
addq %rax, %r13
andl $0xc, %r12d
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x71e0
movq (%r15), %rax
movq (%r14), %rcx
cmpq %rax, %rcx
je 0x1465b
movq 0x10(%rbx), %rdx
movq 0x10(%rsp), %rsi
movslq (%rax), %rdi
testq %rdi, %rdi
js 0x1472b
cmpq %rdi, %rdx
jle 0x1472b
movslq 0x4(%rax), %r8
testq %r8, %r8
js 0x1472b
cmpq %r8, 0x8(%rbx)
jle 0x1472b
cmpq %rdi, 0x18(%rsp)
jle 0x14769
incl (%rsi,%rdi,4)
addq $0x10, %rax
cmpq %rcx, %rax
jne 0x14618
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x14fa2
movq (%r15), %rax
movq (%r14), %rcx
cmpq %rax, %rcx
je 0x146d7
movq 0x40(%rsp), %rdx
testq %rdx, %rdx
je 0x147d5
movq 0x38(%rsp), %rsi
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
movslq (%rax), %r11
movl (%rdx,%r11,4), %r10d
movl (%rsi,%r11,4), %r9d
movl 0x4(%rsi,%r11,4), %ebp
subl %r9d, %ebp
cmpl %ebp, %r10d
jg 0x1474a
movl 0x4(%rax), %ebp
movsd 0x8(%rax), %xmm0
leal 0x1(%r10), %r14d
movl %r14d, (%rdx,%r11,4)
addl %r10d, %r9d
movslq %r9d, %r9
movl %ebp, (%rdi,%r9,4)
movsd %xmm0, (%r8,%r9,8)
addq $0x10, %rax
cmpq %rcx, %rax
jne 0x14692
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x1484a
movq 0x10(%rsp), %rdi
callq 0x7420
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x14a9e
leaq 0x48(%rsp), %rbx
movq -0x10(%rbx), %rdi
callq 0x7420
movq -0x8(%rbx), %rdi
callq 0x7420
movq %rbx, %rdi
callq 0x14f80
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x366a5(%rip), %rdi     # 0x4add7
leaq 0x366eb(%rip), %rsi     # 0x4ae24
leaq 0x36716(%rip), %rcx     # 0x4ae56
movl $0x3a6, %edx            # imm = 0x3A6
callq 0x7240
leaq 0x36fc0(%rip), %rdi     # 0x4b711
leaq 0x366cc(%rip), %rsi     # 0x4ae24
leaq 0x36f31(%rip), %rcx     # 0x4b690
movl $0x37c, %edx            # imm = 0x37C
callq 0x7240
leaq 0x36db4(%rip), %rdi     # 0x4b524
leaq 0x36dca(%rip), %rsi     # 0x4b541
leaq 0x36df2(%rip), %rcx     # 0x4b570
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x7240
leaq 0x36810(%rip), %rdi     # 0x4af9f
leaq 0x36893(%rip), %rsi     # 0x4b029
leaq 0x368bb(%rip), %rcx     # 0x4b058
movl $0x138, %edx            # imm = 0x138
callq 0x7240
movl $0x8, %edi
callq 0x71b0
movq 0x4d7c8(%rip), %rcx     # 0x61f80
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x4d7da(%rip), %rsi     # 0x61fa0
movq 0x4d78b(%rip), %rdx     # 0x61f58
movq %rax, %rdi
callq 0x7680
leaq 0x36ea4(%rip), %rdi     # 0x4b680
leaq 0x36641(%rip), %rsi     # 0x4ae24
leaq 0x36ea6(%rip), %rcx     # 0x4b690
movl $0x37b, %edx            # imm = 0x37B
callq 0x7240
leaq 0x368c9(%rip), %rdi     # 0x4b0c4
leaq 0x3697c(%rip), %rsi     # 0x4b17e
leaq 0x369a0(%rip), %rcx     # 0x4b1a9
movl $0xa1, %edx
callq 0x7240
jmp 0x14817
jmp 0x14817
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x7420
jmp 0x14829
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x14eac
jmp 0x14842
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x14f80
movq %rbx, %rdi
callq 0x76c0