// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/voro++/src/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[4*i];
		uy=pts[1]-pts[4*i+1];
		uz=pts[2]-pts[4*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[4*k]-*pts;
				vy=pts[4*k+1]-pts[1];
				vz=pts[4*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[4*m]-*pts;
					wy=pts[4*m+1]-pts[1];
					wz=pts[4*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>tol_cu) {
		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
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %eax, %eax
movq %rax, (%rcx)
movq %rax, (%rdx)
movq %rax, (%rsi)
movl 0x1c(%rdi), %eax
xorpd %xmm15, %xmm15
cmpl $0x2, %eax
jl 0x9a17
xorl %r8d, %r8d
movq 0x40(%r12), %rcx
movq 0x28(%r12), %rdx
movq 0x30(%r12), %rsi
movl $0x1, %edi
movapd 0x2d895(%rip), %xmm0    # 0x37030
movq %r12, 0x10(%rsp)
cmpl $0x0, (%rsi,%rdi,4)
jle 0x9a01
movq %rdi, %rax
shlq $0x5, %rax
movsd (%rcx), %xmm1
movsd 0x8(%rcx), %xmm2
subsd (%rcx,%rax), %xmm1
subsd 0x8(%rcx,%rax), %xmm2
movsd 0x10(%rcx), %xmm3
subsd 0x10(%rcx,%rax), %xmm3
movq (%rdx,%rdi,8), %rax
movapd %xmm3, %xmm4
xorpd %xmm0, %xmm4
movapd %xmm2, %xmm5
xorpd %xmm0, %xmm5
movapd %xmm1, %xmm6
xorpd %xmm0, %xmm6
xorl %r9d, %r9d
movq %rax, 0x8(%rsp)
movslq (%rax,%r9,4), %r13
testq %r13, %r13
js 0x99e9
movl %r13d, %r10d
notl %r10d
movl %r10d, (%rax,%r9,4)
movslq (%rsi,%rdi,4), %r10
movslq %r9d, %r11
addq %r10, %r11
movl (%rax,%r11,4), %r11d
movl (%rsi,%r13,4), %ebp
decl %ebp
leal 0x1(%r11), %r10d
cmpl %r11d, %ebp
cmovel %r8d, %r10d
leal (,%r13,4), %r11d
movsd (%rcx,%r11,8), %xmm9
movsd 0x8(%rcx,%r11,8), %xmm8
movsd (%rcx), %xmm10
movsd 0x8(%rcx), %xmm11
movsd 0x10(%rcx,%r11,8), %xmm7
movsd 0x10(%rcx), %xmm12
movq (%rdx,%r13,8), %rbp
movslq %r10d, %r8
movl (%rbp,%r8,4), %r11d
movl %r11d, %r12d
notl %r12d
movl %r12d, (%rbp,%r8,4)
cmpq %r11, %rdi
je 0x99e9
subsd %xmm12, %xmm7
subsd %xmm11, %xmm8
subsd %xmm10, %xmm9
movslq %r13d, %r8
movq (%rdx,%r8,8), %r12
movslq (%rsi,%r8,4), %r8
movslq %r10d, %r10
addq %r8, %r10
movl (%r12,%r10,4), %r8d
movslq %r11d, %r13
movl (%rsi,%r13,4), %ebp
decl %ebp
leal 0x1(%r8), %r10d
cmpl %r8d, %ebp
movl $0x0, %eax
cmovel %eax, %r10d
leal (,%r13,4), %r8d
movslq %r8d, %r8
movsd (%rcx,%r8,8), %xmm10
subsd (%rcx), %xmm10
leal 0x1(,%r13,4), %r8d
movslq %r8d, %r8
movsd (%rcx,%r8,8), %xmm11
subsd 0x8(%rcx), %xmm11
leal 0x2(,%r13,4), %r8d
movslq %r8d, %r8
movsd (%rcx,%r8,8), %xmm12
subsd 0x10(%rcx), %xmm12
movapd %xmm1, %xmm13
mulsd %xmm8, %xmm13
movapd %xmm2, %xmm14
mulsd %xmm7, %xmm14
mulsd %xmm10, %xmm14
mulsd %xmm12, %xmm13
addsd %xmm14, %xmm13
movapd %xmm3, %xmm14
mulsd %xmm9, %xmm14
mulsd %xmm11, %xmm14
addsd %xmm13, %xmm14
movapd %xmm8, %xmm13
mulsd %xmm4, %xmm13
mulsd %xmm10, %xmm13
addsd %xmm14, %xmm13
movapd %xmm9, %xmm14
mulsd %xmm5, %xmm14
mulsd %xmm12, %xmm14
addsd %xmm13, %xmm14
movapd %xmm7, %xmm13
mulsd %xmm6, %xmm13
mulsd %xmm11, %xmm13
addsd %xmm14, %xmm13
addsd %xmm10, %xmm9
subsd %xmm1, %xmm9
mulsd %xmm13, %xmm9
addsd (%r15), %xmm9
movsd %xmm9, (%r15)
addsd %xmm11, %xmm8
subsd %xmm2, %xmm8
mulsd %xmm13, %xmm8
addsd (%r14), %xmm8
movsd %xmm8, (%r14)
addsd %xmm12, %xmm7
subsd %xmm3, %xmm7
mulsd %xmm13, %xmm7
addsd (%rbx), %xmm7
movsd %xmm7, (%rbx)
movq (%rdx,%r13,8), %r8
movslq %r10d, %r12
movl (%r8,%r12,4), %ebp
movl %r11d, %r13d
movl %ebp, %r11d
movl %ebp, %eax
notl %eax
movl %eax, (%r8,%r12,4)
addsd %xmm13, %xmm15
movapd %xmm12, %xmm7
movapd %xmm11, %xmm8
movapd %xmm10, %xmm9
cmpq %rbp, %rdi
jne 0x9886
xorl %r8d, %r8d
incq %r9
movslq (%rsi,%rdi,4), %rax
cmpq %rax, %r9
movq 0x8(%rsp), %rax
jl 0x97f4
incq %rdi
movq 0x10(%rsp), %r12
movslq 0x1c(%r12), %rax
cmpq %rax, %rdi
jl 0x97a0
testl %eax, %eax
jle 0x9a85
xorl %ebp, %ebp
movsd %xmm15, 0x8(%rsp)
movq 0x30(%r12), %rax
cmpl $0x0, (%rax,%rbp,4)
jle 0x9a78
xorl %r13d, %r13d
movq 0x28(%r12), %rax
movq (%rax,%rbp,8), %rax
cmpl $0x0, (%rax,%r13,4)
js 0x9a5a
leaq 0x2f3fc(%rip), %rdi     # 0x38e45
movl $0x3, %esi
callq 0x1318d
movsd 0x8(%rsp), %xmm15
movq 0x28(%r12), %rax
movq (%rax,%rbp,8), %rax
notl (%rax,%r13,4)
incq %r13
movq 0x30(%r12), %rax
movslq (%rax,%rbp,4), %rax
cmpq %rax, %r13
jl 0x9a32
incq %rbp
movslq 0x1c(%r12), %rax
cmpq %rax, %rbp
jl 0x9a24
ucomisd 0x50(%r12), %xmm15
jbe 0x9af0
movsd 0x2ef4a(%rip), %xmm0    # 0x389e0
divsd %xmm15, %xmm0
movq 0x40(%r12), %rax
movsd 0x2d580(%rip), %xmm1    # 0x37028
movsd (%rax), %xmm2
mulsd %xmm1, %xmm2
movsd (%r15), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%r15)
movsd 0x8(%rax), %xmm2
mulsd %xmm1, %xmm2
movsd (%r14), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%r14)
mulsd 0x10(%rax), %xmm1
mulsd (%rbx), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
jmp 0x9afb
xorl %eax, %eax
movq %rax, (%rbx)
movq %rax, (%r14)
movq %rax, (%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq