// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/voro++/src/cell.cc
// Function: voro::voronoicell_base::normals_search(std::vector<double, std::allocator<double>>&, int, int, int)
inline void voronoicell_base::normals_search(std::vector<double> &v,int i,int j,int k) {
	ed[i][j]=-1-k;
	int l=cycle_up(ed[i][nu[i]+j],k),m;
	double ux,uy,uz,vx,vy,vz,wx,wy,wz,wmag;
	do {
		m=ed[k][l];ed[k][l]=-1-m;
		ux=pts[4*m]-pts[4*k];
		uy=pts[4*m+1]-pts[4*k+1];
		uz=pts[4*m+2]-pts[4*k+2];

		// Test to see if the length of this edge is above the tolerance
		if(ux*ux+uy*uy+uz*uz>tol) {
			while(m!=i) {
				l=cycle_up(ed[k][nu[k]+l],m);
				k=m;m=ed[k][l];ed[k][l]=-1-m;
				vx=pts[4*m]-pts[4*k];
				vy=pts[4*m+1]-pts[4*k+1];
				vz=pts[4*m+2]-pts[4*k+2];

				// Construct the vector product of this edge with
				// the previous one
				wx=uz*vy-uy*vz;
				wy=ux*vz-uz*vx;
				wz=uy*vx-ux*vy;
				wmag=wx*wx+wy*wy+wz*wz;

				// Test to see if this vector product of the
				// two edges is above the tolerance
				if(wmag>tol) {

					// Construct the normal vector and print it
					wmag=1/sqrt(wmag);
					v.push_back(wx*wmag);
					v.push_back(wy*wmag);
					v.push_back(wz*wmag);

					// Mark all of the remaining edges of this
					// face and exit
					while(m!=i) {
						l=cycle_up(ed[k][nu[k]+l],m);
						k=m;m=ed[k][l];ed[k][l]=-1-m;
					}
					return;
				}
			}
			v.push_back(0);
			v.push_back(0);
			v.push_back(0);
			return;
		}
		l=cycle_up(ed[k][nu[k]+l],m);
		k=m;
	} while (k!=i);
	v.push_back(0);
	v.push_back(0);
	v.push_back(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
movl %r8d, %edx
notl %edx
movq 0x28(%rdi), %rax
movslq %ebx, %rsi
movq (%rax,%rsi,8), %rdi
movslq %ecx, %r9
movl %edx, (%rdi,%r9,4)
movq 0x30(%r15), %rcx
movq 0x40(%r15), %rdx
movslq (%rcx,%rsi,4), %rsi
addq %r9, %rsi
movl (%rdi,%rsi,4), %esi
movslq %r8d, %rdi
movl (%rcx,%rdi,4), %r9d
decl %r9d
leal 0x1(%rsi), %ebp
xorl %edi, %edi
cmpl %esi, %r9d
cmovel %edi, %ebp
movsd 0x48(%r15), %xmm0
movslq %r8d, %r11
movq (%rax,%r11,8), %rsi
movslq %ebp, %r10
movl (%rsi,%r10,4), %r13d
movslq %r13d, %r9
movl %r9d, %r14d
notl %r14d
movl %r14d, (%rsi,%r10,4)
leaq (,%r9,4), %r14
movq %r9, %r12
shlq $0x5, %r12
movsd (%rdx,%r12), %xmm1
leal (,%r11,4), %r12d
movslq %r12d, %r12
subsd (%rdx,%r12,8), %xmm1
leal 0x1(%r14), %r12d
movslq %r12d, %r12
movsd (%rdx,%r12,8), %xmm2
leal 0x1(,%r11,4), %r12d
movslq %r12d, %r12
subsd (%rdx,%r12,8), %xmm2
orl $0x2, %r14d
movslq %r14d, %r14
movsd (%rdx,%r14,8), %xmm3
leal 0x2(,%r11,4), %r14d
movslq %r14d, %r14
subsd (%rdx,%r14,8), %xmm3
movapd %xmm2, %xmm4
mulsd %xmm2, %xmm4
movapd %xmm1, %xmm5
mulsd %xmm1, %xmm5
addsd %xmm4, %xmm5
movapd %xmm3, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm5, %xmm4
ucomisd %xmm0, %xmm4
ja 0xe6b1
movslq (%rcx,%r11,4), %r8
addq %r10, %r8
movl (%rsi,%r8,4), %esi
movl (%rcx,%r9,4), %r8d
decl %r8d
leal 0x1(%rsi), %ebp
cmpl %esi, %r8d
cmovel %edi, %ebp
movl %r13d, %r8d
cmpl %ebx, %r9d
jne 0xe5a0
movq %rsp, %rbx
andq $0x0, (%rbx)
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xea8e
andq $0x0, (%rbx)
movq %rsp, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xea8e
andq $0x0, (%rbx)
movq %rsp, %rsi
movq %r14, %rdi
callq 0xea8e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movapd 0x20987(%rip), %xmm4    # 0x2f040
movapd %xmm2, %xmm5
xorpd %xmm4, %xmm5
movapd %xmm3, %xmm6
xorpd %xmm4, %xmm6
xorpd %xmm1, %xmm4
xorl %edi, %edi
cmpl %ebx, %r13d
je 0xe66a
movl %r13d, %r14d
movslq %r8d, %r8
movslq (%rcx,%r8,4), %r8
movslq %ebp, %r9
addq %r8, %r9
movl (%rsi,%r9,4), %esi
movslq %r13d, %r8
movl (%rcx,%r8,4), %r9d
decl %r9d
leal 0x1(%rsi), %ebp
cmpl %esi, %r9d
cmovel %edi, %ebp
movq (%rax,%r8,8), %rsi
movslq %ebp, %r8
movslq (%rsi,%r8,4), %r13
movl %r13d, %r9d
notl %r9d
movl %r9d, (%rsi,%r8,4)
movq %r13, %r8
shlq $0x5, %r8
movsd (%rdx,%r8), %xmm8
leal (,%r14,4), %r8d
movslq %r8d, %r8
subsd (%rdx,%r8,8), %xmm8
leaq (,%r13,4), %r8
leal 0x1(%r8), %r9d
movslq %r9d, %r9
movsd (%rdx,%r9,8), %xmm10
leal 0x1(,%r14,4), %r9d
movslq %r9d, %r9
subsd (%rdx,%r9,8), %xmm10
orl $0x2, %r8d
movslq %r8d, %r8
movsd (%rdx,%r8,8), %xmm11
leal 0x2(,%r14,4), %r8d
movslq %r8d, %r8
subsd (%rdx,%r8,8), %xmm11
movapd %xmm11, %xmm9
mulsd %xmm5, %xmm9
movapd %xmm3, %xmm7
mulsd %xmm10, %xmm7
addsd %xmm9, %xmm7
movapd %xmm2, %xmm9
mulsd %xmm8, %xmm9
mulsd %xmm6, %xmm8
mulsd %xmm1, %xmm11
addsd %xmm8, %xmm11
mulsd %xmm4, %xmm10
addsd %xmm9, %xmm10
movapd %xmm11, %xmm8
mulsd %xmm11, %xmm8
movapd %xmm7, %xmm9
mulsd %xmm7, %xmm9
addsd %xmm8, %xmm9
movapd %xmm10, %xmm8
mulsd %xmm10, %xmm8
addsd %xmm9, %xmm8
ucomisd %xmm0, %xmm8
movl %r14d, %r8d
jbe 0xe6cf
sqrtsd %xmm8, %xmm0
movsd 0x20828(%rip), %xmm1    # 0x2f018
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
mulsd %xmm1, %xmm7
movq %rsp, %rsi
movsd %xmm7, (%rsi)
movq 0x8(%rsp), %r12
movq %r12, %rdi
movsd %xmm10, 0x20(%rsp)
movsd %xmm11, 0x18(%rsp)
callq 0xea8e
movsd 0x18(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movq %rsp, %rax
movsd %xmm0, (%rax)
movq %rsp, %rsi
movq %r12, %rdi
callq 0xea8e
movsd 0x20(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movq %rsp, %rax
movsd %xmm0, (%rax)
movq %rsp, %rsi
movq %r12, %rdi
callq 0xea8e
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
xorl %edx, %edx
cmpl %ebx, %r13d
je 0xe6a2
movl %r13d, %esi
movslq %r14d, %rdi
movq (%rax,%rdi,8), %r8
movslq (%rcx,%rdi,4), %rdi
movslq %ebp, %r9
addq %rdi, %r9
movl (%r8,%r9,4), %edi
movslq %r13d, %r8
movl (%rcx,%r8,4), %r9d
decl %r9d
leal 0x1(%rdi), %ebp
cmpl %edi, %r9d
cmovel %edx, %ebp
movq (%rax,%r8,8), %rdi
movslq %ebp, %r8
movl (%rdi,%r8,4), %r13d
movl %r13d, %r9d
notl %r9d
movl %r9d, (%rdi,%r8,4)
movl %esi, %r14d
jmp 0xe866