// File: /workspace/github_cpp_makefile_star2_O3/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 0x5f0e
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x629e
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0x1d9d9
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 0x1dc30
movq -0x90(%rbp), %rax
cmpq %rax, -0x88(%rbp)
je 0x1db81
movl $0x1, %r14d
xorl %ecx, %ecx
leaq -0x78(%rbp), %rbx
leaq -0x58(%rbp), %r15
leaq (%rcx,%rcx,4), %r12
cmpb $0x0, -0x34(%rbp)
je 0x1daad
leaq (%rax,%r12,8), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6462
movq %rax, %r13
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rbx, %rdi
leaq 0x8b44(%rip), %rsi      # 0x26596
leaq 0x8b3e(%rip), %rdx      # 0x26597
callq 0x5fac
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6462
movq -0x90(%rbp), %rcx
movsd 0x20(%rcx,%r12,8), %xmm0
movq %rax, %rdi
callq 0x650a
movq %rax, %r12
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %r15, %rdi
leaq 0x88e6(%rip), %rsi      # 0x2637a
leaq 0x88e0(%rip), %rdx      # 0x2637b
callq 0x5fac
movq %r12, %rdi
movq %r15, %rsi
callq 0x6462
jmp 0x1db2b
movsd 0x20(%rax,%r12,8), %xmm0
leaq -0x30(%rbp), %rdi
callq 0x650a
movq %rax, %r13
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rbx, %rdi
leaq 0x88be(%rip), %rsi      # 0x26390
leaq 0x88b8(%rip), %rdx      # 0x26391
callq 0x5fac
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6462
shlq $0x3, %r12
addq -0x90(%rbp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x6462
movq %rax, %r12
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %r15, %rdi
leaq 0x8866(%rip), %rsi      # 0x2637a
leaq 0x8860(%rip), %rdx      # 0x2637b
callq 0x5fac
movq %r12, %rdi
movq %r15, %rsi
callq 0x6462
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1db3d
callq 0x4350
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x1db4f
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 0x1da26
leaq -0x30(%rbp), %rdi
callq 0x6430
movq -0x98(%rbp), %rax
movl 0x28(%rax), %ebx
leaq -0x90(%rbp), %rdi
callq 0x1fbf4
leaq -0x30(%rbp), %rdi
callq 0x63f6
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 0x1dc27
callq 0x4350
jmp 0x1dc27
jmp 0x1dbf8
jmp 0x1dbf8
jmp 0x1dbdf
jmp 0x1dbfd
jmp 0x1dbfd
jmp 0x1dbf8
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1dc00
callq 0x4350
jmp 0x1dc00
jmp 0x1dbfd
movq %rax, %rbx
jmp 0x1dc12
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x1dc12
callq 0x4350
leaq -0x90(%rbp), %rdi
callq 0x1fbf4
leaq -0x30(%rbp), %rdi
callq 0x63f6
movq %rbx, %rdi
callq 0x4650
nop