// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::read_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>>>&, int&, bool)
int
Unigrams::read_vocab(string fname,
                     map<string, flt_type> &vocab,
                     int &maxlen,
                     bool utf8)
{
    SimpleFileInput vocabfile(fname);

    string line;
    flt_type count;
    maxlen = -1;
    while (vocabfile.getline(line)) {
        stringstream ss(line);
        string word;
        ss >> count;
        ss >> word;
        vocab[word] = count;

        maxlen = max(maxlen, (int)get_factor_length(word, utf8));
    }

    return vocab.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movl %ecx, %eax
movq %rsi, %rcx
movq %rdi, %rsi
movq %rsi, -0x8(%rbp)
movq %rcx, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x41a0
movq -0x238(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x75a0
jmp 0x54bc6
leaq -0x48(%rbp), %rdi
callq 0x4828
leaq -0x78(%rbp), %rdi
callq 0x4560
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq -0x28(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x586a0
movb %al, -0x239(%rbp)
jmp 0x54bf7
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x54c06
jmp 0x54d66
movl $0x10, %edi
movl $0x8, %esi
callq 0x13950
movl %eax, -0x240(%rbp)
jmp 0x54c1d
movl -0x240(%rbp), %edx
leaq -0x208(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4630
jmp 0x54c35
leaq -0x228(%rbp), %rdi
callq 0x4560
leaq -0x208(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4350
jmp 0x54c53
leaq -0x208(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x44b0
jmp 0x54c68
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x250(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x47db0
movq %rax, -0x248(%rbp)
jmp 0x54c8e
movq -0x248(%rbp), %rax
movsd -0x250(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x260(%rbp)
movzbl -0x19(%rbp), %esi
andl $0x1, %esi
leaq -0x228(%rbp), %rdi
callq 0x54dc0
movl %eax, -0x254(%rbp)
jmp 0x54cc7
movq -0x260(%rbp), %rdi
movl -0x254(%rbp), %eax
movl %eax, -0x22c(%rbp)
leaq -0x22c(%rbp), %rsi
callq 0x586d0
movq %rax, -0x268(%rbp)
jmp 0x54cef
movq -0x268(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
leaq -0x228(%rbp), %rdi
callq 0x4828
leaq -0x208(%rbp), %rdi
callq 0x4310
jmp 0x54be2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4828
jmp 0x54da8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x54d96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x4828
leaq -0x208(%rbp), %rdi
callq 0x4310
jmp 0x54d96
movq -0x10(%rbp), %rdi
callq 0x5fd0
movl %eax, -0x26c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4828
leaq -0x28(%rbp), %rdi
callq 0x77b0
movl -0x26c(%rbp), %eax
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x4828
leaq -0x28(%rbp), %rdi
callq 0x77b0
movq -0x50(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)