// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/EM.cc
// Function: 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>>>&, MultiStringFactorGraph&)
void
assign_scores(map<string, flt_type> &vocab,
              MultiStringFactorGraph &msfg)
{
    for (auto ndit = msfg.nodes.begin(); ndit != msfg.nodes.end(); ++ndit)
        for (auto arc = ndit->outgoing.begin(); arc != ndit->outgoing.end(); ++arc)
            (**arc).cost = nullptr;

    for (auto it = msfg.factor_node_map.begin(); it != msfg.factor_node_map.end(); ++it) {
        flt_type *curr_score = &(vocab.at(it->first));
        for (auto ndit = it->second.begin(); ndit != it->second.end(); ++ndit) {
            MultiStringFactorGraph::Node &node = msfg.nodes[*ndit];
            for (auto arc = node.incoming.begin(); arc != node.incoming.end(); ++arc)
                (**arc).cost = curr_score;
        }
    }

    set<MultiStringFactorGraph::Arc*> to_remove;
    for (auto ndit = msfg.nodes.begin(); ndit != msfg.nodes.end(); ++ndit)
        for (auto arc = ndit->outgoing.begin(); arc != ndit->outgoing.end(); ++arc)
            if ((**arc).cost == nullptr) to_remove.insert(*arc);
    for (auto trit = to_remove.begin(); trit != to_remove.end(); ++trit)
        msfg.remove_arc(*trit);

    for (auto fnit=msfg.factor_node_map.begin(); fnit != msfg.factor_node_map.end(); ++fnit)
        if (vocab.find(fnit->first) == vocab.end())
            msfg.remove_arcs(fnit->first);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r13
movq %rdi, -0x30(%rbp)
movq 0x20(%rsi), %r14
cmpq 0x28(%r13), %r14
je 0x175b4
movq 0x68(%r14), %rax
leaq 0x58(%r14), %rbx
cmpq %rbx, %rax
je 0x175ae
movq 0x20(%rax), %rcx
andq $0x0, 0x8(%rcx)
movq %rax, %rdi
callq 0x43b0
jmp 0x17596
subq $-0x80, %r14
jmp 0x17588
movq 0xb0(%r13), %r15
leaq 0xa0(%r13), %rax
movq %rax, -0x40(%rbp)
movq %r13, -0x38(%rbp)
cmpq -0x40(%rbp), %r15
je 0x1762f
leaq 0x20(%r15), %rsi
movq -0x30(%rbp), %rdi
callq 0x19244
movq %rax, %r12
movq 0x40(%r15), %r14
movq 0x20(%r13), %r13
cmpq 0x48(%r15), %r14
je 0x1761e
movl (%r14), %eax
shlq $0x7, %rax
leaq (%rax,%r13), %rbx
addq $0x28, %rbx
movq 0x10(%rbx), %rax
cmpq %rbx, %rax
je 0x17618
movq 0x20(%rax), %rcx
movq %r12, 0x8(%rcx)
movq %rax, %rdi
callq 0x43b0
jmp 0x17601
addq $0x4, %r14
jmp 0x175e8
movq %r15, %rdi
callq 0x4270
movq %rax, %r15
movq -0x38(%rbp), %r13
jmp 0x175ca
leaq -0x68(%rbp), %rbx
andl $0x0, (%rbx)
andq $0x0, 0x8(%rbx)
movq %rbx, 0x10(%rbx)
movq %rbx, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
movq 0x20(%r13), %r14
leaq -0x70(%rbp), %r15
cmpq 0x28(%r13), %r14
je 0x17693
movq 0x68(%r14), %r12
leaq 0x58(%r14), %r13
cmpq %r13, %r12
je 0x17689
movq 0x20(%r12), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1767c
leaq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x14282
movq %r12, %rdi
callq 0x43b0
movq %rax, %r12
jmp 0x1765e
subq $-0x80, %r14
movq -0x38(%rbp), %r13
jmp 0x17650
movq -0x58(%rbp), %r15
cmpq %rbx, %r15
je 0x176b5
movq 0x20(%r15), %rsi
movq %r13, %rdi
callq 0x10cd4
movq %r15, %rdi
callq 0x43b0
movq %rax, %r15
jmp 0x17697
movq 0xb0(%r13), %r15
movq -0x30(%rbp), %rax
leaq 0x8(%rax), %r14
cmpq -0x40(%rbp), %r15
je 0x176f7
leaq 0x20(%r15), %r12
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x197ac
cmpq %r14, %rax
jne 0x176ea
movq %r13, %rdi
movq %r12, %rsi
callq 0x10d32
movq %r15, %rdi
callq 0x4270
movq %rax, %r15
jmp 0x176c4
leaq -0x70(%rbp), %rdi
callq 0x121d4
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17715
jmp 0x17715
jmp 0x17715
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x121d4
movq %rbx, %rdi
callq 0x45f0