// 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>>>::sum_from(aggregator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>, summary> const&, 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*)
static summary_type sum_from(const aggregator_type& ag,
				 node *start, node *root)
    {
	summary_type sum = ag.nothing();
	node *n = start;

	while (n != root) {
	    if (n != start)
		sum = ag.combine(sum, n->value);

	    sum = ag.combine(sum, sum_tree(ag, n->right));

	    // Ascend to an ancestor which is lexicographically after n.
	    while (is_right_child(n) && n->parent != root)
		n = n->parent;

	    n = n->parent;
	}

	return sum;
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x48(%rsp), %rdi
callq 0x3900
movl %eax, 0x54(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0x3a9c
movq 0x30(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x3a00
movq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x3b60
movq 0x18(%rsp), %rdi
leaq 0x54(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x3920
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x54(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rsi
callq 0x3d00
movq 0x10(%rsp), %rdi
movl %eax, 0x20(%rsp)
leaq 0x54(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x3920
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x54(%rsp)
movq 0x30(%rsp), %rdi
callq 0x3e00
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0x3a5a
jmp 0x3a6f
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rax
cmpq 0x38(%rsp), %rax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x3a79
jmp 0x3a89
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x3a41
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x39ab
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
nop