// File: /workspace/github_cpp_makefile_star2_O1/epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::bisent2vec(fasttext::Model&, float, std::vector<int, std::allocator<int>> const&)
void FastText::bisent2vec(Model& model, real lr, const std::vector<int32_t>& line){
  if (line.size() <= 1) return;
  std::vector<int32_t> context;
  std::vector<int32_t> line1;
  std::vector<int32_t> line2;
  int32_t flag = 0;
  for (int32_t i=0; i<line.size(); ++i){
    if (line[i] == dict_->getId("<<split>>")){
      flag = 1;
      continue;
    }
    if (flag==0)
      line1.push_back(line[i]);
    else
      line2.push_back(line[i]);
  }
  std::uniform_real_distribution<> uniform(0, 1);
  for (int32_t i=0; i<line1.size(); ++i){
    if (uniform(model.rng) > dict_->getPDiscard(line1[i]) || dict_->getTokenCount(line1[i]) < args_->minCountLabel)
      continue;
    context = line1;
    context[i] = 0;
    dict_->addNgrams(context, args_->wordNgrams, args_->dropoutK, model.rng);
    model.update(context, line1[i], lr);
    context = line2;
    dict_->addNgrams(context, args_->wordNgrams, args_->dropoutK, model.rng);
    model.update(context, line1[i], lr);

  }
  for (int32_t i=0; i<line2.size(); ++i){
    if (uniform(model.rng) > dict_->getPDiscard(line2[i]) || dict_->getTokenCount(line2[i]) < args_->minCountLabel)
      continue;
    context = line2;
    context[i] = 0;
    dict_->addNgrams(context, args_->wordNgrams, args_->dropoutK, model.rng);
    model.update(context, line2[i], lr);
    context = line1;
    dict_->addNgrams(context, args_->wordNgrams, args_->dropoutK, model.rng);
    model.update(context, line2[i], lr);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movss %xmm0, 0x4(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rdx), %rax
subq (%rdx), %rax
cmpq $0x5, %rax
jb 0x14de1
movq %rdx, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
xorl %edx, %edx
movq %rdx, 0x60(%rsp)
movq %rdx, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %rdx, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x14b3a
leaq 0x68(%rsp), %rdi
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %r14, 0x88(%rsp)
movq %rdx, 0x90(%rsp)
movq %r15, 0x48(%rsp)
movq %r14, %rcx
movq %rbx, %r14
movq %r12, %r13
movl (%rax,%r12), %r15d
movq 0x10(%rcx), %rbx
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq %rdi, %r12
leaq 0xadd1(%rip), %rsi      # 0x1f839
leaq 0xadd3(%rip), %rdx      # 0x1f842
callq 0x61b8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6720
movl %eax, %ebx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x14a9d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %ebp
cmpl %ebx, %r15d
movq %r14, %rbx
movq 0x48(%rsp), %r15
movq %r13, %r12
je 0x14b0d
movq (%rbx), %rdx
addq %r12, %rdx
cmpl $0x0, 0x90(%rsp)
je 0x14ad5
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x14af5
leaq 0x38(%rsp), %rax
jmp 0x14ae8
movq 0x18(%rsp), %rsi
xorl %ebp, %ebp
cmpq 0x20(%rsp), %rsi
je 0x14b01
leaq 0x18(%rsp), %rax
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, (%rax)
jmp 0x14b0d
leaq 0x30(%rsp), %rdi
callq 0xad24
jmp 0x14b0d
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdi
callq 0xad24
incq %r15
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
addq $0x4, %r12
movl %ebp, %edx
cmpq %r15, %rcx
movq 0x88(%rsp), %r14
leaq 0x68(%rsp), %rdi
ja 0x14a36
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x14c6c
movq 0x8(%rsp), %rax
leaq 0x110(%rax), %r15
xorl %ebx, %ebx
leaq 0x50(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x30(%rsp), %rbp
movq %r15, %rdi
callq 0xc260
movsd %xmm0, 0x48(%rsp)
movq 0x10(%r14), %rdi
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6e4e
cvtss2sd %xmm0, %xmm0
movsd 0x48(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x14c52
movq 0x10(%r14), %rdi
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6df4
movq (%r14), %rcx
movslq 0xac(%rcx), %rcx
cmpq %rcx, %rax
jl 0x14c52
movq %r12, %rdi
movq %r13, %rsi
callq 0xa78c
movq 0x50(%rsp), %rax
movl $0x0, (%rax,%rbx,4)
movq (%r14), %rax
movq 0x10(%r14), %rdi
movl 0x9c(%rax), %ecx
movl 0xb4(%rax), %edx
movq %r12, %rsi
movq %r15, %r8
callq 0x803a
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
movq %r12, %rdi
movq %rbp, %rsi
callq 0xa78c
movq (%r14), %rax
movq 0x10(%r14), %rdi
movl 0x9c(%rax), %ecx
movl 0xb4(%rax), %edx
movq %r12, %rsi
movq %r15, %r8
callq 0x803a
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
incq %rbx
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0x14b67
movq 0x30(%rsp), %rdi
cmpq %rdi, 0x38(%rsp)
je 0x14da1
movq 0x8(%rsp), %rax
leaq 0x110(%rax), %r15
xorl %ebx, %ebx
leaq 0x50(%rsp), %r12
leaq 0x30(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r15, %rdi
callq 0xc260
movsd %xmm0, 0x48(%rsp)
movq 0x10(%r14), %rdi
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6e4e
cvtss2sd %xmm0, %xmm0
movsd 0x48(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x14d84
movq 0x10(%r14), %rdi
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6df4
movq (%r14), %rcx
movslq 0xac(%rcx), %rcx
cmpq %rcx, %rax
jl 0x14d84
movq %r12, %rdi
movq %r13, %rsi
callq 0xa78c
movq 0x50(%rsp), %rax
movl $0x0, (%rax,%rbx,4)
movq (%r14), %rax
movq 0x10(%r14), %rdi
movl 0x9c(%rax), %ecx
movl 0xb4(%rax), %edx
movq %r12, %rsi
movq %r15, %r8
callq 0x803a
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
movq %r12, %rdi
movq %rbp, %rsi
callq 0xa78c
movq (%r14), %rax
movq 0x10(%r14), %rdi
movl 0x9c(%rax), %ecx
movl 0xb4(%rax), %edx
movq %r12, %rsi
movq %r15, %r8
callq 0x803a
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
incq %rbx
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0x14c99
testq %rdi, %rdi
je 0x14db3
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14dca
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x14de1
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14e1a
jmp 0x14e1a
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x14e1d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x14e1d
jmp 0x14e1a
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x14e34
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14e4b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x14e62
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45b0