// File: /workspace/github_cpp_makefile_star2_O1/miniplane[P]mintree/./BpTree.h
// Function: BpTree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 2ul>::Node::borrow_from_node(BpTree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 2ul>::Node*, unsigned long, bool)
void borrow_from_node(Node* other, size_t pos_in_parent, bool borrow_from_previous) {

			if (borrow_from_previous) {
				push_left(parent->keys[pos_in_parent-1]); // inserts val from parent at the beginning

				for (size_t i = elements; i > 0; i--) // inserts child at beginning
					children[i] = children[i-1];

				children[0] = other->children[other->elements]; // moves child from left to right
				children[0]->parent = this;
				parent->keys[pos_in_parent-1] = other->pop_right(); // puts key from left in parent
			}
			else { // borrow from next
				push_right(parent->keys[pos_in_parent]); // inserts val from parent at the end
				children[elements] = other->children[0]; // adds child from right node
				children[elements]->parent = this;

				for (size_t i = 0; i < other->elements; i++) // rearrange children from other node
					other->children[i] = other->children[i+1];
				
				parent->keys[pos_in_parent] = other->pop_left();
			}
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %ecx, %r12d
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x2150
movq (%r14), %rax
addq $0x38, %rax
testl %r12d, %r12d
je 0x4848
decq %rbx
shlq $0x5, %rbx
leaq -0x60(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq %rcx, -0x10(%rcx)
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x346e
movq 0xb8(%r14), %r13
leaq 0x1(%r13), %rax
movq %rax, 0xb8(%r14)
testq %r13, %r13
je 0x478c
movq %r13, %rax
shlq $0x5, %rax
leaq (%rax,%r14), %r12
addq $0x38, %r12
movq %r12, %rdi
addq $-0x20, %r12
movq %r12, %rsi
callq 0x20f0
decq %r13
jne 0x4778
leaq 0x38(%r14), %rdi
leaq -0x70(%rbp), %rsi
callq 0x20f0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x47b2
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21d0
movq 0xb8(%r14), %rdx
testq %rdx, %rdx
je 0x47cf
leaq 0x8(%r14), %rsi
leaq 0x10(%r14), %rdi
shlq $0x3, %rdx
callq 0x2260
movq 0xb8(%r15), %rax
movq 0x8(%r15,%rax,8), %rcx
movq %rcx, 0x8(%r14)
movq %r14, (%rcx)
decq %rax
movq %rax, 0xb8(%r15)
shlq $0x5, %rax
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x38(%r15,%rax), %rsi
movq 0x40(%r15,%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %r15
movq %r15, %rdi
callq 0x346e
movq (%r14), %rax
leaq (%rax,%rbx), %rdi
addq $0x38, %rdi
movq %r15, %rsi
callq 0x2210
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x4839
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21d0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
shlq $0x5, %rbx
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %r12
movq %r12, %rdi
callq 0x346e
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
shlq $0x5, %rax
leaq (%r14,%rax), %rdi
addq $0x38, %rdi
movq %r12, %rsi
callq 0x20f0
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x48ad
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21d0
movq 0x8(%r15), %rax
movq 0xb8(%r14), %rcx
movq %rax, 0x8(%r14,%rcx,8)
movq %r14, (%rax)
movq 0xb8(%r15), %rdx
testq %rdx, %rdx
je 0x48dd
leaq 0x8(%r15), %rdi
leaq 0x10(%r15), %rsi
shlq $0x3, %rdx
callq 0x2260
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x38(%r15), %rsi
movq 0x40(%r15), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x346e
movq 0xb8(%r15), %r12
decq %r12
movq %r12, 0xb8(%r15)
je 0x4924
addq $0x38, %r15
movq %r15, %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0x20f0
decq %r12
jne 0x4910
movq (%r14), %rax
leaq (%rax,%rbx), %rdi
addq $0x38, %rdi
leaq -0x50(%rbp), %rbx
movq %rbx, %rsi
callq 0x2210
movq (%rbx), %rdi
cmpq %r13, %rdi
jne 0x482d
jmp 0x4839
jmp 0x4981
movq %rax, %rbx
movq -0x90(%rbp), %rdi
jmp 0x4961
movq %rax, %rbx
movq -0x50(%rbp), %rdi
movq %r13, -0x30(%rbp)
cmpq %r13, %rdi
je 0x4979
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22b0
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
jne 0x496a
jmp 0x4979
nop