// File: aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::init_candidates_freq(unsigned int, 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&, 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>>>> const&)
int
Bigrams::init_candidates_freq(unsigned int n_candidates,
                              const map<string, flt_type> &unigram_stats,
                              map<string, flt_type> &candidates,
                              const set<string> &stoplist)
{
    vector<pair<string, flt_type> > sorted_stats;
    Unigrams::sort_vocab(unigram_stats, sorted_stats, false);

    for (auto it = sorted_stats.begin(); it != sorted_stats.end(); ++it) {
        if (stoplist.find(it->first) != stoplist.end()) continue;
        candidates[it->first] = 0.0;
        if (candidates.size() >= n_candidates) break;
    }

    return candidates.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x587e0
movq -0x70(%rbp), %rsi
movq -0x10(%rbp), %rdi
xorl %edx, %edx
callq 0x55590
jmp 0x5fde8
leaq -0x38(%rbp), %rdi
callq 0x58a30
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x58a60
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x5ad80
testb $0x1, %al
jne 0x5fe18
jmp 0x5fedc
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x60b10
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x235e0
movq %rax, -0x78(%rbp)
jmp 0x5fe3b
movq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
callq 0x23610
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x235b0
testb $0x1, %al
jne 0x5fe63
jmp 0x5fe7f
jmp 0x5fece
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x58850
jmp 0x5ff03
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x60b10
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x47db0
movq %rax, -0x88(%rbp)
jmp 0x5feab
movq -0x88(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rdi
callq 0x5fd0
movl -0x4(%rbp), %ecx
cmpq %rcx, %rax
jb 0x5fecc
jmp 0x5fedc
jmp 0x5fece
leaq -0x50(%rbp), %rdi
callq 0x5b5a0
jmp 0x5fdf5
movq -0x18(%rbp), %rdi
callq 0x5fd0
movl %eax, -0x94(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x58850
movl -0x94(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x46e0
nopl (%rax)