// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq %rdi, -0x38(%rbp)
movq 0x20(%rsi), %r14
cmpq 0x28(%rsi), %r14
je 0x19335
movq 0x68(%r14), %rax
leaq 0x58(%r14), %rbx
cmpq %rbx, %rax
je 0x1932a
movq 0x20(%rax), %rcx
movq $0x0, 0x8(%rcx)
movq %rax, %rdi
callq 0x4410
jmp 0x1930f
subq $-0x80, %r14
cmpq 0x28(%r12), %r14
jne 0x19307
movq 0xb0(%r12), %r15
movq %r12, -0x30(%rbp)
leaq 0xa0(%r12), %rax
movq %rax, -0x40(%rbp)
cmpq %rax, %r15
je 0x193b9
leaq 0x20(%r15), %rsi
movq -0x38(%rbp), %rdi
callq 0x1b64c
movq 0x40(%r15), %r14
cmpq 0x48(%r15), %r14
je 0x193a8
movq %rax, %r12
movq -0x30(%rbp), %rax
movq 0x20(%rax), %r13
movl (%r14), %eax
shlq $0x7, %rax
leaq (%rax,%r13), %rbx
addq $0x28, %rbx
movq 0x10(%rbx), %rax
cmpq %rbx, %rax
je 0x1939e
movq 0x20(%rax), %rcx
movq %r12, 0x8(%rcx)
movq %rax, %rdi
callq 0x4410
jmp 0x19387
addq $0x4, %r14
cmpq 0x48(%r15), %r14
jne 0x19374
movq %r15, %rdi
callq 0x4280
movq %rax, %r15
cmpq -0x40(%rbp), %rax
jne 0x19352
leaq -0x68(%rbp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq -0x30(%rbp), %rbx
movq 0x20(%rbx), %r14
cmpq 0x28(%rbx), %r14
je 0x1942b
leaq -0x70(%rbp), %r15
movq -0x30(%rbp), %rbx
movq 0x68(%r14), %r12
leaq 0x58(%r14), %r13
cmpq %r13, %r12
je 0x19421
movq 0x20(%r12), %rax
cmpq $0x0, 0x8(%rax)
jne 0x19411
leaq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x159c8
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %r13, %rax
jne 0x193f8
subq $-0x80, %r14
cmpq 0x28(%rbx), %r14
jne 0x193eb
movq -0x58(%rbp), %r15
leaq -0x68(%rbp), %r14
cmpq %r14, %r15
je 0x19454
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x12288
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq %r14, %rax
jne 0x19438
movq 0xb0(%rbx), %r15
cmpq -0x40(%rbp), %r15
je 0x1949a
movq -0x38(%rbp), %rax
leaq 0x8(%rax), %r14
leaq 0x20(%r15), %r12
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x1bc58
cmpq %r14, %rax
jne 0x19489
movq %rbx, %rdi
movq %r12, %rsi
callq 0x12308
movq %r15, %rdi
callq 0x4280
movq %rax, %r15
cmpq -0x40(%rbp), %rax
jne 0x19469
leaq -0x70(%rbp), %rdi
callq 0x13ea2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x194b8
jmp 0x194b8
jmp 0x194b8
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x13ea2
movq %rbx, %rdi
callq 0x4650