// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %rdi, %rbx
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rdi), %r15
movq 0x30(%rdi), %r14
cmpq %r14, %r15
je 0x6a34
movq %r14, %r12
subq %r15, %r12
movq %r12, %rax
cqto
pushq $0x48
popq %rcx
idivq %rcx
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x7c04
cmpq $0x481, %r12            # imm = 0x481
jl 0x6a29
leaq 0x480(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x8014
cmpq %r14, %r12
je 0x6a34
movq %r12, %rdi
callq 0x80c2
addq $0x48, %r12
jmp 0x6a16
movq %r15, %rdi
movq %r14, %rsi
callq 0x8014
leaq 0x28(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rbx), %r12
movq 0x30(%rbx), %r15
leaq 0x20(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x18(%rsp), %rcx
movq %rcx, 0x40(%rsp)
leaq 0x28(%rsp), %rbp
movq %rax, (%rbp)
movq %rcx, 0x8(%rbp)
movq %r15, 0x10(%rsp)
subq %r12, %r15
movq %r15, %rax
cqto
pushq $0x48
popq %rcx
idivq %rcx
movq %rax, %r14
sarq $0x2, %r14
testq %r14, %r14
jle 0x6af9
movq %rbp, %rdi
movq %r12, %rsi
callq 0x812c
testb %al, %al
jne 0x6b63
leaq 0x48(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x812c
testb %al, %al
jne 0x6b66
leaq 0x90(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x812c
testb %al, %al
jne 0x6b66
leaq 0xd8(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x812c
testb %al, %al
jne 0x6b66
addq $0x120, %r12            # imm = 0x120
decq %r14
addq $-0x120, %r15           # imm = 0xFEE0
jmp 0x6a80
movq %r15, %rax
cqto
pushq $0x48
popq %rcx
idivq %rcx
cmpq $0x1, %rax
movq 0x8(%rsp), %rbp
je 0x6b49
cmpq $0x2, %rax
je 0x6b34
cmpq $0x3, %rax
jne 0x6c36
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x812c
testb %al, %al
jne 0x6b5e
addq $0x48, %r12
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x812c
testb %al, %al
jne 0x6b5e
addq $0x48, %r12
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x812c
testb %al, %al
cmoveq 0x10(%rsp), %r12
movq %r12, %r13
jmp 0x6b6b
movq %r12, %r13
movq 0x8(%rsp), %rbp
movq 0x10(%rsp), %r12
cmpq %r12, %r13
je 0x6bac
leaq 0x38(%rsp), %r15
movq %r13, %r14
addq $0x48, %r13
cmpq %r12, %r13
je 0x6ba6
movq %r15, %rdi
movq %r13, %rsi
callq 0x812c
testb %al, %al
jne 0x6b7d
movq %r14, %rdi
movq %r13, %rsi
callq 0x93a6
addq $0x48, %r14
jmp 0x6b7d
movq 0x30(%rbx), %r12
jmp 0x6baf
movq %r13, %r14
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8830
movq %rbp, %rdi
callq 0x9584
andq $0x0, 0x58(%rbx)
andl $0x0, 0x60(%rbx)
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpq %rcx, %rax
je 0x6be4
orl $-0x1, (%rax)
addq $0x4, %rax
jmp 0x6bd6
movq (%rbp), %r14
cmpq 0x30(%rbx), %r14
je 0x6c27
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5cd6
movl 0x58(%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x58(%rbx)
movq 0x10(%rbx), %rdx
movl %eax, %eax
movl %ecx, (%rdx,%rax,4)
movzbl 0x28(%r14), %eax
cmpl $0x1, %eax
je 0x6c1e
testl %eax, %eax
jne 0x6c21
incl 0x5c(%rbx)
jmp 0x6c21
incl 0x60(%rbx)
addq $0x48, %r14
jmp 0x6be8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r12
movq %r12, %r14
jmp 0x6baf
nop