// File: 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
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl -0x1c(%rbp), %edx
movq 0x28(%rdi), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x28(%rdi), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rdi), %rcx
movslq -0x14(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x1c(%rbp), %edx
callq 0x15f00
movl %eax, -0x20(%rbp)
movq -0xc8(%rbp), %rax
movq 0x28(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x24(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
subl -0x24(%rbp), %esi
movq 0x28(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x40(%rax), %rcx
movl -0x24(%rbp), %edx
shll $0x2, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x40(%rax), %rcx
movl -0x1c(%rbp), %edx
shll $0x2, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x40(%rax), %rcx
movl -0x24(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x40(%rax), %rcx
movl -0x1c(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x40(%rax), %rcx
movl -0x24(%rbp), %edx
shll $0x2, %edx
addl $0x2, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x40(%rax), %rcx
movl -0x1c(%rbp), %edx
shll $0x2, %edx
addl $0x2, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movsd -0x38(%rbp), %xmm0
mulsd -0x38(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x48(%rax), %xmm0
jbe 0x16df2
jmp 0x16aa8
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x16d9c
movq -0xc8(%rbp), %rdi
movq 0x28(%rdi), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rdi), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x24(%rbp), %edx
callq 0x15f00
movl %eax, %ecx
movq -0xc8(%rbp), %rax
movl %ecx, -0x20(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movq 0x28(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x24(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
subl -0x24(%rbp), %esi
movq 0x28(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movq 0x40(%rax), %rcx
movl -0x24(%rbp), %edx
shll $0x2, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x40(%rax), %rcx
movl -0x1c(%rbp), %edx
shll $0x2, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq 0x40(%rax), %rcx
movl -0x24(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x40(%rax), %rcx
movl -0x1c(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movq 0x40(%rax), %rcx
movl -0x24(%rbp), %edx
shll $0x2, %edx
addl $0x2, %edx
movslq %edx, %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x40(%rax), %rcx
movl -0x1c(%rbp), %edx
shll $0x2, %edx
addl $0x2, %edx
movslq %edx, %rdx
subsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x50(%rbp), %xmm2
movsd -0x38(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
movq %xmm1, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x30(%rbp), %xmm0
movsd -0x58(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd -0x48(%rbp), %xmm1
movq %xmm1, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x48(%rbp), %xmm2
movsd -0x30(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
movq %xmm1, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x60(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
movsd -0x68(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
ucomisd 0x48(%rax), %xmm0
jbe 0x16d97
movsd -0x78(%rbp), %xmm0
callq 0x20f0
movaps %xmm0, %xmm1
movsd 0x3f363(%rip), %xmm0    # 0x56010
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
leaq -0x80(%rbp), %rsi
callq 0x16880
movq -0x10(%rbp), %rdi
movsd -0x68(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x16880
movq -0x10(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x16880
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x16d92
movq -0xc8(%rbp), %rdi
movq 0x28(%rdi), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rdi), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x24(%rbp), %edx
callq 0x15f00
movl %eax, %ecx
movq -0xc8(%rbp), %rax
movl %ecx, -0x20(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movq 0x28(%rax), %rcx
movslq -0x1c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, -0x24(%rbp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl -0x24(%rbp), %edx
movq 0x28(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x16d16
jmp 0x16e87
jmp 0x16aa8
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x16880
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x16880
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0xa8(%rbp), %rsi
callq 0x16880
jmp 0x16e87
movq -0xc8(%rbp), %rdi
movq 0x28(%rdi), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rdi), %rcx
movslq -0x1c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %esi
movl -0x24(%rbp), %edx
callq 0x15f00
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x169ae
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
leaq -0xb0(%rbp), %rsi
callq 0x16880
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x16880
movq -0x10(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x16880
addq $0xd0, %rsp
popq %rbp
retq