// File: /workspace/github_cpp_makefile_star2_O3/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), %rcx
movq %rsi, -0x60(%rbp)
leaq 0x8(%rsi), %rax
movq %rax, -0x58(%rbp)
cmpq %rax, %rcx
je 0xd0d2
leaq -0x88(%rbp), %rbx
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x20(%rcx), %rsi
movq %rcx, -0x68(%rbp)
movq 0x28(%rcx), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x5f0e
cmpl $0x2, -0x48(%rbp)
jl 0xd083
xorl %r15d, %r15d
movq %r12, %r14
movq -0x50(%rbp), %rax
movb (%rax,%r15), %r13b
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %rbx, %rdi
leaq 0x1955a(%rip), %rdx     # 0x26597
movq %rdx, %rsi
callq 0x5fac
movsbl %r13b, %esi
xorps %xmm0, %xmm0
movq %r12, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xcbe6
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xd072
callq 0x4350
incq %r15
movl -0x48(%rbp), %eax
decl %eax
cltq
cmpq %rax, %r15
jl 0xd020
jmp 0xd089
movq %r12, %r14
xorl %r15d, %r15d
movq -0x50(%rbp), %rax
movsbl (%rax,%r15), %esi
movq -0x68(%rbp), %r15
movsd 0x40(%r15), %xmm0
movq %r12, %rdi
leaq -0x50(%rbp), %rdx
movq %r14, %rcx
callq 0xcbe6
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xd0bd
callq 0x4350
movq %r15, %rdi
callq 0x4410
movq %rax, %rcx
cmpq -0x58(%rbp), %rax
jne 0xcff4
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r12, %rdi
callq 0xd19a
movq -0x50(%rbp), %rbx
cmpq -0x48(%rbp), %rbx
movq -0x60(%rbp), %r15
je 0xd135
xorl %r14d, %r14d
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0xd62a
cmpq -0x58(%rbp), %rax
jne 0xd127
movq (%rbx), %rax
movq %r14, 0x10(%rax)
movq 0x8(%rax), %rax
movb $0x0, (%rax)
movq (%rbx), %rax
movq %r14, 0x30(%rax)
addq $0x8, %rbx
cmpq -0x48(%rbp), %rbx
jne 0xd0fd
movq -0x50(%rbp), %rbx
testq %rbx, %rbx
je 0xd142
movq %rbx, %rdi
callq 0x4350
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd155
jmp 0xd17d
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
jne 0xd18d
jmp 0xd192
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xd180
callq 0x4350
jmp 0xd180
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xd192
callq 0x4350
movq %rbx, %rdi
callq 0x4650