// File: epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::saveModel()
void FastText::saveModel() {
  std::string fn(args_->output);
  if (quant_) {
    fn += ".ftz";
  } else {
    fn += ".bin";
  }
  std::ofstream ofs(fn, std::ofstream::binary);
  if (!ofs.is_open()) {
    std::cerr << "Model file cannot be opened for saving!" << std::endl;
    exit(EXIT_FAILURE);
  }
  signModel(ofs);
  args_->save(ofs);
  dict_->save(ofs);

  ofs.write((char*)&(quant_), sizeof(bool));
  if (quant_) {
    qinput_->save(ofs);
  } else {
    input_->save(ofs);
  }

  ofs.write((char*)&(args_->qout), sizeof(bool));
  if (quant_ && args_->qout) {
    qoutput_->save(ofs);
  } else {
    output_->save(ofs);
  }

  ofs.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0xe6e0
movq %rax, %rsi
addq $0x40, %rsi
leaq -0x28(%rbp), %rdi
callq 0x51d0
movq -0x240(%rbp), %rax
testb $0x1, 0x80(%rax)
je 0x28ff4
leaq 0x1a78f(%rip), %rsi     # 0x43765
leaq -0x28(%rbp), %rdi
callq 0x5410
jmp 0x28fe1
jmp 0x29008
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2921e
leaq 0x1a76f(%rip), %rsi     # 0x4376a
leaq -0x28(%rbp), %rdi
callq 0x5410
jmp 0x29006
jmp 0x29008
leaq -0x238(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq 0x5860
jmp 0x2901f
leaq -0x238(%rbp), %rdi
callq 0x5350
movb %al, -0x241(%rbp)
jmp 0x29033
movb -0x241(%rbp), %al
testb $0x1, %al
jne 0x29097
jmp 0x2903f
movq 0x35faa(%rip), %rdi     # 0x5eff0
leaq 0x1a6a5(%rip), %rsi     # 0x436f2
callq 0x5420
movq %rax, -0x250(%rbp)
jmp 0x2905b
movq -0x250(%rbp), %rdi
movq 0x35f27(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x29070
movl $0x1, %edi
callq 0x54f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x5660
jmp 0x2921e
movq -0x240(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x28bd0
jmp 0x290ac
movq -0x240(%rbp), %rdi
callq 0xe6e0
movq %rax, %rdi
leaq -0x238(%rbp), %rsi
callq 0x7950
jmp 0x290c9
movq -0x240(%rbp), %rdi
addq $0x10, %rdi
callq 0x34050
movq %rax, %rdi
leaq -0x238(%rbp), %rsi
callq 0xadc0
jmp 0x290ea
movq -0x240(%rbp), %rsi
subq $-0x80, %rsi
leaq -0x238(%rbp), %rdi
movl $0x1, %edx
callq 0x55b0
jmp 0x29108
movq -0x240(%rbp), %rax
testb $0x1, 0x80(%rax)
je 0x2913b
movq -0x240(%rbp), %rdi
addq $0x40, %rdi
callq 0x23860
movq %rax, %rdi
leaq -0x238(%rbp), %rsi
callq 0x20260
jmp 0x29139
jmp 0x2915e
movq -0x240(%rbp), %rdi
addq $0x20, %rdi
callq 0x235f0
movq %rax, %rdi
leaq -0x238(%rbp), %rsi
callq 0x1e680
jmp 0x2915c
jmp 0x2915e
movq -0x240(%rbp), %rdi
callq 0xe6e0
movq %rax, %rsi
addq $0x12c, %rsi            # imm = 0x12C
leaq -0x238(%rbp), %rdi
movl $0x1, %edx
callq 0x55b0
jmp 0x29187
movq -0x240(%rbp), %rax
testb $0x1, 0x80(%rax)
je 0x291cf
movq -0x240(%rbp), %rdi
callq 0xe6e0
testb $0x1, 0x12c(%rax)
je 0x291cf
movq -0x240(%rbp), %rdi
addq $0x50, %rdi
callq 0x23860
movq %rax, %rdi
leaq -0x238(%rbp), %rsi
callq 0x20260
jmp 0x291cd
jmp 0x291f2
movq -0x240(%rbp), %rdi
addq $0x30, %rdi
callq 0x235f0
movq %rax, %rdi
leaq -0x238(%rbp), %rsi
callq 0x1e680
jmp 0x291f0
jmp 0x291f2
leaq -0x238(%rbp), %rdi
callq 0x5620
jmp 0x29200
leaq -0x238(%rbp), %rdi
callq 0x5660
leaq -0x28(%rbp), %rdi
callq 0x58d8
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x58d8
movq -0x30(%rbp), %rdi
callq 0x57a0