// File: /workspace/github_cpp_makefile_star2_O2/planaria[P]cb_tree/./include/cb_tree/detail/cb_tree_base.hpp
// Function: cb_tree::detail::cb_tree_base<cb_tree::cb_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::unique_ptr<counter, std::default_delete<counter>>, cb_tree::cb_key_traits<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>>, cb_tree::cb_key_traits<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>>>>::erase(cb_tree::detail::cb_iterator<cb_tree::detail::cb_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>>>>, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>> const, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>> const&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<counter, std::default_delete<counter>>> const*>)
iterator erase(const_iterator it)
			{
				assert(it != end());

				node_pointer node = it.node();
				node_pointer next = node->next_leaf();

				node->destroy_value(node_allocator());
				--size_;

				if (node == begin_node())
					begin_node() = next;

				do
				{
					if (!node->left() && !node->right())
					{
						if (node->is_left_child())
							node->parent()->left() = nullptr;
						else
							node->parent()->right() = nullptr;

						node_pointer parent = node->parent();
						destroy_node(node);
						node = parent;
					}
					else if (!node->left())
					{
						if (node->is_left_child())
							node->parent()->left() = node->right();
						else
							node->parent()->right() = node->right();

						node->right()->parent() = node->parent();

						destroy_node(node);
						break;
					}
					else if (!node->right())
					{
						if (node->is_left_child())
							node->parent()->left() = node->left();
						else
							node->parent()->right() = node->left();

						node->left()->parent() = node->parent();

						destroy_node(node);
						break;
					}
				} while (!node->leaf());

				return iterator(next);
			}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %rsi, (%r14)
callq 0xed8a
movq %r14, %rdi
movq %rax, %rsi
callq 0xeeca
testb %al, %al
je 0xee9b
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xebae
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
callq 0xeefc
decq 0x18(%rbx)
cmpq (%rbx), %r15
jne 0xedff
movq %r14, (%rbx)
movq (%r15), %rcx
movq 0x10(%r15), %rax
testq %rcx, %rcx
je 0xee12
testq %rax, %rax
jne 0xee3d
jmp 0xee46
testq %rax, %rax
jne 0xee4e
movq 0x18(%r15), %rax
xorl %ecx, %ecx
cmpq %r15, (%rax)
setne %cl
shll $0x4, %ecx
andq $0x0, (%rax,%rcx)
movq 0x18(%r15), %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0xed02
movq %r12, %r15
cmpb $0x0, 0x8(%r15)
je 0xedff
jmp 0xee7c
movq %rcx, %rax
movq %r15, %rcx
jmp 0xee52
leaq 0x10(%r15), %rcx
movq 0x18(%r15), %rdx
xorl %esi, %esi
cmpq %r15, (%rdx)
setne %sil
shll $0x4, %esi
movq %rax, (%rdx,%rsi)
movq 0x18(%r15), %rax
movq (%rcx), %rcx
movq %rax, 0x18(%rcx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xed02
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9be
movq (%rbx), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x3481a(%rip), %rdi     # 0x436bc
leaq 0x311e4(%rip), %rsi     # 0x4008d
leaq 0x34818(%rip), %rcx     # 0x436c8
movl $0x152, %edx            # imm = 0x152
callq 0xa280