// File: epfml[P]sent2vec/src/dictionary.cc
// Function: fasttext::Dictionary::readFromFile(std::istream&)
void Dictionary::readFromFile(std::istream& in) {
  std::string word;
  int64_t minThreshold = 1;
  while (readWord(in, word)) {
    add(word);
    if (ntokens_ % 1000000 == 0 && args_->verbose > 1) {
      std::cerr << "\rRead " << ntokens_  / 1000000 << "M words" << std::flush;
    }
    if (size_ > 0.75 * MAX_VOCAB_SIZE) {
      minThreshold++;
      threshold(minThreshold, minThreshold);
    }
  }
  if (args_->model == model_name::sent2vec || args_->model == model_name::cbowCWNgrams) {
    int32_t h = find("<PLACEHOLDER>");
    entry e;
    e.word = "<PLACEHOLDER>";
    e.count = 1e+18;
    e.type = entry_type::word;
    words_.push_back(e);
    word2int_[h] = size_++;
  }
  threshold(args_->minCount, args_->minCountLabel);
  if (args_->maxVocabSize > 0) {
    truncate(args_->maxVocabSize);
  }
  initTableDiscard();
  initNgrams();
  if (args_->model == model_name::sent2vec || args_->model == model_name::cbowCWNgrams) {
    assert(words_[0].word == "<PLACEHOLDER>");
    words_[0].count = 0;
  }
  if (args_->verbose > 0) {
    std::cerr << "\rRead " << ntokens_  / 1000000 << "M words" << std::endl;
    std::cerr << "Number of words:  " << nwords_ << std::endl;
    std::cerr << "Number of labels: " << nlabels_ << std::endl;
  }
  if (size_ == 0) {
    std::cerr << "Empty vocabulary. Try a smaller -minCount value."
              << std::endl;
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5600
movq $0x1, -0x38(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x9480
movb %al, -0xc1(%rbp)
jmp 0x95db
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x95ea
jmp 0x9713
movq -0xc0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x83a0
jmp 0x95fc
movq -0xc0(%rbp), %rax
movq 0x68(%rax), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
cmpq $0x0, %rdx
jne 0x96d2
movq -0xc0(%rbp), %rdi
callq 0xea70
cmpl $0x1, 0x100(%rax)
jle 0x96d2
movq 0x559b5(%rip), %rdi     # 0x5eff0
leaq 0x394e7(%rip), %rsi     # 0x42b29
callq 0x5420
movq %rax, -0xd0(%rbp)
jmp 0x9650
movq -0xd0(%rbp), %rdi
movq -0xc0(%rbp), %rax
movq 0x68(%rax), %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rsi
movq %rsi, %rdx
shrq $0x3f, %rdx
sarq $0x12, %rsi
addq %rdx, %rsi
callq 0x5810
movq %rax, -0xd8(%rbp)
jmp 0x968e
movq -0xd8(%rbp), %rdi
leaq 0x39494(%rip), %rsi     # 0x42b30
callq 0x5420
movq %rax, -0xe0(%rbp)
jmp 0x96aa
movq -0xe0(%rbp), %rdi
movq 0x55908(%rip), %rsi     # 0x5efc0
callq 0x5460
jmp 0x96bf
jmp 0x96d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9b51
movq -0xc0(%rbp), %rax
cvtsi2sdl 0x58(%rax), %xmm0
movsd 0x39242(%rip), %xmm1    # 0x42928
ucomisd %xmm1, %xmm0
jbe 0x970e
movq -0xc0(%rbp), %rdi
movq -0x38(%rbp), %rax
incq %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
movq %rdx, %rsi
callq 0x9b70
jmp 0x970c
jmp 0x970e
jmp 0x95bf
movq -0xc0(%rbp), %rdi
callq 0xea70
cmpl $0x4, 0xc0(%rax)
je 0x9741
movq -0xc0(%rbp), %rdi
callq 0xea70
cmpl $0x5, 0xc0(%rax)
jne 0x987d
leaq -0x69(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x57b0
movq -0xe8(%rbp), %rdx
leaq 0x393d9(%rip), %rsi     # 0x42b38
leaq -0x68(%rbp), %rdi
callq 0x7e10
jmp 0x976a
movq -0xc0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x8270
movl %eax, -0xec(%rbp)
jmp 0x9782
leaq -0x68(%rbp), %rdi
callq 0x58d8
leaq -0x69(%rbp), %rdi
callq 0x5480
movl -0xec(%rbp), %eax
movl %eax, -0x48(%rbp)
leaq -0xb8(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0xe5f0
movq -0xf8(%rbp), %rdi
leaq 0x3937a(%rip), %rsi     # 0x42b38
callq 0x55e0
jmp 0x97c5
movq -0xc0(%rbp), %rdi
movabsq $0xde0b6b3a7640000, %rax # imm = 0xDE0B6B3A7640000
movq %rax, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
addq $0x28, %rdi
leaq -0xb8(%rbp), %rsi
callq 0xe620
jmp 0x97f6
movq -0xc0(%rbp), %rdi
movl 0x58(%rdi), %eax
movl %eax, -0xfc(%rbp)
addl $0x1, %eax
movl %eax, 0x58(%rdi)
addq $0x10, %rdi
movslq -0x48(%rbp), %rsi
callq 0xe5d0
movl -0xfc(%rbp), %ecx
movl %ecx, (%rax)
leaq -0xb8(%rbp), %rdi
callq 0xe690
jmp 0x987d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9852
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x58d8
leaq -0x69(%rbp), %rdi
callq 0x5480
jmp 0x9b51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xe690
jmp 0x9b51
movq -0xc0(%rbp), %rdi
callq 0xea70
movq -0xc0(%rbp), %rdi
movslq 0xa8(%rax), %rax
movq %rax, -0x108(%rbp)
callq 0xea70
movq -0xc0(%rbp), %rdi
movq -0x108(%rbp), %rsi
movslq 0xac(%rax), %rdx
callq 0x9b70
jmp 0x98bf
movq -0xc0(%rbp), %rdi
callq 0xea70
cmpl $0x0, 0xa4(%rax)
jle 0x98f7
movq -0xc0(%rbp), %rdi
callq 0xea70
movq -0xc0(%rbp), %rdi
movslq 0xa4(%rax), %rsi
callq 0x9dd0
jmp 0x98f5
jmp 0x98f7
movq -0xc0(%rbp), %rdi
callq 0x9f70
jmp 0x9905
movq -0xc0(%rbp), %rdi
callq 0x9360
jmp 0x9913
movq -0xc0(%rbp), %rdi
callq 0xea70
cmpl $0x4, 0xc0(%rax)
je 0x993d
movq -0xc0(%rbp), %rdi
callq 0xea70
cmpl $0x5, 0xc0(%rax)
jne 0x99b1
movq -0xc0(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe6c0
movq %rax, %rdi
leaq 0x391dd(%rip), %rsi     # 0x42b38
callq 0x7ec0
movb %al, -0x109(%rbp)
jmp 0x9968
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x9974
jmp 0x9976
jmp 0x9995
leaq 0x391c9(%rip), %rdi     # 0x42b46
leaq 0x3900a(%rip), %rsi     # 0x4298e
movl $0x105, %edx            # imm = 0x105
leaq 0x391d8(%rip), %rcx     # 0x42b68
callq 0x52d0
movq -0xc0(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe6c0
movq $0x0, 0x20(%rax)
movq -0xc0(%rbp), %rdi
callq 0xea70
cmpl $0x0, 0x100(%rax)
jle 0x9af7
movq 0x5561f(%rip), %rdi     # 0x5eff0
leaq 0x39151(%rip), %rsi     # 0x42b29
callq 0x5420
movq %rax, -0x118(%rbp)
jmp 0x99e6
movq -0x118(%rbp), %rdi
movq -0xc0(%rbp), %rax
movq 0x68(%rax), %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rsi
movq %rsi, %rdx
shrq $0x3f, %rdx
sarq $0x12, %rsi
addq %rdx, %rsi
callq 0x5810
movq %rax, -0x120(%rbp)
jmp 0x9a24
movq -0x120(%rbp), %rdi
leaq 0x390fe(%rip), %rsi     # 0x42b30
callq 0x5420
movq %rax, -0x128(%rbp)
jmp 0x9a40
movq -0x128(%rbp), %rdi
movq 0x55542(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x9a55
movq 0x55594(%rip), %rdi     # 0x5eff0
leaq 0x3913d(%rip), %rsi     # 0x42ba0
callq 0x5420
movq %rax, -0x130(%rbp)
jmp 0x9a71
movq -0x130(%rbp), %rdi
movq -0xc0(%rbp), %rax
movl 0x5c(%rax), %esi
callq 0x5770
movq %rax, -0x138(%rbp)
jmp 0x9a90
movq -0x138(%rbp), %rdi
movq 0x554f2(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x9aa5
movq 0x55544(%rip), %rdi     # 0x5eff0
leaq 0x39100(%rip), %rsi     # 0x42bb3
callq 0x5420
movq %rax, -0x140(%rbp)
jmp 0x9ac1
movq -0x140(%rbp), %rdi
movq -0xc0(%rbp), %rax
movl 0x60(%rax), %esi
callq 0x5770
movq %rax, -0x148(%rbp)
jmp 0x9ae0
movq -0x148(%rbp), %rdi
movq 0x554a2(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x9af5
jmp 0x9af7
movq -0xc0(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jne 0x9b3f
movq 0x554e5(%rip), %rdi     # 0x5eff0
leaq 0x390b4(%rip), %rsi     # 0x42bc6
callq 0x5420
movq %rax, -0x150(%rbp)
jmp 0x9b20
movq -0x150(%rbp), %rdi
movq 0x55462(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x9b35
movl $0x1, %edi
callq 0x54f0
leaq -0x30(%rbp), %rdi
callq 0x58d8
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x58d8
movq -0x40(%rbp), %rdi
callq 0x57a0
nopw %cs:(%rax,%rax)