// File: /workspace/github_cpp_makefile_star2_O3/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 (%rdx), %rax
movq %rdx, 0x68(%rsp)
movq 0x8(%rdx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
cmpq $0x5, %rdx
jb 0x14eda
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
xorl %r12d, %r12d
movq %r12, 0x60(%rsp)
movq %r12, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r12, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
cmpq %rax, %rcx
je 0x14d65
leaq 0x70(%rsp), %rdi
xorl %r15d, %r15d
xorl %ebx, %ebx
movq %r14, 0x90(%rsp)
movq %rbx, 0x48(%rsp)
movq %r15, %r13
movl (%rax,%r15), %r15d
movq 0x10(%r14), %rbx
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %rdi, %r14
leaq 0xacf4(%rip), %rsi      # 0x1f849
leaq 0xacf6(%rip), %rdx      # 0x1f852
callq 0x61ba
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6724
movl %eax, %ebx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x14b90
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %r14d
cmpl %ebx, %r15d
movq 0x48(%rsp), %rbx
movq %r13, %r15
je 0x14c00
movq 0x68(%rsp), %rax
movq (%rax), %rdx
addq %r15, %rdx
testl %r12d, %r12d
je 0x14bc6
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x14be7
leaq 0x38(%rsp), %rax
jmp 0x14bda
movq 0x18(%rsp), %rsi
xorl %r14d, %r14d
cmpq 0x20(%rsp), %rsi
je 0x14bf3
leaq 0x18(%rsp), %rax
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, (%rax)
jmp 0x14c00
leaq 0x30(%rsp), %rdi
callq 0xad56
jmp 0x14c00
xorl %r14d, %r14d
leaq 0x10(%rsp), %rdi
callq 0xad56
incq %rbx
movq 0x68(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
addq $0x4, %r15
movl %r14d, %r12d
cmpq %rbx, %rcx
movq 0x90(%rsp), %r14
leaq 0x70(%rsp), %rdi
ja 0x14b2e
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x14d65
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 0xc204
movsd %xmm0, 0x48(%rsp)
movq 0x10(%r14), %rdi
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6e82
cvtss2sd %xmm0, %xmm0
movsd 0x48(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x14d4b
movq 0x10(%r14), %rdi
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6e28
movq (%r14), %rcx
movslq 0xac(%rcx), %rcx
cmpq %rcx, %rax
jl 0x14d4b
movq %r12, %rdi
movq %r13, %rsi
callq 0xa7b2
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 0x8094
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x10618
movq %r12, %rdi
movq %rbp, %rsi
callq 0xa7b2
movq (%r14), %rax
movq 0x10(%r14), %rdi
movl 0x9c(%rax), %ecx
movl 0xb4(%rax), %edx
movq %r12, %rsi
movq %r15, %r8
callq 0x8094
movq 0x10(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x10618
incq %rbx
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0x14c60
movq 0x30(%rsp), %rdi
cmpq %rdi, 0x38(%rsp)
je 0x14e9a
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 0xc204
movsd %xmm0, 0x48(%rsp)
movq 0x10(%r14), %rdi
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6e82
cvtss2sd %xmm0, %xmm0
movsd 0x48(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x14e7d
movq 0x10(%r14), %rdi
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %esi
callq 0x6e28
movq (%r14), %rcx
movslq 0xac(%rcx), %rcx
cmpq %rcx, %rax
jl 0x14e7d
movq %r12, %rdi
movq %r13, %rsi
callq 0xa7b2
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 0x8094
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x10618
movq %r12, %rdi
movq %rbp, %rsi
callq 0xa7b2
movq (%r14), %rax
movq 0x10(%r14), %rdi
movl 0x9c(%rax), %ecx
movl 0xb4(%rax), %edx
movq %r12, %rsi
movq %r15, %r8
callq 0x8094
movq 0x30(%rsp), %rax
movl (%rax,%rbx,4), %edx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x10618
incq %rbx
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0x14d92
testq %rdi, %rdi
je 0x14eac
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14ec3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x14eda
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 0x14f19
jmp 0x14f19
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x14f1c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x14f1c
jmp 0x14f19
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x14f33
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14f4a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x14f61
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45b0
nop