// File: /workspace/github_cpp_makefile_star2_O1/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 0x17a30
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 0x13e2c
cmpb $0x0, (%rax)
je 0x12cc5
movq 0x60(%rax), %rcx
cmpq 0x48(%rbx), %rcx
jne 0x12ce4
leaq 0x40(%rbx), %rcx
leaq 0x38(%rsp), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rsi)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x17dba
movslq 0x38(%rbx), %rax
testq %rax, %rax
jle 0x12be0
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 0x12ca6
movsd (%rsi,%rdi,8), %xmm0
subsd (%rcx,%rdi,8), %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
cmpq %rdi, %rax
jne 0x12bc0
movq (%rbx), %rdi
callq 0x286e0
cmpl $0x0, 0x38(%rbx)
jle 0x12c83
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 0x37f20(%rip), %xmm0    # 0x4ab48
jb 0x12c33
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x12c60
movsd %xmm4, 0x30(%rsp)
movsd %xmm1, 0x28(%rsp)
movsd %xmm2, 0x20(%rsp)
callq 0x72d0
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 0x27870
incq %r14
movslq 0x38(%rbx), %rax
addq $0x6, %r12
cmpq %rax, %r14
jl 0x12bfb
leaq 0x48(%rsp), %rdi
callq 0x13eaa
movq 0x10(%rsp), %rdi
callq 0x7420
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x38877(%rip), %rdi     # 0x4b524
leaq 0x3888d(%rip), %rsi     # 0x4b541
leaq 0x39de9(%rip), %rcx     # 0x4caa4
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x7240
leaq 0x3a234(%rip), %rdi     # 0x4cf00
leaq 0x3a25d(%rip), %rsi     # 0x4cf30
leaq 0x3a28c(%rip), %rcx     # 0x4cf66
movl $0x5a, %edx
callq 0x7240
leaq 0x3a388(%rip), %rdi     # 0x4d073
leaq 0x3a23e(%rip), %rsi     # 0x4cf30
leaq 0x3a26d(%rip), %rcx     # 0x4cf66
movl $0x5b, %edx
callq 0x7240
jmp 0x12d0c
movq %rax, %rbx
jmp 0x12d19
jmp 0x12d0c
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x13eaa
movq 0x10(%rsp), %rdi
callq 0x7420
movq %rbx, %rdi
callq 0x76c0
nop