// File: /workspace/github_cpp_makefile_star2_O1/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), %eax
xorpd %xmm0, %xmm0
cmpl $0x2, %eax
jl 0x1cfe5
xorl %ebx, %ebx
movq 0x30(%rdi), %r8
movq 0x20(%rdi), %r9
movq 0x28(%rdi), %r10
movl $0x1, %r11d
movapd 0x2dddb(%rip), %xmm1    # 0x4ab60
movq %rdi, 0x8(%rsp)
cmpl $0x0, (%r10,%r11,4)
jle 0x1cfd0
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
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 0x1cfb9
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), %xmm10
movsd 0x8(%r8,%r15,8), %xmm9
movsd (%r8), %xmm11
movsd 0x8(%r8), %xmm12
movsd 0x10(%r8,%r15,8), %xmm8
movsd 0x10(%r8), %xmm13
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 0x1cfb9
subsd %xmm13, %xmm8
subsd %xmm12, %xmm9
subsd %xmm11, %xmm10
movslq %r12d, %rdi
movq (%r9,%rdi,8), %rbx
movslq (%r10,%rdi,4), %rdi
movslq %ebp, %r12
addq %rdi, %r12
movl (%rbx,%r12,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), %xmm11
subsd (%r8), %xmm11
movsd 0x8(%r8,%rdi,8), %xmm12
subsd 0x8(%r8), %xmm12
movsd 0x10(%r8,%rdi,8), %xmm13
subsd 0x10(%r8), %xmm13
movapd %xmm2, %xmm14
mulsd %xmm9, %xmm14
movapd %xmm3, %xmm15
mulsd %xmm8, %xmm15
mulsd %xmm11, %xmm15
mulsd %xmm13, %xmm14
addsd %xmm15, %xmm14
movapd %xmm4, %xmm15
mulsd %xmm10, %xmm15
mulsd %xmm12, %xmm15
addsd %xmm14, %xmm15
movapd %xmm9, %xmm14
mulsd %xmm5, %xmm14
mulsd %xmm11, %xmm14
addsd %xmm15, %xmm14
movapd %xmm10, %xmm15
mulsd %xmm6, %xmm15
mulsd %xmm13, %xmm15
addsd %xmm14, %xmm15
movapd %xmm8, %xmm14
mulsd %xmm7, %xmm14
mulsd %xmm12, %xmm14
addsd %xmm15, %xmm14
addsd %xmm11, %xmm10
subsd %xmm2, %xmm10
mulsd %xmm14, %xmm10
addsd (%rsi), %xmm10
movsd %xmm10, (%rsi)
addsd %xmm12, %xmm9
subsd %xmm3, %xmm9
mulsd %xmm14, %xmm9
addsd (%rdx), %xmm9
movsd %xmm9, (%rdx)
addsd %xmm13, %xmm8
subsd %xmm4, %xmm8
mulsd %xmm14, %xmm8
addsd (%rcx), %xmm8
movsd %xmm8, (%rcx)
movq (%r9,%r12,8), %rdi
movslq %ebp, %rbx
movl (%rdi,%rbx,4), %r13d
movl %r15d, %r12d
movl %r13d, %r15d
movl %r13d, %eax
notl %eax
movl %eax, (%rdi,%rbx,4)
addsd %xmm14, %xmm0
movapd %xmm13, %xmm8
movapd %xmm12, %xmm9
movapd %xmm11, %xmm10
cmpq %r13, %r11
jne 0x1ce6e
xorl %ebx, %ebx
incq %r14
movslq (%r10,%r11,4), %rax
cmpq %rax, %r14
movq 0x10(%rsp), %rax
jl 0x1cde2
incq %r11
movq 0x8(%rsp), %rdi
movslq 0x18(%rdi), %rax
cmpq %rax, %r11
jl 0x1cd8a
testl %eax, %eax
jle 0x1d02c
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %r8
xorl %r9d, %r9d
cmpl $0x0, (%r8,%r9,4)
jle 0x1d020
movq (%rax,%r9,8), %r10
xorl %r11d, %r11d
movl (%r10,%r11,4), %ebx
testl %ebx, %ebx
jns 0x1d0ac
notl %ebx
movl %ebx, (%r10,%r11,4)
incq %r11
movslq (%r8,%r9,4), %rbx
cmpq %rbx, %r11
jl 0x1d002
incq %r9
movslq 0x18(%rdi), %r10
cmpq %r10, %r9
jl 0x1cff4
ucomisd 0x3253c(%rip), %xmm0    # 0x4f570
jbe 0x1d092
movsd 0x3252a(%rip), %xmm1    # 0x4f568
divsd %xmm0, %xmm1
movq 0x30(%rdi), %rax
movsd 0x3252a(%rip), %xmm0    # 0x4f578
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 0x1d09d
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 0x7b60
nop