// File: /workspace/github_cpp_makefile_star2_O3/epfml[P]Bi-Sent2Vec/src/dictionary.cc
// Function: fasttext::Dictionary::threshold(long, long)
void Dictionary::threshold(int64_t t, int64_t tl) {
  sort(words_.begin(), words_.end(), [](const entry& e1, const entry& e2) {
      if (e1.type != e2.type) return e1.type < e2.type;
      return e1.count > e2.count;
  });
  words_.erase(remove_if(words_.begin(), words_.end(), [&](const entry& e) {
        return (e.type == entry_type::word && e.count < t) ||
               (e.type == entry_type::label && e.count < tl);
  }), words_.end());
  words_.shrink_to_fit();
  size_ = 0;
  nwords_ = 0;
  nlabels_ = 0;
  std::fill(word2int_.begin(), word2int_.end(), -1);
  for (auto it = words_.begin(); it != words_.end(); ++it) {
    int32_t h = find(it->word);
    word2int_[h] = size_++;
    if (it->type == entry_type::word) nwords_++;
    if (it->type == entry_type::label) nlabels_++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movq 0x28(%rdi), %r13
movq 0x30(%rdi), %r12
cmpq %r12, %r13
je 0x7658
movq %r12, %rbp
subq %r13, %rbp
movq %rbp, %rax
sarq $0x3, %rax
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rcx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x8f10
cmpq $0x481, %rbp            # imm = 0x481
jl 0x764d
leaq 0x480(%r13), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x9711
cmpq %r12, %rbp
je 0x7658
movq %rbp, %rdi
callq 0x9884
addq $0x48, %rbp
jmp 0x763a
movq %r13, %rdi
movq %r12, %rsi
callq 0x9711
leaq 0x28(%rbx), %r14
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %r13
movq %r13, %rdx
subq %rax, %rdx
movq %rdx, %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rsi # imm = 0x8E38E38E38E38E39
imulq %rsi, %rcx
sarq $0x2, %rcx
movq %rdx, %rsi
movq %rax, %rbp
testq %rcx, %rcx
movq 0x8(%rsp), %r10
jle 0x7752
leaq (%rcx,%rcx,8), %rbp
shlq $0x5, %rbp
addq %rax, %rbp
incq %rcx
leaq 0x90(%rax), %rsi
movq -0x70(%rsi), %rdi
movzbl -0x68(%rsi), %r8d
movq %r15, %r9
testl %r8d, %r8d
je 0x76c6
cmpl $0x1, %r8d
jne 0x76cf
movq %r10, %r9
cmpq %rdi, %r9
jg 0x77df
movq -0x28(%rsi), %rdi
movzbl -0x20(%rsi), %r8d
movq %r15, %r9
testl %r8d, %r8d
je 0x76e9
cmpl $0x1, %r8d
jne 0x76f2
movq %r10, %r9
cmpq %rdi, %r9
jg 0x77e8
movq 0x20(%rsi), %rdi
movzbl 0x28(%rsi), %r8d
movq %r15, %r9
testl %r8d, %r8d
je 0x770c
cmpl $0x1, %r8d
jne 0x7715
movq %r10, %r9
cmpq %rdi, %r9
jg 0x77f2
movq 0x68(%rsi), %rdi
movzbl 0x70(%rsi), %r8d
movq %r15, %r9
testl %r8d, %r8d
je 0x772f
cmpl $0x1, %r8d
jne 0x7738
movq %r10, %r9
cmpq %rdi, %r9
jg 0x77ee
decq %rcx
addq $0x120, %rsi            # imm = 0x120
cmpq $0x1, %rcx
jg 0x76ac
movq %r13, %rsi
subq %rbp, %rsi
sarq $0x3, %rsi
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rcx, %rsi
cmpq $0x1, %rsi
je 0x77ba
cmpq $0x2, %rsi
je 0x779a
cmpq $0x3, %rsi
jne 0x788e
movq 0x20(%rbp), %rcx
movzbl 0x28(%rbp), %esi
movq %r15, %rdi
testl %esi, %esi
je 0x7791
cmpl $0x1, %esi
jne 0x7796
movq %r10, %rdi
cmpq %rcx, %rdi
jg 0x77f5
addq $0x48, %rbp
movq 0x20(%rbp), %rcx
movzbl 0x28(%rbp), %esi
movq %r15, %rdi
testl %esi, %esi
je 0x77b1
cmpl $0x1, %esi
jne 0x77b6
movq %r10, %rdi
cmpq %rcx, %rdi
jg 0x77f5
addq $0x48, %rbp
movq 0x20(%rbp), %rcx
movzbl 0x28(%rbp), %esi
movq %r15, %rdi
testl %esi, %esi
je 0x77d5
cmpl $0x1, %esi
jne 0x788e
movq %r10, %rdi
cmpq %rcx, %rdi
jg 0x77f5
jmp 0x788e
addq $-0x90, %rsi
jmp 0x77f2
addq $-0x48, %rsi
jmp 0x77f2
addq $0x48, %rsi
movq %rsi, %rbp
cmpq %r13, %rbp
sete %cl
leaq 0x48(%rbp), %rsi
cmpq %r13, %rsi
sete %sil
orb %cl, %sil
je 0x7810
movq %rbp, %r13
jmp 0x788e
movq %r14, 0x10(%rsp)
leaq 0x78(%rbp), %r12
movq -0x10(%r12), %rax
movzbl -0x8(%r12), %ecx
movq %r15, %rdx
testl %ecx, %ecx
je 0x7835
cmpl $0x1, %ecx
jne 0x783a
movq 0x8(%rsp), %rdx
cmpq %rax, %rdx
jg 0x786a
leaq -0x30(%r12), %rsi
leaq -0x10(%r12), %r14
movq %rbp, %rdi
callq 0x4390
movq (%r14), %rax
movq %rax, 0x20(%rbp)
movb 0x8(%r14), %al
movb %al, 0x28(%rbp)
leaq 0x30(%rbp), %rdi
movq %r12, %rsi
callq 0xb15e
addq $0x48, %rbp
leaq 0x48(%r12), %rax
addq $0x18, %r12
cmpq %r13, %r12
movq %rax, %r12
jne 0x7819
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdx
subq %rax, %rdx
movq %rbp, %r13
movq 0x10(%rsp), %r14
subq %rax, %r13
addq %rax, %r13
addq %rax, %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0xb368
movq 0x38(%rbx), %rax
cmpq 0x30(%rbx), %rax
je 0x78b4
movq %r14, %rdi
callq 0xb44e
movq $0x0, 0x58(%rbx)
movl $0x0, 0x60(%rbx)
movq 0x10(%rbx), %r14
movq 0x18(%rbx), %rdx
cmpq %rdx, %r14
je 0x78ec
subq %r14, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %r14, %rdi
movl $0xff, %esi
callq 0x41b0
movq 0x28(%rbx), %r15
movq 0x30(%rbx), %r12
cmpq %r12, %r15
je 0x792f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6332
movl 0x58(%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x58(%rbx)
movl %eax, %eax
movl %ecx, (%r14,%rax,4)
movzbl 0x28(%r15), %eax
cmpl $0x1, %eax
je 0x7926
testl %eax, %eax
jne 0x7929
incl 0x5c(%rbx)
jmp 0x7929
incl 0x60(%rbx)
addq $0x48, %r15
jmp 0x78f4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq