// File: mitchellsayer[P]FastPointCloudSegmentation/src/./nanoflann.hpp
// Function: nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<float, ScanlinePointCloud, float>, ScanlinePointCloud, 3, unsigned long>::planeSplit(unsigned long*, unsigned long, int, float&, unsigned long&, unsigned long&)
void planeSplit(IndexType* ind, const IndexType count, int cutfeat, DistanceType &cutval, IndexType& lim1, IndexType& lim2)
		{
			/* Move vector indices for left subtree to front of list. */
			IndexType left = 0;
			IndexType right = count-1;
			for (;; ) {
				while (left<=right && dataset_get(ind[left],cutfeat)<cutval) ++left;
				while (right && left<=right && dataset_get(ind[right],cutfeat)>=cutval) --right;
				if (left>right || !right) break;  // "!right" was added to support unsigned Index types
				std::swap(ind[left], ind[right]);
				++left;
				--right;
			}
			/* If either list is empty, it means that all remaining features
			 * are identical. Split in the middle to maintain a balanced tree.
			 */
			lim1 = left;
			right = count-1;
			for (;; ) {
				while (left<=right && dataset_get(ind[left],cutfeat)<=cutval) ++left;
				while (right && left<=right && dataset_get(ind[right],cutfeat)>cutval) --right;
				if (left>right || !right) break;  // "!right" was added to support unsigned Index types
				std::swap(ind[left], ind[right]);
				++left;
				--right;
			}
			lim2 = left;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x10cf1
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x49(%rbp)
ja 0x10d2c
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
callq 0x105e0
movaps %xmm0, %xmm1
movq -0x28(%rbp), %rax
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
seta %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x10d35
jmp 0x10d43
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x10cf1
jmp 0x10d45
xorl %eax, %eax
cmpq $0x0, -0x40(%rbp)
movb %al, -0x4a(%rbp)
je 0x10d85
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x4a(%rbp)
ja 0x10d85
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
callq 0x105e0
movq -0x28(%rbp), %rax
ucomiss (%rax), %xmm0
setae %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
testb $0x1, %al
jne 0x10d8e
jmp 0x10d9c
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x10d45
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
ja 0x10dad
cmpq $0x0, -0x40(%rbp)
jne 0x10daf
jmp 0x10def
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x10f20
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x10cef
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x10e08
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x4b(%rbp)
ja 0x10e43
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
callq 0x105e0
movaps %xmm0, %xmm1
movq -0x28(%rbp), %rax
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
setae %al
movb %al, -0x4b(%rbp)
movb -0x4b(%rbp), %al
testb $0x1, %al
jne 0x10e4c
jmp 0x10e5a
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x10e08
jmp 0x10e5c
xorl %eax, %eax
cmpq $0x0, -0x40(%rbp)
movb %al, -0x4c(%rbp)
je 0x10e9c
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x4c(%rbp)
ja 0x10e9c
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
callq 0x105e0
movq -0x28(%rbp), %rax
ucomiss (%rax), %xmm0
seta %al
movb %al, -0x4c(%rbp)
movb -0x4c(%rbp), %al
testb $0x1, %al
jne 0x10ea5
jmp 0x10eb3
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x10e5c
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
ja 0x10ec4
cmpq $0x0, -0x40(%rbp)
jne 0x10ec6
jmp 0x10f06
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x10f20
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x10e06
movq -0x38(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)