// File: icemiliang[P]vot/src/vot/./container.hh
// Function: voro::container_poly::update_diagram(std::vector<vot::Dirac, std::allocator<vot::Dirac>>&, Eigen::SparseMatrix<double, 0, int>&)
inline void update_diagram(std::vector<vot::Dirac> &diracs, 
                                   Eigen::SparseMatrix<double>& pHessian) {
            c_loop_all vl(*this);
            voronoicell_neighbor c;
            if (vl.start()) {
                std::vector<Eigen::Triplet<double>> kijs;
                kijs.reserve(diracs.size());
                do {
                    // Update current cell
                    compute_cell(c, vl);

                    // Compute Hessian
                    int idx = id[vl.ijk][vl.q];
                    // Coordinates of the current Centroid
                    double *pp; 
                    pp = p[vl.ijk] + ps*vl.q;

                    std::vector<int> nids;
                    std::vector<double> face_areas;
                    c.neighbors(nids);
                    c.face_areas(face_areas);
                    ASSERT_VOT(nids.size() == face_areas.size(), 
                           "Number of neighbor ids not equal to number of neighbor faces.");

                   for (int i = 0; i < (int)nids.size(); i++) {
                       if (nids[i] < 0) continue;
                       vot::Point tmp = vot::Point(diracs[nids[i]].x() - pp[0], 
                                                   diracs[nids[i]].y() - pp[1], 
                                                   diracs[nids[i]].z() - pp[2]);
                       double dist = tmp.norm();
                       ASSERT_VOT(dist > vot::otTOLERANCE, "Distance equals zero.");
                       kijs.push_back(Eigen::Triplet<double>(idx, nids[i], -face_areas[i] / dist));
                   }
                } while (vl.inc());

                // Put kijs into Hessian
                pHessian.setFromTriplets(kijs.begin(), kijs.end());
                // Fill up diagonal
               for (int iCol = 0; iCol < (int)diracs.size(); iCol++){
                   double sum = pHessian.col(iCol).sum();
                   pHessian.coeffRef(iCol,iCol) = -sum;
                }
                // Hessian may not be symmetric because kij may not equal kji.
                // Face areas at the two sizes of a same plane, computed by voro++, could be different .
                // Need average.
                Eigen::SparseMatrix<double> tmp = pHessian.transpose();
                pHessian = pHessian + tmp;
                pHessian = pHessian * 0.5;
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3d0, %rsp            # imm = 0x3D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x2d0(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x23330
leaq -0x120(%rbp), %rdi
callq 0x48040
movq -0x2c8(%rbp), %rdi
callq 0x23560
movb %al, -0x2b9(%rbp)
jmp 0x21bd2
movb -0x2b9(%rbp), %al
testb $0x1, %al
jne 0x21be1
jmp 0x2237b
leaq -0x148(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x23a90
movq -0x10(%rbp), %rdi
callq 0x23bb0
movq -0x2d8(%rbp), %rdi
movq %rax, %rsi
callq 0x23ab0
jmp 0x21c0e
jmp 0x21c10
movq -0x2d0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x23be0
jmp 0x21c29
movq -0x2d0(%rbp), %rcx
movq 0xa8(%rcx), %rax
movslq -0x24(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x20(%rbp), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, -0x14c(%rbp)
movq 0xb0(%rcx), %rax
movslq -0x24(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl 0xc8(%rcx), %ecx
movl -0x20(%rbp), %edx
imull %edx, %ecx
movslq %ecx, %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x158(%rbp)
leaq -0x170(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x23c40
leaq -0x188(%rbp), %rdi
callq 0x21500
movq -0x2e0(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x482b0
jmp 0x21ca9
leaq -0x120(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x43f50
jmp 0x21cbe
jmp 0x21cc0
leaq -0x170(%rbp), %rdi
callq 0x23c60
movq %rax, -0x2e8(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x23c80
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
cmpq %rcx, %rax
je 0x21df7
movq 0x9d2e7(%rip), %rdi     # 0xbefe0
leaq 0x6c245(%rip), %rsi     # 0x8df45
callq 0xa4a0
movq %rax, -0x2f0(%rbp)
jmp 0x21d0e
movq -0x2f0(%rbp), %rdi
leaq 0x6c265(%rip), %rsi     # 0x8df81
callq 0xa4a0
movq %rax, -0x2f8(%rbp)
jmp 0x21d2a
movq -0x2f8(%rbp), %rdi
leaq 0x6c1cb(%rip), %rsi     # 0x8df03
callq 0xa4a0
movq %rax, -0x300(%rbp)
jmp 0x21d46
movq -0x300(%rbp), %rdi
movl $0x2b4, %esi            # imm = 0x2B4
callq 0xa920
movq %rax, -0x308(%rbp)
jmp 0x21d60
movq -0x308(%rbp), %rdi
leaq 0x6b6cd(%rip), %rsi     # 0x8d43b
callq 0xa4a0
movq %rax, -0x310(%rbp)
jmp 0x21d7c
movq -0x310(%rbp), %rdi
leaq 0x6c206(%rip), %rsi     # 0x8df90
callq 0xa4a0
movq %rax, -0x318(%rbp)
jmp 0x21d98
movq -0x318(%rbp), %rdi
movq 0x9d182(%rip), %rsi     # 0xbef28
callq 0xa500
jmp 0x21dad
callq 0xa170
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x22390
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x2236d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
jmp 0x2226a
jmp 0x21df9
jmp 0x21dfb
movl $0x0, -0x18c(%rbp)
movl -0x18c(%rbp), %eax
movl %eax, -0x31c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x23c60
movq %rax, %rcx
movl -0x31c(%rbp), %eax
cmpl %ecx, %eax
jge 0x22120
movslq -0x18c(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x23ca0
cmpl $0x0, (%rax)
jge 0x21e4b
jmp 0x2210c
movq -0x10(%rbp), %rax
movq %rax, -0x350(%rbp)
movslq -0x18c(%rbp), %rsi
leaq -0x170(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x23ca0
movq -0x350(%rbp), %rdi
movslq (%rax), %rsi
callq 0x218b0
movq %rax, %rdi
callq 0x218d0
movq -0x340(%rbp), %rdi
movq -0x158(%rbp), %rax
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x328(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x348(%rbp)
movslq -0x18c(%rbp), %rsi
callq 0x23ca0
movq -0x348(%rbp), %rdi
movslq (%rax), %rsi
callq 0x218b0
movq %rax, %rdi
callq 0x218f0
movq -0x340(%rbp), %rdi
movq -0x158(%rbp), %rax
movsd 0x8(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x330(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x338(%rbp)
movslq -0x18c(%rbp), %rsi
callq 0x23ca0
movq -0x338(%rbp), %rdi
movslq (%rax), %rsi
callq 0x218b0
movq %rax, %rdi
callq 0x21910
movsd -0x330(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x328(%rbp), %xmm0
movq -0x158(%rbp), %rax
movsd 0x10(%rax), %xmm3
subsd %xmm3, %xmm2
leaq -0x1a8(%rbp), %rdi
callq 0x23cc0
jmp 0x21f51
leaq -0x1a8(%rbp), %rdi
callq 0x23d00
movsd %xmm0, -0x358(%rbp)
jmp 0x21f67
movsd -0x358(%rbp), %xmm0
movsd %xmm0, -0x1b0(%rbp)
movsd -0x1b0(%rbp), %xmm0
movsd 0x6be29(%rip), %xmm1    # 0x8ddb0
ucomisd %xmm1, %xmm0
ja 0x22074
movq 0x9d048(%rip), %rdi     # 0xbefe0
leaq 0x6c02f(%rip), %rsi     # 0x8dfce
callq 0xa4a0
movq %rax, -0x360(%rbp)
jmp 0x21fad
movq -0x360(%rbp), %rdi
leaq 0x6bfc6(%rip), %rsi     # 0x8df81
callq 0xa4a0
movq %rax, -0x368(%rbp)
jmp 0x21fc9
movq -0x368(%rbp), %rdi
leaq 0x6bf2c(%rip), %rsi     # 0x8df03
callq 0xa4a0
movq %rax, -0x370(%rbp)
jmp 0x21fe5
movq -0x370(%rbp), %rdi
movl $0x2bc, %esi            # imm = 0x2BC
callq 0xa920
movq %rax, -0x378(%rbp)
jmp 0x21fff
movq -0x378(%rbp), %rdi
leaq 0x6b42e(%rip), %rsi     # 0x8d43b
callq 0xa4a0
movq %rax, -0x380(%rbp)
jmp 0x2201b
movq -0x380(%rbp), %rdi
leaq 0x6bfd8(%rip), %rsi     # 0x8e001
callq 0xa4a0
movq %rax, -0x388(%rbp)
jmp 0x22037
movq -0x388(%rbp), %rdi
movq 0x9cee3(%rip), %rsi     # 0xbef28
callq 0xa500
jmp 0x2204c
callq 0xa170
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x23dc0
jmp 0x2226a
jmp 0x22076
jmp 0x22078
movslq -0x18c(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x23ca0
movq %rax, -0x390(%rbp)
movslq -0x18c(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x21950
movq -0x390(%rbp), %rdx
movsd (%rax), %xmm0
movaps 0x6bcd9(%rip), %xmm1    # 0x8dd90
pxor %xmm1, %xmm0
movsd -0x1b0(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x1c8(%rbp)
leaq -0x1c0(%rbp), %rdi
leaq -0x14c(%rbp), %rsi
leaq -0x1c8(%rbp), %rcx
callq 0x23d80
jmp 0x220eb
leaq -0x148(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x23d50
jmp 0x22100
leaq -0x1a8(%rbp), %rdi
callq 0x23dc0
movl -0x18c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18c(%rbp)
jmp 0x21e05
leaq -0x188(%rbp), %rdi
callq 0x21520
leaq -0x170(%rbp), %rdi
callq 0x23dd0
leaq -0x60(%rbp), %rdi
callq 0x23630
testb $0x1, %al
jne 0x21c10
movq -0x18(%rbp), %rax
movq %rax, -0x398(%rbp)
leaq -0x148(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x23e80
movq -0x3a0(%rbp), %rdi
movq %rax, -0x1d0(%rbp)
callq 0x23eb0
movq -0x398(%rbp), %rdi
movq %rax, -0x1d8(%rbp)
leaq -0x1d0(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x23e30
jmp 0x2219d
movl $0x0, -0x1dc(%rbp)
movl -0x1dc(%rbp), %eax
movl %eax, -0x3a4(%rbp)
movq -0x10(%rbp), %rdi
callq 0x23bb0
movq %rax, %rcx
movl -0x3a4(%rbp), %eax
cmpl %ecx, %eax
jge 0x22287
movq -0x18(%rbp), %rsi
movslq -0x1dc(%rbp), %rdx
leaq -0x208(%rbp), %rdi
callq 0x23ee0
jmp 0x221e6
leaq -0x208(%rbp), %rdi
callq 0x23f30
movsd %xmm0, -0x3b0(%rbp)
jmp 0x221fc
movsd -0x3b0(%rbp), %xmm0
movsd %xmm0, -0x1e8(%rbp)
movaps 0x6bb7d(%rip), %xmm1    # 0x8dd90
movsd -0x1e8(%rbp), %xmm0
pxor %xmm1, %xmm0
movsd %xmm0, -0x3c0(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x1dc(%rbp), %rdx
movq %rdx, %rsi
callq 0x240d0
movq %rax, -0x3b8(%rbp)
jmp 0x22243
movq -0x3b8(%rbp), %rax
movsd -0x3c0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x221a7
leaq -0x188(%rbp), %rdi
callq 0x21520
leaq -0x170(%rbp), %rdi
callq 0x23dd0
jmp 0x2236d
movq -0x18(%rbp), %rdi
callq 0x242c0
movq %rdx, -0x3d0(%rbp)
movb %al, -0x3c1(%rbp)
jmp 0x2229f
movq -0x3d0(%rbp), %rax
movb -0x3c1(%rbp), %cl
movb %cl, -0x260(%rbp)
movq %rax, -0x258(%rbp)
leaq -0x250(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x242f0
jmp 0x222ce
movq -0x18(%rbp), %rsi
leaq -0x280(%rbp), %rdi
leaq -0x250(%rbp), %rdx
callq 0x24390
jmp 0x222e7
movq -0x18(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x24400
jmp 0x222f9
movq -0x18(%rbp), %rsi
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x2b8(%rbp)
leaq -0x2b0(%rbp), %rdi
leaq -0x2b8(%rbp), %rdx
callq 0x24460
jmp 0x22323
movq -0x18(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x24510
jmp 0x22335
leaq -0x250(%rbp), %rdi
callq 0x22480
leaq -0x148(%rbp), %rdi
callq 0x24570
jmp 0x2237b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x22480
leaq -0x148(%rbp), %rdi
callq 0x24570
jmp 0x22390
leaq -0x120(%rbp), %rdi
callq 0x481e0
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbp
retq
leaq -0x120(%rbp), %rdi
callq 0x481e0
movq -0x128(%rbp), %rdi
callq 0xa950
nopl (%rax,%rax)