// File: /workspace/github_cpp_makefile_star2_O2/agorenst[P]trie/./radixtree.h
// Function: void node<int>::insert<std::reverse_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>>(std::reverse_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>)
void insert(Iter first, Iter last) {
                auto edge_iter = edge_to_follow(*first);

                // if no edge has any prefix with [first, last) then we make a new edge.
                if (edge_iter == edge_list.end()) {
                    edge to_add(std::list<T>(first, last), std::shared_ptr<node>(new node));
                    edge_list.push_back(to_add);
                    return;
                }

                auto edge_first = edge_iter->first.begin();
                auto edge_last = edge_iter->first.end();

                // this loop should always run at least once
                // we "consume" the common prefix between [edge_first, edge_list) and [first, last)
                std::list<T> prefix;
                while (first != last &&
                        edge_first != edge_last &&
                        (*edge_first) == (*first)) {
                    prefix.push_back(*first);
                    ++edge_first;
                    ++first;
                }
                assert(prefix.size() > 0);

                // this string is already included
                if (first == last && edge_first == edge_last) {
                    return;
                }
                // we input a superstring, ie, input = "abcde", edge = "abc"
                // recurse to the child
                if (first != last && edge_first == edge_last) {
                    return edge_iter->second->insert(first, last);
                }
                // something about the input sequence means we have to make a new node.
                if (edge_first != edge_last) {
                    // we clip off the prefix, this creates a copy edge with only the suffix sequence
                    edge clipped_orig(std::list<T>(edge_first, edge_last), edge_iter->second);

                    // this creates the new intermediary node
                    edge prefix_edge(prefix, std::shared_ptr<node>(new node(std::list<edge>{clipped_orig})));

                    edge_list.erase(edge_iter); // erase the old copy of our edge

                    edge_list.push_back(prefix_edge); // ok, we've rebuilt the tree with the new node.

                    if (first != last) {
                        prefix_edge.second->insert(first, last);
                    }
                    return;

                }
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rax
movl -0x4(%rax), %esi
callq 0x2c62
cmpq %rbx, %rax
je 0x292f
movq %rbx, -0x68(%rbp)
leaq 0x10(%rax), %r13
movq %rax, -0x38(%rbp)
movq 0x10(%rax), %rbx
leaq -0xa0(%rbp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
andq $0x0, 0x10(%r12)
movq (%r15), %rsi
movq (%r14), %rcx
cmpq %rcx, %rsi
setne %al
je 0x29c7
cmpq %r13, %rbx
je 0x29c7
movl 0x10(%rbx), %eax
cmpl -0x4(%rsi), %eax
jne 0x29c5
addq $-0x4, %rsi
movq %r12, %rdi
callq 0x2ce2
movq (%rbx), %rbx
movq (%r15), %rsi
addq $-0x4, %rsi
movq %rsi, (%r15)
jmp 0x28f0
movq (%r15), %rax
leaq -0x148(%rbp), %rsi
movq %rax, (%rsi)
movq (%r14), %rax
leaq -0x140(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x60(%rbp), %rdi
leaq -0x118(%rbp), %rcx
callq 0x2c82
pushq $0x18
popq %rdi
callq 0x2120
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x25e4
leaq -0xc8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x2e9c
leaq -0x80(%rbp), %rdi
callq 0x2546
leaq -0x60(%rbp), %rdi
callq 0x2710
leaq -0xc8(%rbp), %rsi
movq %rbx, %rdi
callq 0x2cd2
leaq -0xc8(%rbp), %rdi
callq 0x26f0
jmp 0x2b69
movb $0x1, %al
cmpq $0x0, -0x90(%rbp)
je 0x2b7b
cmpq %rcx, %rsi
movq -0x38(%rbp), %r12
jne 0x29e7
cmpq %r13, %rbx
je 0x2b5d
cmpq %r13, %rbx
sete %dl
andb %dl, %al
cmpb $0x1, %al
jne 0x2a19
movq 0x28(%r12), %rdi
leaq -0x138(%rbp), %rax
movq %rsi, (%rax)
leaq -0x130(%rbp), %rdx
movq %rcx, (%rdx)
movq %rax, %rsi
callq 0x289a
jmp 0x2b5d
cmpq %r13, %rbx
je 0x2b5d
leaq -0x60(%rbp), %rdi
leaq -0x118(%rbp), %rcx
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2cf2
movq %r12, %rsi
addq $0x28, %rsi
leaq -0xd8(%rbp), %rbx
movq %rbx, %rdi
callq 0x30d4
leaq -0xc8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movq %rbx, %rdx
callq 0x2e9c
leaq -0xd0(%rbp), %rdi
callq 0x2546
leaq -0x60(%rbp), %rdi
callq 0x2710
pushq $0x18
popq %rdi
callq 0x2120
movq %rax, %r13
leaq -0x118(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x3112
leaq -0xf0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
pushq $0x1
popq %rdx
leaq -0x29(%rbp), %rcx
callq 0x2d26
movb $0x1, %r12b
leaq -0xf0(%rbp), %rsi
movq %r13, %rdi
callq 0x3180
xorl %r12d, %r12d
leaq -0x78(%rbp), %rdi
movq %r13, %rsi
callq 0x25e4
leaq -0x60(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x2e9c
leaq -0x70(%rbp), %rdi
callq 0x2546
leaq -0xf0(%rbp), %rdi
callq 0x26b6
leaq -0x118(%rbp), %rdi
callq 0x26f0
movq -0x68(%rbp), %rbx
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x2d60
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x2cd2
movq (%r15), %rcx
movq (%r14), %rax
cmpq %rax, %rcx
je 0x2b48
movq -0x48(%rbp), %rdi
leaq -0x128(%rbp), %rsi
movq %rcx, (%rsi)
leaq -0x120(%rbp), %rdx
movq %rax, (%rdx)
callq 0x289a
leaq -0x60(%rbp), %rdi
callq 0x26f0
leaq -0xc8(%rbp), %rdi
callq 0x26f0
leaq -0xa0(%rbp), %rdi
callq 0x2710
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x157c(%rip), %rdi      # 0x40fe
leaq 0x1587(%rip), %rsi      # 0x4110
leaq 0x158e(%rip), %rcx      # 0x411e
pushq $0x38
popq %rdx
callq 0x20d0
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2546
xorl %r12d, %r12d
jmp 0x2bea
movq %rax, %rbx
movb $0x1, %r12b
jmp 0x2bf6
movq %rax, %rbx
jmp 0x2c07
movq %rax, %rbx
jmp 0x2c0f
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2546
leaq -0x60(%rbp), %rdi
callq 0x2710
jmp 0x2c4d
jmp 0x2c4a
jmp 0x2c4a
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x26f0
jmp 0x2c0f
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x26b6
leaq -0x118(%rbp), %rdi
callq 0x26f0
testb %r12b, %r12b
je 0x2c0f
movq %r13, %rdi
callq 0x2100
leaq -0xc8(%rbp), %rdi
callq 0x26f0
jmp 0x2c4d
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x26f0
jmp 0x2c59
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x2546
jmp 0x2c44
movq %rax, %rbx
jmp 0x2c59
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
jmp 0x2c54
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x2710
movq %rbx, %rdi
callq 0x21a0
nop