// File: /workspace/github_cpp_makefile_star2_O3/ddu1[P]polarizedtext/src/model.cc
// Function: fasttext::Model::dfs(int, int, float, std::vector<std::pair<float, int>, std::allocator<std::pair<float, int>>>&, fasttext::Vector&) const
void Model::dfs(int32_t k, int32_t node, real score,
                std::vector<std::pair<real, int32_t>>& heap,
                Vector& hidden) const {
  if (heap.size() == k && score < heap.front().first) {
    return;
  }

  if (tree[node].left == -1 && tree[node].right == -1) {
    heap.push_back(std::make_pair(score, node));
    std::push_heap(heap.begin(), heap.end(), comparePairs);
    if (heap.size() > k) {
      std::pop_heap(heap.begin(), heap.end(), comparePairs);
      heap.pop_back();
    }
    return;
  }

  real f = sigmoid(wo_->dotRow(hidden, node - osz_));
  dfs(k, tree[node].left, score + log(1.0 - f), heap, hidden);
  dfs(k, tree[node].right, score + log(f), heap, hidden);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rcx, %rbx
movss %xmm0, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %r15
movslq %esi, %r12
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jne 0xa6ec
movss (%rax), %xmm0
ucomiss 0x8(%rsp), %xmm0
ja 0xa8c8
movslq %edx, %rax
movq 0xf0(%r15), %rcx
movq %rax, %r13
shlq $0x5, %r13
cmpl $-0x1, 0x4(%rcx,%r13)
jne 0xa712
addq %r13, %rcx
cmpl $-0x1, 0x8(%rcx)
je 0xa827
movq 0x10(%r15), %rdi
movslq 0x80(%r15), %rcx
subq %rcx, %rax
movq %r14, %rsi
movq %rax, %rdx
callq 0x935e
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movss 0x73eb(%rip), %xmm2     # 0x11b24
ucomiss %xmm1, %xmm2
xorps %xmm3, %xmm3
ja 0xa784
ucomiss 0x73e4(%rip), %xmm1     # 0x11b2c
movss 0x73d8(%rip), %xmm3     # 0x11b28
ja 0xa784
addss 0x73d2(%rip), %xmm1     # 0x11b2c
mulss 0x73ce(%rip), %xmm1     # 0x11b30
mulss 0x73ca(%rip), %xmm1     # 0x11b34
mulss 0x73c6(%rip), %xmm1     # 0x11b38
cvttss2si %xmm1, %eax
movq 0x90(%r15), %rcx
cltq
movss (%rcx,%rax,4), %xmm3
movq 0xf0(%r15), %rax
movl 0x4(%rax,%r13), %edx
movss 0x7390(%rip), %xmm2     # 0x11b28
movaps %xmm2, %xmm1
movss %xmm3, 0xc(%rsp)
subss %xmm3, %xmm1
ucomiss %xmm2, %xmm1
ja 0xa7c4
mulss 0x737e(%rip), %xmm1     # 0x11b30
cvttss2si %xmm1, %eax
movq 0x98(%r15), %rcx
cltq
movss (%rcx,%rax,4), %xmm0
addss 0x8(%rsp), %xmm0
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rcx
movq %r14, %r8
callq 0xa6a8
movq 0xf0(%r15), %rax
movl 0x8(%rax,%r13), %edx
xorps %xmm0, %xmm0
movss 0xc(%rsp), %xmm1
ucomiss 0x7332(%rip), %xmm1     # 0x11b28
ja 0xa812
mulss 0x7330(%rip), %xmm1     # 0x11b30
cvttss2si %xmm1, %eax
movq 0x98(%r15), %rcx
cltq
movss (%rcx,%rax,4), %xmm0
movss 0x8(%rsp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
jmp 0xa6ca
leaq 0x10(%rsp), %r14
movss 0x8(%rsp), %xmm0
movss %xmm0, (%r14)
movl %edx, 0x4(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb808
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
leaq -0x286(%rip), %rax      # 0xa5ce
movq %rax, (%r14)
movq -0x8(%rsi), %rcx
subq %rdi, %rsi
sarq $0x3, %rsi
decq %rsi
leaq 0x10(%rsp), %r8
xorl %edx, %edx
callq 0xb779
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq %rax, %rcx
subq %rdi, %rcx
movq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
jbe 0xa8c8
cmpq $0x9, %rcx
jl 0xa8c0
leaq -0x8(%rax), %rdx
movq -0x8(%rax), %rcx
movss (%rdi), %xmm0
movss %xmm0, -0x8(%rax)
movl 0x4(%rdi), %esi
movl %esi, -0x4(%rax)
subq %rdi, %rdx
sarq $0x3, %rdx
leaq -0x2e7(%rip), %r8       # 0xa5ce
xorl %esi, %esi
callq 0xb699
movq 0x8(%rbx), %rax
addq $-0x8, %rax
movq %rax, 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop