LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x10dd2
movq %rdi, %r14
leaq 0x98(%rdi), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11eae
movq (%rax), %r12
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11eae
cmpq 0x8(%rax), %r12
je 0x10db9
movl (%r12), %r13d
shlq $0x7, %r13
addq 0x20(%r14), %r13
cmpq $0x0, 0x48(%r13)
je 0x10dac
movq 0x38(%r13), %rax
movq 0x20(%rax), %rsi
movq %r14, %rdi
callq 0x10cd4
jmp 0x10d83
movq 0x68(%r13), %rax
movq 0x20(%rax), %rsi
movq %r14, %rdi
callq 0x10cd4
cmpq $0x0, 0x78(%r13)
jne 0x10d9c
addq $0x4, %r12
jmp 0x10d66
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1491c
movq 0x2420f(%rip), %rdi     # 0x34fe8
leaq 0x1290f(%rip), %rsi     # 0x236ef
callq 0x4340
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x4180
pushq $0x1
popq %rdi
callq 0x43c0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, %rbx
movq 0x20(%rdi), %r14
cmpq 0x28(%rbx), %r14
je 0x10e69
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10328
testb %al, %al
jne 0x10e63
cmpq $0x0, 0x48(%r14)
je 0x10e43
cmpq $0x0, 0x78(%r14)
jne 0x10e63
jmp 0x10e5c
movq 0x68(%r14), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x10cd4
cmpq $0x0, 0x78(%r14)
jne 0x10e33
jmp 0x10e5c
movq 0x38(%r14), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x10cd4
cmpq $0x0, 0x48(%r14)
jne 0x10e4c
subq $-0x80, %r14
jmp 0x10e0e
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x10f4f
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
movq 0x2413f(%rip), %rdi     # 0x34fe8
leaq 0x12865(%rip), %rsi     # 0x23715
callq 0x4340
movq 0xc0(%rbx), %rsi
subq 0x28(%r14), %rsi
movq %rax, %rdi
callq 0x4250
leaq 0x1284f(%rip), %rsi     # 0x2371e
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x4180
movq 0xb0(%rbx), %r15
movq %rbx, -0x48(%rbp)
leaq 0xa0(%rbx), %r12
leaq 0x8(%r14), %rbx
cmpq %r12, %r15
je 0x10f27
leaq 0x20(%r15), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x14b00
cmpq %rbx, %rax
jne 0x10f1a
leaq -0x40(%rbp), %rdi
movq %r13, %rsi
callq 0x719e
movq %r15, %rdi
callq 0x4270
movq %rax, %r15
jmp 0x10ef5
movq -0x40(%rbp), %r14
movq -0x48(%rbp), %rbx
cmpq -0x38(%rbp), %r14
je 0x10f46
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10d32
addq $0x20, %r14
jmp 0x10f2f
leaq -0x40(%rbp), %rdi
callq 0x54b6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10f64
jmp 0x10f64
jmp 0x10f64
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x54b6
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x14a9a
xorl %eax, %eax
leaq -0x1c(%rbp), %r15
movl %eax, -0x1c(%rbp)
movl %eax, %eax
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rcx
subq %rsi, %rcx
sarq $0x7, %rcx
cmpq %rax, %rcx
jbe 0x11644
shlq $0x7, %rax
addq %rax, %rsi
movq %r14, %rdi
callq 0x11eae
movq %rax, %rdi
movq %r15, %rsi
callq 0xe79a
movl -0x1c(%rbp), %eax
incl %eax
jmp 0x1160a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x11d8e
movl (%rax), %eax
leaq -0x3c(%rbp), %rsi
movl %eax, (%rsi)
leaq -0x68(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x70(%rbp), %rdi
callq 0x13e38
leaq -0x70(%rbp), %r12
cmpq $0x0, -0x48(%rbp)
je 0x11714
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), %r15
cmpq %r14, %r15
je 0x11706
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x11f82
leaq 0x20(%r15), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x11f5e
movq (%r13), %rsi
movq %r12, %rdi
callq 0x13e38
movq %r15, %rdi
callq 0x43b0
movq %rax, %r15
jmp 0x116cd
movq %r12, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x13fc8
jmp 0x1169f
leaq -0x70(%rbp), %rdi
callq 0x1230e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11730
jmp 0x11730
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x1230e
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x11d8e
movl (%rax), %eax
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
leaq -0x58(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x60(%rbp), %rdi
callq 0x13e38
leaq -0x60(%rbp), %r12
cmpq $0x0, -0x38(%rbp)
je 0x117f1
leaq -0x58(%rbp), %rdi
callq 0x4210
movl 0x20(%rax), %r15d
movl %r15d, -0x2c(%rbp)
shlq $0x7, %r15
addq 0x20(%r14), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x123ba
movq 0x38(%r15), %r13
addq $0x28, %r15
cmpq %r15, %r13
je 0x117e3
movq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x13e38
movq %r13, %rdi
callq 0x43b0
movq %rax, %r13
jmp 0x117c5
movq %r12, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x13fc8
jmp 0x11792
leaq -0x60(%rbp), %rdi
callq 0x1230e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1180d
jmp 0x1180d
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x1230e
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x20, %rsp
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0x19cca
xorpd %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movapd %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
movq %r12, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x15593
movsd %xmm0, -0x28(%rbp)
movq -0x40(%rbp), %r14
cmpq -0x38(%rbp), %r14
je 0x1580e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18d90
movsd (%rax), %xmm0
addsd 0xdf94(%rip), %xmm0     # 0x23798
movsd %xmm0, (%rax)
addq $0x20, %r14
jmp 0x157e7
leaq -0x40(%rbp), %rdi
callq 0x54b6
movsd -0x28(%rbp), %xmm0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1582b
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x54b6
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x10, %rsp
movapd %xmm0, %xmm4
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movapd 0xdd41(%rip), %xmm0     # 0x237b0
xorpd %xmm2, %xmm0
movapd %xmm0, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm4
andnpd %xmm1, %xmm3
orpd %xmm3, %xmm4
movapd %xmm4, -0x10(%rbp)
minsd %xmm2, %xmm0
callq 0x4600
callq 0x4670
addsd -0x10(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x15d3c
movq %rdx, %rbx
movq %rsi, %r14
movl %ecx, -0x3c(%rbp)
movq %rdi, -0x38(%rbp)
movq %rdx, %rdi
callq 0x19cca
movslq %r15d, %r13
leaq -0x90(%rbp), %rdi
leaq -0x58(%rbp), %rdx
movq %r13, %rsi
callq 0x18e94
movabsq $-0x3fa7000000000000, %r12 # imm = 0xC059000000000000
leaq -0x78(%rbp), %rdx
movq %r12, (%rdx)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rcx
movq %r13, %rsi
callq 0x18ee6
movq -0x58(%rbp), %rax
andq $0x0, (%rax)
leaq -0x60(%rbp), %rdx
movq %r12, (%rdx)
leaq -0x78(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movq %r13, %rsi
callq 0x18ee6
movq -0x70(%rbp), %rax
andq $0x0, -0x8(%rax)
movzbl -0x3c(%rbp), %r8d
leaq -0x90(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x1583f
leaq -0x90(%rbp), %rdx
leaq -0x58(%rbp), %rcx
leaq -0x78(%rbp), %r8
movq %r14, %rsi
movq %rbx, %r9
callq 0x15aa6
shlq $0x20, %r15
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r15, %rax
sarq $0x20, %rax
movq -0x90(%rbp), %rcx
imulq $0x18, %rax, %rax
movq 0x8(%rcx,%rax), %rdx
cmpq (%rcx,%rax), %rdx
je 0x15d46
movq -0x50(%rbp), %rax
movsd -0x8(%rax), %xmm0
jmp 0x15d4e
movsd 0xda4c(%rip), %xmm0     # 0x23790
jmp 0x15d76
movsd 0xda42(%rip), %xmm0     # 0x23790
movsd %xmm0, -0x38(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x1a10a
leaq -0x58(%rbp), %rdi
callq 0x1a10a
leaq -0x90(%rbp), %rdi
callq 0x18f46
movsd -0x38(%rbp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x15d9b
movq %rax, %rbx
jmp 0x15da4
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x1a10a
leaq -0x58(%rbp), %rdi
callq 0x1a10a
leaq -0x90(%rbp), %rdi
callq 0x18f46
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x15eb2
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, -0x58(%rbp)
movl %r8d, -0x38(%rbp)
movq %rdx, %rdi
callq 0x19cca
movslq %r13d, %r12
leaq -0x78(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r12, %rsi
callq 0x18e94
movabsq $-0x3fa7000000000000, %rax # imm = 0xC059000000000000
leaq -0x60(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movq %r12, %rsi
callq 0x18ee6
movq -0x50(%rbp), %rax
andq $0x0, (%rax)
leaq -0x60(%rbp), %rdx
movabsq $-0x3fa7000000000000, %rax # imm = 0xC059000000000000
movq %rax, (%rdx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x18f72
movq 0x8(%r14), %rax
andq $0x0, -0x8(%rax)
movzbl -0x38(%rbp), %r8d
leaq -0x78(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x1583f
leaq -0x78(%rbp), %rdx
leaq -0x50(%rbp), %rcx
movq %r15, %rsi
movq %r14, %r8
movq %rbx, %r9
callq 0x15aa6
shlq $0x20, %r13
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r13, %rax
sarq $0x20, %rax
movq -0x78(%rbp), %rcx
imulq $0x18, %rax, %rax
movq 0x8(%rcx,%rax), %rdx
cmpq (%rcx,%rax), %rdx
je 0x15ebc
movq -0x48(%rbp), %rax
movsd -0x8(%rax), %xmm0
jmp 0x15ec4
movsd 0xd8d6(%rip), %xmm0     # 0x23790
jmp 0x15ee0
movsd 0xd8cc(%rip), %xmm0     # 0x23790
movsd %xmm0, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x1a10a
leaq -0x78(%rbp), %rdi
callq 0x18f46
movsd -0x38(%rbp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15ef6
movq %rax, %rbx
jmp 0x15f02
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a10a
leaq -0x78(%rbp), %rdi
callq 0x18f46
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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>>, 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>>>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
flt_type viterbi(const StringSet &vocab,
                 const string &text,
                 transitions_t &stats,
                 const string &start_end_symbol)
{
    stats.clear();
    vector<string> best_path;
    flt_type lp = viterbi(vocab, text, best_path, true);
    if (best_path.size() == 0) return MIN_FLOAT;
    best_path.insert(best_path.begin(), start_end_symbol);
    best_path.push_back(start_end_symbol);
    for (unsigned int i=1; i<best_path.size(); i++)
        stats[best_path[i-1]][best_path[i]] += 1.0;
    return lp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0x1a3dc
xorpd %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movapd %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
pushq $0x1
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %r8d, %r8d
callq 0x15593
movsd %xmm0, -0x48(%rbp)
movq -0x40(%rbp), %rsi
cmpq %rsi, -0x38(%rbp)
je 0x1604b
leaq -0x40(%rbp), %rdi
movq %r14, %rdx
callq 0x18fac
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x719e
xorl %eax, %eax
leal 0x1(%rax), %r14d
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
cmpq %r14, %rcx
jbe 0x16058
movl %eax, %eax
shlq $0x5, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x19048
movq %r14, %rsi
shlq $0x5, %rsi
addq -0x40(%rbp), %rsi
movq %rax, %rdi
callq 0x18d90
movsd (%rax), %xmm0
addsd 0xd756(%rip), %xmm0     # 0x23798
movsd %xmm0, (%rax)
movl %r14d, %eax
jmp 0x15ffa
movsd 0xd73d(%rip), %xmm0     # 0x23790
movsd %xmm0, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x54b6
movsd -0x48(%rbp), %xmm0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16077
jmp 0x16077
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x54b6
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
xorl %r12d, %r12d
movl %r12d, %r12d
movq -0x38(%rbp), %rcx
movq 0x20(%rcx), %rax
movq 0x28(%rcx), %rcx
subq %rax, %rcx
sarq $0x7, %rcx
cmpq %r12, %rcx
jbe 0x177ee
movq -0x30(%rbp), %rcx
movq (%rcx), %r13
movsd (%r13,%r12,8), %xmm0
ucomisd 0xc016(%rip), %xmm0     # 0x23790
jne 0x17783
jp 0x17783
incl %r12d
jmp 0x17745
movq %r12, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %r14
addq $0x58, %r14
movq 0x10(%r14), %r15
cmpq %r14, %r15
je 0x1777e
movq 0x20(%r15), %rax
movsd (%r13,%r12,8), %xmm1
movq 0x8(%rax), %rcx
addsd (%rcx), %xmm1
movslq 0x4(%rax), %rbx
movsd (%r13,%rbx,8), %xmm0
ucomisd 0xbfcf(%rip), %xmm0     # 0x23790
jne 0x177ce
jp 0x177ce
movsd %xmm1, (%r13,%rbx,8)
jmp 0x177e1
callq 0x15a53
movq -0x30(%rbp), %rax
movq (%rax), %r13
movsd %xmm0, (%r13,%rbx,8)
movq %r15, %rdi
callq 0x43b0
movq %rax, %r15
jmp 0x17796
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/EM.cc
// Function: forward(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, MultiStringFactorGraph const&, std::map<unsigned int, double, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, double>>>&)
flt_type
forward(const string &text,
        const MultiStringFactorGraph &msfg,
        map<msfg_node_idx_t, flt_type> &fw)
{
    map<msfg_node_idx_t, vector<MultiStringFactorGraph::Arc*> > arcs;
    msfg.collect_arcs(text, arcs);

    for (auto ndit = arcs.begin(); ndit != arcs.end(); ++ndit) {

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %rsi
leaq -0x88(%rbp), %rcx
andl $0x0, (%rcx)
andq $0x0, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
andq $0x0, 0x20(%rcx)
leaq -0x90(%rbp), %rdx
movq %rax, -0x48(%rbp)
movq %rax, %rdi
movq %rsi, -0x50(%rbp)
callq 0x11650
movq -0x78(%rbp), %rcx
leaq 0x8(%rbx), %rax
movq %rax, -0x60(%rbp)
leaq -0x88(%rbp), %rax
cmpq %rax, %rcx
je 0x1793f
leaq 0x20(%rcx), %r15
movq %rcx, -0x58(%rbp)
movl 0x20(%rcx), %eax
movq -0x48(%rbp), %rcx
movq 0x20(%rcx), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %r14
addq $0x58, %r14
movq 0x10(%r14), %r13
cmpq %r14, %r13
je 0x1792e
movq 0x20(%r13), %rax
movl 0x4(%rax), %r12d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x19294
movsd (%rax), %xmm0
movq 0x20(%r13), %rax
movq 0x8(%rax), %rax
addsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movl %r12d, -0x2c(%rbp)
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1ae0e
cmpq -0x60(%rbp), %rax
je 0x17905
movl %r12d, -0x2c(%rbp)
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x192e6
movsd (%rax), %xmm0
movsd -0x38(%rbp), %xmm1
callq 0x15a53
movsd %xmm0, -0x38(%rbp)
movl %r12d, -0x3c(%rbp)
movq %rbx, %rdi
leaq -0x3c(%rbp), %rsi
callq 0x192e6
jmp 0x17915
movl %r12d, -0x2c(%rbp)
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x192e6
movsd -0x38(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %r13, %rdi
callq 0x43b0
movq %rax, %r13
jmp 0x17889
movq -0x58(%rbp), %rdi
callq 0x4270
movq %rax, %rcx
jmp 0x17856
movq -0x48(%rbp), %rdi
addq $0x38, %rdi
movq -0x50(%rbp), %rsi
callq 0x11d8e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x19338
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x195fc
movsd -0x38(%rbp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1798e
jmp 0x1798e
jmp 0x1798e
jmp 0x1798e
jmp 0x1798e
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x195fc
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, -0x34(%rbp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x18(%rsi), %r13
addq $0x8, %r15
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
cmpq %r15, %r13
je 0x17fed
leaq 0x20(%r13), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x19102
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
cmpb $0x0, -0x34(%rbp)
je 0x17fbe
movq %rbx, %rdi
movq %r14, %rsi
callq 0x17b1c
jmp 0x17fc9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x17d38
movsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r13, %rdi
callq 0x43b0
movq %rax, %r13
jmp 0x17f8e
movsd -0x30(%rbp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq 0x28(%rdi), %rax
cmpq 0x20(%rdi), %rax
je 0x18722
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x50(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x24(%rbp), %rsi
andl $0x0, (%rsi)
leaq -0x58(%rbp), %rdi
callq 0x192e6
andq $0x0, (%rax)
leaq -0x58(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x177fd
leaq -0x58(%rbp), %rdx
movsd 0xb0b8(%rip), %xmm0     # 0x23798
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x182ac
addq $0x38, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11d8e
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x19294
movsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x19654
movsd -0x20(%rbp), %xmm0
jmp 0x1872a
movsd 0xb066(%rip), %xmm0     # 0x23790
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18737
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x19654
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x30, %rsp
movsd %xmm0, -0x40(%rbp)
movq %rdx, %rbx
xorpd %xmm0, %xmm0
leaq -0x30(%rbp), %rdx
movapd %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
callq 0x1874b
movsd %xmm0, -0x38(%rbp)
xorl %eax, %eax
leal 0x1(%rax), %r14d
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
cmpq %r14, %rcx
jbe 0x18a62
movl %eax, %eax
shlq $0x5, %rax
addq %rax, %rsi
movq %rbx, %rdi
callq 0x19048
movq %r14, %rsi
shlq $0x5, %rsi
addq -0x30(%rbp), %rsi
movq %rax, %rdi
callq 0x18d90
movsd (%rax), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
movl %r14d, %eax
jmp 0x18a14
leaq -0x30(%rbp), %rdi
callq 0x54b6
movsd -0x38(%rbp), %xmm0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x18a7b
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x54b6
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::read_vocab(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>>>&, int&, bool)
int
Unigrams::read_vocab(string fname,
                     map<string, flt_type> &vocab,
                     int &maxlen,
                     bool utf8)
{
    SimpleFileInput vocabfile(fname);

    string line;
    flt_type count;
    maxlen = -1;
    while (vocabfile.getline(line)) {
        stringstream ss(line);
        string word;
        ss >> count;
        ss >> word;
        vocab[word] = count;

        maxlen = max(maxlen, (int)get_factor_length(word, utf8));
    }

    return vocab.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, -0x38(%rbp)
movq %rdi, %rsi
leaq -0xa8(%rbp), %r15
movq %r15, %rdi
callq 0x4460
leaq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x5688
leaq -0xa8(%rbp), %rdi
callq 0x46b8
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
orl $-0x1, (%r14)
leaq -0x88(%rbp), %r15
leaq -0x230(%rbp), %r12
leaq -0x68(%rbp), %r13
movzbl %bl, %ebx
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *(%rax)
testb %al, %al
je 0x1bb11
movq %r12, %rdi
movq %r15, %rsi
pushq $0x18
popq %rdx
callq 0x4520
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq %r12, %rdi
leaq -0x48(%rbp), %rsi
callq 0x4240
movq %r12, %rdi
movq %r13, %rsi
callq 0x43f0
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x18d90
movsd -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %r13, %rdi
movl %ebx, %esi
callq 0x1bb8e
movl (%r14), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl %eax, (%r14)
movq %r13, %rdi
callq 0x46b8
movq %r12, %rdi
callq 0x42b0
jmp 0x1ba82
movq -0x38(%rbp), %rax
movl 0x28(%rax), %ebx
leaq -0x88(%rbp), %rdi
callq 0x46b8
leaq -0x30(%rbp), %rdi
callq 0x577c
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x46b8
jmp 0x1bb86
jmp 0x1bb54
movq %rax, %rbx
jmp 0x1bb71
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x46b8
leaq -0x230(%rbp), %rdi
callq 0x42b0
leaq -0x88(%rbp), %rdi
callq 0x46b8
leaq -0x30(%rbp), %rdi
callq 0x577c
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x1d9fe
movq 0x18(%r15), %r13
addq $0x8, %r15
leaq -0x50(%rbp), %r12
cmpq %r15, %r13
je 0x1c002
leaq 0x20(%r13), %rsi
leaq 0x40(%r13), %rdx
movq %r12, %rdi
callq 0x1da0c
movq %r14, %rdi
movq %r12, %rsi
callq 0x1da2e
movq %r12, %rdi
callq 0x46b8
movq %r13, %rdi
callq 0x43b0
movq %rax, %r13
jmp 0x1bfcd
movq (%r14), %rdi
movq 0x8(%r14), %rsi
leaq -0x624(%rip), %rax      # 0x1b9ec
leaq -0x618(%rip), %rdx      # 0x1b9ff
testb %bl, %bl
cmovneq %rax, %rdx
callq 0x1e41e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x46b8
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x7532
leaq -0x70(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x4460
leaq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x5688
leaq -0x70(%rbp), %rdi
callq 0x46b8
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r14d, %r14d
leaq -0x50(%rbp), %r15
pushq $0xa
popq %r12
pushq $-0x1
popq %r13
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *(%rax)
testb %al, %al
je 0x1c122
movq %r15, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x4260
cmpq $-0x1, %rax
je 0x1c0ff
incq %rax
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x40c0
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x4310
cmpq $-0x1, %rax
je 0x1c112
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x40c0
jmp 0x1c112
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x40b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x719e
incl %r14d
jmp 0x1c0a8
leaq -0x50(%rbp), %rdi
callq 0x46b8
leaq -0x30(%rbp), %rdi
callq 0x577c
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x46b8
jmp 0x1c169
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x46b8
leaq -0x30(%rbp), %rdi
callq 0x577c
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %ebx
movq %rdx, %r14
leaq -0x98(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rsi, -0x38(%rbp)
movq %rdi, %r12
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0xa0(%rbp), %r13
leaq -0x70(%rbp), %r15
subl $0x1, %ebx
jb 0x1c21f
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
andq $0x0, -0x60(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movq %r14, %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x1c264
movsd %xmm0, -0x30(%rbp)
movq %r15, %rdi
callq 0x53c6
movq %r14, %rdi
movq %r13, %rsi
callq 0x1dac8
movq %r14, %rdi
movsd 0x7620(%rip), %xmm0     # 0x23838
callq 0x1c30a
jmp 0x1c1be
leaq -0xa0(%rbp), %rdi
callq 0x543e
movsd -0x30(%rbp), %xmm0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x53c6
jmp 0x1c250
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x543e
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movapd %xmm0, -0x30(%rbp)
movq %rdi, %rbx
callq 0x1c7c2
callq 0x42e0
movsd %xmm0, -0x20(%rbp)
movq 0x18(%rbx), %r14
addq $0x8, %rbx
movabsq $0x7ff0000000000000, %r15 # imm = 0x7FF0000000000000
cmpq %rbx, %r14
je 0x1c3b3
movsd 0x40(%r14), %xmm0
callq 0x42e0
subsd -0x20(%rbp), %xmm0
movq %xmm0, %rax
btrq $0x3f, %rax
movapd -0x30(%rbp), %xmm1
cmpq %r15, %rax
je 0x1c36d
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
movapd -0x30(%rbp), %xmm4
cmpltsd %xmm4, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm1, %xmm3
andpd %xmm4, %xmm2
orpd %xmm3, %xmm2
cmpunordsd %xmm0, %xmm0
movapd %xmm0, %xmm1
andnpd %xmm2, %xmm1
andpd %xmm4, %xmm0
orpd %xmm1, %xmm0
movlpd %xmm0, 0x40(%r14)
movq %r14, %rdi
callq 0x4270
movq %rax, %r14
jmp 0x1c340
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
leaq -0x58(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rdi, %r12
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x60(%rbp), %r13
subl $0x1, %ebx
jb 0x1c437
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x1c468
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x1dac8
movq %r14, %rdi
movsd 0x7408(%rip), %xmm0     # 0x23838
callq 0x1c30a
jmp 0x1c3ff
leaq -0x60(%rbp), %rdi
callq 0x543e
movsd -0x30(%rbp), %xmm0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x543e
movq %rbx, %rdi
callq 0x45f0