// File: /workspace/github_cpp_makefile_star2_O3/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, -0x38(%rbp)
movq %rdi, %rbx
movq %rsi, -0x60(%rbp)
movq (%rsi), %rax
movl -0x4(%rax), %ecx
movq %rdi, %r12
movq (%r12), %r12
cmpq %rbx, %r12
je 0x2a0d
movq 0x10(%r12), %r13
cmpl %ecx, 0x10(%r13)
jne 0x2944
leaq -0x50(%rbp), %r15
movq %r15, 0x8(%r15)
movq %r15, (%r15)
movq $0x0, 0x10(%r15)
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
cmpq %rax, %rcx
je 0x2daf
leaq 0x10(%r12), %r14
cmpq %r14, %r13
je 0x2daf
movl 0x10(%r13), %edx
cmpl -0x4(%rax), %edx
jne 0x2b0b
addq $-0x4, %rax
movq %rax, %r15
movl $0x18, %edi
callq 0x2110
movl (%r15), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
leaq -0x50(%rbp), %rsi
callq 0x2040
movq -0x40(%rbp), %rsi
incq %rsi
movq %rsi, -0x40(%rbp)
movq (%r13), %r13
movq -0x60(%rbp), %rcx
movq (%rcx), %rdi
leaq -0x4(%rdi), %rax
movq %rax, (%rcx)
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
cmpq %rcx, %rax
setne %dl
je 0x29fd
cmpq %r14, %r13
je 0x29fd
movl 0x10(%r13), %edx
leaq -0x8(%rdi), %r15
cmpl -0x8(%rdi), %edx
je 0x29a1
movb $0x1, %dl
testq %rsi, %rsi
sete %sil
leaq -0x50(%rbp), %r15
jmp 0x2b10
leaq -0x150(%rbp), %rsi
movq %rax, (%rsi)
movq -0x38(%rbp), %rax
movq (%rax), %rax
leaq -0x148(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x88(%rbp), %r14
leaq -0x108(%rbp), %rcx
movq %r14, %rdi
callq 0x2f10
movl $0x18, %edi
callq 0x2110
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
leaq -0xb0(%rbp), %rdi
movq %rax, -0x8(%rdi)
movq %rax, %rsi
callq 0x2674
leaq -0xe0(%rbp), %rdi
leaq -0x88(%rbp), %r15
leaq -0xb8(%rbp), %rdx
movq %r15, %rsi
callq 0x305a
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x2a98
callq 0x25fa
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x2ab4
movq (%rdi), %r14
callq 0x20f0
movq %r14, %rdi
cmpq %r15, %r14
jne 0x2aa4
leaq -0xe0(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x313c
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2040
incq 0x10(%rbx)
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x2ae6
callq 0x25fa
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d9d
movq (%rdi), %rbx
callq 0x20f0
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x2af6
jmp 0x2d9d
movb $0x1, %sil
movb $0x1, %dl
testb %sil, %sil
jne 0x2daf
cmpq %rcx, %rax
jne 0x2b27
cmpq %r14, %r13
je 0x2d84
cmpq %r14, %r13
sete %sil
andb %sil, %dl
cmpb $0x1, %dl
jne 0x2b59
movq 0x28(%r12), %rdi
leaq -0x140(%rbp), %rsi
movq %rax, (%rsi)
leaq -0x138(%rbp), %rdx
movq %rcx, (%rdx)
callq 0x291c
jmp 0x2d84
cmpq %r14, %r13
je 0x2d84
leaq -0x88(%rbp), %rdi
leaq -0x108(%rbp), %rcx
movq %r13, %rsi
movq %r14, %rdx
callq 0x2f76
movq 0x28(%r12), %rax
movq %rax, -0x98(%rbp)
movq 0x30(%r12), %rax
movq %rax, -0x90(%rbp)
testq %rax, %rax
je 0x2bad
movq 0x3429(%rip), %rcx      # 0x5fc8
cmpb $0x0, (%rcx)
je 0x2ba9
incl 0x8(%rax)
jmp 0x2bad
lock
incl 0x8(%rax)
leaq -0xe0(%rbp), %rdi
leaq -0x88(%rbp), %r14
leaq -0x98(%rbp), %rdx
movq %r14, %rsi
callq 0x305a
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x2bdb
callq 0x25fa
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x2bf7
movq (%rdi), %r15
callq 0x20f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2be7
movl $0x18, %edi
callq 0x2110
leaq -0x108(%rbp), %rdi
leaq -0xe0(%rbp), %r13
movq %r13, %rsi
movq %rax, -0x58(%rbp)
callq 0x31c6
leaq -0x120(%rbp), %rdi
leaq -0x108(%rbp), %r14
leaq -0x29(%rbp), %rcx
movl $0x1, %edx
movq %r14, %rsi
callq 0x2fc6
movb $0x1, %al
movl %eax, -0x30(%rbp)
leaq -0x120(%rbp), %rsi
movq -0x58(%rbp), %r15
movq %r15, %rdi
callq 0x324e
leaq -0xa0(%rbp), %rdi
movq %r15, -0x8(%rdi)
movl $0x0, -0x30(%rbp)
movq %r15, %rsi
callq 0x2674
leaq -0x88(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x305a
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x2c94
callq 0x25fa
leaq -0x120(%rbp), %rdi
callq 0x2738
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x2cb1
callq 0x25fa
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x2ccd
movq (%rdi), %r15
callq 0x20f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2cbd
movq %rbx, %rdi
movq %r12, %rsi
callq 0x32d0
leaq -0x88(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x313c
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2040
incq 0x10(%rbx)
movq -0x60(%rbp), %rax
movq (%rax), %rcx
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq %rax, %rcx
je 0x2d29
movq -0x70(%rbp), %rdi
leaq -0x130(%rbp), %rsi
movq %rcx, (%rsi)
leaq -0x128(%rbp), %rdx
movq %rax, (%rdx)
callq 0x291c
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
leaq -0x50(%rbp), %r15
je 0x2d3b
callq 0x25fa
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d57
movq (%rdi), %rbx
callq 0x20f0
movq %rbx, %rdi
cmpq %r14, %rbx
jne 0x2d47
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x2d68
callq 0x25fa
movq -0xe0(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d84
movq (%rdi), %rbx
callq 0x20f0
movq %rbx, %rdi
cmpq %r13, %rbx
jne 0x2d74
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x2d9d
movq (%rdi), %rbx
callq 0x20f0
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0x2d8d
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1348(%rip), %rdi      # 0x40fe
leaq 0x1353(%rip), %rsi      # 0x4110
leaq 0x135a(%rip), %rcx      # 0x411e
movl $0x38, %edx
callq 0x20b0
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x2de2
callq 0x25fa
xorl %r14d, %r14d
jmp 0x2e66
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x27ae
jmp 0x2e83
movq %rax, %rbx
jmp 0x2e83
movq %rax, %rbx
jmp 0x2e8c
movq %rax, %rbx
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x2e1f
callq 0x25fa
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x2eea
movq (%rdi), %r15
callq 0x20f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2e2f
jmp 0x2eea
jmp 0x2ee7
jmp 0x2ee7
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x27ae
jmp 0x2e8c
movl -0x30(%rbp), %r14d
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x2738
leaq -0x108(%rbp), %rdi
callq 0x27ae
testb %r14b, %r14b
je 0x2e8c
movq -0x58(%rbp), %rdi
callq 0x20f0
leaq -0xe0(%rbp), %rdi
callq 0x27ae
jmp 0x2eea
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x27ae
jmp 0x2f07
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x2ec9
callq 0x25fa
jmp 0x2ec9
movq %rax, %rbx
jmp 0x2f07
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x2f07
movq (%rdi), %r15
callq 0x20f0
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2ed5
jmp 0x2f07
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x50(%rbp), %r15
cmpq %r15, %rdi
je 0x2f07
movq (%rdi), %r14
callq 0x20f0
movq %r14, %rdi
cmpq %r15, %r14
jne 0x2ef7
movq %rbx, %rdi
callq 0x21b0
nop