// File: /workspace/github_cpp_makefile_star2_O3/icemiliang[P]vot/src/vot/cell.cc
// Function: voro::voronoicell_base::centroid(double&, double&, double&)
void voronoicell_base::centroid(double &cx,double &cy,double &cz) {
    double tvol,vol=0;cx=cy=cz=0;
    int i,j,k,l,m,n;
    double ux,uy,uz,vx,vy,vz,wx,wy,wz;
    for(i=1;i<p;i++) {
        ux=*pts-pts[3*i];
        uy=pts[1]-pts[3*i+1];
        uz=pts[2]-pts[3*i+2];
        for(j=0;j<nu[i];j++) {
            k=ed[i][j];
            if(k>=0) {
                ed[i][j]=-1-k;
                l=cycle_up(ed[i][nu[i]+j],k);
                vx=pts[3*k]-*pts;
                vy=pts[3*k+1]-pts[1];
                vz=pts[3*k+2]-pts[2];
                m=ed[k][l];ed[k][l]=-1-m;
                while(m!=i) {
                    n=cycle_up(ed[k][nu[k]+l],m);
                    wx=pts[3*m]-*pts;
                    wy=pts[3*m+1]-pts[1];
                    wz=pts[3*m+2]-pts[2];
                    tvol=ux*vy*wz+uy*vz*wx+uz*vx*wy-uz*vy*wx-uy*vx*wz-ux*vz*wy;
                    vol+=tvol;
                    cx+=(wx+vx-ux)*tvol;
                    cy+=(wy+vy-uy)*tvol;
                    cz+=(wz+vz-uz)*tvol;
                    k=m;l=n;vx=wx;vy=wy;vz=wz;
                    m=ed[k][l];ed[k][l]=-1-m;
                }
            }
        }
    }
    reset_edges();
    if(vol>tolerance_sq) {
        vol=0.125/vol;
        cx=cx*vol+0.5*(*pts);
        cy=cy*vol+0.5*pts[1];
        cz=cz*vol+0.5*pts[2];
    } else cx=cy=cz=0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
movq %rax, (%rcx)
movq %rax, (%rdx)
movq %rax, (%rsi)
movl 0x18(%rdi), %ebp
xorpd %xmm0, %xmm0
cmpl $0x2, %ebp
jl 0x1d062
xorl %ebx, %ebx
movq 0x30(%rdi), %r8
movq 0x20(%rdi), %r9
movq 0x28(%rdi), %r10
movl $0x1, %r11d
movq %rdi, 0x8(%rsp)
cmpl $0x0, (%r10,%r11,4)
jle 0x1d053
leaq (%r11,%r11,2), %rax
movsd (%r8), %xmm2
movsd 0x8(%r8), %xmm3
subsd (%r8,%rax,8), %xmm2
subsd 0x8(%r8,%rax,8), %xmm3
movsd 0x10(%r8), %xmm4
subsd 0x10(%r8,%rax,8), %xmm4
movq (%r9,%r11,8), %rax
movapd %xmm4, %xmm5
movapd 0x2dd1e(%rip), %xmm1    # 0x4ab70
xorpd %xmm1, %xmm5
movapd %xmm3, %xmm6
xorpd %xmm1, %xmm6
movapd %xmm2, %xmm7
xorpd %xmm1, %xmm7
xorl %r14d, %r14d
movq %rax, 0x10(%rsp)
movl (%rax,%r14,4), %r12d
testl %r12d, %r12d
js 0x1d034
movl %r12d, %ebp
notl %ebp
movl %ebp, (%rax,%r14,4)
movslq (%r10,%r11,4), %r15
movslq %r14d, %r13
addq %r15, %r13
movl (%rax,%r13,4), %r15d
movl (%r10,%r12,4), %r13d
decl %r13d
leal 0x1(%r15), %ebp
cmpl %r15d, %r13d
cmovel %ebx, %ebp
leaq (%r12,%r12,2), %r15
movsd (%r8,%r15,8), %xmm9
movsd (%r8), %xmm10
movupd 0x8(%r8,%r15,8), %xmm11
movupd 0x8(%r8), %xmm1
movq (%r9,%r12,8), %r13
movslq %ebp, %rbx
movl (%r13,%rbx,4), %r15d
movl %r15d, %edi
notl %edi
movl %edi, (%r13,%rbx,4)
cmpq %r15, %r11
je 0x1d034
subpd %xmm1, %xmm11
subsd %xmm10, %xmm9
movslq %r12d, %rdi
movslq (%r10,%rdi,4), %rdi
movslq %ebp, %rbx
addq %rdi, %rbx
movl (%r13,%rbx,4), %edi
movslq %r15d, %r12
movl (%r10,%r12,4), %ebx
decl %ebx
leal 0x1(%rdi), %ebp
cmpl %edi, %ebx
movl $0x0, %eax
cmovel %eax, %ebp
leal (%r12,%r12,2), %edi
movslq %edi, %rdi
movsd (%r8,%rdi,8), %xmm10
subsd (%r8), %xmm10
movupd 0x8(%r8,%rdi,8), %xmm1
movupd 0x8(%r8), %xmm12
subpd %xmm12, %xmm1
movapd %xmm2, %xmm14
mulsd %xmm11, %xmm14
movapd %xmm11, %xmm13
unpckhpd %xmm11, %xmm13          # xmm13 = xmm13[1],xmm11[1]
movapd %xmm3, %xmm15
mulsd %xmm13, %xmm15
mulsd %xmm10, %xmm15
movapd %xmm1, %xmm12
unpckhpd %xmm1, %xmm12           # xmm12 = xmm12[1],xmm1[1]
mulsd %xmm12, %xmm14
addsd %xmm15, %xmm14
movapd %xmm4, %xmm15
mulsd %xmm9, %xmm15
mulsd %xmm1, %xmm15
addsd %xmm14, %xmm15
movapd %xmm11, %xmm8
mulsd %xmm5, %xmm8
mulsd %xmm10, %xmm8
addsd %xmm15, %xmm8
movapd %xmm9, %xmm14
mulsd %xmm6, %xmm14
mulsd %xmm12, %xmm14
addsd %xmm8, %xmm14
addsd %xmm13, %xmm12
mulsd %xmm7, %xmm13
mulsd %xmm1, %xmm13
addsd %xmm14, %xmm13
addsd %xmm10, %xmm9
subsd %xmm2, %xmm9
mulsd %xmm13, %xmm9
addsd (%rsi), %xmm9
movsd %xmm9, (%rsi)
addsd %xmm1, %xmm11
subsd %xmm3, %xmm11
mulsd %xmm13, %xmm11
addsd (%rdx), %xmm11
movsd %xmm11, (%rdx)
subsd %xmm4, %xmm12
mulsd %xmm13, %xmm12
addsd (%rcx), %xmm12
movsd %xmm12, (%rcx)
movq (%r9,%r12,8), %r13
movslq %ebp, %rdi
movl (%r13,%rdi,4), %ebx
movl %r15d, %r12d
movl %ebx, %r15d
movl %ebx, %eax
notl %eax
movl %eax, (%r13,%rdi,4)
addsd %xmm13, %xmm0
movapd %xmm10, %xmm9
movapd %xmm1, %xmm11
cmpq %rbx, %r11
jne 0x1cee8
xorl %ebx, %ebx
incq %r14
movslq (%r10,%r11,4), %rax
cmpq %rax, %r14
movq 0x10(%rsp), %rax
jl 0x1ce6e
movq 0x8(%rsp), %rdi
movl 0x18(%rdi), %ebp
incq %r11
movslq %ebp, %rax
cmpq %rax, %r11
jl 0x1ce0e
testl %ebp, %ebp
jle 0x1d0ab
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %r8
xorl %r9d, %r9d
cmpl $0x0, (%r8,%r9,4)
jle 0x1d0a0
movq (%rax,%r9,8), %r10
xorl %r11d, %r11d
movl (%r10,%r11,4), %ebx
testl %ebx, %ebx
jns 0x1d12b
notl %ebx
movl %ebx, (%r10,%r11,4)
incq %r11
movslq (%r8,%r9,4), %rbx
cmpq %rbx, %r11
jl 0x1d07f
movl 0x18(%rdi), %ebp
incq %r9
movslq %ebp, %r10
cmpq %r10, %r9
jl 0x1d071
ucomisd 0x3262d(%rip), %xmm0    # 0x4f6e0
jbe 0x1d111
movsd 0x3261b(%rip), %xmm1    # 0x4f6d8
divsd %xmm0, %xmm1
movq 0x30(%rdi), %rax
movsd 0x3261b(%rip), %xmm0    # 0x4f6e8
movsd (%rax), %xmm2
mulsd %xmm0, %xmm2
movsd (%rsi), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rsi)
movsd 0x8(%rax), %xmm2
mulsd %xmm0, %xmm2
movsd (%rdx), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rdx)
mulsd 0x10(%rax), %xmm0
mulsd (%rcx), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rcx)
jmp 0x1d11c
xorl %eax, %eax
movq %rax, (%rcx)
movq %rax, (%rdx)
movq %rax, (%rsi)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x7b6e