// File: miniplane[P]mintree/./BpTree.h
// Function: BpTree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 2ul>::Node::split()
Node *split() { // splits one Node in two

			size_t splitpoint = elements/2;

			Node * const left = this;
			Node *right = new Node(parent);

			right->leaf = left->leaf; // right is the same (inner or leaf) as left
			int z = leaf == false;

			for (size_t j = splitpoint+z; j < elements+1; j++)  {
				if (!leaf) {
					left->children[j]->parent = right; // copys children (one child more than value)
					right->children[right->elements] = left->children[j];
				}
				if (j<elements) {
					right->keys[right->elements] = left->keys[j]; // copies values
					right->elements++;
				}
			}

			left->elements = splitpoint; // sets new value for elements

			if (leaf) { // resets pointers to next and previous children
				right->next() = left->next();
				left->next() = right;
				right->previous() = left; 
				if (right->next() != nullptr)
					right->next()->previous() = right; 
			}
			return right;
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x50(%rbp)
callq 0x31d0
movq -0x50(%rbp), %rdi
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq 0xb8(%rax), %rcx
shrq %rcx
movq %rcx, -0x10(%rbp)
movq %rax, -0x18(%rbp)
movl $0xc8, %edi
callq 0x3250
movq %rax, %rdi
movq -0x48(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x40(%rbp)
movq (%rax), %rsi
callq 0x4dd0
jmp 0x5e85
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rcx
movb 0xc0(%rcx), %dl
movq -0x20(%rbp), %rcx
andb $0x1, %dl
movb %dl, 0xc0(%rcx)
movb 0xc0(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0xb8(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x5fbb
movq -0x48(%rbp), %rax
testb $0x1, 0xc0(%rax)
jne 0x5f4f
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x8(%rax,%rdx,8), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq -0x20(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0xb8(%rcx), %rcx
movq %rdx, 0x8(%rax,%rcx,8)
jmp 0x5f4f
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0xc8, %esi
callq 0x3270
jmp 0x6066
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rax
cmpq 0xb8(%rcx), %rax
jae 0x5fa8
movq -0x18(%rbp), %rsi
addq $0x38, %rsi
movq -0x38(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
movq -0x20(%rbp), %rax
movq 0xb8(%rax), %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x3040
movq -0x20(%rbp), %rax
movq 0xb8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xb8(%rax)
jmp 0x5faa
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x5ed0
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq %rdx, 0xb8(%rcx)
testb $0x1, 0xc0(%rax)
je 0x605c
movq -0x18(%rbp), %rdi
callq 0x56b0
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
callq 0x56b0
movq -0x68(%rbp), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x56b0
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
callq 0x5680
movq -0x58(%rbp), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x56b0
cmpq $0x0, (%rax)
je 0x605a
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x56b0
movq (%rax), %rdi
callq 0x5680
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x605c
movq -0x20(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x33d0
nop