// File: epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::loadModel(std::istream&)
void FastText::loadModel(std::istream& in) {
  args_ = std::make_shared<Args>();
  dict_ = std::make_shared<Dictionary>(args_);
  input_ = std::make_shared<Matrix>();
  output_ = std::make_shared<Matrix>();
  qinput_ = std::make_shared<QMatrix>();
  qoutput_ = std::make_shared<QMatrix>();
  args_->load(in);

  dict_->load(in);

  bool quant_input;
  in.read((char*) &quant_input, sizeof(bool));
  if (quant_input) {
    quant_ = true;
    qinput_->load(in);
  } else {
    input_->load(in);
  }

  in.read((char*) &args_->qout, sizeof(bool));
  if (quant_ && args_->qout) {
    qoutput_->load(in);
  } else {
    output_->load(in);
  }

  model_ = std::make_shared<Model>(input_, output_, args_, 0);
  model_->quant_ = quant_;
  model_->setQuantizePointer(qinput_, qoutput_, args_->qout);

  model_->setTargetCounts(dict_->getCounts(entry_type::word));

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x342b0
movq -0xe0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x34320
leaq -0x20(%rbp), %rdi
callq 0xe1b0
movq -0xe0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x34350
movq -0xe0(%rbp), %rdi
addq $0x10, %rdi
leaq -0x30(%rbp), %rsi
callq 0x343c0
leaq -0x30(%rbp), %rdi
callq 0x343f0
leaq -0x40(%rbp), %rdi
callq 0x34410
movq -0xe0(%rbp), %rdi
addq $0x20, %rdi
leaq -0x40(%rbp), %rsi
callq 0x34480
leaq -0x40(%rbp), %rdi
callq 0x23810
leaq -0x50(%rbp), %rdi
callq 0x34410
movq -0xe0(%rbp), %rdi
addq $0x30, %rdi
leaq -0x50(%rbp), %rsi
callq 0x34480
leaq -0x50(%rbp), %rdi
callq 0x23810
leaq -0x60(%rbp), %rdi
callq 0x344b0
movq -0xe0(%rbp), %rdi
addq $0x40, %rdi
leaq -0x60(%rbp), %rsi
callq 0x34520
leaq -0x60(%rbp), %rdi
callq 0x237f0
leaq -0x70(%rbp), %rdi
callq 0x344b0
movq -0xe0(%rbp), %rdi
addq $0x50, %rdi
leaq -0x70(%rbp), %rsi
callq 0x34520
leaq -0x70(%rbp), %rdi
callq 0x237f0
movq -0xe0(%rbp), %rdi
callq 0xe6e0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x7ab0
movq -0xe0(%rbp), %rdi
addq $0x10, %rdi
callq 0x34050
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0xafe0
movq -0x10(%rbp), %rdi
leaq -0x71(%rbp), %rsi
movl $0x1, %edx
callq 0x5540
testb $0x1, -0x71(%rbp)
je 0x29c66
movq -0xe0(%rbp), %rdi
movb $0x1, 0x80(%rdi)
addq $0x40, %rdi
callq 0x23860
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x20340
jmp 0x29c82
movq -0xe0(%rbp), %rdi
addq $0x20, %rdi
callq 0x235f0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x1e6f0
movq -0xe0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
callq 0xe6e0
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
addq $0x12c, %rsi            # imm = 0x12C
movl $0x1, %edx
callq 0x5540
movq -0xe0(%rbp), %rax
testb $0x1, 0x80(%rax)
je 0x29cf7
movq -0xe0(%rbp), %rdi
callq 0xe6e0
testb $0x1, 0x12c(%rax)
je 0x29cf7
movq -0xe0(%rbp), %rdi
addq $0x50, %rdi
callq 0x23860
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x20340
jmp 0x29d13
movq -0xe0(%rbp), %rdi
addq $0x30, %rdi
callq 0x235f0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x1e6f0
movq -0xe0(%rbp), %rcx
movq %rcx, %rsi
addq $0x20, %rsi
movq %rcx, %rdx
addq $0x30, %rdx
movl $0x0, -0x8c(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0x118(%rbp)
leaq -0x8c(%rbp), %r8
callq 0x34550
movq -0x118(%rbp), %rsi
movq -0xe0(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x108(%rbp)
callq 0x345e0
movq -0x118(%rbp), %rdi
callq 0x34610
movq -0x108(%rbp), %rdi
movq -0xe0(%rbp), %rax
movb 0x80(%rax), %al
movb %al, -0x109(%rbp)
callq 0x34630
movb -0x109(%rbp), %cl
movq -0x108(%rbp), %rdi
andb $0x1, %cl
movb %cl, 0x118(%rax)
callq 0x34630
movq -0xe0(%rbp), %rsi
movq %rax, -0x100(%rbp)
addq $0x40, %rsi
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x34650
movq -0xe0(%rbp), %rsi
addq $0x50, %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x34650
movq -0xe0(%rbp), %rdi
callq 0xe6e0
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
movzbl 0x12c(%rax), %ecx
andl $0x1, %ecx
callq 0x21a60
jmp 0x29e25
leaq -0xb0(%rbp), %rdi
callq 0x237f0
leaq -0xa0(%rbp), %rdi
callq 0x237f0
movq -0xe0(%rbp), %rdi
addq $0x60, %rdi
callq 0x34630
movq -0xe0(%rbp), %rdi
movq %rax, -0x128(%rbp)
addq $0x10, %rdi
callq 0x34050
movq %rax, %rsi
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x120(%rbp)
xorl %edx, %edx
callq 0x9e50
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
callq 0x22e20
jmp 0x29e91
leaq -0xd8(%rbp), %rdi
callq 0xecf0
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x237f0
leaq -0xa0(%rbp), %rdi
callq 0x237f0
jmp 0x29ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0xecf0
movq -0xb8(%rbp), %rdi
callq 0x57a0
nopl (%rax)