// File: /workspace/github_cpp_makefile_star2_O3/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
movq 0x28(%rsi), %rcx
cmpq %rcx, %r14
je 0x19236
movq 0x68(%r14), %rax
leaq 0x58(%r14), %rbx
cmpq %rbx, %rax
je 0x1922b
movq 0x20(%rax), %rcx
movq $0x0, 0x8(%rcx)
movq %rax, %rdi
callq 0x4410
cmpq %rbx, %rax
jne 0x1920e
movq 0x28(%r13), %rcx
subq $-0x80, %r14
cmpq %rcx, %r14
jne 0x19201
jmp 0x19239
movq %r14, %rcx
movq 0xb0(%r13), %r15
leaq 0xa0(%r13), %rbx
cmpq %rbx, %r15
movq %rbx, -0x40(%rbp)
je 0x192cf
movq %r13, -0x38(%rbp)
leaq 0x20(%r15), %rsi
movq -0x30(%rbp), %rdi
callq 0x1b56a
movq 0x40(%r15), %r14
movq 0x48(%r15), %rcx
cmpq %rcx, %r14
je 0x192b3
movq %rax, %r12
movq -0x38(%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 0x192aa
movq 0x20(%rax), %rcx
movq %r12, 0x8(%rcx)
movq %rax, %rdi
callq 0x4410
cmpq %rbx, %rax
jne 0x19291
movq 0x48(%r15), %rcx
addq $0x4, %r14
cmpq %rcx, %r14
jne 0x19279
movq %r15, %rdi
callq 0x4280
movq %rax, %r15
movq -0x40(%rbp), %rbx
cmpq %rbx, %rax
jne 0x19254
movq -0x38(%rbp), %r13
movq 0x28(%r13), %rcx
leaq -0x68(%rbp), %rdx
movl $0x0, (%rdx)
xorl %eax, %eax
movq %rax, 0x8(%rdx)
movq %rdx, 0x10(%rdx)
movq %rdx, 0x18(%rdx)
movq %rax, 0x20(%rdx)
movq 0x20(%r13), %r14
cmpq %rcx, %r14
je 0x1936e
movq %r13, %rbx
leaq -0x70(%rbp), %r15
movq 0x68(%r14), %r12
leaq 0x58(%r14), %r13
cmpq %r13, %r12
je 0x19335
movq 0x20(%r12), %rax
cmpq $0x0, 0x8(%rax)
jne 0x19321
leaq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x158b8
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %r13, %rax
jne 0x19308
movq 0x28(%rbx), %rcx
subq $-0x80, %r14
cmpq %rcx, %r14
jne 0x192fb
movq -0x58(%rbp), %r15
leaq -0x68(%rbp), %r14
cmpq %r14, %r15
movq %rbx, %r13
movq -0x40(%rbp), %rbx
je 0x1936e
movq 0x20(%r15), %rsi
movq %r13, %rdi
callq 0x12172
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq %r14, %rax
jne 0x19352
movq 0xb0(%r13), %r15
cmpq %rbx, %r15
je 0x193b2
movq -0x30(%rbp), %rax
leaq 0x8(%rax), %r14
leaq 0x20(%r15), %r12
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x1bb6a
cmpq %r14, %rax
jne 0x193a2
movq %r13, %rdi
movq %r12, %rsi
callq 0x121ee
movq %r15, %rdi
callq 0x4280
movq %rax, %r15
cmpq %rbx, %rax
jne 0x19382
leaq -0x70(%rbp), %rdi
callq 0x13dca
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x193d0
jmp 0x193d0
jmp 0x193d0
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x13dca
movq %rbx, %rdi
callq 0x4650