// File: /workspace/github_cpp_makefile_star2_O1/aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::write_vocab(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 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&, bool, int)
int
Unigrams::write_vocab(string fname,
                      const map<string, flt_type> &vocab,
                      bool count_style,
                      int num_decimals)
{
    SimpleFileOutput vocabfile(fname);

    vector<pair<string, flt_type> > sorted_vocab;
    sort_vocab(vocab, sorted_vocab);
    for (unsigned int i=0; i<sorted_vocab.size(); i++)
        if (count_style)
            vocabfile << sorted_vocab[i].first << "\t" << sorted_vocab[i].second << "\n";
        else
            vocabfile << sorted_vocab[i].second << " " << sorted_vocab[i].first << "\n";
    vocabfile.close();

    return vocab.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, -0x34(%rbp)
movq %rsi, %r15
leaq -0xa8(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x5f0a
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x6292
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0x1db11
callq 0x4350
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r15, -0x98(%rbp)
movq %r15, %rdi
movl $0x1, %edx
callq 0x1dd68
movq -0x90(%rbp), %rax
cmpq %rax, -0x88(%rbp)
je 0x1dcb9
movl $0x1, %r14d
xorl %ecx, %ecx
leaq -0x78(%rbp), %rbx
leaq -0x58(%rbp), %r15
leaq (%rcx,%rcx,4), %r12
cmpb $0x0, -0x34(%rbp)
je 0x1dbe5
leaq (%rax,%r12,8), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6456
movq %rax, %r13
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rbx, %rdi
leaq 0x8a0c(%rip), %rsi      # 0x26596
leaq 0x8a06(%rip), %rdx      # 0x26597
callq 0x5fa4
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6456
movq -0x90(%rbp), %rcx
movsd 0x20(%rcx,%r12,8), %xmm0
movq %rax, %rdi
callq 0x64fe
movq %rax, %r12
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %r15, %rdi
leaq 0x87ae(%rip), %rsi      # 0x2637a
leaq 0x87a8(%rip), %rdx      # 0x2637b
callq 0x5fa4
movq %r12, %rdi
movq %r15, %rsi
callq 0x6456
jmp 0x1dc63
movsd 0x20(%rax,%r12,8), %xmm0
leaq -0x30(%rbp), %rdi
callq 0x64fe
movq %rax, %r13
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rbx, %rdi
leaq 0x8786(%rip), %rsi      # 0x26390
leaq 0x8780(%rip), %rdx      # 0x26391
callq 0x5fa4
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6456
shlq $0x3, %r12
addq -0x90(%rbp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x6456
movq %rax, %r12
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %r15, %rdi
leaq 0x872e(%rip), %rsi      # 0x2637a
leaq 0x8728(%rip), %rdx      # 0x2637b
callq 0x5fa4
movq %r12, %rdi
movq %r15, %rsi
callq 0x6456
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1dc75
callq 0x4350
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x1dc87
callq 0x4350
movl %r14d, %ecx
movq -0x90(%rbp), %rax
movq -0x88(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rsi, %rdx
incl %r14d
cmpq %rcx, %rdx
ja 0x1db5e
leaq -0x30(%rbp), %rdi
callq 0x6424
movq -0x98(%rbp), %rax
movl 0x28(%rax), %ebx
leaq -0x90(%rbp), %rdi
callq 0x1fd8a
leaq -0x30(%rbp), %rdi
callq 0x63ea
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0x1dd5f
callq 0x4350
jmp 0x1dd5f
jmp 0x1dd30
jmp 0x1dd30
jmp 0x1dd17
jmp 0x1dd35
jmp 0x1dd35
jmp 0x1dd30
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1dd38
callq 0x4350
jmp 0x1dd38
jmp 0x1dd35
movq %rax, %rbx
jmp 0x1dd4a
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x1dd4a
callq 0x4350
leaq -0x90(%rbp), %rdi
callq 0x1fd8a
leaq -0x30(%rbp), %rdi
callq 0x63ea
movq %rbx, %rdi
callq 0x4650
nop