// File: /workspace/github_cpp_makefile_star2_O3/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 0x19ace
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x134a0
callq 0xaaa4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x134a0
callq 0xaaa4
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x19c3c
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x18(%rbx), %rdi
movups %xmm0, 0x10(%rbx)
testq %rdi, %rdi
je 0x134ee
callq 0xaaa4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x134ee
callq 0xaaa4
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq 0x19dfe
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x28(%rbx), %rdi
movups %xmm0, 0x20(%rbx)
testq %rdi, %rdi
je 0x13539
callq 0xaaa4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x13539
callq 0xaaa4
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq 0x19dfe
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x38(%rbx), %rdi
movups %xmm0, 0x30(%rbx)
testq %rdi, %rdi
je 0x13584
callq 0xaaa4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x13584
callq 0xaaa4
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %rdx
movq %r15, %rsi
callq 0x19eca
movaps (%r15), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r15)
movq 0x48(%rbx), %rdi
movups %xmm0, 0x40(%rbx)
testq %rdi, %rdi
je 0x135cf
callq 0xaaa4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x135cf
callq 0xaaa4
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r15
movq %r12, %rsi
movq %r15, %rdx
callq 0x19eca
movaps (%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r12)
movq 0x58(%rbx), %rdi
movups %xmm0, 0x50(%rbx)
testq %rdi, %rdi
je 0x1361f
callq 0xaaa4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1361f
callq 0xaaa4
leaq 0x20(%rbx), %r12
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x619c
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x8bea
leaq 0x36(%rsp), %r13
movl $0x1, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x43b0
cmpb $0x1, (%r13)
jne 0x1366b
movb $0x1, 0x80(%rbx)
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq 0xf214
jmp 0x13677
movq (%r12), %rdi
movq %r14, %rsi
callq 0xe78c
leaq 0x30(%rbx), %r13
testb %bpl, %bpl
je 0x136c4
movl $0x12c, %esi            # imm = 0x12C
addq (%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x43b0
cmpb $0x1, 0x80(%rbx)
jne 0x136b8
movq (%rbx), %rax
cmpb $0x1, 0x12c(%rax)
jne 0x136b8
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0xf214
jmp 0x136c4
movq (%r13), %rdi
movq %r14, %rsi
callq 0xe78c
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 0x19f96
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x68(%rbx), %rdi
movups %xmm0, 0x60(%rbx)
testq %rdi, %rdi
je 0x13724
callq 0xaaa4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x13724
callq 0xaaa4
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 0x13760
movq 0x16866(%rip), %rcx     # 0x29fb8
cmpb $0x0, (%rcx)
je 0x1375c
incl 0x8(%rax)
jmp 0x13760
lock
incl 0x8(%rax)
movq 0x50(%rbx), %rax
movq %rax, 0x38(%rsp)
movq 0x58(%rbx), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x1378c
movq 0x1683a(%rip), %rcx     # 0x29fb8
cmpb $0x0, (%rcx)
je 0x13788
incl 0x8(%rax)
jmp 0x1378c
lock
incl 0x8(%rax)
movq (%rbx), %rax
movzbl 0x12c(%rax), %ecx
leaq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0xfc60
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x137b4
callq 0xaaa4
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x137c3
callq 0xaaa4
movq (%rbx), %rax
movq 0x60(%rbx), %r14
cmpl $0x3, 0xc0(%rax)
jne 0x137f6
movq 0x10(%rbx), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x1, %edx
callq 0x7d16
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10ac8
jmp 0x13814
movq 0x10(%rbx), %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x7d16
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10ac8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1382b
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 0x1383c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13879
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
jmp 0x13879
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1386a
callq 0xaaa4
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x13879
callq 0xaaa4
movq %rbx, %rdi
callq 0x45b0
nop