LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/EM.cc
// Function: viterbi(StringSet const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 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 0x1c43c
xorpd %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movapd %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movq %r12, %rdi
movq %r15, %rsi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x16b54
movsd %xmm0, -0x48(%rbp)
movq -0x40(%rbp), %rsi
cmpq %rsi, -0x38(%rbp)
je 0x177f7
leaq -0x40(%rbp), %rdi
movq %r14, %rdx
callq 0x1b24e
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x7f60
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0x17804
movl $0x1, %r14d
movl $0x2, %r15d
leal -0x2(%r15), %esi
shlq $0x5, %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x1b318
shlq $0x5, %r14
addq -0x40(%rbp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x1af86
movsd (%rax), %xmm0
addsd 0xf031(%rip), %xmm0     # 0x26808
movsd %xmm0, (%rax)
movl %r15d, %r14d
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
incl %r15d
cmpq %r14, %rcx
ja 0x177a5
jmp 0x17804
movsd 0xf001(%rip), %xmm0     # 0x26800
movsd %xmm0, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movsd -0x48(%rbp), %xmm0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17823
jmp 0x17823
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/EM.cc
// Function: forward(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 $0x28, %rsp
movq %rsi, -0x30(%rbp)
movq 0x20(%rdi), %rax
movq %rdi, -0x38(%rbp)
movq 0x28(%rdi), %rcx
cmpq %rax, %rcx
je 0x19503
movq -0x30(%rbp), %rdx
movq (%rdx), %r13
xorl %r12d, %r12d
movsd (%r13,%r12,8), %xmm0
ucomisd 0xd3d9(%rip), %xmm0     # 0x26800
jne 0x1942f
jnp 0x194ed
movq %r12, %rdx
shlq $0x7, %rdx
leaq (%rax,%rdx), %r14
addq $0x58, %r14
movq 0x10(%r14), %r15
cmpq %r14, %r15
je 0x194ed
movq 0x20(%r15), %rax
movsd (%r13,%r12,8), %xmm1
movq 0x8(%rax), %rcx
addsd (%rcx), %xmm1
movslq 0x4(%rax), %rbx
movsd (%r13,%rbx,8), %xmm2
ucomisd 0xd38f(%rip), %xmm2     # 0x26800
jne 0x1947e
jp 0x1947e
movsd %xmm1, (%r13,%rbx,8)
jmp 0x194cd
movapd %xmm2, %xmm3
subsd %xmm1, %xmm3
movapd %xmm3, %xmm0
xorpd 0xd38e(%rip), %xmm0     # 0x26820
movapd %xmm0, %xmm4
cmpltsd %xmm3, %xmm4
andpd %xmm4, %xmm2
andnpd %xmm1, %xmm4
orpd %xmm2, %xmm4
movapd %xmm4, -0x50(%rbp)
minsd %xmm3, %xmm0
callq 0x4660
callq 0x46e0
addsd -0x50(%rbp), %xmm0
movq -0x30(%rbp), %rax
movq (%rax), %r13
movsd %xmm0, (%r13,%rbx,8)
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq %r14, %rax
jne 0x1944b
movq -0x38(%rbp), %rcx
movq 0x20(%rcx), %rax
movq 0x28(%rcx), %rcx
incl %r12d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x7, %rdx
cmpq %r12, %rdx
ja 0x19418
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/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 %rsi, %r15
movq 0x18(%rsi), %r13
addq $0x8, %r15
cmpq %r15, %r13
je 0x19ee4
movq %rdx, %r14
movq %rdi, %r12
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x20(%r13), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1b3f6
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
cmpb $0x0, -0x34(%rbp)
je 0x19eb0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19903
jmp 0x19ebb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19bde
movsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r13, %rdi
callq 0x4410
movq %rax, %r13
cmpq %r15, %rax
jne 0x19e85
jmp 0x19eed
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
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_O3/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 0x1a7e5
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x50(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0x24(%rbp), %rsi
movl %ecx, (%rsi)
leaq -0x58(%rbp), %rdi
callq 0x1b630
movq $0x0, (%rax)
leaq -0x58(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19512
leaq -0x58(%rbp), %rdx
movsd 0xc065(%rip), %xmm0     # 0x26808
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x1a291
addq $0x38, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x138da
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x1b5c8
movsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x1ba0a
movsd -0x20(%rbp), %xmm0
jmp 0x1a7ed
movsd 0xc013(%rip), %xmm0     # 0x26800
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a7fa
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x1ba0a
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movsd %xmm0, -0x40(%rbp)
movq %rdx, %rbx
xorpd %xmm0, %xmm0
leaq -0x30(%rbp), %rdx
movapd %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
callq 0x1a80e
movsd %xmm0, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0x1ab9a
movl $0x1, %r14d
movl $0x2, %r15d
leal -0x2(%r15), %esi
shlq $0x5, %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x1b318
shlq $0x5, %r14
addq -0x30(%rbp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x1af86
movsd (%rax), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
movl %r15d, %r14d
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
incl %r15d
cmpq %r14, %rcx
ja 0x1ab4d
leaq -0x30(%rbp), %rdi
callq 0x5d4e
movsd -0x38(%rbp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1abb5
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x1fc4c
movq 0x18(%r15), %r12
addq $0x8, %r15
cmpq %r15, %r12
je 0x1dcb5
leaq -0x48(%rbp), %rbx
leaq -0x58(%rbp), %r13
movq %rbx, -0x58(%rbp)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x5f0e
movsd 0x40(%r12), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x1fc92
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1dca5
callq 0x4350
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %r15, %rax
jne 0x1dc67
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x1dd18
leaq -0x7d0(%rip), %rax      # 0x1d4f8
leaq -0x7c4(%rip), %r12      # 0x1d50b
cmpb $0x0, -0x2c(%rbp)
cmovneq %rax, %r12
movq %r14, %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x20626
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20722
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1dd38
callq 0x4350
movq %r14, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x82a2
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r14
movq %r14, %rdi
callq 0x5f0e
leaq -0x28(%rbp), %rdi
movq %r14, %rsi
callq 0x604c
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x1dd95
callq 0x4350
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
xorl %r14d, %r14d
leaq -0x48(%rbp), %r15
movq -0x28(%rbp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *(%rax)
testb %al, %al
je 0x1de3c
movq %r15, %rdi
movl $0xa, %esi
movq $-0x1, %rdx
callq 0x4270
cmpq $-0x1, %rax
je 0x1de1a
leaq 0x1(%rax), %rdx
movq -0x40(%rbp), %rcx
cmpq %rax, %rcx
jbe 0x1de63
movq %rdx, -0x40(%rbp)
movq -0x48(%rbp), %rax
movb $0x0, (%rax,%rdx)
movq %r15, %rdi
movl $0xa, %esi
xorl %edx, %edx
callq 0x4340
cmpq $-0x1, %rax
je 0x1de29
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x40b0
jmp 0x1de29
movq -0x48(%rbp), %rax
movq $0x0, -0x40(%rbp)
movb $0x0, (%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7f60
incl %r14d
jmp 0x1ddb3
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x1de4a
callq 0x4350
leaq -0x28(%rbp), %rdi
callq 0x619e
movl %r14d, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x85b9(%rip), %rdi      # 0x26423
leaq 0x859e(%rip), %rsi      # 0x2640f
xorl %eax, %eax
callq 0x4530
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x1dea7
callq 0x4350
jmp 0x1dea7
jmp 0x1de8d
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x1de9e
callq 0x4350
leaq -0x28(%rbp), %rdi
callq 0x619e
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
leaq -0x98(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
testl %ebx, %ebx
je 0x1df5e
movq %rdx, %r14
xorl %r12d, %r12d
leaq -0xa0(%rbp), %r13
leaq -0x70(%rbp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq %r12, -0x60(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movq %r12, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %r14, %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x1dfac
movsd %xmm0, -0x30(%rbp)
movq %r15, %rdi
callq 0x5c7a
movq %r14, %rdi
movq %r13, %rsi
callq 0x1fcf8
movq %r14, %rdi
movsd 0x8955(%rip), %xmm0     # 0x268a8
callq 0x1e052
decl %ebx
jne 0x1deff
jmp 0x1df66
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x5ce4
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 0x5c7a
jmp 0x1df97
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x5ce4
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1e5b0
callq 0x42f0
movsd %xmm0, -0x20(%rbp)
movq 0x18(%rbx), %r14
addq $0x8, %rbx
cmpq %rbx, %r14
je 0x1e101
movabsq $0x7ff0000000000000, %r15 # imm = 0x7FF0000000000000
movsd 0x40(%r14), %xmm0
callq 0x42f0
subsd -0x20(%rbp), %xmm0
movq %xmm0, %rax
btrq $0x3f, %rax
movapd -0x30(%rbp), %xmm2
movapd %xmm2, %xmm1
cmpq %r15, %rax
movapd %xmm2, %xmm4
je 0x1e0bd
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
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 0x4280
movq %rax, %r14
cmpq %rbx, %rax
jne 0x1e08d
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
leaq -0x58(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
testl %ebx, %ebx
je 0x1e183
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq -0x60(%rbp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x1e1bc
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x1fcf8
movq %r14, %rdi
movsd 0x8730(%rip), %xmm0     # 0x268a8
callq 0x1e052
decl %ebx
jne 0x1e14c
jmp 0x1e18b
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5ce4
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 0x5ce4
movq %rbx, %rdi
callq 0x4650
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::resegment_sents(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&, StringSet 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
Unigrams::resegment_sents(const vector<string> &sents,
                          const StringSet &vocab,
                          map<string, flt_type> &new_freqs)
{
    new_freqs.clear();
    flt_type ll = 0.0;

    for (auto sent = sents.begin(); sent != sents.end(); ++sent) {

        map<string, flt_type> stats;
        flt_type curr_ll = segf(vocab, *sent, stats, this->utf8);

        if (stats.size() == 0) {
            cerr << "warning, no segmentation for sentence: " << *sent << endl;
            continue;
        }

        ll += curr_ll;

        // Update statistics
        for (auto it = stats.begin(); it != stats.end(); ++it)
            new_freqs[it->first] += it->second;
    }

    return ll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movq %rdx, -0x48(%rbp)
movq %rsi, %r14
movq %rdi, -0x40(%rbp)
movq %rcx, %rdi
callq 0x1bf52
movq (%r14), %r13
movq %r14, -0x38(%rbp)
cmpq 0x8(%r14), %r13
je 0x1e57c
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x78(%rbp), %r15
leaq -0x80(%rbp), %r14
movl $0x0, -0x78(%rbp)
xorl %eax, %eax
movq %rax, -0x70(%rbp)
movq %r15, -0x68(%rbp)
movq %r15, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x8(%rax), %ecx
movq -0x48(%rbp), %rdi
movq %r13, %rsi
movq %r14, %r12
movq %r14, %rdx
callq *(%rax)
cmpq $0x0, -0x58(%rbp)
je 0x1e507
movsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
movq -0x68(%rbp), %r14
cmpq %r15, %r14
je 0x1e55d
leaq 0x20(%r14), %rsi
movsd 0x40(%r14), %xmm0
movsd %xmm0, -0x50(%rbp)
movq %rbx, %rdi
callq 0x1af86
movsd -0x50(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x4280
movq %rax, %r14
cmpq %r15, %rax
jne 0x1e4d1
jmp 0x1e55d
movl $0x27, %edx
movq 0x15ad5(%rip), %rdi     # 0x33fe8
leaq 0x83da(%rip), %rsi      # 0x268f4
callq 0x4400
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x15aba(%rip), %rdi     # 0x33fe8
callq 0x4400
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4260
movq %r12, %rdi
callq 0x5ce4
movq %r12, %r14
addq $0x20, %r13
movq -0x38(%rbp), %rax
cmpq 0x8(%rax), %r13
jne 0x1e47f
jmp 0x1e585
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e59b
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x5ce4
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rax
addq $0x8, %rbx
xorpd %xmm0, %xmm0
cmpq %rbx, %rax
je 0x1e60f
movsd %xmm0, -0x18(%rbp)
movabsq $0x7ff0000000000000, %r14 # imm = 0x7FF0000000000000
movq 0x40(%rax), %xmm0
movq %xmm0, %rcx
btrq $0x3f, %rcx
cmpq %r14, %rcx
jge 0x1e600
movsd -0x18(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x18(%rbp)
movq %rax, %rdi
callq 0x4410
cmpq %rbx, %rax
jne 0x1e5de
jmp 0x1e614
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x42f0
movq 0x18(%rbx), %r14
addq $0x8, %rbx
cmpq %rbx, %r14
je 0x1e6a8
xorps %xmm1, %xmm1
movsd %xmm0, -0x28(%rbp)
movaps %xmm1, -0x20(%rbp)
movsd 0x40(%r14), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x42f0
subsd -0x28(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movapd -0x20(%rbp), %xmm3
movapd %xmm3, %xmm2
addsd %xmm0, %xmm2
cmpunordsd %xmm0, %xmm0
movapd %xmm0, %xmm1
andnpd %xmm2, %xmm1
andpd %xmm3, %xmm0
orpd %xmm1, %xmm0
movapd %xmm0, -0x20(%rbp)
movq %r14, %rdi
callq 0x4410
movaps -0x20(%rbp), %xmm0
movq %rax, %r14
movaps %xmm0, %xmm1
cmpq %rbx, %rax
jne 0x1e64a
jmp 0x1e6ab
xorps %xmm0, %xmm0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movsd %xmm0, -0x50(%rbp)
movq 0x18(%rsi), %r15
movq %rsi, -0x40(%rbp)
leaq 0x8(%rsi), %r14
cmpq %r14, %r15
je 0x1e7b1
movl %ecx, %ebx
movq %rdx, %r13
movq %rdi, %r12
leaq 0x8(%rdx), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x2c(%rbp)
movq %rdi, -0x38(%rbp)
movsd -0x50(%rbp), %xmm0
ucomisd 0x40(%r15), %xmm0
jb 0x1e76c
movq 0x28(%r15), %rax
cmpb $0x1, 0x8(%r12)
jne 0x1e750
testq %rax, %rax
je 0x1e754
movq 0x20(%r15), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
movb (%rdx,%rsi), %r8b
movl $0x1, %edi
testb %r8b, %r8b
jns 0x1e745
movl $0x4, %edi
cmpb $-0x11, %r8b
ja 0x1e745
cmpb $-0x20, %r8b
movl $0x2, %edi
sbbl $-0x1, %edi
addl %edi, %esi
incl %ecx
cmpq %rsi, %rax
ja 0x1e720
jmp 0x1e756
movl %eax, %ecx
jmp 0x1e756
xorl %ecx, %ecx
cmpl %ebx, %ecx
jb 0x1e76c
leaq 0x20(%r15), %rsi
movq %r13, %rdi
callq 0x10c22
cmpq -0x48(%rbp), %rax
je 0x1e782
movq %r15, %rdi
callq 0x4280
movq %rax, %r15
cmpq %r14, %r15
jne 0x1e6fa
jmp 0x1e7b8
movq %r15, %rdi
callq 0x4280
movl %ebx, %r12d
movq %r13, %rbx
movq %rax, %r13
movq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x212fa
incl -0x2c(%rbp)
movq %r13, %r15
movq %rbx, %r13
movl %r12d, %ebx
movq -0x38(%rbp), %r12
jmp 0x1e777
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/defs.hh
// Function: sub_log_domain_probs(double, double)
static flt_type sub_log_domain_probs(flt_type a, flt_type b) {
    flt_type delta = b - a;
    if (delta > 0) {
      fprintf(stderr, "invalid call to sub_log_domain_probs, a should be bigger than b (a=%f,b=%f)\n",a,b);
      exit(1);
    }
    return a + log1p(-exp(delta));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
ja 0x1f4f8
callq 0x4660
xorpd 0x7337(%rip), %xmm0     # 0x26820
callq 0x46e0
addsd 0x6fba(%rip), %xmm0     # 0x264b0
popq %rbp
retq
callq 0x4bb6
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::normalize(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
Bigrams::normalize(transitions_t &trans_stats)
{
    for (auto srcit = trans_stats.begin(); srcit != trans_stats.end(); ++srcit) {
        flt_type normalizer = MIN_FLOAT;
        for (auto tgtit = srcit->second.begin(); tgtit != srcit->second.end(); ++tgtit)
            if (normalizer == MIN_FLOAT) normalizer = tgtit->second;
            else normalizer = add_log_domain_probs(normalizer, tgtit->second);
        for (auto tgtit = srcit->second.begin(); tgtit != srcit->second.end(); ++tgtit)
            tgtit->second -= normalizer;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %r14
addq $0x8, %rbx
cmpq %rbx, %r14
je 0x22235
movq 0x58(%r14), %r15
leaq 0x48(%r14), %r12
movsd 0x468b(%rip), %xmm3     # 0x26800
cmpq %r12, %r15
je 0x221f2
ucomisd 0x467e(%rip), %xmm3     # 0x26800
movsd 0x40(%r15), %xmm1
jne 0x22193
jp 0x22193
movapd %xmm1, -0x30(%rbp)
jmp 0x221d9
movapd %xmm3, %xmm2
subsd %xmm1, %xmm2
movapd %xmm2, %xmm0
xorpd 0x4679(%rip), %xmm0     # 0x26820
movapd %xmm0, %xmm4
cmpltsd %xmm2, %xmm4
andpd %xmm4, %xmm3
andnpd %xmm1, %xmm4
orpd %xmm3, %xmm4
movapd %xmm4, -0x30(%rbp)
minsd %xmm2, %xmm0
callq 0x4660
callq 0x46e0
addsd -0x30(%rbp), %xmm0
movapd %xmm0, -0x30(%rbp)
movq %r15, %rdi
callq 0x4280
movq %rax, %r15
cmpq %r12, %rax
movapd -0x30(%rbp), %xmm3
jne 0x2217a
movq 0x58(%r14), %r15
cmpq %r12, %r15
movapd %xmm3, -0x30(%rbp)
je 0x22221
movsd 0x40(%r15), %xmm0
subsd %xmm3, %xmm0
movsd %xmm0, 0x40(%r15)
movq %r15, %rdi
callq 0x4280
movapd -0x30(%rbp), %xmm3
movq %rax, %r15
cmpq %r12, %rax
jne 0x221fc
movq %r14, %rdi
callq 0x4280
movq %rax, %r14
cmpq %rbx, %rax
jne 0x22165
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::remove_transitions(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::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
Bigrams::remove_transitions(vector<string> &to_remove,
                            transitions_t &transitions)
{
    for (auto it = to_remove.begin(); it != to_remove.end(); ++it)
        transitions.erase(*it);

    for (auto srcit = transitions.begin(); srcit != transitions.end(); ++srcit)
        for (auto it = to_remove.begin(); it != to_remove.end(); ++it)
            srcit->second.erase(*it);

    for (auto srcit = transitions.begin(); srcit != transitions.end();)
        if (srcit->second.size() == 0) transitions.erase(srcit++);
        else ++srcit;

    normalize(transitions);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movq %rdi, %r14
movq (%rdi), %r15
cmpq 0x8(%rdi), %r15
je 0x227e9
movq %r13, %rdi
movq %r15, %rsi
callq 0x23d82
movq %r13, %rdi
movq %rax, %rsi
callq 0x23e3e
addq $0x20, %r15
cmpq 0x8(%r14), %r15
jne 0x227c9
movq 0x18(%r13), %r12
leaq 0x8(%r13), %rbx
cmpq %rbx, %r12
je 0x22842
movq %r13, -0x30(%rbp)
movq (%r14), %rax
cmpq %r15, %rax
je 0x2282a
leaq 0x40(%r12), %r13
movq %rax, %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x23f12
movq %r13, %rdi
movq %rax, %rsi
callq 0x23fce
addq $0x20, %r15
cmpq 0x8(%r14), %r15
jne 0x2280a
movq %r12, %rdi
callq 0x4280
movq %rax, %r12
cmpq %rbx, %rax
jne 0x227fa
movq -0x30(%rbp), %r13
movq 0x18(%r13), %r12
cmpq %rbx, %r12
je 0x2286f
movq 0x68(%r12), %r15
movq %r12, %rdi
callq 0x4280
movq %rax, %r14
testq %r15, %r15
jne 0x22867
movq %r13, %rdi
movq %r12, %rsi
callq 0x24082
movq %r14, %r12
cmpq %rbx, %r14
jne 0x22847
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22142
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::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>>> const&, double, 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>>>>>>&, MultiStringFactorGraph&)
int
Bigrams::cutoff(const map<string, flt_type> &unigram_stats,
                flt_type cutoff,
                transitions_t &transitions,
                MultiStringFactorGraph &msfg)
{
    vector<string> to_remove;
    for (auto it = unigram_stats.begin(); it != unigram_stats.end(); ++it)
        if (it->second < cutoff && it->first.length() > 2) to_remove.push_back(it->first);

    remove_transitions(to_remove, transitions);

    for (unsigned int i=0; i<to_remove.size(); i++)
        msfg.remove_arcs(to_remove[i]);

    return to_remove.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movsd %xmm0, -0x48(%rbp)
movq %rdi, %r15
xorpd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq 0x18(%rdi), %r12
addq $0x8, %r15
cmpq %r15, %r12
je 0x22a50
leaq -0x40(%rbp), %r13
movsd -0x48(%rbp), %xmm0
ucomisd 0x40(%r12), %xmm0
jbe 0x22a40
cmpq $0x3, 0x28(%r12)
jb 0x22a40
leaq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x7f60
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %r15, %rax
jne 0x22a1d
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x227ac
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %r14
subq %rax, %r14
je 0x22a9c
movl $0x1, %r15d
xorl %esi, %esi
shlq $0x5, %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x121ee
movl %r15d, %esi
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %r14
subq %rax, %r14
sarq $0x5, %r14
incl %r15d
cmpq %rsi, %r14
ja 0x22a71
jmp 0x22aa0
sarq $0x5, %r14
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x22abf
jmp 0x22abf
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
nop
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::transition_count(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>>>>>> const&)
int
Bigrams::transition_count(const transitions_t &transitions)
{
    int count = 0;
    for (auto srcit = transitions.cbegin(); srcit != transitions.cend(); ++srcit)
        for (auto tgtit = srcit->second.cbegin(); tgtit != srcit->second.cend(); ++tgtit)
            count++;
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %r15
addq $0x8, %rbx
xorl %r14d, %r14d
cmpq %rbx, %r15
je 0x22dae
movq 0x58(%r15), %rax
leaq 0x48(%r15), %r12
cmpq %r12, %rax
je 0x22d9e
incl %r14d
movq %rax, %rdi
callq 0x4410
jmp 0x22d8c
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq %rbx, %rax
jne 0x22d84
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::reverse_transitions(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>>>>>> 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>>>>>>&)
void
Bigrams::reverse_transitions(const transitions_t &transitions,
                             transitions_t &reverse_transitions)
{
    reverse_transitions.clear();
    for (auto srcit = transitions.cbegin(); srcit != transitions.cend(); ++srcit)
        for (auto tgtit = srcit->second.cbegin(); tgtit != srcit->second.cend(); ++tgtit)
            reverse_transitions[tgtit->first][srcit->first] = tgtit->second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1c43c
movq 0x18(%r14), %r15
addq $0x8, %r14
movq %r14, -0x30(%rbp)
cmpq %r14, %r15
je 0x22e9d
movq 0x58(%r15), %r12
leaq 0x48(%r15), %r14
cmpq %r14, %r12
je 0x22e8c
leaq 0x20(%r15), %r13
leaq 0x20(%r12), %rsi
movsd 0x40(%r12), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %rbx, %rdi
callq 0x1b318
movq %rax, %rdi
movq %r13, %rsi
callq 0x1af86
movsd -0x38(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %r14, %rax
jne 0x22e4f
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq -0x30(%rbp), %rax
jne 0x22e3e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq