// File: /workspace/github_cpp_makefile_star2_O3/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), %r9d
xorpd %xmm11, %xmm11
cmpl $0x2, %r9d
jl 0x9916
xorl %r8d, %r8d
movq 0x40(%r12), %rcx
movq 0x28(%r12), %rdx
movq 0x30(%r12), %rsi
movl $0x1, %edi
movq %r12, 0x10(%rsp)
cmpl $0x0, (%rsi,%rdi,4)
jle 0x9907
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
movapd 0x2d95e(%rip), %xmm0    # 0x37040
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 0x98e5
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), %xmm8
movsd (%rcx), %xmm9
movupd 0x8(%rcx,%r11,8), %xmm7
movupd 0x8(%rcx), %xmm10
movq (%rdx,%r13,8), %rbp
movslq %r10d, %r12
movl (%rbp,%r12,4), %r11d
movl %r11d, %r8d
notl %r8d
movl %r8d, (%rbp,%r12,4)
cmpq %r11, %rdi
je 0x98e5
subpd %xmm10, %xmm7
subsd %xmm9, %xmm8
movslq %r13d, %r8
movslq (%rsi,%r8,4), %r8
movslq %r10d, %r10
addq %r8, %r10
movl (%rbp,%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), %xmm9
subsd (%rcx), %xmm9
leal 0x1(,%r13,4), %r8d
movslq %r8d, %r8
movupd (%rcx,%r8,8), %xmm10
movapd %xmm11, %xmm0
movupd 0x8(%rcx), %xmm11
subpd %xmm11, %xmm10
movapd %xmm1, %xmm13
mulsd %xmm7, %xmm13
movapd %xmm7, %xmm12
unpckhpd %xmm7, %xmm12           # xmm12 = xmm12[1],xmm7[1]
movapd %xmm2, %xmm14
mulsd %xmm12, %xmm14
mulsd %xmm9, %xmm14
movapd %xmm10, %xmm11
unpckhpd %xmm10, %xmm11          # xmm11 = xmm11[1],xmm10[1]
mulsd %xmm11, %xmm13
addsd %xmm14, %xmm13
movapd %xmm3, %xmm14
mulsd %xmm8, %xmm14
mulsd %xmm10, %xmm14
addsd %xmm13, %xmm14
movapd %xmm7, %xmm15
mulsd %xmm4, %xmm15
mulsd %xmm9, %xmm15
addsd %xmm14, %xmm15
movapd %xmm8, %xmm13
mulsd %xmm5, %xmm13
mulsd %xmm11, %xmm13
addsd %xmm15, %xmm13
addsd %xmm12, %xmm11
mulsd %xmm6, %xmm12
mulsd %xmm10, %xmm12
addsd %xmm13, %xmm12
addsd %xmm9, %xmm8
subsd %xmm1, %xmm8
mulsd %xmm12, %xmm8
addsd (%r15), %xmm8
movsd %xmm8, (%r15)
addsd %xmm10, %xmm7
subsd %xmm2, %xmm7
mulsd %xmm12, %xmm7
addsd (%r14), %xmm7
movsd %xmm7, (%r14)
subsd %xmm3, %xmm11
mulsd %xmm12, %xmm11
addsd (%rbx), %xmm11
movsd %xmm11, (%rbx)
movapd %xmm0, %xmm11
movq (%rdx,%r13,8), %rbp
movslq %r10d, %r8
movl (%rbp,%r8,4), %r12d
movl %r11d, %r13d
movl %r12d, %r11d
movl %r12d, %eax
notl %eax
movl %eax, (%rbp,%r8,4)
addsd %xmm12, %xmm11
movapd %xmm9, %xmm8
movapd %xmm10, %xmm7
cmpq %r12, %rdi
jne 0x977e
xorl %r8d, %r8d
incq %r9
movslq (%rsi,%rdi,4), %rax
cmpq %rax, %r9
movq 0x8(%rsp), %rax
jl 0x96fe
movq 0x10(%rsp), %r12
movl 0x1c(%r12), %r9d
incq %rdi
movslq %r9d, %rax
cmpq %rax, %rdi
jl 0x96a2
testl %r9d, %r9d
jle 0x998f
movq 0x30(%r12), %rax
xorl %ebp, %ebp
movsd %xmm11, 0x8(%rsp)
cmpl $0x0, (%rax,%rbp,4)
jle 0x9984
movq 0x28(%r12), %rcx
movq (%rcx,%rbp,8), %rcx
xorl %r13d, %r13d
movl (%rcx,%r13,4), %edx
testl %edx, %edx
js 0x996d
leaq 0x2f56b(%rip), %rdi     # 0x38eb5
movl $0x3, %esi
callq 0x133c5
movsd 0x8(%rsp), %xmm11
movq 0x28(%r12), %rcx
movq 0x30(%r12), %rax
movq (%rcx,%rbp,8), %rcx
movl (%rcx,%r13,4), %edx
notl %edx
movl %edx, (%rcx,%r13,4)
incq %r13
movslq (%rax,%rbp,4), %rdx
cmpq %rdx, %r13
jl 0x993b
movl 0x1c(%r12), %r9d
incq %rbp
movslq %r9d, %rcx
cmpq %rcx, %rbp
jl 0x9929
ucomisd 0x50(%r12), %xmm11
jbe 0x99fa
movsd 0x2f0b0(%rip), %xmm0    # 0x38a50
divsd %xmm11, %xmm0
movq 0x40(%r12), %rax
movsd 0x2d67e(%rip), %xmm1    # 0x37030
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 0x9a05
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