// 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_between(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_between(const aggregator_type& ag,
				    node *first, node *last)
    {
	if (is_header(first))
	    return ag.nothing();

	// This special case works, because last is the parent of the
	// root. The sum will include the root's right subtree iff the
	// path to first is left of the root
	if (is_header(last))
	    return ag.combine(ag.summarize(first->value),
			      sum_from(ag, first, last));

	if (first == last)
	    return ag.nothing();

	node *c = concestor(first, last);

	summary_type sum = ag.summarize(first->value);

	sum = ag.combine(sum, sum_from(ag, first, c));

	if ((c != last) && (c != first))
	    sum = ag.combine(sum, c->value);

	sum = ag.combine(sum, sum_to(ag, last, c));

	return sum;
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x50(%rsp), %rdi
callq 0x38e0
testb $0x1, %al
jne 0x3743
jmp 0x3756
movq 0x58(%rsp), %rdi
callq 0x3900
movl %eax, 0x64(%rsp)
jmp 0x38d1
movq 0x48(%rsp), %rdi
callq 0x38e0
testb $0x1, %al
jne 0x3766
jmp 0x37b8
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x3950
movl %eax, 0x44(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x3980
movq 0x18(%rsp), %rdi
movl %eax, 0x40(%rsp)
leaq 0x44(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x3920
movl %eax, 0x64(%rsp)
jmp 0x38d1
movq 0x50(%rsp), %rax
cmpq 0x48(%rsp), %rax
jne 0x37d7
movq 0x58(%rsp), %rdi
callq 0x3900
movl %eax, 0x64(%rsp)
jmp 0x38d1
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3ab0
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x3950
movl %eax, 0x64(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x3980
movq 0x10(%rsp), %rdi
movl %eax, 0x30(%rsp)
leaq 0x64(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x3920
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x64(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x48(%rsp), %rax
je 0x3891
movq 0x38(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x3891
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x3b60
movq 0x8(%rsp), %rdi
leaq 0x64(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x3920
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x64(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x3b80
movq (%rsp), %rdi
movl %eax, 0x20(%rsp)
leaq 0x64(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x3920
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw (%rax,%rax)