// File: /workspace/github_cpp_makefile_star2_O3/jaxonwang[P]suffixtree/main.cc
// Function: SuffixTreeBase::break_edge(InternalNode*&, char, unsigned long)
internal_node_ptr break_edge(internal_node_ptr &edge_owner, const CharT c,
                               const size_type pos) {
    // break edge[start, end] into [start, pos] [post+1, end]
    auto real_node = edge_owner;
    auto &e = real_node->adj_edges[c];
    auto edge_pair = e->break_edge(pos);
    auto first_edge = move(edge_pair.first);
    auto second_edge = move(edge_pair.second);
    std::unique_ptr<InternalNode> new_internal_ptr{new InternalNode()};
    internal_node_ptr new_internal = new_internal_ptr.get();
    node_holder.push_back(move(new_internal_ptr));

    const CharT breakpoint_c = text[pos + 1];
    new_internal->children[breakpoint_c] = real_node->children[c];
    new_internal->adj_edges[breakpoint_c] = move(second_edge);

    real_node->children[c] = new_internal;
    real_node->adj_edges[c] = move(first_edge);
    return new_internal;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rdi, %r12
leaq -0x29(%rbp), %rax
movb %dl, (%rax)
movq (%rsi), %r13
leaq 0x40(%r13), %rdi
movq %rdi, -0x58(%rbp)
movq %rax, %rsi
callq 0x3416
movq (%rax), %rsi
movq (%rsi), %rax
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq *0x28(%rax)
movq (%r14), %rax
movq %rax, -0x40(%rbp)
movq 0x8(%r14), %r15
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl $0x80, %edi
callq 0x21a0
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x60(%rax)
movaps %xmm0, 0x70(%rax)
addq $0x38, %rax
movq %rax, 0x8(%r14)
movl $0x1, %eax
movq %rax, 0x10(%r14)
movups %xmm0, 0x18(%r14)
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x28(%r14)
movups %xmm0, 0x30(%r14)
leaq 0x70(%r14), %rdx
movq %rdx, 0x40(%r14)
movq %rax, 0x48(%r14)
movups %xmm0, 0x50(%r14)
movl %ecx, 0x60(%r14)
movups %xmm0, 0x68(%r14)
leaq 0x4a04(%rip), %rax      # 0x7c30
movq %rax, (%r14)
leaq 0x30(%r12), %rdi
leaq -0x38(%rbp), %rsi
movq %r14, (%rsi)
callq 0x2eb0
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x324f
movq (%rdi), %rax
callq *0x8(%rax)
movq (%r12), %rax
movb 0x1(%rax,%rbx), %al
movb %al, -0x38(%rbp)
addq $0x8, %r13
leaq -0x29(%rbp), %rsi
movq %r13, %rdi
callq 0x394e
leaq 0x8(%r14), %rdi
movq (%rax), %rbx
leaq -0x38(%rbp), %rsi
callq 0x394e
movq %r14, %rdi
addq $0x40, %rdi
movq %rbx, (%rax)
leaq -0x38(%rbp), %rsi
callq 0x3416
movq (%rax), %rdi
movq %r15, (%rax)
testq %rdi, %rdi
je 0x329e
movq (%rdi), %rax
callq *0x8(%rax)
xorl %r15d, %r15d
leaq -0x29(%rbp), %rsi
movq %r13, %rdi
callq 0x394e
movq %r14, (%rax)
xorl %r15d, %r15d
leaq -0x29(%rbp), %rsi
movq -0x58(%rbp), %rdi
callq 0x3416
movq (%rax), %rdi
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
testq %rdi, %rdi
je 0x32d5
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x32e4
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, -0x48(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x32fb
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x3326
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x3326
jmp 0x3323
movq %rax, %rbx
testq %r15, %r15
je 0x3334
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
cmpq $0x0, -0x40(%rbp)
je 0x3345
movq -0x40(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x3354
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, -0x48(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x336b
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x2290
nop