LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::set_text(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>> const&, int)
void
FactorGraph::set_text(const string &text,
                      const string &start_end_symbol,
                      const map<string, flt_type> &vocab,
                      int maxlen)
{
    this->text.assign(text);
    this->start_end_symbol.assign(start_end_symbol);
    if (text.length() == 0) return;

    vector<unordered_set<fg_node_idx_t> > incoming(text.size()+1); // (pos in text, source pos)

    // Create all nodes
    incoming[0].insert(0);
    create_nodes(text, vocab, maxlen, incoming);

    // No possible segmentations
    if (incoming[text.size()].size() == 0) {
        nodes.clear();
        return;
    }

    prune_and_create_arcs(incoming);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r12d
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
callq 0x41c0
leaq 0x20(%rbx), %rdi
movq %r13, %rsi
callq 0x41c0
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0xe244
movq %r15, -0x38(%rbp)
incq %rsi
leaq -0x50(%rbp), %r13
leaq -0x58(%rbp), %r15
movq %r13, %rdi
movq %r15, %rdx
callq 0xffc0
movq (%r13), %rdi
leaq -0x2a(%rbp), %rsi
movw $0x0, (%rsi)
movq %rdi, (%r15)
leaq -0x58(%rbp), %rdx
callq 0x10960
leaq -0x50(%rbp), %r8
movq %rbx, %rdi
movq %r14, %rsi
movq -0x38(%rbp), %rdx
movl %r12d, %ecx
callq 0xe584
movq -0x50(%rbp), %rax
imulq $0x38, 0x8(%r14), %rcx
cmpq $0x0, 0x18(%rax,%rcx)
je 0xe216
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0xede0
jmp 0xe23b
movq 0x40(%rbx), %r15
movq 0x48(%rbx), %r12
cmpq %r15, %r12
je 0xe23b
movq %r15, %r14
movq %r14, %rdi
callq 0xfea4
addq $0x38, %r14
cmpq %r12, %r14
jne 0xe226
movq %r15, 0x48(%rbx)
leaq -0x50(%rbp), %rdi
callq 0x10060
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe255
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x10060
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::set_text(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, StringSet const&)
void
FactorGraph::set_text(const string &text,
                      const string &start_end_symbol,
                      const StringSet &vocab)
{
    this->text.assign(text);
    this->start_end_symbol.assign(start_end_symbol);
    if (text.length() == 0) return;

    vector<unordered_set<fg_node_idx_t> > incoming(text.size()+1); // (pos in text, source pos)

    // Create all nodes
    incoming[0].insert(0);
    create_nodes(text, vocab, incoming);

    // No possible segmentations
    if (incoming[text.size()].size() == 0) {
        nodes.clear();
        return;
    }

    prune_and_create_arcs(incoming);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
callq 0x41c0
leaq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x41c0
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0xe55e
incq %rsi
leaq -0x48(%rbp), %r12
leaq -0x50(%rbp), %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0xffc0
movq (%r12), %rdi
leaq -0x2a(%rbp), %rsi
movw $0x0, (%rsi)
movq %rdi, (%r13)
leaq -0x50(%rbp), %rdx
callq 0x10960
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xebf8
movq -0x48(%rbp), %rax
imulq $0x38, 0x8(%r14), %rcx
cmpq $0x0, 0x18(%rax,%rcx)
je 0xe530
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0xede0
jmp 0xe555
movq 0x40(%rbx), %r15
movq 0x48(%rbx), %r12
cmpq %r15, %r12
je 0xe555
movq %r15, %r14
movq %r14, %rdi
callq 0xfea4
addq $0x38, %r14
cmpq %r12, %r14
jne 0xe540
movq %r15, 0x48(%rbx)
leaq -0x48(%rbp), %rdi
callq 0x10060
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe56f
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x10060
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/defs.hh
// Function: get_character_positions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<unsigned int, std::allocator<unsigned int>>&, bool)
static void get_character_positions(const std::string &word,
                                    std::vector<unsigned int> &positions,
                                    bool utf8=false)
{
    if (utf8)
        get_character_positions_utf8(word, positions);
    else
        get_character_positions_onebyte(word, positions);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testl %edx, %edx
je 0xe850
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
cmpq %rax, %rsi
je 0xe82c
movq %rax, 0x8(%rbx)
movq %rax, %rsi
movl $0x0, -0x1c(%rbp)
cmpq 0x10(%rbx), %rsi
je 0xe8d9
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe8e5
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x40(%rbp), %rdi
callq 0x5f0e
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0xe878
movq %rax, 0x8(%rbx)
movl $0x0, -0x1c(%rbp)
movq -0x38(%rbp), %rax
cmpq $-0x1, %rax
je 0xe8c5
xorl %ecx, %ecx
leaq -0x1c(%rbp), %r14
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xe8a5
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe8b4
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1048c
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
incl %ecx
movl %ecx, -0x1c(%rbp)
leaq 0x1(%rax), %rdx
cmpq %rcx, %rdx
ja 0xe88f
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xe955
callq 0x4350
jmp 0xe955
leaq -0x1c(%rbp), %rdx
movq %rbx, %rdi
callq 0x102de
movl $0x0, -0x1c(%rbp)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0xe955
xorl %ecx, %ecx
leaq -0x1c(%rbp), %r15
movq (%r14), %rdx
movb (%rdx,%rcx), %sil
movl $0x1, %edx
testb %sil, %sil
jns 0xe923
movl $0x4, %edx
cmpb $-0x11, %sil
ja 0xe923
cmpb $-0x20, %sil
movl $0x2, %edx
sbbl $-0x1, %edx
addl %ecx, %edx
movl %edx, -0x1c(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xe93e
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xe94d
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1048c
movq 0x8(%r14), %rax
movl -0x1c(%rbp), %ecx
cmpq %rcx, %rax
ja 0xe8fb
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xe971
callq 0x4350
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::num_paths() const
int
FactorGraph::num_paths() const
{

    if (nodes.size() == 0) return 0;
    vector<int> path_counts(nodes.size());
    path_counts[0] = 1;

    for (unsigned int i=0; i<nodes.size(); i++) {
        const FactorGraph::Node &node = nodes[i];
        for (auto arc = node.outgoing.begin(); arc != node.outgoing.end(); ++arc)
            path_counts[(**arc).target_node] += path_counts[i];
    }

    return path_counts.back();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq 0x48(%rdi), %rsi
subq 0x40(%rdi), %rsi
je 0xf47b
movq %rdi, %rbx
sarq $0x3, %rsi
movabsq $0x6db6db6db6db6db7, %r15 # imm = 0x6DB6DB6DB6DB6DB7
imulq %r15, %rsi
leaq -0x38(%rbp), %r14
leaq -0x19(%rbp), %rdx
movq %r14, %rdi
callq 0x100b0
movq (%r14), %rdi
movl $0x1, (%rdi)
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
subq %rax, %rcx
je 0xf46d
sarq $0x3, %rcx
imulq %r15, %rcx
xorl %edx, %edx
imulq $0x38, %rdx, %r8
movq 0x20(%rax,%r8), %rsi
movq 0x28(%rax,%r8), %r8
cmpq %r8, %rsi
je 0xf463
movl (%rdi,%rdx,4), %r9d
movq (%rsi), %r10
movzwl 0x2(%r10), %r10d
addl %r9d, (%rdi,%r10,4)
addq $0x8, %rsi
jmp 0xf448
incq %rdx
movl %edx, %esi
cmpq %rsi, %rcx
ja 0xf43a
movq -0x30(%rbp), %rax
movl -0x4(%rax), %ebx
callq 0x4350
jmp 0xf47d
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::advance(std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, unsigned short) const
void
FactorGraph::advance(vector<vector<string> > &paths,
                     vector<string> &curr_string,
                     fg_node_idx_t node_idx) const
{
    const FactorGraph::Node &node = nodes[node_idx];

    std::string tmp;
    get_factor(node, tmp);
    curr_string.push_back(tmp);

    if (node_idx == nodes.size()-1) {
        paths.push_back(curr_string);
        return;
    }

    for (auto arc  = node.outgoing.begin(); arc != node.outgoing.end(); ++arc) {
        vector<string> curr_copy(curr_string);
        advance(paths, curr_copy, (**arc).target_node);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, -0x30(%rbp)
movq %rdi, %r15
movl %ecx, %r14d
imulq $0x38, %r14, %r12
addq 0x40(%rdi), %r12
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x50(%rbp), %rdx
movq %r12, %rsi
callq 0x10146
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x7f60
movq 0x48(%r15), %rax
subq 0x40(%r15), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rcx
decq %rcx
cmpq %r14, %rcx
jne 0xf551
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x10178
jmp 0xf595
movq 0x20(%r12), %r14
cmpq 0x28(%r12), %r14
je 0xf595
leaq -0x68(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x101b4
movq (%r14), %rax
movzwl 0x2(%rax), %ecx
movq %r15, %rdi
movq -0x30(%rbp), %rsi
movq %r13, %rdx
callq 0xf4d0
movq %r13, %rdi
callq 0x5d4e
addq $0x8, %r14
cmpq 0x28(%r12), %r14
jne 0xf561
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf5a7
callq 0x4350
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf5b8
movq %rax, %rbx
jmp 0xf5c9
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x5d4e
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xf5db
callq 0x4350
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::remove_arc(FactorGraph::Arc*)
void
FactorGraph::remove_arc(Arc *arc)
{
    auto ait = find(arcs.begin(), arcs.end(), arc);
    arcs.erase(ait);

    Node &src_node = nodes[(*arc).source_node];
    auto sit = find(src_node.outgoing.begin(), src_node.outgoing.end(), arc);
    src_node.outgoing.erase(sit);

    Node &tgt_node = nodes[(*arc).target_node];
    auto tit = find(tgt_node.incoming.begin(), tgt_node.incoming.end(), arc);
    tgt_node.incoming.erase(tit);

    delete arc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x18(%rbp), %rdx
movq %rsi, (%rdx)
movq 0x58(%rdi), %rdi
movq 0x60(%rbx), %rsi
callq 0x1158d
leaq 0x8(%rax), %rsi
movq 0x60(%rbx), %rdx
cmpq %rdx, %rsi
je 0xf622
subq %rsi, %rdx
movq %rax, %rdi
callq 0x45b0
movq 0x60(%rbx), %rdx
addq $-0x8, %rdx
movq %rdx, 0x60(%rbx)
leaq -0x18(%rbp), %rdx
movq (%rdx), %rax
movzwl (%rax), %eax
movq 0x40(%rbx), %rcx
imulq $0x38, %rax, %rax
leaq (%rcx,%rax), %r14
addq $0x20, %r14
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x1158d
leaq 0x8(%rax), %rsi
movq 0x8(%r14), %rdx
cmpq %rdx, %rsi
je 0xf66c
subq %rsi, %rdx
movq %rax, %rdi
callq 0x45b0
movq 0x8(%r14), %rdx
addq $-0x8, %rdx
movq %rdx, 0x8(%r14)
leaq -0x18(%rbp), %rdx
movq (%rdx), %rax
movzwl 0x2(%rax), %eax
movq 0x40(%rbx), %rcx
imulq $0x38, %rax, %rax
leaq (%rcx,%rax), %rbx
addq $0x8, %rbx
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x1158d
leaq 0x8(%rax), %rsi
movq 0x8(%rbx), %rdx
cmpq %rdx, %rsi
je 0xf6b7
subq %rsi, %rdx
movq %rax, %rdi
callq 0x45b0
movq 0x8(%rbx), %rdx
addq $-0x8, %rdx
movq %rdx, 0x8(%rbx)
movq -0x18(%rbp), %rdi
callq 0x4350
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::remove_arcs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void
FactorGraph::remove_arcs(const std::string &remstr)
{
    for (auto node = nodes.begin(); node != nodes.end(); ++node) {
        if (this->get_factor(*node) != remstr) continue;
        while (node->incoming.size() > 0)
            remove_arc(node->incoming[0]);
        while (node->outgoing.size() > 0)
            remove_arc(node->outgoing[0]);
    }

    // Prune all transitions from non-reachable nodes
    for (auto it = nodes.begin(); it != nodes.end(); it++) {
        if (it->incoming.size() == 0 && it->len > 0) {
            while (it->outgoing.size() > 0)
                remove_arc(it->outgoing[0]);
            continue;
        }
        if (it->outgoing.size() == 0 && it->len > 0) {
            while (it->incoming.size() > 0)
                remove_arc(it->incoming[0]);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x40(%rdi), %r14
cmpq 0x48(%rdi), %r14
je 0xf9bf
movq %rsi, %r15
movq %rdi, %rbx
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10242
movq -0x40(%rbp), %rdx
cmpq 0x8(%r15), %rdx
jne 0xf8f2
movq -0x48(%rbp), %r13
testq %rdx, %rdx
je 0xf8fb
movq (%r15), %rsi
movq %r13, %rdi
callq 0x43a0
testl %eax, %eax
setne %r12b
jmp 0xf8fe
movb $0x1, %r12b
movq -0x48(%rbp), %r13
jmp 0xf8fe
xorl %r12d, %r12d
leaq -0x38(%rbp), %rax
cmpq %rax, %r13
je 0xf90f
movq %r13, %rdi
callq 0x4350
testb %r12b, %r12b
jne 0xf940
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
je 0xf936
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xf5e4
jmp 0xf914
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xf5e4
movq 0x20(%r14), %rax
cmpq %rax, 0x28(%r14)
jne 0xf92b
addq $0x38, %r14
cmpq 0x48(%rbx), %r14
jne 0xf8bd
movq 0x40(%rbx), %r15
cmpq %r14, %r15
je 0xf9bf
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
cmpq %rax, %rcx
je 0xf9a1
movq 0x28(%r15), %rdx
cmpq 0x20(%r15), %rdx
jne 0xf995
cmpq %rax, %rcx
sete %cl
cmpb $0x0, 0x2(%r15)
sete %dl
orb %cl, %dl
jne 0xf995
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xf5e4
movq 0x8(%r15), %rax
cmpq %rax, 0x10(%r15)
jne 0xf980
addq $0x38, %r15
cmpq 0x48(%rbx), %r15
jne 0xf957
jmp 0xf9bf
cmpb $0x0, 0x2(%r15)
je 0xf964
movq 0x20(%r15), %rax
cmpq %rax, 0x28(%r15)
je 0xf995
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xf5e4
jmp 0xf9a8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::~MultiStringFactorGraph()
MultiStringFactorGraph::~MultiStringFactorGraph() {
    vector<Arc*> arcs;
    collect_arcs(arcs);
    for (auto it = arcs.begin(); it != arcs.end(); ++it)
        delete *it;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
callq 0x116ec
movq -0x30(%rbp), %r14
cmpq -0x28(%rbp), %r14
je 0x11689
movq (%r14), %rdi
callq 0x4350
addq $0x8, %r14
cmpq -0x28(%rbp), %r14
jne 0x11673
movq -0x30(%rbp), %r14
testq %r14, %r14
je 0x11696
movq %r14, %rdi
callq 0x4350
leaq 0xc8(%rbx), %rdi
callq 0x13baa
leaq 0x98(%rbx), %rdi
callq 0x13c0c
leaq 0x68(%rbx), %rdi
callq 0x13ca2
leaq 0x38(%rbx), %rdi
callq 0x13d36
leaq 0x20(%rbx), %rdi
callq 0x13582
movq (%rbx), %rdi
addq $0x10, %rbx
cmpq %rbx, %rdi
je 0x116da
callq 0x4350
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0x5c6c
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::num_paths(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
int
MultiStringFactorGraph::num_paths(const std::string &text) const
{
    if (nodes.size() == 0) return 0;
    if (string_end_nodes.find(text) == string_end_nodes.end()) return 0;
    msfg_node_idx_t end_node = string_end_nodes.at(text);
    map<msfg_node_idx_t, int> path_counts; path_counts[end_node] = 1;
    set<msfg_node_idx_t> nodes_to_process; nodes_to_process.insert(end_node);

    while(nodes_to_process.size() > 0) {

        msfg_node_idx_t i = *(nodes_to_process.rbegin());

        const Node &node = nodes[i];
        for (auto arc = node.incoming.begin(); arc != node.incoming.end(); ++arc) {
            path_counts[(**arc).source_node] += path_counts[i];
            nodes_to_process.insert((**arc).source_node);
        }

        nodes_to_process.erase(i);
    }

    return path_counts[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq 0x28(%rdi), %rax
xorl %r14d, %r14d
cmpq 0x20(%rdi), %rax
je 0x11ed2
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x38(%rdi), %r12
movq %r12, %rdi
callq 0x15326
leaq 0x40(%rbx), %rcx
cmpq %rcx, %rax
je 0x11ed2
movq %r12, %rdi
movq %r15, %rsi
callq 0x138da
movl (%rax), %eax
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
leaq -0x90(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0x98(%rbp), %rdi
callq 0x13938
movl $0x1, (%rax)
leaq -0x60(%rbp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x68(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x155c4
cmpq $0x0, -0x40(%rbp)
je 0x11ea4
leaq -0x68(%rbp), %r15
leaq -0x98(%rbp), %r13
movq %rbx, -0x38(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4210
movl 0x20(%rax), %eax
movl %eax, -0x2c(%rbp)
movq 0x20(%rbx), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %rbx
addq $0x28, %rbx
movq 0x10(%rbx), %r14
cmpq %rbx, %r14
je 0x11e7e
movq %r13, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x13938
movl (%rax), %r12d
movq 0x20(%r14), %rsi
movq %r13, %rdi
callq 0x13938
addl %r12d, (%rax)
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x155c4
movq %r14, %rdi
callq 0x4410
movq %rax, %r14
cmpq %rbx, %rax
jne 0x11e44
movq %r15, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x156e0
movq %r15, %rdi
movq %rax, %rsi
callq 0x15762
cmpq $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rbx
jne 0x11e1c
leaq -0x2c(%rbp), %rsi
movl $0x0, (%rsi)
leaq -0x98(%rbp), %rdi
callq 0x139a0
movl (%rax), %r14d
leaq -0x68(%rbp), %rdi
callq 0x13f0a
leaq -0x98(%rbp), %rdi
callq 0x13f62
movl %r14d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11eef
jmp 0x11eef
movq %rax, %rbx
jmp 0x11efb
jmp 0x11eef
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x13f0a
leaq -0x98(%rbp), %rdi
callq 0x13f62
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::get_paths(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&) const
void
MultiStringFactorGraph::get_paths(const string &text,
                                  vector<vector<string> > &paths) const
{
    if (string_end_nodes.find(text) == string_end_nodes.end()) return;
    msfg_node_idx_t end_node = string_end_nodes.at(text);
    vector<string> curr_string;
    advance(paths, curr_string, end_node);
    for (auto it = paths.begin(); it != paths.end(); ++it)
        std::reverse(it->begin(), it->end());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x38(%rdi), %r12
movq %r12, %rdi
callq 0x15326
leaq 0x40(%r14), %rcx
cmpq %rcx, %rax
je 0x11fc2
movq %r12, %rdi
movq %r15, %rsi
callq 0x138da
movl (%rax), %ecx
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11fe4
movq (%rbx), %r12
movq 0x8(%rbx), %rax
cmpq %rax, %r12
je 0x11fb9
movq (%r12), %r14
movq 0x8(%r12), %r15
cmpq %r15, %r14
setne %cl
addq $-0x20, %r15
cmpq %r14, %r15
seta %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x11fb3
movq %r14, %rdi
movq %r15, %rsi
callq 0x42a0
addq $0x20, %r14
addq $-0x20, %r15
cmpq %r15, %r14
jb 0x11f97
movq 0x8(%rbx), %rax
addq $0x18, %r12
jmp 0x11f72
leaq -0x40(%rbp), %rdi
callq 0x5d4e
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::advance(std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, unsigned int) const
void
MultiStringFactorGraph::advance(vector<vector<string> > &paths,
                                vector<string> &curr_string,
                                msfg_node_idx_t node_idx) const
{
    const MultiStringFactorGraph::Node &node = nodes[node_idx];
    curr_string.push_back(node.factor);

    if (node_idx == 0) {
        paths.push_back(curr_string);
        return;
    }

    for (auto arc = node.incoming.begin(); arc != node.incoming.end(); ++arc) {
        vector<string> curr_copy(curr_string);
        advance(paths, curr_copy, (**arc).source_node);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %rbx
movl %ecx, %r12d
shlq $0x7, %r12
movq %rdi, -0x30(%rbp)
addq 0x20(%rdi), %r12
movq %rdx, %rdi
movq %r12, %rsi
callq 0x7f60
testl %r14d, %r14d
je 0x12076
movq 0x38(%r12), %r13
addq $0x28, %r12
cmpq %r12, %r13
je 0x12067
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x101b4
movq 0x20(%r13), %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11fe4
movq %r14, %rdi
callq 0x5d4e
movq %r13, %rdi
callq 0x4410
movq %rax, %r13
cmpq %r12, %rax
jne 0x1202f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r15, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10178
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::print_paths(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void
MultiStringFactorGraph::print_paths(const string &text) const
{
    vector<vector<string> > paths;
    get_paths(text, paths);

    for (auto pathit = paths.begin(); pathit != paths.end(); ++pathit) {
        for (auto it = pathit->begin(); it != pathit->end(); ++it)
            cout << *it << " ";
        cout << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
callq 0x11f10
movq -0x40(%rbp), %r15
cmpq -0x38(%rbp), %r15
je 0x12143
movq 0x21ee5(%rip), %rbx     # 0x33fc0
leaq 0x142ae(%rip), %r14     # 0x26390
movq (%r15), %r12
cmpq 0x8(%r15), %r12
je 0x12112
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x4400
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4400
addq $0x20, %r12
jmp 0x120e5
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4260
addq $0x18, %r15
cmpq -0x38(%rbp), %r15
jne 0x120e2
leaq -0x40(%rbp), %rdi
callq 0x13a08
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1215d
jmp 0x1215d
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x13a08
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::remove_arc(MultiStringFactorGraph::Arc*)
void
MultiStringFactorGraph::remove_arc(Arc *arc)
{
    Node &src_node = nodes[(*arc).source_node];
    src_node.outgoing.erase(arc);

    Node &tgt_node = nodes[(*arc).target_node];
    tgt_node.incoming.erase(arc);

    delete arc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq -0x20(%rbp), %rbx
movq %rsi, (%rbx)
movl (%rsi), %eax
movq 0x20(%rdi), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %r15
addq $0x50, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x159da
movq %r15, %rdi
movq %rax, %rsi
callq 0x15a62
movq (%rbx), %rax
movl 0x4(%rax), %eax
movq 0x20(%r14), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %r14
addq $0x20, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x159da
movq %r14, %rdi
movq %rax, %rsi
callq 0x15a62
movq (%rbx), %rdi
callq 0x4350
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::remove_arcs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void
MultiStringFactorGraph::remove_arcs(const std::string &factor)
{
    if (factor.length() < 2) {
        cerr << "Trying to remove factor of length 1: " << factor << endl;
        exit(EXIT_FAILURE);
    }

    for (auto ndit = factor_node_map[factor].begin(); ndit != factor_node_map[factor].end(); ++ndit) {
        Node &node = nodes[*ndit];
        while (node.incoming.size() > 0)
            remove_arc(*(node.incoming.begin()));
        while (node.outgoing.size() > 0)
            remove_arc(*(node.outgoing.begin()));
    }

    factor_node_map.erase(factor);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpq $0x1, 0x8(%rsi)
jbe 0x122a5
movq %rdi, %r15
leaq 0x98(%rdi), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x13a58
movq (%rax), %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x13a58
cmpq 0x8(%rax), %r12
je 0x12281
movl (%r12), %eax
movq 0x20(%r15), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %r13
cmpq $0x0, 0x48(%rcx,%rax)
je 0x12274
movq 0x38(%r13), %rax
movq 0x20(%rax), %rsi
movq %r15, %rdi
callq 0x12172
cmpq $0x0, 0x48(%r13)
jne 0x1224b
jmp 0x12274
movq 0x68(%r13), %rax
movq 0x20(%rax), %rsi
movq %r15, %rdi
callq 0x12172
cmpq $0x0, 0x78(%r13)
jne 0x12264
addq $0x4, %r12
jmp 0x12222
movq %r14, %rdi
movq %rbx, %rsi
callq 0x15e68
movq %r14, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x15f24
movq 0x21d3c(%rip), %rdi     # 0x33fe8
leaq 0x144ac(%rip), %rsi     # 0x2675f
callq 0x4380
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4330
movq %rax, %rdi
callq 0x4180
movl $0x1, %edi
callq 0x4420
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::prune_unreachable()
void
MultiStringFactorGraph::prune_unreachable()
{
    for (auto it = nodes.begin(); it != nodes.end(); it++) {

        if (it->factor == start_end_symbol) continue;

        if (it->incoming.size() == 0)
            while (it->outgoing.size() > 0)
                remove_arc(*(it->outgoing.begin()));

        if (it->outgoing.size() == 0)
            while (it->incoming.size() > 0)
                remove_arc(*(it->incoming.begin()));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x20(%rdi), %r14
cmpq 0x28(%rdi), %r14
je 0x12359
movq %rdi, %rbx
movq 0x8(%r14), %rdx
cmpq 0x8(%rbx), %rdx
jne 0x12308
testq %rdx, %rdx
je 0x1234f
movq (%rbx), %rsi
movq (%r14), %rdi
callq 0x43a0
testl %eax, %eax
je 0x1234f
cmpq $0x0, 0x48(%r14)
movq 0x78(%r14), %rax
je 0x1231a
testq %rax, %rax
jne 0x1234f
jmp 0x12348
testq %rax, %rax
je 0x12348
movq 0x68(%r14), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x12172
cmpq $0x0, 0x78(%r14)
jne 0x1231f
jmp 0x12348
movq 0x38(%r14), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x12172
cmpq $0x0, 0x48(%r14)
jne 0x12338
subq $-0x80, %r14
cmpq 0x28(%rbx), %r14
jne 0x122ea
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::prune_unused(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>>>>&)
void
MultiStringFactorGraph::prune_unused(transitions_t &transitions)
{
    if (transitions.size() < factor_node_map.size()) {
        vector<string> to_remove;
        cerr << "Pruning " << factor_node_map.size()-transitions.size() << " unused factors from msfg." << endl;
        for (auto it = factor_node_map.begin(); it != factor_node_map.end(); ++it)
            if (transitions.find(it->first) == transitions.end())
                to_remove.push_back(it->first);
        for (auto it = to_remove.begin(); it != to_remove.end(); ++it)
            remove_arcs(*it);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x28(%rsi), %rax
cmpq 0xc0(%rdi), %rax
jae 0x12479
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq 0x21c4c(%rip), %rdi     # 0x33fe8
leaq 0x143e2(%rip), %rsi     # 0x26785
movl $0x8, %edx
callq 0x4400
movq 0xc0(%rbx), %rsi
subq 0x28(%r14), %rsi
movq 0x21c29(%rip), %rdi     # 0x33fe8
callq 0x4250
movq %rax, %r15
leaq 0x143c0(%rip), %rsi     # 0x2678e
movl $0x1a, %edx
movq %rax, %rdi
callq 0x4400
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4260
movq 0xb0(%rbx), %r15
movq %rbx, -0x48(%rbp)
leaq 0xa0(%rbx), %r12
cmpq %r12, %r15
je 0x1244d
leaq 0x8(%r14), %rbx
leaq 0x20(%r15), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x1604a
cmpq %rbx, %rax
jne 0x1243d
leaq -0x40(%rbp), %rdi
movq %r13, %rsi
callq 0x7f60
movq %r15, %rdi
callq 0x4280
movq %rax, %r15
cmpq %r12, %rax
jne 0x1241d
movq -0x40(%rbp), %r14
cmpq -0x38(%rbp), %r14
movq -0x48(%rbp), %rbx
je 0x12470
movq %rbx, %rdi
movq %r14, %rsi
callq 0x121ee
addq $0x20, %r14
cmpq -0x38(%rbp), %r14
jne 0x1245b
leaq -0x40(%rbp), %rdi
callq 0x5d4e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1248e
jmp 0x1248e
jmp 0x1248e
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::update_factor_node_map()
void
MultiStringFactorGraph::update_factor_node_map()
{
    factor_node_map.clear();
    for (msfg_node_idx_t idx=0; idx < nodes.size(); idx++) {
        Node &nd = nodes[idx];
        factor_node_map[nd.factor].push_back(idx);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x98(%rdi), %r14
movq %r14, %rdi
callq 0x15fd8
movl $0x0, -0x1c(%rbp)
movq 0x20(%rbx), %rax
cmpq %rax, 0x28(%rbx)
je 0x12e71
xorl %esi, %esi
leaq -0x1c(%rbp), %r15
shlq $0x7, %rsi
addq %rax, %rsi
movq %r14, %rdi
callq 0x13a58
movq 0x8(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x12e47
movl -0x1c(%rbp), %esi
movl %esi, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x8(%rax)
jmp 0x12e58
movq %rax, %rdi
movq %rcx, %rsi
movq %r15, %rdx
callq 0x1048c
movl -0x1c(%rbp), %esi
incl %esi
movl %esi, -0x1c(%rbp)
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
subq %rax, %rcx
sarq $0x7, %rcx
cmpq %rsi, %rcx
ja 0x12e1f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::collect_arcs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<unsigned int, std::vector<MultiStringFactorGraph::Arc*, std::allocator<MultiStringFactorGraph::Arc*>>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<MultiStringFactorGraph::Arc*, std::allocator<MultiStringFactorGraph::Arc*>>>>>&) const
void
MultiStringFactorGraph::collect_arcs(const string &text,
                                     map<msfg_node_idx_t, vector<Arc*> > &arcs) const
{
    msfg_node_idx_t end_node = string_end_nodes.at(text);
    set<msfg_node_idx_t> nodes_to_process; nodes_to_process.insert(end_node);

    while(nodes_to_process.size() > 0) {

        msfg_node_idx_t i = *(nodes_to_process.rbegin());

        const Node &node = nodes[i];
        for (auto arc = node.incoming.begin(); arc != node.incoming.end(); ++arc) {
            arcs[(**arc).source_node].push_back(*arc);
            nodes_to_process.insert((**arc).source_node);
        }

        nodes_to_process.erase(i);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rdi, -0x38(%rbp)
addq $0x38, %rdi
callq 0x138da
movl (%rax), %eax
leaq -0x3c(%rbp), %rsi
movl %eax, (%rsi)
leaq -0x68(%rbp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x70(%rbp), %rdi
callq 0x155c4
cmpq $0x0, -0x48(%rbp)
je 0x12f74
leaq -0x70(%rbp), %r12
leaq -0x68(%rbp), %rdi
callq 0x4210
movl 0x20(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rcx
movq 0x20(%rcx), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %r14
addq $0x28, %r14
movq 0x10(%r14), %r13
cmpq %r14, %r13
je 0x12f52
movq 0x20(%r13), %rsi
movq %rbx, %rdi
callq 0x13b42
leaq 0x20(%r13), %r15
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x12f2c
movq (%r15), %rcx
movq %rcx, (%rsi)
addq $0x8, 0x8(%rax)
jmp 0x12f37
movq %rax, %rdi
movq %r15, %rdx
callq 0x16310
movq (%r15), %rsi
movq %r12, %rdi
callq 0x155c4
movq %r13, %rdi
callq 0x4410
movq %rax, %r13
cmpq %r14, %rax
jne 0x12f05
movq %r12, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x156e0
movq %r12, %rdi
movq %rax, %rsi
callq 0x15762
cmpq $0x0, -0x48(%rbp)
jne 0x12ed9
leaq -0x70(%rbp), %rdi
callq 0x13f0a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12f90
jmp 0x12f90
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x13f0a
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::collect_factors(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&) const
void
MultiStringFactorGraph::collect_factors(const string &text,
                                        set<string> &factors) const
{
    msfg_node_idx_t end_node = string_end_nodes.at(text);
    set<msfg_node_idx_t> nodes_to_process; nodes_to_process.insert(end_node);

    while(nodes_to_process.size() > 0) {

        msfg_node_idx_t i = *(nodes_to_process.rbegin());

        const Node &node = nodes[i];
        factors.insert(node.factor);
        for (auto arc = node.incoming.begin(); arc != node.incoming.end(); ++arc)
            nodes_to_process.insert((**arc).source_node);

        nodes_to_process.erase(i);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rdi, %r14
addq $0x38, %rdi
callq 0x138da
movl (%rax), %eax
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
leaq -0x58(%rbp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x60(%rbp), %rdi
callq 0x155c4
cmpq $0x0, -0x38(%rbp)
je 0x13067
leaq -0x60(%rbp), %r12
leaq -0x58(%rbp), %rdi
callq 0x4210
movl 0x20(%rax), %r13d
movl %r13d, -0x2c(%rbp)
shlq $0x7, %r13
addq 0x20(%r14), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x13fba
movq 0x38(%r13), %r15
addq $0x28, %r13
cmpq %r13, %r15
je 0x13049
movq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x155c4
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq %r13, %rax
jne 0x1302d
movq %r12, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x156e0
movq %r12, %rdi
movq %rax, %rsi
callq 0x15762
cmpq $0x0, -0x38(%rbp)
jne 0x12ffc
leaq -0x60(%rbp), %rdi
callq 0x13f0a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13083
jmp 0x13083
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x13f0a
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/EM.cc
// Function: viterbi(StringSet const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>&, bool)
flt_type viterbi(const StringSet &vocab,
                 const string &text,
                 map<string, flt_type> &stats,
                 bool utf8)
{
    stats.clear();
    vector<string> best_path;
    flt_type lp = viterbi(vocab, text, best_path, false, utf8);
    for (auto it = best_path.begin(); it != best_path.end(); ++it)
        stats[*it] += 1.0;
    return lp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0x1bf52
xorpd %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movapd %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x16b54
movsd %xmm0, -0x48(%rbp)
movq -0x40(%rbp), %r14
cmpq -0x38(%rbp), %r14
je 0x16e4e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1af86
movsd (%rax), %xmm0
addsd 0xf9c4(%rip), %xmm0     # 0x26808
movsd %xmm0, (%rax)
addq $0x20, %r14
jmp 0x16e27
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movsd -0x48(%rbp), %xmm0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16e6b
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/EM.cc
// Function: forward_backward(StringSet const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>&, bool)
flt_type forward_backward(const StringSet &vocab,
                          const string &text,
                          map<string, flt_type> &stats,
                          bool utf8)
{
    int len = text.length();
    if (len == 0) return MIN_FLOAT;

    stats.clear();
    vector<vector<Token> > search(len);
    vector<flt_type> fw(len, SMALL_LP); fw[0] = 0.0;
    vector<flt_type> bw(len, SMALL_LP); bw.back() = 0.0;

    forward(vocab, text, search, fw, utf8);
    backward(vocab, text, search, fw, bw, stats);

    if (search[len-1].size() == 0) return MIN_FLOAT;
    return fw.back();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl 0x8(%rsi), %r15d
testq %r15, %r15
je 0x1749f
movq %rdx, %rbx
movq %rsi, %r14
movl %ecx, -0x3c(%rbp)
movq %rdi, -0x38(%rbp)
movq %rdx, %rdi
callq 0x1bf52
movslq %r15d, %r13
leaq -0x90(%rbp), %rdi
leaq -0x58(%rbp), %rdx
movq %r13, %rsi
callq 0x1b0b6
movabsq $-0x3fa7000000000000, %r12 # imm = 0xC059000000000000
leaq -0x78(%rbp), %rdx
movq %r12, (%rdx)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rcx
movq %r13, %rsi
callq 0x1b134
movq -0x58(%rbp), %rax
movq $0x0, (%rax)
leaq -0x60(%rbp), %rdx
movq %r12, (%rdx)
leaq -0x78(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movq %r13, %rsi
callq 0x1b134
movq -0x70(%rbp), %rax
movq $0x0, -0x8(%rax)
movzbl -0x3c(%rbp), %r8d
leaq -0x90(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x16e7f
leaq -0x90(%rbp), %rdx
leaq -0x58(%rbp), %rcx
leaq -0x78(%rbp), %r8
movq %r14, %rsi
movq %rbx, %r9
callq 0x17194
shlq $0x20, %r15
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r15, %rax
sarq $0x20, %rax
movq -0x90(%rbp), %rcx
leaq (%rax,%rax,2), %rax
movq 0x8(%rcx,%rax,8), %rdx
cmpq (%rcx,%rax,8), %rdx
je 0x174a9
movq -0x50(%rbp), %rax
movsd -0x8(%rax), %xmm0
jmp 0x174b1
movsd 0xf359(%rip), %xmm0     # 0x26800
jmp 0x174e3
movsd 0xf34f(%rip), %xmm0     # 0x26800
movsd %xmm0, -0x38(%rbp)
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x174c4
callq 0x4350
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x174d2
callq 0x4350
leaq -0x90(%rbp), %rdi
callq 0x1b1c0
movsd -0x38(%rbp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1750d
movq %rax, %rbx
jmp 0x1751b
movq %rax, %rbx
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x1750d
callq 0x4350
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x1751b
callq 0x4350
leaq -0x90(%rbp), %rdi
callq 0x1b1c0
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/EM.cc
// Function: forward_backward(StringSet const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>&, std::vector<double, std::allocator<double>>&, bool)
flt_type forward_backward(const StringSet &vocab,
                          const string &text,
                          map<string, flt_type> &stats,
                          vector<flt_type> &bw,
                          bool utf8)
{
    int len = text.length();
    if (len == 0) return MIN_FLOAT;

    stats.clear();
    vector<vector<Token> > search(len);
    vector<flt_type> fw(len, SMALL_LP); fw[0] = 0.0;
    bw.resize(len, SMALL_LP); bw.back() = 0.0;

    forward(vocab, text, search, fw, utf8);
    backward(vocab, text, search, fw, bw, stats);

    if (search[len-1].size() == 0) return MIN_FLOAT;
    return fw.back();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl 0x8(%rsi), %r13d
testq %r13, %r13
je 0x1762f
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, -0x58(%rbp)
movl %r8d, -0x38(%rbp)
movq %rdx, %rdi
callq 0x1bf52
movslq %r13d, %r12
leaq -0x78(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r12, %rsi
callq 0x1b0b6
movabsq $-0x3fa7000000000000, %rax # imm = 0xC059000000000000
leaq -0x60(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movq %r12, %rsi
callq 0x1b134
movq -0x50(%rbp), %rax
movq $0x0, (%rax)
leaq -0x60(%rbp), %rdx
movabsq $-0x3fa7000000000000, %rax # imm = 0xC059000000000000
movq %rax, (%rdx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1b214
movq 0x8(%r14), %rax
movq $0x0, -0x8(%rax)
movzbl -0x38(%rbp), %r8d
leaq -0x78(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x16e7f
leaq -0x78(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movq %r15, %rsi
movq %r14, %r8
movq %rbx, %r9
callq 0x17194
shlq $0x20, %r13
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r13, %rax
sarq $0x20, %rax
movq -0x78(%rbp), %rcx
leaq (%rax,%rax,2), %rax
movq 0x8(%rcx,%rax,8), %rdx
cmpq (%rcx,%rax,8), %rdx
je 0x17639
movq -0x48(%rbp), %rax
movsd -0x8(%rax), %xmm0
jmp 0x17641
movsd 0xf1c9(%rip), %xmm0     # 0x26800
jmp 0x17662
movsd 0xf1bf(%rip), %xmm0     # 0x26800
movsd %xmm0, -0x38(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x17654
callq 0x4350
leaq -0x78(%rbp), %rdi
callq 0x1b1c0
movsd -0x38(%rbp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17678
movq %rax, %rbx
jmp 0x17689
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x17689
callq 0x4350
leaq -0x78(%rbp), %rdi
callq 0x1b1c0
movq %rbx, %rdi
callq 0x4650