// File: epfml[P]sent2vec/src/dictionary.cc
// Function: fasttext::Dictionary::getLine(std::istream&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::linear_congruential_engine<unsigned long, 48271ul, 0ul, 2147483647ul>&) const
int32_t Dictionary::getLine(std::istream& in,
                            std::vector<int32_t>& words,
                            std::vector<int32_t>& word_hashes,
                            std::vector<int32_t>& labels,
                            std::minstd_rand& rng) const {
  std::uniform_real_distribution<> uniform(0, 1);

  if (in.eof()) {
    in.clear();
    in.seekg(std::streampos(0));
  }

  words.clear();
  labels.clear();
  word_hashes.clear();
  int32_t ntokens = 0;
  std::string token;
  while (readWord(in, token)) {
    if (token == EOS && (args_-> model == model_name::sent2vec || args_->model == model_name::cbowCWNgrams)){
       break;
    }
    int32_t h = find(token);
    int32_t wid = word2int_[h];
    if (wid < 0) {
      entry_type type = getType(token);
      if (type == entry_type::word) word_hashes.push_back(hash(token));
      continue;
    }
    entry_type type = getType(wid);
    ntokens++;
    if (type == entry_type::word && !discard(wid, uniform(rng))) {
      words.push_back(wid);
      word_hashes.push_back(hash(token));
    }
    if (type == entry_type::label) {
      labels.push_back(wid - nwords_);
    }
    if (token == EOS) break;
    if (ntokens > MAX_LINE_SIZE && args_->model != model_name::sup && args_->model != model_name::sent2vec && args_->model != model_name::cbowCWNgrams) break;
  }
  return ntokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x40(%rbp), %rdi
xorps %xmm0, %xmm0
movsd 0x37cb3(%rip), %xmm1    # 0x42930
callq 0xf400
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x5820
testb $0x1, %al
jne 0xac98
jmp 0xacd6
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
xorl %esi, %esi
callq 0x5740
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xf430
movq -0xb0(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x5550
movq -0x18(%rbp), %rdi
callq 0xe920
movq -0x28(%rbp), %rdi
callq 0xe920
movq -0x20(%rbp), %rdi
callq 0xe920
movl $0x0, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5600
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x9480
movb %al, -0xb1(%rbp)
jmp 0xad1d
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0xad2c
jmp 0xaf8f
leaq -0x78(%rbp), %rdi
leaq 0x54759(%rip), %rsi     # 0x5f490
callq 0xf470
testb $0x1, %al
jne 0xad42
jmp 0xad8e
movq -0xa8(%rbp), %rdi
callq 0xea70
cmpl $0x4, 0xc0(%rax)
je 0xad6c
movq -0xa8(%rbp), %rdi
callq 0xea70
cmpl $0x5, 0xc0(%rax)
jne 0xad8e
jmp 0xaf8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x58d8
jmp 0xafb0
movq -0xa8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x8270
movl %eax, -0xb8(%rbp)
jmp 0xada6
movq -0xa8(%rbp), %rdi
movl -0xb8(%rbp), %eax
movl %eax, -0x88(%rbp)
addq $0x10, %rdi
movslq -0x88(%rbp), %rsi
callq 0xe560
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
cmpl $0x0, -0x8c(%rbp)
jge 0xae36
movq -0xa8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x84e0
movb %al, -0x8d(%rbp)
cmpb $0x0, -0x8d(%rbp)
jne 0xae31
movq -0xa8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x78(%rbp), %rsi
callq 0x8320
movq -0xc0(%rbp), %rdi
movl %eax, -0x94(%rbp)
leaq -0x94(%rbp), %rsi
callq 0xea40
jmp 0xae2f
jmp 0xae31
jmp 0xad01
movq -0xa8(%rbp), %rdi
movl -0x8c(%rbp), %esi
callq 0x9020
movb %al, -0x95(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
cmpb $0x0, -0x95(%rbp)
jne 0xaef3
movl -0x8c(%rbp), %eax
movl %eax, -0xcc(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xf500
movsd %xmm0, -0xc8(%rbp)
jmp 0xae87
movl -0xcc(%rbp), %esi
movq -0xa8(%rbp), %rdi
movsd -0xc8(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x8f30
testb $0x1, %al
jne 0xaef3
movq -0x18(%rbp), %rdi
leaq -0x8c(%rbp), %rsi
callq 0xe960
jmp 0xaebb
movq -0xa8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x78(%rbp), %rsi
callq 0x8320
movq -0xd8(%rbp), %rdi
movl %eax, -0x9c(%rbp)
leaq -0x9c(%rbp), %rsi
callq 0xea40
jmp 0xaef1
jmp 0xaef3
cmpb $0x1, -0x95(%rbp)
jne 0xaf28
movq -0xa8(%rbp), %rcx
movq -0x28(%rbp), %rdi
movl -0x8c(%rbp), %eax
movl 0x5c(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0xea40
jmp 0xaf26
jmp 0xaf28
leaq -0x78(%rbp), %rdi
leaq 0x5455d(%rip), %rsi     # 0x5f490
callq 0xf470
testb $0x1, %al
jne 0xaf3e
jmp 0xaf40
jmp 0xaf8f
cmpl $0x400, -0x54(%rbp)     # imm = 0x400
jle 0xaf8a
movq -0xa8(%rbp), %rdi
callq 0xea70
cmpl $0x3, 0xc0(%rax)
je 0xaf8a
movq -0xa8(%rbp), %rdi
callq 0xea70
cmpl $0x4, 0xc0(%rax)
je 0xaf8a
movq -0xa8(%rbp), %rdi
callq 0xea70
cmpl $0x5, 0xc0(%rax)
je 0xaf8a
jmp 0xaf8f
jmp 0xad01
movl -0x54(%rbp), %eax
movl %eax, -0xdc(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x58d8
movl -0xdc(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x57a0
nopl (%rax)