// File: /workspace/github_cpp_makefile_star2_O3/mitchellsayer[P]FastPointCloudSegmentation/src/./nanoflann.hpp
// Function: void nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<float, ScanlinePointCloud, float>, ScanlinePointCloud, 3, unsigned long>::searchLevel<nanoflann::KNNResultSet<float, unsigned long, unsigned long>>(nanoflann::KNNResultSet<float, unsigned long, unsigned long>&, float const*, nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<float, ScanlinePointCloud, float>, ScanlinePointCloud, 3, unsigned long>::Node*, float, nanoflann::CArray<float, 3ul>&, float) const
void searchLevel(RESULTSET& result_set, const ElementType* vec, const NodePtr node, DistanceType mindistsq,
						 distance_vector_t& dists, const float epsError) const
		{
			/* If this is a leaf node, then do check and return. */
			if ((node->child1 == NULL)&&(node->child2 == NULL)) {
				//count_leaf += (node->lr.right-node->lr.left);  // Removed since was neither used nor returned to the user.
				DistanceType worst_dist = result_set.worstDist();
				for (IndexType i=node->node_type.lr.left; i<node->node_type.lr.right; ++i) {
					const IndexType index = vind[i];// reorder... : i;
					DistanceType dist = distance(vec, index, (DIM>0 ? DIM : dim));
					if (dist<worst_dist) {
						result_set.addPoint(dist,vind[i]);
					}
				}
				return;
			}

			/* Which child branch should be taken first? */
			int idx = node->node_type.sub.divfeat;
			ElementType val = vec[idx];
			DistanceType diff1 = val - node->node_type.sub.divlow;
			DistanceType diff2 = val - node->node_type.sub.divhigh;

			NodePtr bestChild;
			NodePtr otherChild;
			DistanceType cut_dist;
			if ((diff1+diff2)<0) {
				bestChild = node->child1;
				otherChild = node->child2;
				cut_dist = distance.accum_dist(val, node->node_type.sub.divhigh, idx);
			}
			else {
				bestChild = node->child2;
				otherChild = node->child1;
				cut_dist = distance.accum_dist( val, node->node_type.sub.divlow, idx);
			}

			/* Call recursively to search next level down. */
			searchLevel(result_set, vec, bestChild, mindistsq, dists, epsError);

			DistanceType dst = dists[idx];
			mindistsq = mindistsq + cut_dist - dst;
			dists[idx] = cut_dist;
			if (mindistsq*epsError<=result_set.worstDist()) {
				searchLevel(result_set, vec, otherChild, mindistsq, dists, epsError);
			}
			dists[idx] = dst;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq 0x10(%rcx), %r13
testq %r13, %r13
jne 0x761e
cmpq $0x0, 0x18(%rcx)
je 0x7703
movslq (%rcx), %r12
movss (%rbx,%r12,4), %xmm3
movaps %xmm3, %xmm2
subss 0x4(%rcx), %xmm2
subss 0x8(%rcx), %xmm3
movaps %xmm2, %xmm4
addss %xmm3, %xmm4
xorps %xmm5, %xmm5
ucomiss %xmm4, %xmm5
movq 0x18(%rcx), %rcx
mulss %xmm3, %xmm3
mulss %xmm2, %xmm2
movq %rcx, -0x48(%rbp)
cmovaq %r13, %rcx
movss %xmm4, -0x30(%rbp)
cmpltss %xmm5, %xmm4
andps %xmm4, %xmm3
andnps %xmm2, %xmm4
orps %xmm3, %xmm4
movaps %xmm4, -0x60(%rbp)
movq %rdi, -0x40(%rbp)
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %r8
movss %xmm1, -0x2c(%rbp)
movss %xmm0, -0x34(%rbp)
callq 0x75f0
movss -0x2c(%rbp), %xmm1
movss (%r15,%r12,4), %xmm4
movaps -0x60(%rbp), %xmm2
movaps %xmm2, %xmm0
addss -0x34(%rbp), %xmm0
subss %xmm4, %xmm0
movss %xmm2, (%r15,%r12,4)
movaps %xmm0, %xmm3
mulss %xmm1, %xmm3
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
movss -0x4(%rax,%rcx,4), %xmm2
ucomiss %xmm3, %xmm2
jb 0x76ee
xorps %xmm2, %xmm2
ucomiss -0x30(%rbp), %xmm2
cmovaq -0x48(%rbp), %r13
movq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movq %r15, %r8
movss %xmm4, -0x2c(%rbp)
callq 0x75f0
movss -0x2c(%rbp), %xmm4
movss %xmm4, (%r15,%r12,4)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rcx), %rax
cmpq 0x8(%rcx), %rax
jae 0x76f4
movq 0x8(%r14), %rdx
movq 0x10(%r14), %r9
movss -0x4(%rdx,%r9,4), %xmm0
movq (%rdi), %rsi
movq 0x90(%rdi), %rdi
movq 0x8(%rdi), %rdi
movq (%r14), %r8
movq (%rsi,%rax,8), %r10
leaq (%r10,%r10,4), %r11
movss (%rdi,%r11,8), %xmm2
movss 0x4(%rdi,%r11,8), %xmm3
subss (%rbx), %xmm2
subss 0x4(%rbx), %xmm3
movss 0x8(%rdi,%r11,8), %xmm1
subss 0x8(%rbx), %xmm1
mulss %xmm3, %xmm3
mulss %xmm2, %xmm2
addss %xmm3, %xmm2
mulss %xmm1, %xmm1
addss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x77d4
movq 0x18(%r14), %r11
testq %r11, %r11
je 0x77ae
movq (%r14), %r15
movss -0x4(%rdx,%r11,4), %xmm2
ucomiss %xmm1, %xmm2
movq 0x10(%r14), %r9
jbe 0x77b1
leaq -0x1(%r11), %r12
cmpq %r9, %r11
jae 0x77a2
movss %xmm2, (%rdx,%r11,4)
movq (%r15,%r12,8), %r9
movq %r9, (%r15,%r11,8)
movq %r12, %r11
testq %r12, %r12
jne 0x777b
movq 0x10(%r14), %r9
xorl %r11d, %r11d
cmpq %r9, %r11
jae 0x77c4
movss %xmm1, (%rdx,%r11,4)
movq %r10, (%r8,%r11,8)
movq 0x10(%r14), %r9
movq 0x18(%r14), %r10
cmpq %r9, %r10
jae 0x77d4
incq %r10
movq %r10, 0x18(%r14)
incq %rax
cmpq 0x8(%rcx), %rax
jb 0x772c
jmp 0x76f4