// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::init_candidates(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::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>>>>&, unsigned int, 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&, unsigned int)
int
Unigrams::init_candidates(const map<string, flt_type> &vocab,
                          set<string> &candidates,
                          unsigned int n_candidates,
                          const set<string> &stoplist,
                          unsigned int min_length)
{

    vector<pair<string, flt_type> > sorted_vocab;
    sort_vocab(vocab, sorted_vocab, false);

    int selected_candidates = 0;
    for (auto it = sorted_vocab.cbegin(); it != sorted_vocab.cend(); ++it) {
        const string &subword = it->first;
        if (get_factor_length(subword, this->utf8) < min_length) continue;
        if (candidates.find(subword) != candidates.end()) continue;
        if (stoplist.find(subword) != stoplist.end()) continue;
        candidates.insert(subword);
        selected_candidates++;
        if (candidates.size() >= n_candidates) break;
    }

    return selected_candidates;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %ebx
movq %r8, -0x38(%rbp)
movl %ecx, %r13d
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movl $0x0, -0x2c(%rbp)
movq %rax, %rdi
xorl %edx, %edx
callq 0x1dc30
movq -0x50(%rbp), %r14
cmpq -0x48(%rbp), %r14
je 0x1e927
movl %r13d, %ecx
leaq 0x8(%r15), %r13
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x60(%rbp)
movl %ecx, %eax
movq %rax, -0x58(%rbp)
movl $0x0, -0x2c(%rbp)
movq 0x8(%r14), %rax
cmpb $0x1, 0x8(%r12)
jne 0x1e8d5
testq %rax, %rax
je 0x1e8d9
movq (%r14), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
movb (%rdx,%rsi), %r8b
movl $0x1, %edi
testb %r8b, %r8b
jns 0x1e8ca
movl $0x4, %edi
cmpb $-0x11, %r8b
ja 0x1e8ca
cmpb $-0x20, %r8b
movl $0x2, %edi
sbbl $-0x1, %edi
addl %edi, %esi
incl %ecx
cmpq %rsi, %rax
ja 0x1e8a5
jmp 0x1e8db
movl %eax, %ecx
jmp 0x1e8db
xorl %ecx, %ecx
cmpl %ebx, %ecx
jb 0x1e919
movq %r15, %rdi
movq %r14, %rsi
callq 0x2125c
cmpq %r13, %rax
jne 0x1e919
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x10c22
cmpq -0x60(%rbp), %rax
jne 0x1e919
movq %r15, %rdi
movq %r14, %rsi
callq 0x13fba
incl -0x2c(%rbp)
movq -0x58(%rbp), %rax
cmpq %rax, 0x28(%r15)
jae 0x1e927
addq $0x28, %r14
cmpq -0x48(%rbp), %r14
jne 0x1e88d
leaq -0x50(%rbp), %rdi
callq 0x1fbf4
movl -0x2c(%rbp), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e948
jmp 0x1e948
jmp 0x1e948
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1fbf4
movq %rbx, %rdi
callq 0x4650