// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::resegment_words(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&, StringSet const&, 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>>>&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
flt_type
Unigrams::resegment_words(const map<string, flt_type> &words,
                          const StringSet &vocab,
                          map<string, flt_type> &new_freqs,
                          set<string> special_words)
{
    new_freqs.clear();
    flt_type ll = 0.0;

    for (auto worditer = words.cbegin(); worditer != words.cend(); ++worditer) {

        // Special symbols like 
 
 etc. which should not be segmented
        if (special_words.size() > 0 && special_words.find(worditer->first) != special_words.end()) {
            new_freqs[worditer->first] += worditer->second;
            continue;
        }

        map<string, flt_type> stats;
        flt_type curr_ll = worditer->second * segf(vocab, worditer->first, stats, this->utf8);

        if (stats.size() == 0) {
            cerr << "warning, no segmentation for word: " << worditer->first << endl;
            continue;
        }

        ll += curr_ll;

        // Update statistics
        for (auto it = stats.begin(); it != stats.end(); ++it)
            new_freqs[it->first] += worditer->second * it->second;
    }

    return ll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, -0x48(%rbp)
movq %rsi, %r12
movq %rdi, -0x40(%rbp)
movq %rcx, %rdi
callq 0x19cca
movq 0x18(%r12), %r15
addq $0x8, %r12
movq %r12, -0x58(%rbp)
leaq 0x8(%rbx), %rax
movq %rax, -0x50(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x88(%rbp), %r13
cmpq -0x58(%rbp), %r15
je 0x1c66d
cmpq $0x0, 0x28(%rbx)
je 0x1c581
leaq 0x20(%r15), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1edee
cmpq -0x50(%rbp), %rax
je 0x1c581
movsd 0x40(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x18d90
movsd -0x30(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x1c65d
andl $0x0, -0x88(%rbp)
andq $0x0, -0x80(%rbp)
movq %r13, -0x78(%rbp)
movq %r13, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
leaq 0x20(%r15), %r12
movsd 0x40(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x40(%rbp), %rax
movzbl 0x8(%rax), %ecx
movq -0x48(%rbp), %rdi
movq %r12, %rsi
leaq -0x90(%rbp), %rdx
callq *(%rax)
cmpq $0x0, -0x68(%rbp)
je 0x1c62b
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x78(%rbp), %r12
cmpq %r13, %r12
je 0x1c651
movsd 0x40(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x20(%r12), %rsi
movsd 0x40(%r12), %xmm0
movsd %xmm0, -0x60(%rbp)
movq %r14, %rdi
callq 0x18d90
movsd -0x30(%rbp), %xmm0
mulsd -0x60(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq %r12, %rdi
callq 0x4270
movq %rax, %r12
jmp 0x1c5e3
movq 0x189b6(%rip), %rdi     # 0x34fe8
leaq 0x7227(%rip), %rsi      # 0x23860
callq 0x4340
movq %rax, %rdi
movq %r12, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x90(%rbp), %rdi
callq 0x543e
movq %r15, %rdi
callq 0x43b0
movq %rax, %r15
jmp 0x1c533
movsd -0x38(%rbp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1c683
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x543e
movq %rbx, %rdi
callq 0x45f0