// File: /workspace/github_cpp_makefile_star2_O1/epfml[P]sent2vec/src/fasttext.cc
// Function: fasttext::FastText::loadModel(std::istream&, bool)
void FastText::loadModel(std::istream& in, bool load_output_matrix /* = true */) {
  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);
  }

  // Only load qoutput_ and output_ matrices if explicitly requested
  if (load_output_matrix) {
      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);

  if (args_->model == model_name::sup) {
    model_->setTargetCounts(dict_->getCounts(entry_type::label));
  } else {
    model_->setTargetCounts(dict_->getCounts(entry_type::word));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq 0x199d0
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x1343f
callq 0xaa70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1344e
callq 0xaa70
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x19b44
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x18(%rbx), %rdi
movups %xmm0, 0x10(%rbx)
testq %rdi, %rdi
je 0x1348d
callq 0xaa70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1349c
callq 0xaa70
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq 0x19d0c
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x28(%rbx), %rdi
movups %xmm0, 0x20(%rbx)
testq %rdi, %rdi
je 0x134d8
callq 0xaa70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x134e7
callq 0xaa70
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq 0x19d0c
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x38(%rbx), %rdi
movups %xmm0, 0x30(%rbx)
testq %rdi, %rdi
je 0x13523
callq 0xaa70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x13532
callq 0xaa70
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq 0x19dde
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x48(%rbx), %rdi
movups %xmm0, 0x40(%rbx)
testq %rdi, %rdi
je 0x1356e
callq 0xaa70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1357d
callq 0xaa70
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r15
movq %r12, %rsi
movq %r15, %rdx
callq 0x19dde
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x58(%rbx), %rdi
movups %xmm0, 0x50(%rbx)
testq %rdi, %rdi
je 0x135be
callq 0xaa70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x135cd
callq 0xaa70
leaq 0x20(%rbx), %r12
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x619a
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x8bc8
leaq 0x36(%rsp), %r13
movl $0x1, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x43b0
cmpb $0x1, (%r13)
jne 0x13619
movb $0x1, 0x80(%rbx)
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq 0xefe2
jmp 0x13625
movq (%r12), %rdi
movq %r14, %rsi
callq 0xe51a
leaq 0x30(%rbx), %r13
testb %bpl, %bpl
je 0x13672
movl $0x12c, %esi            # imm = 0x12C
addq (%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x43b0
cmpb $0x1, 0x80(%rbx)
jne 0x13666
movq (%rbx), %rax
cmpb $0x1, 0x12c(%rax)
jne 0x13666
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0xefe2
jmp 0x13672
movq (%r13), %rdi
movq %r14, %rsi
callq 0xe51a
movl $0x0, 0xc(%rsp)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %r15, (%rsp)
leaq 0x10(%rsp), %r14
leaq 0x37(%rsp), %rdx
movq %r14, %rsi
movq %r12, %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0x19eb0
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x68(%rbx), %rdi
movups %xmm0, 0x60(%rbx)
testq %rdi, %rdi
je 0x136c3
callq 0xaa70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x136d2
callq 0xaa70
movb 0x80(%rbx), %al
movq 0x60(%rbx), %rdi
movb %al, 0x118(%rdi)
movq 0x40(%rbx), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rbx), %rax
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0x1370e
movq 0x168b8(%rip), %rcx     # 0x29fb8
cmpb $0x0, (%rcx)
je 0x1370a
incl 0x8(%rax)
jmp 0x1370e
lock
incl 0x8(%rax)
movq 0x50(%rbx), %rax
movq %rax, 0x38(%rsp)
movq 0x58(%rbx), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x1373a
movq 0x1688c(%rip), %rcx     # 0x29fb8
cmpb $0x0, (%rcx)
je 0x13736
incl 0x8(%rax)
jmp 0x1373a
lock
incl 0x8(%rax)
movq (%rbx), %rax
movzbl 0x12c(%rax), %ecx
leaq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0xfa44
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x13762
callq 0xaa70
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x13771
callq 0xaa70
movq (%rbx), %rax
movq 0x60(%rbx), %r14
cmpl $0x3, 0xc0(%rax)
jne 0x137a4
movq 0x10(%rbx), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x1, %edx
callq 0x7cca
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10a90
jmp 0x137c2
movq 0x10(%rbx), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x7cca
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10a90
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x137d9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x137ea
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13827
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
jmp 0x13827
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x13818
callq 0xaa70
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x13827
callq 0xaa70
movq %rbx, %rdi
callq 0x45b0
nop