// File: dlbeer[P]summary_map/./summary_map.hpp
// Function: summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::add_node(std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> const&, std::allocator<summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node>&, summary_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, summary, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>::node*, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int> const&)
static std::pair<node *, bool>
    add_node(const key_compare& cmp, node_allocator& alloc,
	     node *header, const value_type& val)
    {
	node **nptr = &header->left;
	node *p = header;

	// Keep descending until we find a null down-pointer
	while (*nptr) {
	    node *c = *nptr;

	    invalidate(c);

	    if (cmp(val.first, c->value.first))
		nptr = &c->left;
	    else if (cmp(c->value.first, val.first))
		nptr = &c->right;
	    else
		return std::make_pair(c, false);

	    p = c;
	}

	// Attach a new node to the tree
	node *c = new_node(alloc, val);

	*nptr = c;
	c->parent = p;

	// Perform rebalancing
	rebalance_after_insert(c);

	return std::make_pair(c, true);
    }

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq 0x60(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x50(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax)
je 0x44d2
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x45d0
movq 0x70(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x3c30
testb $0x1, %al
jne 0x4453
jmp 0x4463
movq 0x40(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x50(%rsp)
jmp 0x44c3
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x3c30
testb $0x1, %al
jne 0x447d
jmp 0x448d
movq 0x40(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x50(%rsp)
jmp 0x44c1
movb $0x0, 0x3f(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x3f(%rsp), %rsi
callq 0x45f0
movb %dl, 0x30(%rsp)
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x78(%rsp)
movb 0x30(%rsp), %al
movb %al, 0x80(%rsp)
jmp 0x453d
jmp 0x44c3
movq 0x40(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x4413
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x3c60
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x20(%rsp), %rdi
callq 0x3d10
movb $0x1, 0x1f(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x1f(%rsp), %rsi
callq 0x45f0
movb %dl, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x78(%rsp)
movb 0x10(%rsp), %al
movb %al, 0x80(%rsp)
movq 0x78(%rsp), %rax
movb 0x80(%rsp), %dl
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)