// File: /workspace/github_cpp_makefile_star2_O1/epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::saveModel(int)
void FastText::saveModel(int32_t checkpoint) {
  std::string fn(args_->output + "_Chk" + std::to_string(checkpoint) + ".ckpt");
  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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rax
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xa8dc
leaq 0xc9f0(%rip), %rsi      # 0x1f73b
movq %r15, %rdi
callq 0x4620
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x12db0
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x12da7
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x12dad
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x12db0
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x12d74
addl $-0x3, %r15d
jmp 0x12db0
addl $-0x2, %r15d
jmp 0x12db0
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x4360
movl %r14d, %edi
addq 0x8(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x1a14c
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x10(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x12e04
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x12e1f
movl $0xf, %esi
cmpq %r13, 0x8(%rsp)
je 0x12e1a
movq 0x18(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x12e30
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x4100
jmp 0x12e3e
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4340
leaq 0x78(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x12e62
movq %rsi, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x12e68
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xc943(%rip), %rsi      # 0x1f7cf
leaq 0x68(%rsp), %rdi
callq 0x4620
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x12ebd
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x12ec4
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12ef7
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12f0e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x12f25
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0xc899(%rip), %rax      # 0x1f7c5
leaq 0xc897(%rip), %rsi      # 0x1f7ca
cmpb $0x0, 0x80(%rbx)
cmovneq %rax, %rsi
leaq 0x48(%rsp), %rdi
callq 0x4620
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movl $0x4, %edx
callq 0x4630
leaq 0xd8(%rsp), %rdi
callq 0x40b0
testb %al, %al
je 0x130ab
leaq 0x28(%rsp), %rsi
movl $0x2f4f16ba, (%rsi)     # imm = 0x2F4F16BA
movl $0xb, 0x8(%rsp)
leaq 0x68(%rsp), %rdi
movl $0x4, %edx
callq 0x43f0
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x4, %edx
callq 0x43f0
movq (%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0x5f4a
movq 0x10(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0x87d0
leaq 0x80(%rbx), %r14
leaq 0x68(%rsp), %rdi
movl $0x1, %edx
movq %r14, %rsi
callq 0x43f0
cmpb $0x1, (%r14)
jne 0x12ff1
movq 0x40(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xed42
jmp 0x12fff
movq 0x20(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xe2ca
movl $0x12c, %esi            # imm = 0x12C
addq (%rbx), %rsi
leaq 0x68(%rsp), %rdi
movl $0x1, %edx
callq 0x43f0
cmpb $0x1, (%r14)
jne 0x13038
movq (%rbx), %rax
cmpb $0x1, 0x12c(%rax)
jne 0x13038
movq 0x50(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xed42
jmp 0x13046
movq 0x30(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xe2ca
leaq 0x68(%rsp), %rdi
callq 0x4440
movq 0x16f51(%rip), %rax     # 0x29fa8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x70(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x68(%rsp,%rcx)
callq 0x4280
leaq 0x160(%rsp), %rdi
callq 0x4110
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x13099
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x16f3e(%rip), %rdi     # 0x29ff0
leaq 0xc699(%rip), %rsi      # 0x1f752
movl $0x27, %edx
callq 0x4350
movq 0x16f26(%rip), %rdi     # 0x29ff0
callq 0x4170
movl $0x1, %edi
callq 0x4380
jmp 0x130db
movq %rax, %rbx
jmp 0x1313f
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13103
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x13103
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x13121
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x13121
jmp 0x1311e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x13156
movq 0x38(%rsp), %rsi
jmp 0x1314e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4480
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x13156
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45b0