// File: /workspace/github_cpp_makefile_star2_O1/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 0x7372
movq %rax, %r14
movq %r15, %rdx
subq %r12, %rdx
cmpq 0x18(%r13), %rdx
jbe 0x7031
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 0x71fc
leaq -0x2c(%rbp), %rdx
movl (%rdx), %eax
movl %eax, (%r14)
movq 0x10(%rbx), %rax
leaq -0x70(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups (%rbx), %xmm0
movaps %xmm0, (%rcx)
leaq -0x30(%rbp), %rax
movss (%rax), %xmm0
movslq (%rdx), %rax
movss %xmm0, -0x6c(%rbp,%rax,8)
leaq -0x38(%rbp), %rax
movq (%rax), %rdx
addq %r12, %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x6ef8
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 0x6ef8
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 0x7000
jmp 0x71e9
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movq %r12, (%r14)
movq %r15, 0x8(%r14)
movq (%r13), %rcx
movq 0x20(%r13), %rax
movq (%rcx,%r12,8), %rdx
xorl %ecx, %ecx
leaq (%rdx,%rdx,4), %rdx
leaq (,%rdx,8), %rsi
cmpl $0x1, %ecx
je 0x706c
testl %ecx, %ecx
jne 0x707a
movq 0x8(%rax), %rdi
addq %rsi, %rdi
jmp 0x7086
movq 0x8(%rax), %rdi
leaq (%rdi,%rdx,8), %rdi
addq $0x4, %rdi
jmp 0x7086
movq 0x8(%rax), %rdi
leaq (%rdi,%rdx,8), %rdi
addq $0x8, %rdi
movss (%rdi), %xmm0
movss %xmm0, (%rbx,%rcx,8)
cmpl $0x1, %ecx
je 0x70a1
testl %ecx, %ecx
jne 0x70af
movq 0x8(%rax), %rdi
addq %rsi, %rdi
jmp 0x70bb
movq 0x8(%rax), %rdi
leaq (%rdi,%rdx,8), %rdi
addq $0x4, %rdi
jmp 0x70bb
movq 0x8(%rax), %rdi
leaq (%rdi,%rdx,8), %rdi
addq $0x8, %rdi
movss (%rdi), %xmm0
movss %xmm0, 0x4(%rbx,%rcx,8)
incq %rcx
cmpq $0x3, %rcx
jne 0x705a
incq %r12
cmpq %r15, %r12
jae 0x71e9
movq (%r13), %rax
movq 0x20(%r13), %rcx
movq (%rax,%r12,8), %rdx
leaq (%rdx,%rdx,4), %rdx
leaq (,%rdx,8), %rsi
xorl %edi, %edi
cmpl $0x1, %edi
je 0x7106
testl %edi, %edi
jne 0x7114
movq 0x8(%rcx), %r8
addq %rsi, %r8
jmp 0x7120
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x4, %r8
jmp 0x7120
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x8, %r8
movss (%rbx,%rdi,8), %xmm0
ucomiss (%r8), %xmm0
jbe 0x7161
cmpl $0x1, %edi
je 0x713d
testl %edi, %edi
jne 0x714b
movq 0x8(%rcx), %r8
addq %rsi, %r8
jmp 0x7157
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x4, %r8
jmp 0x7157
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x8, %r8
movss (%r8), %xmm0
movss %xmm0, (%rbx,%rdi,8)
cmpl $0x1, %edi
je 0x7173
testl %edi, %edi
jne 0x7181
movq 0x8(%rcx), %r8
addq %rsi, %r8
jmp 0x718d
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x4, %r8
jmp 0x718d
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x8, %r8
movss (%r8), %xmm0
ucomiss 0x4(%rbx,%rdi,8), %xmm0
jbe 0x71d0
cmpl $0x1, %edi
je 0x71ab
testl %edi, %edi
jne 0x71b9
movq 0x8(%rcx), %r8
addq %rsi, %r8
jmp 0x71c5
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x4, %r8
jmp 0x71c5
movq 0x8(%rcx), %r8
leaq (%r8,%rdx,8), %r8
addq $0x8, %r8
movss (%r8), %xmm0
movss %xmm0, 0x4(%rbx,%rdi,8)
incq %rdi
cmpq $0x3, %rdi
jne 0x70f4
incq %r12
cmpq %r15, %r12
jne 0x70e2
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop