// File: /workspace/github_cpp_makefile_star2_O2/epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::loadModelForInference(std::istream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
void FastText::loadModelForInference(std::istream& in,
                                     const std::string& filename,
                                     const int timeout_sec) {
  std::string shmem_name = "s2v_" + basename(filename) + "_input_matrix";

  args_ = std::make_shared<Args>();
  args_->load(in);

  dict_ = std::make_shared<Dictionary>(args_);
  dict_->load(in);

  in.read((char*) &quant_, sizeof(bool));

  input_ = ShmemMatrix::load(in, shmem_name, timeout_sec);

  in.read((char*) &args_->qout, sizeof(bool));

  output_ = std::make_shared<Matrix>();
  in.read((char*) &(output_->m_), sizeof(int64_t));
  in.read((char*) &(output_->n_), sizeof(int64_t));

  model_ = std::make_shared<Model>(input_, output_, args_, 0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %ecx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x4460
leaq 0xb297(%rip), %rsi      # 0x1b9fe
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x4310
cmpq $-0x1, %rax
je 0x1078a
incq %rax
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x40b0
leaq 0x20(%rsp), %rdi
pushq $0x2e
popq %rsi
pushq $-0x1
popq %rdx
callq 0x4690
cmpq $-0x1, %rax
je 0x107b0
leaq 0x20(%rsp), %rdi
pushq $-0x1
popq %rdx
movq %rax, %rsi
callq 0x40b0
leaq 0xb026(%rip), %rsi      # 0x1b7dd
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x15c22
leaq 0xb017(%rip), %rdx      # 0x1b7e2
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x15aad
movq %rsp, %rdi
callq 0x46c8
leaq 0x20(%rsp), %rdi
callq 0x46c8
movq %rsp, %rdi
callq 0x15b8c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x160b4
leaq 0x8(%rsp), %rdi
callq 0x8b66
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x5a62
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x15ba7
leaq 0x10(%rbx), %rdi
movq %rsp, %rsi
callq 0x162fc
leaq 0x8(%rsp), %rdi
callq 0x8b66
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x7836
leaq 0x80(%rbx), %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x43e0
movq %rsp, %rdi
leaq 0x40(%rsp), %rdx
movq %r14, %rsi
movl %ebp, %ecx
callq 0xc542
leaq 0x20(%rbx), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0x168d6
leaq 0x8(%rsp), %rdi
callq 0x8b66
movl $0x12c, %esi            # imm = 0x12C
addq (%rbx), %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x43e0
movq %rsp, %rdi
callq 0x15bc5
leaq 0x30(%rbx), %r12
movq %rsp, %rsi
movq %r12, %rdi
callq 0x1648e
leaq 0x8(%rsp), %rdi
callq 0x8b66
movq 0x30(%rbx), %rsi
addq $0x8, %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x43e0
movq (%r12), %rsi
addq $0x10, %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x43e0
leaq 0x20(%rsp), %r8
andl $0x0, (%r8)
movq %rsp, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x15bfb
leaq 0x60(%rbx), %rdi
movq %rsp, %rsi
callq 0x168a8
leaq 0x8(%rsp), %rdi
callq 0x8b66
movq 0x60(%rbx), %r14
movq 0x10(%rbx), %rsi
movq %rsp, %rdi
xorl %edx, %edx
callq 0x6dfe
movq %rsp, %rsi
movq %r14, %rdi
callq 0xe4ca
movq %rsp, %rdi
callq 0x9a28
leaq 0x40(%rsp), %rdi
callq 0x46c8
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1096c
jmp 0x1096c
movq %rax, %rbx
movq %rsp, %rdi
callq 0x9a28
jmp 0x10979
jmp 0x10976
jmp 0x10976
jmp 0x10976
jmp 0x10976
jmp 0x10976
jmp 0x10976
movq %rax, %rbx
movq %rsp, %rdi
callq 0x46c8
jmp 0x1096f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x1097e
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x46c8
movq %rbx, %rdi
callq 0x45d0
nop