// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x28, %rsp
movq %rdx, (%rsp)
movq %rsi, %r12
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x30(%rdi), %r14
movabsq $0x4ec4ec4ec4ec4ec5, %rbp # imm = 0x4EC4EC4EC4EC4EC5
cmpq %r14, %r15
je 0x5a8b
movq %r14, %r13
subq %r15, %r13
movq %r13, %rax
sarq $0x3, %rax
imulq %rbp, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x65d1
cmpq $0x681, %r13            # imm = 0x681
jl 0x5a80
leaq 0x680(%r15), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x7099
cmpq %r14, %r13
je 0x5a8b
movq %r13, %rdi
callq 0x7299
addq $0x68, %r13
jmp 0x5a6d
movq %r15, %rdi
movq %r14, %rsi
callq 0x7099
leaq 0x28(%rbx), %r14
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %r13
movq %r13, %rdx
subq %rax, %rdx
movq %rdx, %rcx
sarq $0x3, %rcx
movq %rbp, %r10
imulq %rbp, %rcx
sarq $0x2, %rcx
movq %rdx, %rsi
movq %rax, %rbp
testq %rcx, %rcx
jle 0x5b88
imulq $0x1a0, %rcx, %rbp      # imm = 0x1A0
addq %rax, %rbp
incq %rcx
leaq 0xd0(%rax), %rsi
movq -0xb0(%rsi), %rdi
movzbl -0xa8(%rsi), %r8d
movq %r12, %r9
testl %r8d, %r8d
je 0x5af3
cmpl $0x1, %r8d
jne 0x5afc
movq (%rsp), %r9
cmpq %rdi, %r9
jg 0x5c0e
movq -0x48(%rsi), %rdi
movzbl -0x40(%rsi), %r8d
movq %r12, %r9
testl %r8d, %r8d
je 0x5b17
cmpl $0x1, %r8d
jne 0x5b20
movq (%rsp), %r9
cmpq %rdi, %r9
jg 0x5c17
movq 0x20(%rsi), %rdi
movzbl 0x28(%rsi), %r8d
movq %r12, %r9
testl %r8d, %r8d
je 0x5b3b
cmpl $0x1, %r8d
jne 0x5b44
movq (%rsp), %r9
cmpq %rdi, %r9
jg 0x5c21
movq 0x88(%rsi), %rdi
movzbl 0x90(%rsi), %r8d
movq %r12, %r9
testl %r8d, %r8d
je 0x5b65
cmpl $0x1, %r8d
jne 0x5b6e
movq (%rsp), %r9
cmpq %rdi, %r9
jg 0x5c1d
decq %rcx
addq $0x1a0, %rsi            # imm = 0x1A0
cmpq $0x1, %rcx
jg 0x5ad2
movq %r13, %rsi
subq %rbp, %rsi
sarq $0x3, %rsi
imulq %r10, %rsi
cmpq $0x1, %rsi
je 0x5be8
cmpq $0x2, %rsi
je 0x5bc7
cmpq $0x3, %rsi
jne 0x5cef
movq 0x20(%rbp), %rcx
movzbl 0x28(%rbp), %esi
movq %r12, %rdi
testl %esi, %esi
je 0x5bbe
cmpl $0x1, %esi
jne 0x5bc3
movq (%rsp), %rdi
cmpq %rcx, %rdi
jg 0x5c24
addq $0x68, %rbp
movq 0x20(%rbp), %rcx
movzbl 0x28(%rbp), %esi
movq %r12, %rdi
testl %esi, %esi
je 0x5bdf
cmpl $0x1, %esi
jne 0x5be4
movq (%rsp), %rdi
cmpq %rcx, %rdi
jg 0x5c24
addq $0x68, %rbp
movq 0x20(%rbp), %rcx
movzbl 0x28(%rbp), %esi
movq %r12, %rdi
testl %esi, %esi
je 0x5c04
cmpl $0x1, %esi
jne 0x5cef
movq (%rsp), %rdi
cmpq %rcx, %rdi
jg 0x5c24
jmp 0x5cef
addq $-0xd0, %rsi
jmp 0x5c21
addq $-0x68, %rsi
jmp 0x5c21
addq $0x68, %rsi
movq %rsi, %rbp
cmpq %r13, %rbp
je 0x5cef
movq %r14, 0x8(%rsp)
leaq 0x68(%rbp), %r14
cmpq %r13, %r14
je 0x5ce7
movq 0x20(%r14), %rax
movzbl 0x28(%r14), %ecx
movq %r12, %rdx
testl %ecx, %ecx
je 0x5c58
cmpl $0x1, %ecx
jne 0x5c5d
movq (%rsp), %rdx
cmpq %rax, %rdx
jg 0x5ccf
leaq 0x20(%r14), %r15
movq %rbp, %rdi
movq %r14, %rsi
callq 0x32c0
movq (%r15), %rax
movq %rax, 0x20(%rbp)
movb 0x8(%r15), %al
movb %al, 0x28(%rbp)
leaq 0x30(%rbp), %rdi
leaq 0x30(%r14), %rsi
callq 0x8640
movb 0x48(%r14), %al
movb %al, 0x48(%rbp)
movq 0x60(%rbp), %rax
movups 0x50(%r14), %xmm0
movups 0x50(%rbp), %xmm1
movups %xmm0, 0x50(%rbp)
movq 0x60(%r14), %rcx
movq %rcx, 0x60(%rbp)
movaps %xmm1, 0x10(%rsp)
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r14)
movq $0x0, 0x60(%r14)
leaq 0x10(%rsp), %rdi
callq 0x7674
addq $0x68, %rbp
addq $0x68, %r14
cmpq %r13, %r14
jne 0x5c3f
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdx
subq %rax, %rdx
movq %rbp, %r13
movq 0x8(%rsp), %r14
subq %rax, %r13
addq %rax, %r13
addq %rax, %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x894c
movq 0x38(%rbx), %r12
cmpq 0x30(%rbx), %r12
je 0x5d19
movq %r14, %rdi
callq 0x8a86
movq 0x30(%rbx), %r12
movq $0x0, 0x58(%rbx)
movl $0x0, 0x60(%rbx)
movq 0x10(%rbx), %r14
movl $0x7270e00, %edx        # imm = 0x7270E00
movq %r14, %rdi
movl $0xff, %esi
callq 0x3150
movq 0x28(%rbx), %r15
cmpq %r12, %r15
je 0x5d7d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4a2e
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 0x5d74
testl %eax, %eax
jne 0x5d77
incl 0x5c(%rbx)
jmp 0x5d77
incl 0x60(%rbx)
addq $0x68, %r15
jmp 0x5d42
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq