// File: /workspace/github_cpp_makefile_star2_O3/icemiliang[P]vot/src/vot/diagram.cc
// Function: vot::Diagram::update_h(Eigen::SparseMatrix<double, 0, int>&)
void Diagram::update_h(Eigen::SparseMatrix<double>& pHessian) {
        Eigen::VectorXd deltaH;
        Eigen::LeastSquaresConjugateGradient<Eigen::SparseMatrix<double>> solver;
        deltaH = solver.compute(pHessian).solve(mGradient);

        for (int i = 0; i < mNumDiracs; i++) {
            mHs[i] -= deltaH(i);
        }

        // I haven't found a way to directly update h
        // The alternative is to clear the diagram and define a new one with new h
        // Liang Mi
        mDiagram->clear();
        for (int i = 0; i < mNumDiracs; i++) {
            mDiagram->put(i, mDiracs[i].x(), mDiracs[i].y(), mDiracs[i].z(), sqrt(mHs[i]));
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
leaq 0x50(%rsp), %rdi
movb $0x0, -0x8(%rdi)
callq 0x17cbe
leaq 0x48(%rsp), %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0xe0(%rdi)
xorl %eax, %eax
movb %al, 0xf0(%rdi)
movb %al, (%rdi)
movw $0x0, 0x11c(%rdi)
movq $-0x1, 0xf8(%rdi)
movabsq $0x3cb0000000000000, %rax # imm = 0x3CB0000000000000
movq %rax, 0x100(%rdi)
movq %r14, %rsi
callq 0x13db4
cmpb $0x0, (%rax)
je 0x12c21
movq 0x60(%rax), %rcx
cmpq 0x48(%rbx), %rcx
jne 0x12c40
leaq 0x40(%rbx), %rcx
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rsi)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x18038
movslq 0x38(%rbx), %rax
testq %rax, %rax
jle 0x12b3c
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
movq 0x50(%rbx), %rsi
xorl %edi, %edi
testq %rdx, %rdx
cmovleq %rdi, %rdx
cmpq %rdi, %rdx
je 0x12c02
movsd (%rsi,%rdi,8), %xmm0
subsd (%rcx,%rdi,8), %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rax
jne 0x12b1c
movq (%rbx), %rdi
callq 0x28e2c
cmpl $0x0, 0x38(%rbx)
jle 0x12bdf
movl $0x2, %r12d
xorl %r14d, %r14d
movq (%rbx), %r15
movq 0x20(%rbx), %rax
movsd -0x10(%rax,%r12,8), %xmm4
movsd -0x8(%rax,%r12,8), %xmm1
movsd (%rax,%r12,8), %xmm2
movq 0x50(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd 0x37fd4(%rip), %xmm0    # 0x4ab58
jb 0x12b8f
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x12bbc
movsd %xmm4, 0x30(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm2, 0x20(%rsp)
callq 0x72e0
movsd 0x20(%rsp), %xmm2
movsd 0x28(%rsp), %xmm1
movsd 0x30(%rsp), %xmm4
movapd %xmm0, %xmm3
movq %r15, %rdi
movl %r14d, %esi
movapd %xmm4, %xmm0
callq 0x27fc2
incq %r14
movslq 0x38(%rbx), %rax
addq $0x6, %r12
cmpq %rax, %r14
jl 0x12b57
leaq 0x48(%rsp), %rdi
callq 0x13e32
movq 0x10(%rsp), %rdi
callq 0x7430
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x3896b(%rip), %rdi     # 0x4b574
leaq 0x38981(%rip), %rsi     # 0x4b591
leaq 0x39edd(%rip), %rcx     # 0x4caf4
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x7240
leaq 0x3a328(%rip), %rdi     # 0x4cf50
leaq 0x3a351(%rip), %rsi     # 0x4cf80
leaq 0x3a380(%rip), %rcx     # 0x4cfb6
movl $0x5a, %edx
callq 0x7240
leaq 0x3a47c(%rip), %rdi     # 0x4d0c3
leaq 0x3a332(%rip), %rsi     # 0x4cf80
leaq 0x3a361(%rip), %rcx     # 0x4cfb6
movl $0x5b, %edx
callq 0x7240
jmp 0x12c6a
movq %rax, %rbx
xorl %edi, %edi
jmp 0x12c7c
jmp 0x12c6a
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x13e32
movq 0x10(%rsp), %rdi
callq 0x7430
movq %rbx, %rdi
callq 0x76d0
nop