// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
addq $0x68, %rdi
movl $0x20, %esi
callq 0x71ba
movq %rax, %r14
movq %r15, %rdx
subq %r12, %rdx
cmpq 0x18(%r13), %rdx
jbe 0x6f1d
leaq (,%r12,8), %rsi
addq (%r13), %rsi
movq %rbx, (%rsp)
leaq -0x38(%rbp), %rcx
leaq -0x2c(%rbp), %r8
leaq -0x30(%rbp), %r9
movq %r13, %rdi
callq 0x7044
leaq -0x2c(%rbp), %rax
movslq (%rax), %rax
movl %eax, (%r14)
movq 0x10(%rbx), %rdx
leaq -0x70(%rbp), %rcx
movq %rdx, 0x10(%rcx)
movups (%rbx), %xmm0
movaps %xmm0, (%rcx)
leaq -0x30(%rbp), %rdx
movss (%rdx), %xmm0
movss %xmm0, -0x6c(%rbp,%rax,8)
leaq -0x38(%rbp), %rax
movq (%rax), %rdx
addq %r12, %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x6de6
movq %rax, 0x10(%r14)
movq 0x10(%rbx), %rax
leaq -0x50(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups (%rbx), %xmm0
movaps %xmm0, (%rcx)
leaq -0x30(%rbp), %rax
movss (%rax), %xmm0
leaq -0x2c(%rbp), %rax
movslq (%rax), %rax
movss %xmm0, -0x50(%rbp,%rax,8)
leaq -0x38(%rbp), %rax
addq (%rax), %r12
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6de6
movq %rax, 0x18(%r14)
leaq -0x2c(%rbp), %rax
movslq (%rax), %rax
movss -0x6c(%rbp,%rax,8), %xmm0
movss %xmm0, 0x4(%r14)
movss -0x50(%rbp,%rax,8), %xmm0
movss %xmm0, 0x8(%r14)
xorl %eax, %eax
movss -0x50(%rbp,%rax,8), %xmm0
minss -0x70(%rbp,%rax,8), %xmm0
movss %xmm0, (%rbx,%rax,8)
movss -0x4c(%rbp,%rax,8), %xmm0
maxss -0x6c(%rbp,%rax,8), %xmm0
movss %xmm0, 0x4(%rbx,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x6eec
jmp 0x7032
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movq %r12, (%r14)
movq %r15, 0x8(%r14)
movq (%r13), %rax
movq 0x20(%r13), %rcx
movq (%rax,%r12,8), %rdx
movq 0x8(%rcx), %rcx
leaq (%rdx,%rdx,4), %rdx
movss (%rcx,%rdx,8), %xmm0
movss %xmm0, (%rbx)
movss %xmm0, 0x4(%rbx)
movss 0x4(%rcx,%rdx,8), %xmm0
movss %xmm0, 0x8(%rbx)
movss %xmm0, 0xc(%rbx)
movss 0x8(%rcx,%rdx,8), %xmm0
movss %xmm0, 0x10(%rbx)
movss %xmm0, 0x14(%rbx)
incq %r12
cmpq %r15, %r12
jae 0x7032
movq (%rax,%r12,8), %rdx
leaq (%rdx,%rdx,4), %rdi
leaq (%rcx,%rdi,8), %rdx
addq $0x4, %rdx
leaq (%rcx,%rdi,8), %rsi
leaq (%rcx,%rdi,8), %rdi
addq $0x8, %rdi
xorl %r8d, %r8d
movq %rsi, %r9
testl %r8d, %r8d
je 0x6fad
movq %rdx, %r9
cmpl $0x1, %r8d
je 0x6fad
movq %rdi, %r9
movss (%rbx,%r8,8), %xmm0
ucomiss (%r9), %xmm0
jbe 0x6fd8
movq %rsi, %r9
testl %r8d, %r8d
je 0x6fcd
movq %rdx, %r9
cmpl $0x1, %r8d
je 0x6fcd
movq %rdi, %r9
movss (%r9), %xmm0
movss %xmm0, (%rbx,%r8,8)
movq %rsi, %r9
testl %r8d, %r8d
je 0x6fec
movq %rdx, %r9
cmpl $0x1, %r8d
je 0x6fec
movq %rdi, %r9
movss (%r9), %xmm0
ucomiss 0x4(%rbx,%r8,8), %xmm0
jbe 0x7019
movq %rsi, %r9
testl %r8d, %r8d
je 0x700d
movq %rdx, %r9
cmpl $0x1, %r8d
je 0x700d
movq %rdi, %r9
movss (%r9), %xmm0
movss %xmm0, 0x4(%rbx,%r8,8)
incq %r8
cmpq $0x3, %r8
jne 0x6f99
incq %r12
cmpq %r15, %r12
jne 0x6f7a
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq