LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::learn_map(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&)
void
StringSet::learn_map(const map<string, flt_type> &vocab)
{
    for (int i=0; i<256; i++) charmap[i] = 255;

    map<unsigned char, int> charcounts;
    for (auto it = vocab.begin(); it != vocab.end(); ++it) {
        for (const char &chr : it->first) charcounts[(unsigned char)chr]++;
    }

    vector<pair<unsigned char, int> > sorted_charcounts;
    for (auto it = charcounts.begin(); it != charcounts.end(); ++it) {
        pair<unsigned char, int> ccount = make_pair(it->first, it->second);
        sorted_charcounts.push_back(ccount);
    }
    sort(sorted_charcounts.begin(), sorted_charcounts.end(), rank_desc_sort);

    unsigned char idx = 0;
    character_count = charcounts.size();
    for (auto it = sorted_charcounts.begin(); it != sorted_charcounts.end(); ++it) {
        charmap[it->first] = idx;
        idx++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0xb749
movb $-0x1, 0x1c(%rdi,%rax)
incq %rax
jmp 0xb737
movq %rdi, -0x48(%rbp)
leaq -0x88(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x18(%rsi), %rax
addq $0x8, %rsi
movq %rsi, -0x50(%rbp)
leaq -0x90(%rbp), %r12
leaq -0x40(%rbp), %r13
cmpq -0x50(%rbp), %rax
je 0xb7be
movq 0x20(%rax), %rbx
movq %rax, -0x58(%rbp)
movq 0x28(%rax), %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0xb7b3
movb (%rbx,%r15), %al
movb %al, -0x40(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0xc0c0
incl (%rax)
incq %r15
jmp 0xb795
movq -0x58(%rbp), %rdi
callq 0x43b0
jmp 0xb780
leaq -0x40(%rbp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq -0x78(%rbp), %r12
leaq -0x60(%rbp), %r15
leaq -0x88(%rbp), %rbx
cmpq %rbx, %r12
je 0xb810
movzbl 0x20(%r12), %eax
movl 0x24(%r12), %ecx
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, -0x60(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xc112
movq %r12, %rdi
callq 0x4270
movq %rax, %r12
jmp 0xb7dd
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq 0x7c5(%rip), %rdx       # 0xbfe4
callq 0xc986
movl -0x68(%rbp), %eax
movq -0x48(%rbp), %rdi
movl %eax, 0x11c(%rdi)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
xorl %edx, %edx
cmpq %rcx, %rax
je 0xb84f
movzbl (%rax), %esi
movb %dl, 0x1c(%rdi,%rsi)
incb %dl
addq $0x8, %rax
jmp 0xb83b
leaq -0x40(%rbp), %rdi
callq 0xc824
leaq -0x90(%rbp), %rdi
callq 0x55c0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb875
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xc824
jmp 0xb886
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x55c0
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, double)
void
StringSet::add(const string &factor, flt_type cost)
{
    Node *node = &root_node;
    int i=0;
    for (; i < (int)factor.length()-1; i++)
        node = insert(factor[i], "" , 0.0, node);
    insert(factor[i], factor, cost, node);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movsd %xmm0, -0x40(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
xorl %r14d, %r14d
leaq -0x60(%rbp), %r13
movq %rdi, -0x38(%rbp)
movl 0x8(%rbx), %eax
decl %eax
cltq
cmpq %rax, %r14
jge 0xb90d
movq (%rbx), %rax
movsbl (%rax,%r14), %r12d
movq %r13, %rdi
leaq 0x17c48(%rip), %rsi     # 0x23527
leaq -0x29(%rbp), %rdx
callq 0x4140
xorps %xmm0, %xmm0
movq -0x38(%rbp), %rdi
movl %r12d, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0xb9e2
movq %rax, %r15
movq %r13, %rdi
callq 0x46b8
incq %r14
jmp 0xb8c1
movq (%rbx), %rax
movsbl (%rax,%r14), %esi
movq -0x38(%rbp), %rdi
movq %rbx, %rdx
movsd -0x40(%rbp), %xmm0
movq %r15, %rcx
callq 0xb9e2
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x46b8
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::clear(StringSet::Node*)
void
StringSet::clear(Node *node)
{
    for (auto ait = node->arcs.begin(); ait != node->arcs.end(); ++ait) {
        if (*ait != nullptr) {
            clear((*ait)->target_node);
            delete (*ait)->target_node;
            delete *ait;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r12
cmpq 0x8(%rbx), %r12
je 0xb9d8
movq (%r12), %rax
testq %rax, %rax
je 0xb9d2
movq 0x28(%rax), %rsi
movq %r14, %rdi
callq 0xb96c
movq (%r12), %rax
movq 0x28(%rax), %r15
testq %r15, %r15
je 0xb9b0
movq %r15, %rdi
callq 0xc136
movq %r15, %rdi
callq 0x4320
movq (%r12), %r15
testq %r15, %r15
je 0xb9ca
leaq 0x8(%r15), %rdi
callq 0x46b8
movq %r15, %rdi
callq 0x4320
addq $0x8, %r12
jmp 0xb980
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::insert(char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, double, StringSet::Node*)
StringSet::Node*
StringSet::insert(char letter,
                  const string &factor,
                  flt_type cost,
                  StringSet::Node *node)
{
    // Find a possible existing arc with the letter
    Arc *arc = find_arc(letter, node);

    // No existing arc: create a new arc
    if (arc == nullptr) {
        Node *new_node = new Node();
        unsigned int remapped = remap_char(letter); // unsigned char!
        if (node->arcs.size() < remapped+1) node->arcs.resize(remapped+1, nullptr);
        arc = new Arc(letter, factor, new_node, cost);
        node->arcs[remapped] = arc;
    }

    // Update the existing arc if factor was set
    else if (factor.length() > 0) {
        if (arc->factor.length() == 0) arc->factor = factor;
        arc->cost = cost;
    }

    // Maintain the length of the longest factor
    if ((int)factor.length() > max_factor_length)
        max_factor_length = factor.length();

    return arc->target_node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movl %esi, %r13d
movq %rdi, %rbx
movzbl %r13b, %r14d
movzbl 0x1c(%rdi,%r14), %eax
movq (%rcx), %rcx
movq 0x8(%r15), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
cmpq %rax, %rsi
jbe 0xba5e
movq (%rcx,%rax,8), %r12
testq %r12, %r12
je 0xba5e
cmpq $0x0, 0x8(%rdx)
je 0xbaff
cmpq $0x0, 0x10(%r12)
jne 0xba52
leaq 0x8(%r12), %rdi
movq %rdx, %rsi
movq %rdx, %r14
movsd %xmm0, -0x30(%rbp)
callq 0x41c0
movsd -0x30(%rbp), %xmm0
movq %r14, %rdx
movsd %xmm0, 0x30(%r12)
jmp 0xbaff
movsd %xmm0, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
pushq $0x18
popq %rdi
callq 0x4350
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
callq 0xbff8
movq %r12, -0x40(%rbp)
movzbl 0x1c(%rbx,%r14), %r14d
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x3, %rax
cmpq %r14, %rax
ja 0xbaaa
leaq 0x1(%r14), %rsi
leaq -0x68(%rbp), %rdx
andq $0x0, (%rdx)
movq %r15, %rdi
callq 0xc03e
pushq $0x38
popq %rdi
callq 0x4350
movq %rax, %r12
leaq -0x60(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x4460
movb %r13b, (%r12)
movq %r12, %rdi
addq $0x8, %rdi
leaq -0x60(%rbp), %rsi
callq 0x4460
movq -0x40(%rbp), %rax
movq %rax, 0x28(%r12)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x30(%r12)
leaq -0x60(%rbp), %rdi
callq 0x46b8
movq (%r15), %rax
movq %r12, (%rax,%r14,8)
movq -0x38(%rbp), %rdx
movl 0x8(%rdx), %eax
cmpl %eax, 0x18(%rbx)
jge 0xbb0a
movl %eax, 0x18(%rbx)
movq 0x28(%r12), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x46b8
jmp 0xbb31
jmp 0xbb2e
movq %rax, %rbx
movq %r12, %rdi
callq 0x4320
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::includes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
bool
StringSet::includes(const string &factor) const
{
    const StringSet::Node *node = &root_node;
    StringSet::Arc *arc = nullptr;
    for (unsigned int i=0; i<factor.length(); i++) {
        arc = find_arc(factor[i], node);
        if (arc == nullptr) return false;
        node = arc->target_node;
    }
    if (arc->factor.length() == 0) return false;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
xorl %esi, %esi
movq %rdi, %r8
xorl %edx, %edx
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0xbbcc
movzbl (%rax,%rdx), %esi
movzbl 0x1c(%rdi,%rsi), %esi
movq (%r8), %r9
movq 0x8(%r8), %r8
subq %r9, %r8
sarq $0x3, %r8
cmpq %rsi, %r8
jbe 0xbbc8
movq (%r9,%rsi,8), %rsi
testq %rsi, %rsi
je 0xbbc8
movq 0x28(%rsi), %r8
incl %edx
jmp 0xbb94
xorl %eax, %eax
jmp 0xbbd4
cmpq $0x0, 0x10(%rsi)
setne %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::get_score(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
flt_type
StringSet::get_score(const string &factor) const
{
    const StringSet::Node *node = &root_node;
    StringSet::Arc *arc = nullptr;
    for (unsigned int i=0; i<factor.length(); i++) {
        arc = find_arc(factor[i], node);
        if (arc == nullptr) throw string("could not find factor");
        node = arc->target_node;
    }
    if (arc->factor.length() == 0) throw string("could not find factor");
    return arc->cost;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
xorl %esi, %esi
movq %rdi, %r8
xorl %edx, %edx
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0xbc23
movzbl (%rax,%rdx), %esi
movzbl 0x1c(%rdi,%rsi), %esi
movq (%r8), %r9
movq 0x8(%r8), %r8
subq %r9, %r8
sarq $0x3, %r8
cmpq %rsi, %r8
jbe 0xbc38
movq (%r9,%rsi,8), %rsi
testq %rsi, %rsi
je 0xbc38
movq 0x28(%rsi), %r8
incl %edx
jmp 0xbbef
cmpq $0x0, 0x10(%rsi)
je 0xbc6c
movsd 0x30(%rsi), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x4190
movq %rax, %rbx
leaq 0x179ac(%rip), %rsi     # 0x235f6
leaq -0x12(%rbp), %rdx
movq %rax, %rdi
callq 0x4140
leaq 0x290fb(%rip), %rsi     # 0x34d58
movq 0x2933c(%rip), %rdx     # 0x34fa0
movq %rbx, %rdi
callq 0x45c0
pushq $0x20
popq %rdi
callq 0x4190
movq %rax, %rbx
leaq 0x17978(%rip), %rsi     # 0x235f6
leaq -0x11(%rbp), %rdx
movq %rax, %rdi
callq 0x4140
jmp 0xbc56
jmp 0xbc8e
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::remove(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
flt_type
StringSet::remove(const string &factor)
{
    StringSet::Node *node = &root_node;
    StringSet::Arc *arc = nullptr;

    for (unsigned int i=0; i<factor.length(); i++) {
        arc = find_arc(factor[i], node);
        if (arc == nullptr) throw string("could not remove factor");
        node = arc->target_node;
    }
    arc->factor.clear();
    flt_type cost = arc->cost;
    arc->cost = 0.0;
    return cost;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
xorl %edx, %edx
xorl %esi, %esi
movq %rdi, %r8
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0xbcef
movzbl (%rax,%rdx), %esi
movzbl 0x1c(%rdi,%rsi), %esi
movq (%r8), %r9
movq 0x8(%r8), %r8
subq %r9, %r8
sarq $0x3, %r8
cmpq %rsi, %r8
jbe 0xbd0e
movq (%r9,%rsi,8), %rsi
testq %rsi, %rsi
je 0xbd0e
movq 0x28(%rsi), %r8
incl %edx
jmp 0xbcbb
andq $0x0, 0x10(%rsi)
movq 0x8(%rsi), %rax
movb $0x0, (%rax)
movsd 0x30(%rsi), %xmm0
andq $0x0, 0x30(%rsi)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x4190
movq %rax, %rbx
leaq 0x178ec(%rip), %rsi     # 0x2360c
leaq -0x11(%rbp), %rdx
movq %rax, %rdi
callq 0x4140
leaq 0x29025(%rip), %rsi     # 0x34d58
movq 0x29266(%rip), %rdx     # 0x34fa0
movq %rbx, %rdi
callq 0x45c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::assign_scores(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&)
void
StringSet::assign_scores(const map<string, flt_type> &vocab)
{
    for (auto it = vocab.begin(); it != vocab.end(); ++it) {
        string factor(it->first);
        Node *node = &root_node;
        int i=0;
        for (; i < (int)factor.length()-1; i++)
            node = insert(factor[i], "" , 0.0, node);
        insert(factor[i], factor, it->second, node);
    }

    vector<Arc*> arcs;
    collect_arcs(arcs);

    for (auto ait = arcs.begin(); ait != arcs.end(); ++ait) {
        if (vocab.find((*ait)->factor) == vocab.end()) {
            (*ait)->factor.clear();
            (*ait)->cost = 0.0;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r12
movq 0x18(%rsi), %rax
movq %rsi, -0x58(%rbp)
leaq 0x8(%rsi), %r15
leaq -0x50(%rbp), %r13
leaq -0x88(%rbp), %rbx
movq %r15, -0x60(%rbp)
cmpq %r15, %rax
je 0xbe2e
movq %rax, -0x68(%rbp)
leaq 0x20(%rax), %rsi
movq %r13, %rdi
callq 0x4460
xorl %r13d, %r13d
movq %r12, %r14
movl -0x48(%rbp), %eax
decl %eax
cltq
cmpq %rax, %r13
jge 0xbdf0
movq -0x50(%rbp), %rax
movb (%rax,%r13), %r15b
movq %rbx, %rdi
leaq 0x17765(%rip), %rsi     # 0x23527
leaq -0x29(%rbp), %rdx
callq 0x4140
movsbl %r15b, %esi
xorps %xmm0, %xmm0
movq %r12, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xb9e2
movq %rax, %r14
movq %rbx, %rdi
callq 0x46b8
incq %r13
jmp 0xbda4
movq -0x50(%rbp), %rax
movsbl (%rax,%r13), %esi
movq -0x68(%rbp), %r15
movsd 0x40(%r15), %xmm0
movq %r12, %rdi
leaq -0x50(%rbp), %r13
movq %r13, %rdx
movq %r14, %rcx
callq 0xb9e2
movq %r13, %rdi
callq 0x46b8
movq %r15, %rdi
callq 0x43b0
movq -0x60(%rbp), %r15
jmp 0xbd85
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %r12, %rdi
callq 0xbed4
movq -0x50(%rbp), %rbx
movq -0x58(%rbp), %r14
cmpq -0x48(%rbp), %rbx
je 0xbe84
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0xc3dc
cmpq %r15, %rax
jne 0xbe7e
movq (%rbx), %rax
andq $0x0, 0x10(%rax)
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movq (%rbx), %rax
andq $0x0, 0x30(%rax)
addq $0x8, %rbx
jmp 0xbe4d
leaq -0x50(%rbp), %rdi
callq 0xc136
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbea0
jmp 0xbebf
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0xc136
jmp 0xbecb
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x46b8
jmp 0xbec2
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/StringSet.cc
// Function: StringSet::collect_arcs(std::vector<StringSet::Arc*, std::allocator<StringSet::Arc*>>&)
void
StringSet::collect_arcs(vector<Arc*> &arcs)
{
    vector<Node*> nodes_to_process;
    nodes_to_process.push_back(&root_node);

    while (nodes_to_process.size() > 0) {
        Node *node = nodes_to_process.back();
        nodes_to_process.pop_back();

        for (auto ait = node->arcs.begin(); ait != node->arcs.end(); ++ait) {
            if (*ait == nullptr) continue;
            arcs.push_back(*ait);
            nodes_to_process.push_back((*ait)->target_node);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
leaq -0x40(%rbp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq -0x48(%rbp), %rsi
movq %rdi, (%rsi)
movq %rax, %rdi
callq 0xc47a
leaq -0x40(%rbp), %r14
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0xbf4f
movq -0x8(%rax), %r12
addq $-0x8, %rax
movq %rax, -0x38(%rbp)
movq (%r12), %r15
cmpq 0x8(%r12), %r15
je 0xbf08
cmpq $0x0, (%r15)
je 0xbf49
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc078
movq (%r15), %rsi
addq $0x28, %rsi
movq %r14, %rdi
callq 0xc09c
addq $0x8, %r15
jmp 0xbf22
leaq -0x40(%rbp), %rdi
callq 0xc466
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbf67
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xc466
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::string_count()
unsigned int
StringSet::string_count()
{
    vector<Arc*> arcs;
    collect_arcs(arcs);

    unsigned int count = 0;
    for (auto ait = arcs.begin(); ait != arcs.end(); ++ait) {
        if (*ait == nullptr) continue;
        if ((*ait)->factor.length() > 0) count++;
    }
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
xorps %xmm0, %xmm0
leaq -0x20(%rbp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
callq 0xbed4
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
xorl %ebx, %ebx
cmpq %rcx, %rax
je 0xbfbe
movq (%rax), %rdx
testq %rdx, %rdx
je 0xbfb8
cmpq $0x1, 0x10(%rdx)
sbbl $-0x1, %ebx
addq $0x8, %rax
jmp 0xbfa3
leaq -0x20(%rbp), %rdi
callq 0xc136
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rdi
callq 0xc136
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::set_text(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>> const&, int)
void
FactorGraph::set_text(const string &text,
                      const string &start_end_symbol,
                      const map<string, flt_type> &vocab,
                      int maxlen)
{
    this->text.assign(text);
    this->start_end_symbol.assign(start_end_symbol);
    if (text.length() == 0) return;

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

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

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

    prune_and_create_arcs(incoming);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %r12d
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
callq 0x41c0
leaq 0x20(%rbx), %rdi
movq %r13, %rsi
callq 0x41c0
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0xd174
movq %r15, -0x38(%rbp)
incq %rsi
leaq -0x50(%rbp), %r13
leaq -0x2a(%rbp), %r15
movq %r13, %rdi
movq %r15, %rdx
callq 0xe810
movq (%r13), %rdi
andw $0x0, (%r15)
leaq -0x2a(%rbp), %rsi
callq 0xf180
leaq -0x50(%rbp), %r8
movq %rbx, %rdi
movq %r14, %rsi
movq -0x38(%rbp), %rdx
movl %r12d, %ecx
callq 0xd44c
movq -0x50(%rbp), %rax
imulq $0x38, 0x8(%r14), %rcx
cmpq $0x0, 0x18(%rax,%rcx)
je 0xd15f
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0xdb72
jmp 0xd16b
addq $0x40, %rbx
movq %rbx, %rdi
callq 0xe862
leaq -0x50(%rbp), %rdi
callq 0xe870
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd185
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0xe870
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::set_text(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, StringSet const&)
void
FactorGraph::set_text(const string &text,
                      const string &start_end_symbol,
                      const StringSet &vocab)
{
    this->text.assign(text);
    this->start_end_symbol.assign(start_end_symbol);
    if (text.length() == 0) return;

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

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

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

    prune_and_create_arcs(incoming);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
callq 0x41c0
leaq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x41c0
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0xd426
incq %rsi
leaq -0x48(%rbp), %r12
leaq -0x2a(%rbp), %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0xe810
movq (%r12), %rdi
andw $0x0, (%r13)
leaq -0x2a(%rbp), %rsi
callq 0xf180
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xd9ba
movq -0x48(%rbp), %rax
imulq $0x38, 0x8(%r14), %rcx
cmpq $0x0, 0x18(%rax,%rcx)
je 0xd411
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0xdb72
jmp 0xd41d
addq $0x40, %rbx
movq %rbx, %rdi
callq 0xe862
leaq -0x48(%rbp), %rdi
callq 0xe870
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd437
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0xe870
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/defs.hh
// Function: get_character_positions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<unsigned int, std::allocator<unsigned int>>&, bool)
static void get_character_positions(const std::string &word,
                                    std::vector<unsigned int> &positions,
                                    bool utf8=false)
{
    if (utf8)
        get_character_positions_utf8(word, positions);
    else
        get_character_positions_onebyte(word, positions);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testl %edx, %edx
je 0xd70d
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0xd6b1
movq %rax, 0x8(%rbx)
leaq -0x2c(%rbp), %r15
andl $0x0, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xea9e
andl $0x0, (%r15)
xorl %eax, %eax
pushq $0x1
popq %r12
pushq $0x4
popq %r13
movl %eax, %eax
cmpq %rax, 0x8(%r14)
jbe 0xd758
movq (%r14), %rcx
movb (%rcx,%rax), %dl
movl %r12d, %ecx
testb %dl, %dl
jns 0xd6f8
movl %r13d, %ecx
cmpb $-0x11, %dl
ja 0xd6f8
cmpb $-0x20, %dl
pushq $0x2
popq %rcx
sbbl $-0x1, %ecx
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe79a
movl -0x2c(%rbp), %eax
jmp 0xd6d2
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x4460
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0xd726
movq %rax, 0x8(%rbx)
xorl %eax, %eax
leaq -0x2c(%rbp), %r14
movl %eax, -0x2c(%rbp)
movl %eax, %eax
movq -0x48(%rbp), %rcx
incq %rcx
cmpq %rax, %rcx
jbe 0xd74f
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe79a
movl -0x2c(%rbp), %eax
incl %eax
jmp 0xd72c
leaq -0x50(%rbp), %rdi
callq 0x46b8
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/FactorGraph.cc
// Function: FactorGraph::assert_equal(FactorGraph const&) const
bool
FactorGraph::assert_equal(const FactorGraph &other) const
{
    if (nodes.size() != other.nodes.size()) return false;

    auto it = nodes.begin();
    auto it2 = other.nodes.begin();
    for (; it != nodes.end(); ) {
        if (it->start_pos != it2->start_pos) return false;
        if (it->len != it2->len) return false;
        if (it->incoming.size() != it2->incoming.size()) return false;
        if (it->outgoing.size() != it2->outgoing.size()) return false;
        for (unsigned int i=0; i<it->incoming.size(); i++)
            if (*(it->incoming[i]) != *(it2->incoming[i])) return false;
        for (unsigned int i=0; i<it->outgoing.size(); i++)
            if (*(it->outgoing[i]) != *(it2->outgoing[i])) return false;
        it++;
        it2++;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x40(%rdi), %r14
movq 0x48(%rdi), %rax
movq %rax, %rcx
subq %r14, %rcx
movq 0x40(%rsi), %r15
movq 0x48(%rsi), %rdx
subq %r15, %rdx
cmpq %rdx, %rcx
jne 0xdf95
movq %rdi, %rbx
cmpq %rax, %r14
sete %al
je 0xdf97
movzwl (%r14), %ecx
cmpw (%r15), %cx
jne 0xdf97
movb 0x2(%r14), %cl
cmpb 0x2(%r15), %cl
jne 0xdf97
movq 0x10(%r14), %rcx
subq 0x8(%r14), %rcx
movq 0x10(%r15), %rdx
subq 0x8(%r15), %rdx
cmpq %rdx, %rcx
jne 0xdf97
movq 0x28(%r14), %rcx
subq 0x20(%r14), %rcx
movq 0x28(%r15), %rdx
subq 0x20(%r15), %rdx
cmpq %rdx, %rcx
jne 0xdf97
xorl %ecx, %ecx
movl %ecx, %r12d
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0xdf4f
movq (%rax,%r12,8), %rdi
movq 0x8(%r15), %rax
movq (%rax,%r12,8), %rsi
callq 0xe89c
leal 0x1(%r12), %ecx
testb %al, %al
je 0xdf1c
jmp 0xdf95
xorl %ecx, %ecx
movl %ecx, %r12d
movq 0x20(%r14), %rax
movq 0x28(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0xdf84
movq (%rax,%r12,8), %rdi
movq 0x20(%r15), %rax
movq (%rax,%r12,8), %rsi
callq 0xe89c
leal 0x1(%r12), %ecx
testb %al, %al
je 0xdf51
jmp 0xdf95
addq $0x38, %r14
addq $0x38, %r15
movq 0x48(%rbx), %rax
jmp 0xdec4
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::num_paths() const
int
FactorGraph::num_paths() const
{

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

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

    return path_counts.back();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq 0x48(%rdi), %rax
subq 0x40(%rdi), %rax
je 0xe03b
movq %rdi, %rbx
pushq $0x38
popq %r15
cqto
idivq %r15
leaq -0x38(%rbp), %r14
leaq -0x19(%rbp), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0xe8ca
movq (%r14), %rcx
movl $0x1, (%rcx)
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rax
subq %rsi, %rax
cqto
idivq %r15
xorl %edx, %edx
movl %edx, %edx
cmpq %rdx, %rax
jbe 0xe029
imulq $0x38, %rdx, %r8
movq 0x20(%rsi,%r8), %rdi
movq 0x28(%rsi,%r8), %r8
cmpq %r8, %rdi
je 0xe025
movl (%rcx,%rdx,4), %r9d
movq (%rdi), %r10
movzwl 0x2(%r10), %r10d
addl %r9d, (%rcx,%r10,4)
addq $0x8, %rdi
jmp 0xe00a
incl %edx
jmp 0xdff5
leaq -0x38(%rbp), %rdi
movq 0x8(%rdi), %rax
movl -0x4(%rax), %ebx
callq 0xa2cc
jmp 0xe03d
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::advance(std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, unsigned short) const
void
FactorGraph::advance(vector<vector<string> > &paths,
                     vector<string> &curr_string,
                     fg_node_idx_t node_idx) const
{
    const FactorGraph::Node &node = nodes[node_idx];

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, -0x30(%rbp)
movq %rdi, %r15
movl %ecx, %r13d
imulq $0x38, %r13, %r12
addq 0x40(%rdi), %r12
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x50(%rbp), %rdx
movq %r12, %rsi
callq 0xe91c
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x719e
movq 0x48(%r15), %rax
subq 0x40(%r15), %rax
pushq $0x38
popq %rcx
cqto
idivq %rcx
decq %rax
cmpq %r13, %rax
jne 0xe118
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0xe94e
leaq -0x50(%rbp), %rdi
callq 0x46b8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r12), %r14
leaq -0x68(%rbp), %r13
cmpq 0x28(%r12), %r14
je 0xe100
movq %r13, %rdi
movq %rbx, %rsi
callq 0xe98a
movq (%r14), %rax
movzwl 0x2(%rax), %ecx
movq %r15, %rdi
movq -0x30(%rbp), %rsi
movq %r13, %rdx
callq 0xe08e
movq %r13, %rdi
callq 0x54b6
addq $0x8, %r14
jmp 0xe121
jmp 0xe159
movq %rax, %rbx
jmp 0xe16a
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x54b6
leaq -0x50(%rbp), %rdi
callq 0x46b8
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::remove_arc(FactorGraph::Arc*)
void
FactorGraph::remove_arc(Arc *arc)
{
    auto ait = find(arcs.begin(), arcs.end(), arc);
    arcs.erase(ait);

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

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

    delete arc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq -0x20(%rbp), %rbx
movq %rsi, (%rbx)
leaq 0x58(%rdi), %r15
movq 0x58(%rdi), %rdi
movq 0x60(%r14), %rsi
movq %rbx, %rdx
callq 0x10295
movq %r15, %rdi
movq %rax, %rsi
callq 0xe9de
movq (%rbx), %rax
movzwl (%rax), %eax
movq 0x40(%r14), %rcx
imulq $0x38, %rax, %rax
leaq (%rcx,%rax), %r15
addq $0x20, %r15
movq (%r15), %rdi
movq 0x8(%r15), %rsi
movq %rbx, %rdx
callq 0x10295
movq %r15, %rdi
movq %rax, %rsi
callq 0xe9de
movq (%rbx), %rax
movzwl 0x2(%rax), %eax
movq 0x40(%r14), %rcx
imulq $0x38, %rax, %rax
leaq (%rcx,%rax), %r14
addq $0x8, %r14
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rbx, %rdx
callq 0x10295
movq %r14, %rdi
movq %rax, %rsi
callq 0xe9de
movq (%rbx), %rdi
callq 0x4320
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/FactorGraph.cc
// Function: FactorGraph::remove_arcs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void
FactorGraph::remove_arcs(const std::string &source,
                         const std::string &target)
{
    for (auto node = nodes.begin(); node != nodes.end(); ++node) {
        if (source != this->get_factor(*node)) continue;
        for (unsigned int i=0; i<node->outgoing.size(); i++) {
            FactorGraph::Arc *arc = node->outgoing[i];
            if (target != this->get_factor(arc->target_node)) continue;
            this->remove_arc(arc);
            break;
        }
    }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, -0x40(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
movq 0x40(%rdi), %r14
movq %rdi, -0x30(%rbp)
cmpq 0x48(%rbx), %r14
je 0xe2ec
leaq -0x60(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xea24
movq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0xea17
movl %eax, %r12d
movq %r15, %rdi
callq 0x46b8
testb %r12b, %r12b
jne 0xe2df
xorl %eax, %eax
movl %eax, %r13d
movq 0x20(%r14), %rax
movq 0x28(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0xe2df
movq (%rax,%r13,8), %r12
movzwl 0x2(%r12), %edx
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0xea5a
movq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0xea17
movl %eax, %r15d
movq %rbx, %rdi
callq 0x46b8
leal 0x1(%r13), %eax
testb %r15b, %r15b
jne 0xe282
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0xe17c
addq $0x38, %r14
movq -0x30(%rbp), %rbx
jmp 0xe248
movq 0x40(%rbx), %r15
cmpq %r14, %r15
je 0xe355
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
cmpq %rax, %rcx
je 0xe316
movq 0x28(%r15), %rdx
cmpq 0x20(%r15), %rdx
je 0xe334
addq $0x38, %r15
movq 0x48(%rbx), %r14
jmp 0xe2f0
cmpb $0x0, 0x2(%r15)
je 0xe302
movq 0x20(%r15), %rax
cmpq %rax, 0x28(%r15)
je 0xe30c
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe17c
jmp 0xe31d
cmpb $0x0, 0x2(%r15)
je 0xe30c
cmpq %rax, %rcx
je 0xe30c
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe17c
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
jmp 0xe33b
addq $0x38, %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/FactorGraph.cc
// Function: FactorGraph::remove_arcs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void
FactorGraph::remove_arcs(const std::string &remstr)
{
    for (auto node = nodes.begin(); node != nodes.end(); ++node) {
        if (this->get_factor(*node) != remstr) continue;
        while (node->incoming.size() > 0)
            remove_arc(node->incoming[0]);
        while (node->outgoing.size() > 0)
            remove_arc(node->outgoing[0]);
    }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x40(%rdi), %r14
leaq -0x48(%rbp), %r12
cmpq 0x48(%rbx), %r14
je 0xe3e4
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xea24
movq %r12, %rdi
movq %r15, %rsi
callq 0xea17
movl %eax, %r13d
movq %r12, %rdi
callq 0x46b8
testb %r13b, %r13b
jne 0xe3de
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
je 0xe3d4
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe17c
jmp 0xe3b2
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe17c
movq 0x20(%r14), %rax
cmpq %rax, 0x28(%r14)
jne 0xe3c9
addq $0x38, %r14
jmp 0xe383
movq 0x40(%rbx), %r15
cmpq %r14, %r15
je 0xe44d
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
cmpq %rax, %rcx
je 0xe40e
movq 0x28(%r15), %rdx
cmpq 0x20(%r15), %rdx
je 0xe42c
addq $0x38, %r15
movq 0x48(%rbx), %r14
jmp 0xe3e8
cmpb $0x0, 0x2(%r15)
je 0xe3fa
movq 0x20(%r15), %rax
cmpq %rax, 0x28(%r15)
je 0xe404
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe17c
jmp 0xe415
cmpb $0x0, 0x2(%r15)
je 0xe404
cmpq %rax, %rcx
je 0xe404
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe17c
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
jmp 0xe433
addq $0x28, %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/FactorGraph.hh
// Function: FactorGraph::Arc::operator!=(FactorGraph::Arc&) const
bool operator!=(Arc& rhs) const {
            if (source_node != rhs.source_node) return true;
            if (target_node != rhs.target_node) return true;
            if (cost != rhs.cost) return true;
            return false;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl (%rdi), %ecx
movb $0x1, %al
cmpw (%rsi), %cx
jne 0xe8c7
movzwl 0x2(%rdi), %ecx
cmpw 0x2(%rsi), %cx
jne 0xe8c7
movsd 0x8(%rsi), %xmm0
cmpneqsd 0x8(%rdi), %xmm0
movq %xmm0, %rax
andl $0x1, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::~MultiStringFactorGraph()
MultiStringFactorGraph::~MultiStringFactorGraph() {
    vector<Arc*> arcs;
    collect_arcs(arcs);
    for (auto it = arcs.begin(); it != arcs.end(); ++it)
        delete *it;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x30(%rbp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
callq 0x103dc
movq -0x30(%rbp), %r14
cmpq -0x28(%rbp), %r14
je 0x10386
movq (%r14), %rdi
callq 0x4320
addq $0x8, %r14
jmp 0x10372
leaq -0x30(%rbp), %rdi
callq 0x12b1e
leaq 0xc8(%rbx), %rdi
callq 0x11fd4
leaq 0x98(%rbx), %rdi
callq 0x1204c
leaq 0x68(%rbx), %rdi
callq 0x120e4
leaq 0x38(%rbx), %rdi
callq 0x1215c
leaq 0x20(%rbx), %rdi
callq 0x11ada
movq %rbx, %rdi
callq 0x46b8
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0x53b8
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::num_paths(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
int
MultiStringFactorGraph::num_paths(const std::string &text) const
{
    if (nodes.size() == 0) return 0;
    if (string_end_nodes.find(text) == string_end_nodes.end()) return 0;
    msfg_node_idx_t end_node = string_end_nodes.at(text);
    map<msfg_node_idx_t, int> path_counts; path_counts[end_node] = 1;
    set<msfg_node_idx_t> nodes_to_process; nodes_to_process.insert(end_node);

    while(nodes_to_process.size() > 0) {

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

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

        nodes_to_process.erase(i);
    }

    return path_counts[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq 0x28(%rdi), %rax
xorl %r14d, %r14d
cmpq 0x20(%rdi), %rax
je 0x10aa0
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x38(%rdi), %r12
movq %r12, %rdi
callq 0x13af2
leaq 0x40(%rbx), %rcx
cmpq %rcx, %rax
je 0x10aa0
movq %r12, %rdi
movq %r15, %rsi
callq 0x11d8e
movl (%rax), %eax
leaq -0x30(%rbp), %rsi
movl %eax, (%rsi)
leaq -0x90(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x98(%rbp), %rdi
callq 0x11dde
movq %rbx, -0x38(%rbp)
movl $0x1, (%rax)
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x68(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x13e38
leaq -0x2c(%rbp), %r12
leaq -0x98(%rbp), %r13
cmpq $0x0, -0x40(%rbp)
je 0x10a75
leaq -0x60(%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), %rbx
addq $0x28, %rbx
movq 0x10(%rbx), %r14
cmpq %rbx, %r14
je 0x10a67
movq %r13, %rdi
movq %r12, %rsi
callq 0x11dde
movl (%rax), %r15d
movq 0x20(%r14), %rsi
movq %r13, %rdi
callq 0x11dde
addl %r15d, (%rax)
movq 0x20(%r14), %rsi
leaq -0x68(%rbp), %rdi
callq 0x13e38
movq %r14, %rdi
callq 0x43b0
movq %rax, %r14
jmp 0x10a2b
leaq -0x68(%rbp), %rdi
movq %r12, %rsi
callq 0x13fc8
jmp 0x109fd
leaq -0x2c(%rbp), %rsi
andl $0x0, (%rsi)
leaq -0x98(%rbp), %rdi
callq 0x11e30
movl (%rax), %r14d
leaq -0x68(%rbp), %rdi
callq 0x1230e
leaq -0x98(%rbp), %rdi
callq 0x12364
movl %r14d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10abd
jmp 0x10abd
movq %rax, %rbx
jmp 0x10ac9
jmp 0x10abd
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x1230e
leaq -0x98(%rbp), %rdi
callq 0x12364
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::get_paths(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&) const
void
MultiStringFactorGraph::get_paths(const string &text,
                                  vector<vector<string> > &paths) const
{
    if (string_end_nodes.find(text) == string_end_nodes.end()) return;
    msfg_node_idx_t end_node = string_end_nodes.at(text);
    vector<string> curr_string;
    advance(paths, curr_string, end_node);
    for (auto it = paths.begin(); it != paths.end(); ++it)
        std::reverse(it->begin(), it->end());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x38(%rdi), %r12
movq %r12, %rdi
callq 0x13af2
leaq 0x40(%r14), %rcx
cmpq %rcx, %rax
je 0x10b56
movq %r12, %rdi
movq %r15, %rsi
callq 0x11d8e
movl (%rax), %ecx
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10b7a
movq (%rbx), %r14
cmpq 0x8(%rbx), %r14
je 0x10b4d
movq (%r14), %rdi
movq 0x8(%r14), %rsi
callq 0x1423d
addq $0x18, %r14
jmp 0x10b35
leaq -0x40(%rbp), %rdi
callq 0x54b6
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10b65
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x54b6
movq %rbx, %rdi
callq 0x45f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::advance(std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, unsigned int) const
void
MultiStringFactorGraph::advance(vector<vector<string> > &paths,
                                vector<string> &curr_string,
                                msfg_node_idx_t node_idx) const
{
    const MultiStringFactorGraph::Node &node = nodes[node_idx];
    curr_string.push_back(node.factor);

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %rbx
movl %ecx, %r12d
shlq $0x7, %r12
movq %rdi, -0x30(%rbp)
addq 0x20(%rdi), %r12
movq %rdx, %rdi
movq %r12, %rsi
callq 0x719e
testl %r14d, %r14d
je 0x10c09
movq 0x38(%r12), %r14
addq $0x28, %r12
leaq -0x48(%rbp), %r13
cmpq %r12, %r14
je 0x10bfa
movq %r13, %rdi
movq %r15, %rsi
callq 0xe98a
movq 0x20(%r14), %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x10b7a
movq %r13, %rdi
callq 0x54b6
movq %r14, %rdi
callq 0x43b0
movq %rax, %r14
jmp 0x10bc0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r15, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe94e
movq %rax, %rbx
leaq -0x48(%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::print_paths(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void
MultiStringFactorGraph::print_paths(const string &text) const
{
    vector<vector<string> > paths;
    get_paths(text, paths);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
callq 0x10ade
movq -0x40(%rbp), %r12
movq 0x24354(%rip), %rbx     # 0x34fb8
leaq 0x126fd(%rip), %r14     # 0x23368
cmpq -0x38(%rbp), %r12
je 0x10ca6
movq (%r12), %r15
cmpq 0x8(%r12), %r15
je 0x10c98
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, %rdi
movq %r14, %rsi
callq 0x4340
addq $0x20, %r15
jmp 0x10c75
movq %rbx, %rdi
callq 0x4180
addq $0x18, %r12
jmp 0x10c6b
leaq -0x40(%rbp), %rdi
callq 0x11e82
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10cc0
jmp 0x10cc0
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x11e82
movq %rbx, %rdi
callq 0x45f0
// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::remove_arc(MultiStringFactorGraph::Arc*)
void
MultiStringFactorGraph::remove_arc(Arc *arc)
{
    Node &src_node = nodes[(*arc).source_node];
    src_node.outgoing.erase(arc);

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

    delete arc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x18(%rbp), %r14
movq %rsi, (%r14)
movl (%rsi), %eax
movq 0x20(%rdi), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %rdi
addq $0x50, %rdi
movq %r14, %rsi
callq 0x14394
movq (%r14), %rax
movl 0x4(%rax), %eax
movq 0x20(%rbx), %rcx
shlq $0x7, %rax
leaq (%rcx,%rax), %rdi
addq $0x20, %rdi
movq %r14, %rsi
callq 0x14394
movq (%r14), %rdi
callq 0x4320
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq