// File: /workspace/github_cpp_makefile_star2_O2/mitchellsayer[P]FastPointCloudSegmentation/src/./nanoflann.hpp
// Function: nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<float, ScanlinePointCloud, float>, ScanlinePointCloud, 3, unsigned long>::divideTree(unsigned long, unsigned long, nanoflann::CArray<nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<float, ScanlinePointCloud, float>, ScanlinePointCloud, 3, unsigned long>::Interval, 3ul>&)
NodePtr divideTree(const IndexType left, const IndexType right, BoundingBox& bbox)
		{
			NodePtr node = pool.allocate<Node>(); // allocate memory

			/* If too few exemplars remain, then make this a leaf node. */
			if ( (right-left) <= static_cast<IndexType>(m_leaf_max_size) ) {
				node->child1 = node->child2 = NULL;    /* Mark as leaf node. */
				node->node_type.lr.left = left;
				node->node_type.lr.right = right;

				// compute bounding-box of leaf points
				for (int i=0; i<(DIM>0 ? DIM : dim); ++i) {
					bbox[i].low = dataset_get(vind[left],i);
					bbox[i].high = dataset_get(vind[left],i);
				}
				for (IndexType k=left+1; k<right; ++k) {
					for (int i=0; i<(DIM>0 ? DIM : dim); ++i) {
						if (bbox[i].low>dataset_get(vind[k],i)) bbox[i].low=dataset_get(vind[k],i);
						if (bbox[i].high<dataset_get(vind[k],i)) bbox[i].high=dataset_get(vind[k],i);
					}
				}
			}
			else {
				IndexType idx;
				int cutfeat;
				DistanceType cutval;
				middleSplit_(&vind[0]+left, right-left, idx, cutfeat, cutval, bbox);

				node->node_type.sub.divfeat = cutfeat;

				BoundingBox left_bbox(bbox);
				left_bbox[cutfeat].high = cutval;
				node->child1 = divideTree(left, left+idx, left_bbox);

				BoundingBox right_bbox(bbox);
				right_bbox[cutfeat].low = cutval;
				node->child2 = divideTree(left+idx, right, right_bbox);

				node->node_type.sub.divlow = left_bbox[cutfeat].high;
				node->node_type.sub.divhigh = right_bbox[cutfeat].low;

				for (int i=0; i<(DIM>0 ? DIM : dim); ++i) {
					bbox[i].low = std::min(left_bbox[i].low, right_bbox[i].low);
					bbox[i].high = std::max(left_bbox[i].high, right_bbox[i].high);
				}
			}

			return node;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
addq $0x68, %rdi
pushq $0x20
popq %rsi
callq 0x6664
movq %r15, %rdx
subq %r12, %rdx
cmpq 0x18(%r13), %rdx
movq %rax, -0x38(%rbp)
jbe 0x63a6
leaq (,%r12,8), %rsi
addq (%r13), %rsi
movq %rbx, (%rsp)
leaq -0x48(%rbp), %rcx
leaq -0x4c(%rbp), %r14
leaq -0x3c(%rbp), %r9
movq %r13, %rdi
movq %r14, %r8
callq 0x64ec
movslq (%r14), %rax
movq -0x38(%rbp), %rcx
movl %eax, (%rcx)
movq 0x10(%rbx), %rdx
leaq -0x90(%rbp), %rcx
movq %rdx, 0x10(%rcx)
movups (%rbx), %xmm0
movaps %xmm0, (%rcx)
leaq -0x3c(%rbp), %rdx
movss (%rdx), %xmm0
movss %xmm0, -0x8c(%rbp,%rax,8)
leaq -0x48(%rbp), %rax
movq (%rax), %rdx
addq %r12, %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x625c
movq -0x38(%rbp), %rcx
movq %rax, 0x10(%rcx)
movq 0x10(%rbx), %rax
leaq -0x70(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups (%rbx), %xmm0
movaps %xmm0, (%rcx)
leaq -0x3c(%rbp), %rax
movss (%rax), %xmm0
movslq (%r14), %rax
movss %xmm0, -0x70(%rbp,%rax,8)
leaq -0x48(%rbp), %rax
addq (%rax), %r12
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x625c
movq -0x38(%rbp), %rcx
movq %rax, 0x18(%rcx)
movslq (%r14), %rax
movq -0x38(%rbp), %rcx
movss -0x8c(%rbp,%rax,8), %xmm0
movss %xmm0, 0x4(%rcx)
movss -0x70(%rbp,%rax,8), %xmm0
movss %xmm0, 0x8(%rcx)
xorl %eax, %eax
cmpq $0x3, %rax
je 0x649a
movss -0x70(%rbp,%rax,8), %xmm0
minss -0x90(%rbp,%rax,8), %xmm0
movss %xmm0, (%rbx,%rax,8)
movss -0x6c(%rbp,%rax,8), %xmm0
maxss -0x8c(%rbp,%rax,8), %xmm0
movss %xmm0, 0x4(%rbx,%rax,8)
incq %rax
jmp 0x636e
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %r12, (%rax)
movq %r15, 0x8(%rax)
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0x648e
movq (%r13), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0x64ae
movss %xmm0, (%rbx,%r14,8)
movq (%r13), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0x64ae
movss %xmm0, 0x4(%rbx,%r14,8)
incq %r14
jmp 0x63b7
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0x648e
movss (%rbx,%r14,8), %xmm0
movss %xmm0, -0x2c(%rbp)
movq (%r13), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0x64ae
movss -0x2c(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x6447
movq (%r13), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0x64ae
movss %xmm0, (%rbx,%r14,8)
movss 0x4(%rbx,%r14,8), %xmm0
movss %xmm0, -0x2c(%rbp)
movq (%r13), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0x64ae
ucomiss -0x2c(%rbp), %xmm0
jbe 0x6486
movq (%r13), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0x64ae
movss %xmm0, 0x4(%rbx,%r14,8)
incq %r14
jmp 0x63fc
incq %r12
cmpq %r15, %r12
jb 0x63f9
movq -0x38(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop