// File: /workspace/github_cpp_makefile_star2_O1/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 0xd1a6
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 0x5f0a
cmpl $0x2, -0x48(%rbp)
jl 0xd157
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 0x19486(%rip), %rdx     # 0x26597
movq %rdx, %rsi
callq 0x5fa4
movsbl %r13b, %esi
xorps %xmm0, %xmm0
movq %r12, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xcc4c
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xd146
callq 0x4350
incq %r15
movl -0x48(%rbp), %eax
decl %eax
cltq
cmpq %rax, %r15
jl 0xd0f4
jmp 0xd15d
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 0xcc4c
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xd191
callq 0x4350
movq %r15, %rdi
callq 0x4410
movq %rax, %rcx
cmpq -0x58(%rbp), %rax
jne 0xd0c8
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r12, %rdi
callq 0xd26c
movq -0x50(%rbp), %rbx
cmpq -0x48(%rbp), %rbx
movq -0x60(%rbp), %r15
je 0xd205
xorl %r14d, %r14d
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0xd700
cmpq -0x58(%rbp), %rax
jne 0xd1fb
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 0xd1d1
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xd213
callq 0x4350
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd226
jmp 0xd24e
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
jne 0xd25e
jmp 0xd263
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xd251
callq 0x4350
jmp 0xd251
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xd263
callq 0x4350
movq %rbx, %rdi
callq 0x4650
nop