// File: epfml[P]Bi-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::bisent2vec) {
    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::bisent2vec) {
    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 0x91b0
movb %al, -0xc1(%rbp)
jmp 0x930b
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x931a
jmp 0x9443
movq -0xc0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x81a0
jmp 0x932c
movq -0xc0(%rbp), %rax
movq 0x68(%rax), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
cmpq $0x0, %rdx
jne 0x9402
movq -0xc0(%rbp), %rdi
callq 0xe6e0
cmpl $0x1, 0x100(%rax)
jle 0x9402
movq 0x55c85(%rip), %rdi     # 0x5eff0
leaq 0x39747(%rip), %rsi     # 0x42ab9
callq 0x5420
movq %rax, -0xd0(%rbp)
jmp 0x9380
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 0x93be
movq -0xd8(%rbp), %rdi
leaq 0x396f4(%rip), %rsi     # 0x42ac0
callq 0x5420
movq %rax, -0xe0(%rbp)
jmp 0x93da
movq -0xe0(%rbp), %rdi
movq 0x55bd8(%rip), %rsi     # 0x5efc0
callq 0x5460
jmp 0x93ef
jmp 0x9402
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9857
movq -0xc0(%rbp), %rax
cvtsi2sdl 0x58(%rax), %xmm0
movsd 0x3949a(%rip), %xmm1    # 0x428b0
ucomisd %xmm1, %xmm0
jbe 0x943e
movq -0xc0(%rbp), %rdi
movq -0x38(%rbp), %rax
incq %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
movq %rdx, %rsi
callq 0x9870
jmp 0x943c
jmp 0x943e
jmp 0x92ef
movq -0xc0(%rbp), %rdi
callq 0xe6e0
cmpl $0x4, 0xc0(%rax)
jne 0x9598
leaq -0x69(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x57b0
movq -0xe8(%rbp), %rdx
leaq 0x3964e(%rip), %rsi     # 0x42ac8
leaq -0x68(%rbp), %rdi
callq 0x7c10
jmp 0x9485
movq -0xc0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x8070
movl %eax, -0xec(%rbp)
jmp 0x949d
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 0xe260
movq -0xf8(%rbp), %rdi
leaq 0x395ef(%rip), %rsi     # 0x42ac8
callq 0x55e0
jmp 0x94e0
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 0xe290
jmp 0x9511
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 0xe240
movl -0xfc(%rbp), %ecx
movl %ecx, (%rax)
leaq -0xb8(%rbp), %rdi
callq 0xe300
jmp 0x9598
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x956d
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 0x9857
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xe300
jmp 0x9857
movq -0xc0(%rbp), %rdi
callq 0xe6e0
movq -0xc0(%rbp), %rdi
movslq 0xa8(%rax), %rax
movq %rax, -0x108(%rbp)
callq 0xe6e0
movq -0xc0(%rbp), %rdi
movq -0x108(%rbp), %rsi
movslq 0xac(%rax), %rdx
callq 0x9870
jmp 0x95da
movq -0xc0(%rbp), %rdi
callq 0xe6e0
cmpl $0x0, 0xa4(%rax)
jle 0x9612
movq -0xc0(%rbp), %rdi
callq 0xe6e0
movq -0xc0(%rbp), %rdi
movslq 0xa4(%rax), %rsi
callq 0x9ad0
jmp 0x9610
jmp 0x9612
movq -0xc0(%rbp), %rdi
callq 0x9c70
jmp 0x9620
movq -0xc0(%rbp), %rdi
callq 0x9090
jmp 0x962e
movq -0xc0(%rbp), %rdi
callq 0xe6e0
cmpl $0x4, 0xc0(%rax)
jne 0x96b7
movq -0xc0(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe330
movq %rax, %rdi
leaq 0x39467(%rip), %rsi     # 0x42ac8
callq 0x7cc0
movb %al, -0x109(%rbp)
jmp 0x966e
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x967a
jmp 0x967c
jmp 0x969b
leaq 0x39453(%rip), %rdi     # 0x42ad6
leaq 0x39294(%rip), %rsi     # 0x4291e
movl $0x101, %edx            # imm = 0x101
leaq 0x39462(%rip), %rcx     # 0x42af8
callq 0x52d0
movq -0xc0(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe330
movq $0x0, 0x20(%rax)
movq -0xc0(%rbp), %rdi
callq 0xe6e0
cmpl $0x0, 0x100(%rax)
jle 0x97fd
movq 0x55919(%rip), %rdi     # 0x5eff0
leaq 0x393db(%rip), %rsi     # 0x42ab9
callq 0x5420
movq %rax, -0x118(%rbp)
jmp 0x96ec
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 0x972a
movq -0x120(%rbp), %rdi
leaq 0x39388(%rip), %rsi     # 0x42ac0
callq 0x5420
movq %rax, -0x128(%rbp)
jmp 0x9746
movq -0x128(%rbp), %rdi
movq 0x5583c(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x975b
movq 0x5588e(%rip), %rdi     # 0x5eff0
leaq 0x393c7(%rip), %rsi     # 0x42b30
callq 0x5420
movq %rax, -0x130(%rbp)
jmp 0x9777
movq -0x130(%rbp), %rdi
movq -0xc0(%rbp), %rax
movl 0x5c(%rax), %esi
callq 0x5770
movq %rax, -0x138(%rbp)
jmp 0x9796
movq -0x138(%rbp), %rdi
movq 0x557ec(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x97ab
movq 0x5583e(%rip), %rdi     # 0x5eff0
leaq 0x3938a(%rip), %rsi     # 0x42b43
callq 0x5420
movq %rax, -0x140(%rbp)
jmp 0x97c7
movq -0x140(%rbp), %rdi
movq -0xc0(%rbp), %rax
movl 0x60(%rax), %esi
callq 0x5770
movq %rax, -0x148(%rbp)
jmp 0x97e6
movq -0x148(%rbp), %rdi
movq 0x5579c(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x97fb
jmp 0x97fd
movq -0xc0(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jne 0x9845
movq 0x557df(%rip), %rdi     # 0x5eff0
leaq 0x3933e(%rip), %rsi     # 0x42b56
callq 0x5420
movq %rax, -0x150(%rbp)
jmp 0x9826
movq -0x150(%rbp), %rdi
movq 0x5575c(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x983b
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
nopl (%rax)