LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
addq $0x20, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x30c00
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xabb0
cmpl $0x0, -0x1c(%rbp)
jne 0x2df39
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x24160
jmp 0x2dfd3
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
callq 0x30260
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
callq 0x302c0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30290
testb $0x1, %al
jne 0x2df6e
jmp 0x2dfd3
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x241d0
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x302f0
movq -0x68(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq (%rax), %rax
movl (%rax), %ecx
callq 0x2dee0
jmp 0x2dfa8
leaq -0x50(%rbp), %rdi
callq 0x6970
leaq -0x30(%rbp), %rdi
callq 0x30320
jmp 0x2df4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6970
jmp 0x2dfdc
addq $0x80, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)
// File: 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
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x30e30
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq -0x10(%rbp), %rsi
callq 0x2dd90
jmp 0x2e028
leaq -0x28(%rbp), %rdi
callq 0x2bb30
movq %rax, -0x40(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2b9a0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x30d70
testb $0x1, %al
jne 0x2e058
jmp 0x2e10e
leaq -0x40(%rbp), %rdi
callq 0x30df0
movq %rax, %rdi
callq 0xb2f0
movq %rax, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x30df0
movq %rax, %rdi
callq 0xb320
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x11960
testb $0x1, %al
jne 0x2e095
jmp 0x2e0e9
leaq -0x50(%rbp), %rdi
callq 0x119d0
movq %rax, %rsi
movq 0x65f10(%rip), %rdi     # 0x93fb8
callq 0x4380
movq %rax, -0x70(%rbp)
jmp 0x2e0b3
movq -0x70(%rbp), %rdi
leaq 0x382aa(%rip), %rsi     # 0x66368
callq 0x43c0
jmp 0x2e0c5
jmp 0x2e0c7
leaq -0x50(%rbp), %rdi
callq 0x117f0
jmp 0x2e06d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x30e50
jmp 0x2e11d
movq 0x65ec8(%rip), %rdi     # 0x93fb8
movq 0x65ea1(%rip), %rsi     # 0x93f98
callq 0x4400
jmp 0x2e0fe
jmp 0x2e100
leaq -0x40(%rbp), %rdi
callq 0x30e10
jmp 0x2e035
leaq -0x28(%rbp), %rdi
callq 0x30e50
addq $0x70, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x20, %rdi
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, %esi
callq 0x30240
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
leaq -0x10(%rbp), %rsi
callq 0x30f30
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
callq 0x30240
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
leaq -0x10(%rbp), %rsi
callq 0x30f30
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x2e1b0
movq -0x28(%rbp), %rdi
callq 0x43a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x45e0
cmpq $0x2, %rax
jae 0x2e21f
movq 0x65dfa(%rip), %rdi     # 0x93fe8
leaq 0x384de(%rip), %rsi     # 0x666d3
callq 0x43c0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
movq 0x65d88(%rip), %rsi     # 0x93f98
callq 0x4400
movl $0x1, %edi
callq 0x4470
movq -0x40(%rbp), %rdi
addq $0x98, %rdi
movq -0x10(%rbp), %rsi
callq 0x30f60
movq %rax, %rdi
callq 0x24e80
movq %rax, -0x18(%rbp)
movq -0x40(%rbp), %rdi
addq $0x98, %rdi
movq -0x10(%rbp), %rsi
callq 0x30f60
movq %rax, %rdi
callq 0x24d10
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x31040
testb $0x1, %al
jne 0x2e275
jmp 0x2e323
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x48(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x31080
movq -0x48(%rbp), %rdi
movl (%rax), %eax
movl %eax, %esi
callq 0x30240
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
callq 0x310a0
cmpq $0x0, %rax
jbe 0x2e2d6
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
callq 0x30260
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x302f0
movq -0x40(%rbp), %rdi
movq (%rax), %rsi
callq 0x2e130
jmp 0x2e29b
jmp 0x2e2d8
movq -0x28(%rbp), %rdi
addq $0x50, %rdi
callq 0x310a0
cmpq $0x0, %rax
jbe 0x2e313
movq -0x28(%rbp), %rdi
addq $0x50, %rdi
callq 0x30260
movq %rax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x302f0
movq -0x40(%rbp), %rdi
movq (%rax), %rsi
callq 0x2e130
jmp 0x2e2d8
jmp 0x2e315
leaq -0x18(%rbp), %rdi
callq 0x310c0
jmp 0x2e23f
movq -0x40(%rbp), %rdi
addq $0x98, %rdi
movq -0x10(%rbp), %rsi
callq 0x310e0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x20, %rdi
callq 0x31110
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
callq 0x31180
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x31140
testb $0x1, %al
jne 0x2e388
jmp 0x2e492
leaq -0x10(%rbp), %rdi
callq 0x311b0
movq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x2cc30
testb $0x1, %al
jne 0x2e3a3
jmp 0x2e3a8
jmp 0x2e47e
leaq -0x10(%rbp), %rdi
callq 0x311b0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x310a0
cmpq $0x0, %rax
jne 0x2e412
jmp 0x2e3c5
leaq -0x10(%rbp), %rdi
callq 0x311b0
movq %rax, %rdi
addq $0x50, %rdi
callq 0x310a0
cmpq $0x0, %rax
jbe 0x2e410
leaq -0x10(%rbp), %rdi
callq 0x311b0
movq %rax, %rdi
addq $0x50, %rdi
callq 0x30260
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x302f0
movq -0x38(%rbp), %rdi
movq (%rax), %rsi
callq 0x2e130
jmp 0x2e3c5
jmp 0x2e412
leaq -0x10(%rbp), %rdi
callq 0x311b0
movq %rax, %rdi
addq $0x50, %rdi
callq 0x310a0
cmpq $0x0, %rax
jne 0x2e47c
jmp 0x2e42f
leaq -0x10(%rbp), %rdi
callq 0x311b0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x310a0
cmpq $0x0, %rax
jbe 0x2e47a
leaq -0x10(%rbp), %rdi
callq 0x311b0
movq %rax, %rdi
addq $0x20, %rdi
callq 0x30260
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x302f0
movq -0x38(%rbp), %rdi
movq (%rax), %rsi
callq 0x2e130
jmp 0x2e42f
jmp 0x2e47c
jmp 0x2e47e
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x311d0
movq %rax, -0x30(%rbp)
jmp 0x2e361
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x98, %rdi
callq 0x315d0
movl $0x0, -0xc(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %eax
movq %rax, -0x28(%rbp)
addq $0x20, %rdi
callq 0x30500
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x2f318
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movl -0xc(%rbp), %eax
movl %eax, %esi
callq 0x30240
movq -0x20(%rbp), %rdi
movq %rax, -0x18(%rbp)
addq $0x98, %rdi
movq -0x18(%rbp), %rsi
callq 0x30f60
movq %rax, %rdi
leaq -0xc(%rbp), %rsi
callq 0x23b00
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2f2b7
addq $0x30, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
addq $0x38, %rdi
movq -0x10(%rbp), %rsi
callq 0x30970
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x30b10
movq -0xd0(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x30b30
movb %dl, -0xc1(%rbp)
movq %rax, -0xc0(%rbp)
jmp 0x2f593
movb -0xc1(%rbp), %al
movq -0xc0(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movb %al, -0x68(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x30b80
cmpq $0x0, %rax
jbe 0x2f705
leaq -0x80(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x30ba0
movq -0xe8(%rbp), %rdi
callq 0x30bd0
movq %rax, -0xe0(%rbp)
jmp 0x2f5e3
movq -0xd8(%rbp), %rdi
movq -0xe0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x74(%rbp)
addq $0x20, %rdi
movl -0x74(%rbp), %eax
movl %eax, %esi
callq 0x30c00
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x31820
movb %dl, -0xf1(%rbp)
movq %rax, -0xf0(%rbp)
jmp 0x2f62a
movb -0xf1(%rbp), %al
movq -0xf0(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movb %al, -0x90(%rbp)
movq -0x88(%rbp), %rdi
addq $0x20, %rdi
callq 0x30260
movq %rax, -0xa0(%rbp)
movq -0x88(%rbp), %rdi
addq $0x20, %rdi
callq 0x302c0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x30290
testb $0x1, %al
jne 0x2f68b
jmp 0x2f6f1
leaq -0xa0(%rbp), %rdi
callq 0x302f0
movq (%rax), %rsi
leaq -0x50(%rbp), %rdi
callq 0x30b30
movb %dl, -0x101(%rbp)
movq %rax, -0x100(%rbp)
jmp 0x2f6b2
movb -0x101(%rbp), %al
movq -0x100(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movb %al, -0xb0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x30320
jmp 0x2f65b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x30d30
jmp 0x2f717
leaq -0x50(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0x30c20
jmp 0x2f700
jmp 0x2f5a7
leaq -0x50(%rbp), %rdi
callq 0x30d30
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x46e0
// File: 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
subq $0x90, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rdi
callq 0x47d90
leaq -0x38(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0xa160
movq -0x70(%rbp), %rdx
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzbl -0x19(%rbp), %r8d
andl $0x1, %r8d
xorl %ecx, %ecx
callq 0x40860
movsd %xmm0, -0x68(%rbp)
jmp 0x40d87
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xb2f0
movq %rax, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xb320
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x11960
testb $0x1, %al
jne 0x40dbe
jmp 0x40e17
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x119d0
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x47db0
movq %rax, -0x78(%rbp)
jmp 0x40de1
movq -0x78(%rbp), %rax
movsd 0x25993(%rip), %xmm0    # 0x66780
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x117f0
jmp 0x40d9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6970
jmp 0x40e3e
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6970
movsd -0x88(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x46e0
nopw (%rax,%rax)
// File: aalto-speech[P]ftk/src/defs.hh
// Function: add_log_domain_probs(double, double)
static flt_type add_log_domain_probs(flt_type a, flt_type b) {
    flt_type delta = a - b;
    if (delta > 0) {
      b = a;
      delta = -delta;
    }
    return b + log1p(exp(delta));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
subsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4133a
movsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x18(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x4710
callq 0x47d0
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
addsd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: aalto-speech[P]ftk/src/EM.cc
// Function: forward(MultiStringFactorGraph const&, std::vector<double, std::allocator<double>>&)
void
forward(const MultiStringFactorGraph &msfg,
        vector<flt_type> &fw)
{
    for (unsigned int i=0; i<msfg.nodes.size(); i++) {

        if (fw[i] == MIN_FLOAT) continue;

        const MultiStringFactorGraph::Node &node = msfg.nodes[i];
        for (auto arc = node.outgoing.begin(); arc != node.outgoing.end(); ++arc) {
            int tgt_node = (**arc).target_node;
            flt_type cost = fw[i] + *(**arc).cost;
            if (fw[tgt_node] == MIN_FLOAT) fw[tgt_node] = cost;
            else fw[tgt_node] = add_log_domain_probs(fw[tgt_node], cost);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
callq 0x30500
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x45082
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x47eb0
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x47bf0
movaps %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jne 0x44f33
jp 0x44f33
jmp 0x45074
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x30c00
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
callq 0x30260
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
callq 0x302c0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x30290
testb $0x1, %al
jne 0x44f81
jmp 0x45072
leaq -0x28(%rbp), %rdi
callq 0x302f0
movq (%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x47eb0
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x302f0
movsd -0x60(%rbp), %xmm0
movq (%rax), %rax
movq 0x8(%rax), %rax
addsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x47eb0
movsd (%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x47bf0
movaps %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4502c
jp 0x4502c
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x47eb0
movsd -0x68(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x45062
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x47eb0
movsd (%rax), %xmm0
movsd -0x40(%rbp), %xmm1
callq 0x412e0
movsd %xmm0, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x47eb0
movsd -0x70(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x45064
leaq -0x28(%rbp), %rdi
callq 0x30320
jmp 0x44f5a
jmp 0x45074
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x44ec7
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: aalto-speech[P]ftk/src/EM.cc
// Function: likelihood(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&, 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&, MultiStringFactorGraph const&, bool)
flt_type
likelihood(const map<string, flt_type> &words,
           const set<string> &selected_words,
           const MultiStringFactorGraph &msfg,
           bool forward_backward)
{
    flt_type total_lp = 0.0;

    for (auto it = selected_words.cbegin(); it != selected_words.cend(); ++it)
        if (forward_backward)
            total_lp += words.at(*it) * likelihood_fb(*it, msfg);
        else
            total_lp += words.at(*it) * likelihood_viterbi(*it, msfg);

    return total_lp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x49190
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x491c0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x235b0
testb $0x1, %al
jne 0x45ee3
jmp 0x45fa5
testb $0x1, -0x19(%rbp)
je 0x45f40
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x491f0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x48880
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x491f0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x45640
movaps %xmm0, %xmm2
movsd -0x40(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x45f95
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x491f0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x48880
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x491f0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x45a60
movaps %xmm0, %xmm2
movsd -0x50(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x45f97
leaq -0x30(%rbp), %rdi
callq 0x49260
jmp 0x45ec0
movsd -0x28(%rbp), %xmm0
addq $0x60, %rsp
popq %rbp
retq
// File: aalto-speech[P]ftk/src/EM.cc
// Function: forward_backward(MultiStringFactorGraph 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>>, 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>>>>>>&)
flt_type
forward_backward(const MultiStringFactorGraph &msfg,
                 const string &text,
                 transitions_t &stats)
{
    if (msfg.nodes.size() == 0) return MIN_FLOAT;

    map<msfg_node_idx_t, flt_type> fw;
    fw[0] = 0.0;

    forward(text, msfg, fw);
    backward(msfg, text, fw, stats);

    return fw[msfg.string_end_nodes.at(text)];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x30500
cmpq $0x0, %rax
jne 0x46d00
callq 0x47bf0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x46dc3
leaq -0x50(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x49290
movq -0x78(%rbp), %rdi
movl $0x0, -0x54(%rbp)
leaq -0x54(%rbp), %rsi
callq 0x48fd0
movq %rax, -0x70(%rbp)
jmp 0x46d27
movq -0x70(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x45090
jmp 0x46d45
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
leaq -0x50(%rbp), %rdx
movsd 0x1fa23(%rip), %xmm0    # 0x66780
callq 0x46500
jmp 0x46d64
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movq -0x18(%rbp), %rsi
callq 0x30970
movq %rax, -0x80(%rbp)
jmp 0x46d7b
movq -0x80(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x48e60
movq %rax, -0x88(%rbp)
jmp 0x46d91
movq -0x88(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x492b0
jmp 0x46dc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x492b0
jmp 0x46dd1
movsd -0x8(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x46e0
nopw (%rax,%rax)
// File: aalto-speech[P]ftk/src/EM.cc
// Function: viterbi(MultiStringFactorGraph 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>>, 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>>>>>>&, double)
flt_type
viterbi(const MultiStringFactorGraph &msfg,
        const string &text,
        transitions_t &stats,
        flt_type multiplier)
{
    vector<string> best_path;
    flt_type lp = viterbi(msfg, text, best_path);
    for (unsigned int i=1; i<best_path.size(); i++)
        stats[best_path[i-1]][best_path[i]] += multiplier;
    return lp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xa160
movq -0x60(%rbp), %rdx
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x46de0
movsd %xmm0, -0x58(%rbp)
jmp 0x47321
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x1, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq %rax, -0x68(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x5f70
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jae 0x473e2
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x50(%rbp), %eax
decl %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x5f90
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x48700
movq %rax, -0x70(%rbp)
jmp 0x47386
movl -0x50(%rbp), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x5f90
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x47db0
movq %rax, -0x88(%rbp)
jmp 0x473a9
movq -0x88(%rbp), %rax
movsd -0x80(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x47332
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6970
jmp 0x47409
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6970
movsd -0x90(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::sort_vocab(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&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double>>>&, bool)
void
Unigrams::sort_vocab(const map<string, flt_type> &vocab,
                     vector<pair<string, flt_type> > &sorted_vocab,
                     bool descending)
{
    sorted_vocab.clear();
    for (auto it = vocab.cbegin(); it != vocab.cend(); it++) {
        pair<string, flt_type> curr_pair(it->first, it->second);
        sorted_vocab.push_back(curr_pair);
    }
    if (descending)
        sort(sorted_vocab.begin(), sorted_vocab.end(), descending_sort);
    else
        sort(sorted_vocab.begin(), sorted_vocab.end(), ascending_sort);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rdi
callq 0x588b0
movq -0x8(%rbp), %rdi
callq 0x1b260
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b2c0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1b290
testb $0x1, %al
jne 0x555e3
jmp 0x5566a
leaq -0x20(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x1b2f0
movq -0xa0(%rbp), %rdi
movq %rax, -0x98(%rbp)
callq 0x1b2f0
movq -0x98(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %rdx
leaq -0x50(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x588d0
movq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x58910
jmp 0x55636
leaq -0x50(%rbp), %rdi
callq 0x58980
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x589a0
movq %rax, -0x68(%rbp)
jmp 0x555c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x58980
jmp 0x556dd
testb $0x1, -0x11(%rbp)
je 0x556a0
movq -0x10(%rbp), %rdi
callq 0x58a30
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
callq 0x58a60
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
leaq -0xb69(%rip), %rdx      # 0x54b30
callq 0x589e0
jmp 0x556d4
movq -0x10(%rbp), %rdi
callq 0x58a30
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x58a60
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
leaq -0xb7f(%rip), %rdx      # 0x54b50
callq 0x589e0
addq $0xa0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::read_sents(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>>>>&)
int
Unigrams::read_sents(string fname,
                     vector<string> &sents)
{
    sents.clear();
    SimpleFileInput sfi(fname);

    int lc = 0;
    string line;
    while (sfi.getline(line)) {
        trim(line, '\n');
        sents.push_back(line);
        lc++;
    }

    return lc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb7e0
movq -0x78(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x41a0
movq -0x70(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x75a0
jmp 0x55730
leaq -0x38(%rbp), %rdi
callq 0x4828
movl $0x0, -0x48(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4560
leaq -0x18(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x586a0
movb %al, -0x79(%rbp)
jmp 0x5575b
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x55764
jmp 0x557c5
leaq -0x68(%rbp), %rdi
movl $0xa, %esi
callq 0x55800
jmp 0x55774
movq -0x10(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xabb0
jmp 0x55783
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x55749
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4828
jmp 0x557e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4828
leaq -0x18(%rbp), %rdi
callq 0x77b0
jmp 0x557e9
movl -0x48(%rbp), %eax
movl %eax, -0x80(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4828
leaq -0x18(%rbp), %rdi
callq 0x77b0
movl -0x80(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)
// File: aalto-speech[P]ftk/src/defs.hh
// Function: trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char)
static void trim(std::string &str, char to_trim)
{
    std::string::size_type pos = str.find_last_not_of(to_trim);
    if(pos != std::string::npos) {
        str.erase(pos + 1);
        pos = str.find_first_not_of(to_trim);
        if(pos != std::string::npos) str.erase(0, pos);
    }
    else str.erase(str.begin(), str.end());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
movq $-0x1, %rdx
movsbl -0x9(%rbp), %esi
callq 0x42b0
movq %rax, -0x18(%rbp)
cmpq $-0x1, -0x18(%rbp)
je 0x55878
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movq $-0x1, %rdx
callq 0x40e0
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movsbl -0x9(%rbp), %esi
callq 0x4390
movq %rax, -0x18(%rbp)
cmpq $-0x1, -0x18(%rbp)
je 0x55876
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x40e0
jmp 0x558c9
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4360
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x58f30
movq -0x8(%rbp), %rdi
callq 0x4240
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x58f30
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x40d0
movq %rax, -0x40(%rbp)
addq $0x50, %rsp
popq %rbp
retq
nop
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::iterate(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&, 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>>>&, unsigned int)
flt_type
Unigrams::iterate(const map<string, flt_type> &words,
                  map<string, flt_type> &vocab,
                  unsigned int iterations)
{
    map<string, flt_type> freqs;
    flt_type ll = 0.0;

    for (unsigned int i=0; i<iterations; i++) {
        ll = resegment_words(words, vocab, freqs);
        vocab = freqs;
        freqs_to_logprobs(vocab);
    }

    return ll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5fb0
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x55a02
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x6050
movq -0xa8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq -0xb8(%rbp), %r8
leaq -0x50(%rbp), %rcx
callq 0x55a40
movsd %xmm0, -0xb0(%rbp)
jmp 0x55983
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x6070
movq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x58a90
jmp 0x559ab
movq -0x18(%rbp), %rdi
movsd 0x10e61(%rip), %xmm0    # 0x66818
callq 0x55b60
jmp 0x559be
jmp 0x559c0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x5590d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x6070
jmp 0x55a29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x55a29
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0xd0(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6090
movsd -0xd0(%rbp), %xmm0
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x6090
movq -0x98(%rbp), %rdi
callq 0x46e0
nop
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::freqs_to_logprobs(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>>>&, double)
void
Unigrams::freqs_to_logprobs(map<string, flt_type> &vocab,
                            flt_type min_lp)
{
    flt_type densum = Unigrams::get_sum(vocab);
    densum = log(densum);
    for (auto iter = vocab.begin(); iter != vocab.end(); ++iter) {
        iter->second = (log(iter->second)-densum);
        if (iter->second < min_lp || std::isinf(iter->second) || std::isnan(iter->second))
            iter->second = min_lp;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x56410
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x4340
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x58790
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x48c90
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x48c30
testb $0x1, %al
jne 0x55bbe
jmp 0x55c64
leaq -0x20(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x4340
subsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x587c0
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
leaq -0x20(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm1
movsd -0x10(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x55c37
leaq -0x20(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x58b50
testb $0x1, %al
jne 0x55c37
leaq -0x20(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x58b90
testb $0x1, %al
jne 0x55c37
jmp 0x55c54
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x587c0
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
jmp 0x55c56
leaq -0x20(%rbp), %rdi
callq 0x4bba0
jmp 0x55b9b
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::iterate(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&, 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>>>&, unsigned int)
flt_type
Unigrams::iterate(const vector<string> &sents,
                  map<string, flt_type> &vocab,
                  unsigned int iterations)
{
    map<string, flt_type> freqs;
    flt_type ll = 0.0;

    for (unsigned int i=0; i<iterations; i++) {
        ll = resegment_sents(sents, vocab, freqs);
        vocab = freqs;
        freqs_to_logprobs(vocab);
    }

    return ll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5fb0
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x55d1e
movq -0x78(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x55d50
movsd %xmm0, -0x80(%rbp)
jmp 0x55cce
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x58a90
jmp 0x55ce7
movq -0x18(%rbp), %rdi
movsd 0x10b25(%rip), %xmm0    # 0x66818
callq 0x55b60
jmp 0x55cfa
jmp 0x55cfc
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x55caa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6090
jmp 0x55d45
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6090
movsd -0x88(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x46e0
nop
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::get_sum(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&)
flt_type
Unigrams::get_sum(const map<string, flt_type> &freqs)
{
    flt_type total = 0.0;
    for (auto iter = freqs.cbegin(); iter != freqs.cend(); ++iter) {
        if (std::isinf(iter->second) || std::isnan(iter->second)) continue;
        total += iter->second;
    }
    return total;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b260
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b2c0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1b290
testb $0x1, %al
jne 0x56451
jmp 0x564a6
leaq -0x18(%rbp), %rdi
callq 0x1b2f0
movsd 0x20(%rax), %xmm0
callq 0x58b50
testb $0x1, %al
jne 0x56481
leaq -0x18(%rbp), %rdi
callq 0x1b2f0
movsd 0x20(%rax), %xmm0
callq 0x58b90
testb $0x1, %al
jne 0x56481
jmp 0x56483
jmp 0x5649b
leaq -0x18(%rbp), %rdi
callq 0x1b2f0
movsd 0x20(%rax), %xmm0
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x1b320
jmp 0x56431
movsd -0x10(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::get_cost(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&, double)
flt_type
Unigrams::get_cost(const map<string, flt_type> &freqs,
                   flt_type densum)
{
    flt_type total = 0.0;
    flt_type tmp = 0.0;
    densum = log(densum);
    for (auto iter = freqs.cbegin(); iter != freqs.cend(); ++iter) {
        tmp = iter->second * (log(iter->second)-densum);
        if (!std::isnan(tmp)) total += tmp;
    }
    return total;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x4340
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b260
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b2c0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1b290
testb $0x1, %al
jne 0x5651d
jmp 0x56586
leaq -0x28(%rbp), %rdi
callq 0x1b2f0
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1b2f0
movsd 0x20(%rax), %xmm0
callq 0x4340
movaps %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
subsd -0x10(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x58b90
testb $0x1, %al
jne 0x56576
movsd -0x20(%rbp), %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x56578
leaq -0x28(%rbp), %rdi
callq 0x1b320
jmp 0x564fd
movsd -0x18(%rbp), %xmm0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::cutoff(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>>>&, double, 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&, unsigned int)
int
Unigrams::cutoff(map<string, flt_type> &vocab,
                 flt_type limit,
                 const set<string> &stoplist,
                 unsigned int min_length)
{
    int nremovals = 0;
    auto iter = vocab.begin();
    while (iter != vocab.end()) {
        if (iter->second <= limit
            && get_factor_length(iter->first, this->utf8) >= min_length
            && stoplist.find(iter->first) == stoplist.end()) {
                vocab.erase(iter++);
                nremovals++;
        }
        else ++iter;
    }
    return nremovals;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x58790
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x48c90
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x48c30
testb $0x1, %al
jne 0x565fe
jmp 0x566cd
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm1
movsd -0x18(%rbp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0x61(%rbp)
jb 0x56683
leaq -0x30(%rbp), %rdi
callq 0x587c0
movq %rax, %rdi
movq -0x60(%rbp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x54dc0
movl %eax, %ecx
xorl %eax, %eax
cmpl -0x24(%rbp), %ecx
movb %al, -0x61(%rbp)
jb 0x56683
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x587c0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x235e0
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x23610
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x28330
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x5668c
jmp 0x566bf
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x58bf0
movq -0x78(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
callq 0x58bb0
movq %rax, -0x58(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x566c8
leaq -0x30(%rbp), %rdi
callq 0x4bba0
jmp 0x565db
movl -0x28(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)