// File: /workspace/github_cpp_makefile_star2_O2/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 $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 0x511c
movq %r14, %r12
subq %r15, %r12
movq %r12, %rax
cqto
pushq $0x68
popq %rcx
idivq %rcx
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x5932
cmpq $0x681, %r12            # imm = 0x681
jl 0x5111
leaq 0x680(%r15), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x5d4b
cmpq %r14, %r12
je 0x511c
movq %r12, %rdi
callq 0x5deb
addq $0x68, %r12
jmp 0x50fe
movq %r15, %rdi
movq %r14, %rsi
callq 0x5d4b
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 $0x68
popq %rcx
idivq %rcx
movq %rax, %r14
sarq $0x2, %r14
testq %r14, %r14
jle 0x51e1
movq %rbp, %rdi
movq %r12, %rsi
callq 0x5e50
testb %al, %al
jne 0x524b
leaq 0x68(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5e50
testb %al, %al
jne 0x524e
leaq 0xd0(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5e50
testb %al, %al
jne 0x524e
leaq 0x138(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5e50
testb %al, %al
jne 0x524e
addq $0x1a0, %r12            # imm = 0x1A0
decq %r14
addq $-0x1a0, %r15           # imm = 0xFE60
jmp 0x5168
movq %r15, %rax
cqto
pushq $0x68
popq %rcx
idivq %rcx
cmpq $0x1, %rax
movq 0x8(%rsp), %rbp
je 0x5231
cmpq $0x2, %rax
je 0x521c
cmpq $0x3, %rax
jne 0x5320
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x5e50
testb %al, %al
jne 0x5246
addq $0x68, %r12
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x5e50
testb %al, %al
jne 0x5246
addq $0x68, %r12
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x5e50
testb %al, %al
cmoveq 0x10(%rsp), %r12
movq %r12, %r13
jmp 0x5253
movq %r12, %r13
movq 0x8(%rsp), %rbp
movq 0x10(%rsp), %r12
cmpq %r12, %r13
je 0x5294
leaq 0x38(%rsp), %r15
movq %r13, %r14
addq $0x68, %r13
cmpq %r12, %r13
je 0x528e
movq %r15, %rdi
movq %r13, %rsi
callq 0x5e50
testb %al, %al
jne 0x5265
movq %r14, %rdi
movq %r13, %rsi
callq 0x701e
addq $0x68, %r14
jmp 0x5265
movq 0x30(%rbx), %r12
jmp 0x5297
movq %r13, %r14
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x60ce
movq %rbp, %rdi
callq 0x7262
andq $0x0, 0x58(%rbx)
andl $0x0, 0x60(%rbx)
movq 0x10(%rbx), %rax
xorl %ecx, %ecx
cmpq $0x1c9c380, %rcx        # imm = 0x1C9C380
je 0x52ce
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x52bc
movq (%rbp), %r14
cmpq 0x30(%rbx), %r14
je 0x5311
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4622
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 0x5308
testl %eax, %eax
jne 0x530b
incl 0x5c(%rbx)
jmp 0x530b
incl 0x60(%rbx)
addq $0x68, %r14
jmp 0x52d2
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r12
movq %r12, %r14
jmp 0x5297
nop