// File: /workspace/github_cpp_makefile_star2_O2/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 %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rcx), %rax
testq %rax, %rax
jne 0x6a2b
cmpq $0x0, 0x18(%r13)
je 0x6b1e
movslq (%r13), %r12
movss (%rbx,%r12,4), %xmm3
movaps %xmm3, %xmm2
subss 0x4(%r13), %xmm2
subss 0x8(%r13), %xmm3
movaps %xmm2, %xmm4
addss %xmm3, %xmm4
xorps %xmm5, %xmm5
ucomiss %xmm4, %xmm5
movq 0x18(%r13), %rcx
mulss %xmm3, %xmm3
mulss %xmm2, %xmm2
movq %rcx, -0x60(%rbp)
cmovaq %rax, %rcx
movss %xmm4, -0x30(%rbp)
cmpltss %xmm5, %xmm4
andps %xmm4, %xmm3
andnps %xmm2, %xmm4
orps %xmm3, %xmm4
movaps %xmm4, -0x50(%rbp)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r8, %r13
movss %xmm1, -0x2c(%rbp)
movq %rax, -0x58(%rbp)
movss %xmm0, -0x34(%rbp)
callq 0x69fa
movss -0x2c(%rbp), %xmm1
movq %r13, %rdx
movss (%r13,%r12,4), %xmm4
movaps -0x50(%rbp), %xmm2
movaps %xmm2, %xmm0
addss -0x34(%rbp), %xmm0
subss %xmm4, %xmm0
movss %xmm2, (%r13,%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 0x6b09
xorps %xmm2, %xmm2
ucomiss -0x30(%rbp), %xmm2
movq -0x58(%rbp), %rcx
cmovaq -0x60(%rbp), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %r8
movss %xmm4, -0x2c(%rbp)
callq 0x69fa
movss -0x2c(%rbp), %xmm4
movq %r13, %rdx
movss %xmm4, (%rdx,%r12,4)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rax
movq %r14, -0x50(%rbp)
movq 0x10(%r14), %rcx
movss -0x4(%rax,%rcx,4), %xmm0
movss %xmm0, -0x2c(%rbp)
movq (%r13), %r14
leaq 0x90(%r15), %r12
cmpq 0x8(%r13), %r14
jae 0x6b0f
movq (%r15), %rax
movq (%rax,%r14,8), %rdx
movq %r12, %rdi
movq %rbx, %rsi
pushq $0x3
popq %rcx
callq 0x6b7a
movss -0x2c(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x6b75
movq (%r15), %rax
movq (%rax,%r14,8), %rsi
movq -0x50(%rbp), %rdi
callq 0x6b90
incq %r14
jmp 0x6b40