// File: /workspace/github_cpp_makefile_star2_O3/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 0xa910
leaq 0xc9ae(%rip), %rsi      # 0x1f74b
movq %r15, %rdi
callq 0x4620
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x12e02
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x12df9
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x12dff
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x12e02
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x12dc6
addl $-0x3, %r15d
jmp 0x12e02
addl $-0x2, %r15d
jmp 0x12e02
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 0x1a1f4
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x10(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x12e56
movq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x12e74
movl $0xf, %edi
cmpq %r13, %rsi
je 0x12e6f
movq 0x18(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x12e80
leaq 0x28(%rsp), %rdi
callq 0x4100
jmp 0x12e8e
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 0x12eb2
movq %rsi, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x12eb8
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 0xc903(%rip), %rsi      # 0x1f7df
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 0x12f0d
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x12f14
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 0x12f47
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12f5e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x12f75
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0xc859(%rip), %rax      # 0x1f7d5
leaq 0xc857(%rip), %rsi      # 0x1f7da
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 0x130fb
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 0x5f4c
movq 0x10(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0x87f2
leaq 0x80(%rbx), %r14
leaq 0x68(%rsp), %rdi
movl $0x1, %edx
movq %r14, %rsi
callq 0x43f0
cmpb $0x1, (%r14)
jne 0x13041
movq 0x40(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xef74
jmp 0x1304f
movq 0x20(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xe53c
movl $0x12c, %esi            # imm = 0x12C
addq (%rbx), %rsi
leaq 0x68(%rsp), %rdi
movl $0x1, %edx
callq 0x43f0
cmpb $0x1, (%r14)
jne 0x13088
movq (%rbx), %rax
cmpb $0x1, 0x12c(%rax)
jne 0x13088
movq 0x50(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xef74
jmp 0x13096
movq 0x30(%rbx), %rdi
leaq 0x68(%rsp), %rsi
callq 0xe53c
leaq 0x68(%rsp), %rdi
callq 0x4440
movq 0x16f01(%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 0x130e9
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 0x16eee(%rip), %rdi     # 0x29ff0
leaq 0xc659(%rip), %rsi      # 0x1f762
movl $0x27, %edx
callq 0x4350
movq 0x16ed6(%rip), %rdi     # 0x29ff0
callq 0x4170
movl $0x1, %edi
callq 0x4380
jmp 0x1312b
movq %rax, %rbx
jmp 0x1318f
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13153
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x13153
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x13171
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x13171
jmp 0x1316e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x131a6
movq 0x38(%rsp), %rsi
jmp 0x1319e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4480
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x131a6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45b0