// File: /workspace/github_cpp_makefile_star2_O1/ddu1[P]polarizedtext/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;
  for (int32_t i = 0; i < MAX_VOCAB_SIZE; i++) {
    word2int_[i] = -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
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x28(%rdi), %r13
movq 0x30(%rdi), %r12
cmpq %r12, %r13
je 0x5a67
movq %r12, %rbp
subq %r13, %rbp
movq %rbp, %rax
sarq $0x3, %rax
movabsq $0x4ec4ec4ec4ec4ec5, %rcx # imm = 0x4EC4EC4EC4EC4EC5
imulq %rcx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x65c7
cmpq $0x681, %rbp            # imm = 0x681
jl 0x5a5c
leaq 0x680(%r13), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x704b
cmpq %r12, %rbp
je 0x5a67
movq %rbp, %rdi
callq 0x725f
addq $0x68, %rbp
jmp 0x5a49
movq %r13, %rdi
movq %r12, %rsi
callq 0x704b
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %r13
movq %r13, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $0x4ec4ec4ec4ec4ec5, %rdx # imm = 0x4EC4EC4EC4EC4EC5
imulq %rdx, %rcx
sarq $0x2, %rcx
testq %rcx, %rcx
jle 0x5b77
imulq $0x1a0, %rcx, %rdx      # imm = 0x1A0
addq %rax, %rdx
incq %rcx
addq $0xd0, %rax
movq %rax, %r12
movzbl -0xa8(%r12), %eax
cmpl $0x1, %eax
je 0x5ace
testl %eax, %eax
jne 0x5adc
cmpq %r15, -0xb0(%r12)
jl 0x5c17
cmpb $0x1, %al
jne 0x5adc
cmpq %r14, -0xb0(%r12)
jl 0x5c17
movzbl -0x40(%r12), %eax
cmpl $0x1, %eax
je 0x5afa
testl %eax, %eax
jne 0x5b05
cmpq %r15, -0x48(%r12)
jl 0x5c20
cmpb $0x1, %al
jne 0x5b05
cmpq %r14, -0x48(%r12)
jl 0x5c20
movzbl 0x28(%r12), %eax
cmpl $0x1, %eax
je 0x5b23
testl %eax, %eax
jne 0x5b2e
cmpq %r15, 0x20(%r12)
jl 0x5c2a
cmpb $0x1, %al
jne 0x5b2e
cmpq %r14, 0x20(%r12)
jl 0x5c2a
movzbl 0x90(%r12), %eax
cmpl $0x1, %eax
je 0x5b52
testl %eax, %eax
jne 0x5b60
cmpq %r15, 0x88(%r12)
jl 0x5c26
cmpb $0x1, %al
jne 0x5b60
cmpq %r14, 0x88(%r12)
jl 0x5c26
decq %rcx
addq $0x1a0, %r12            # imm = 0x1A0
cmpq $0x1, %rcx
jg 0x5aaa
movq %rdx, %rax
movq %r13, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $0x4ec4ec4ec4ec4ec5, %rdx # imm = 0x4EC4EC4EC4EC4EC5
imulq %rdx, %rcx
cmpq $0x1, %rcx
je 0x5bec
cmpq $0x2, %rcx
je 0x5bca
movq %r13, %r12
cmpq $0x3, %rcx
jne 0x5c2a
movzbl 0x28(%rax), %ecx
cmpl $0x1, %ecx
je 0x5bc0
testl %ecx, %ecx
jne 0x5bc6
cmpq %r15, 0x20(%rax)
jl 0x5c12
cmpb $0x1, %cl
jne 0x5bc6
cmpq %r14, 0x20(%rax)
jl 0x5c12
addq $0x68, %rax
movzbl 0x28(%rax), %ecx
cmpl $0x1, %ecx
je 0x5be2
testl %ecx, %ecx
jne 0x5be8
cmpq %r15, 0x20(%rax)
jl 0x5c12
cmpb $0x1, %cl
jne 0x5be8
cmpq %r14, 0x20(%rax)
jl 0x5c12
addq $0x68, %rax
movzbl 0x28(%rax), %ecx
cmpl $0x1, %ecx
je 0x5c0a
movq %r13, %r12
testl %ecx, %ecx
jne 0x5c2a
cmpq %r15, 0x20(%rax)
jl 0x5c12
movq %r13, %r12
cmpb $0x1, %cl
jne 0x5c2a
cmpq %r14, 0x20(%rax)
cmovgeq %r13, %rax
movq %rax, %r12
jmp 0x5c2a
addq $-0xd0, %r12
jmp 0x5c2a
addq $-0x68, %r12
jmp 0x5c2a
addq $0x68, %r12
leaq 0x28(%rbx), %rax
movq %rax, (%rsp)
cmpq %r13, %r12
sete %al
leaq 0x68(%r12), %rcx
cmpq %r13, %rcx
sete %cl
orb %al, %cl
jne 0x5cc0
leaq 0xb8(%r12), %rbp
movzbl -0x28(%rbp), %eax
cmpl $0x1, %eax
je 0x5c66
testl %eax, %eax
jne 0x5c6c
cmpq %r15, -0x30(%rbp)
jl 0x5cb0
cmpb $0x1, %al
jne 0x5c6c
cmpq %r14, -0x30(%rbp)
jl 0x5cb0
leaq -0x50(%rbp), %rsi
movq %r12, %rdi
callq 0x32c0
movq -0x30(%rbp), %rax
movq %rax, 0x20(%r12)
movb -0x28(%rbp), %al
movb %al, 0x28(%r12)
leaq 0x30(%r12), %rdi
leaq -0x20(%rbp), %rsi
callq 0x8650
movb -0x8(%rbp), %al
movb %al, 0x48(%r12)
leaq 0x50(%r12), %rdi
movq %rbp, %rsi
callq 0x8690
addq $0x68, %r12
leaq 0x68(%rbp), %rax
addq $0x18, %rbp
cmpq %r13, %rbp
movq %rax, %rbp
jne 0x5c4f
movq 0x30(%rbx), %rdx
movq (%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x89b0
movq 0x38(%rbx), %rax
cmpq 0x30(%rbx), %rax
je 0x5ce5
movq %r14, %rdi
callq 0x8aa4
movq $0x0, 0x58(%rbx)
movl $0x0, 0x60(%rbx)
movq 0x10(%rbx), %rdi
movl $0x7270e00, %edx        # imm = 0x7270E00
movl $0xff, %esi
callq 0x3150
movq 0x28(%rbx), %r14
movq 0x30(%rbx), %r15
cmpq %r15, %r14
je 0x5d51
movq 0x10(%rbx), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a22
movl 0x58(%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x58(%rbx)
movl %eax, %eax
movl %ecx, (%r12,%rax,4)
movzbl 0x28(%r14), %eax
cmpl $0x1, %eax
je 0x5d45
testl %eax, %eax
jne 0x5d48
incl 0x5c(%rbx)
jmp 0x5d48
incl 0x60(%rbx)
addq $0x68, %r14
cmpq %r15, %r14
jne 0x5d18
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq