// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x28(%rdi), %r13
movq 0x30(%rdi), %r12
cmpq %r12, %r13
je 0x761d
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 0x8ee6
cmpq $0x481, %rbp            # imm = 0x481
jl 0x7612
leaq 0x480(%r13), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x971d
cmpq %r12, %rbp
je 0x761d
movq %rbp, %rdi
callq 0x9877
addq $0x48, %rbp
jmp 0x75ff
movq %r13, %rdi
movq %r12, %rsi
callq 0x971d
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %r13
movq %r13, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
sarq $0x2, %rcx
testq %rcx, %rcx
jle 0x771c
leaq (%rcx,%rcx,8), %rdx
shlq $0x5, %rdx
addq %rax, %rdx
incq %rcx
addq $0x90, %rax
movq %rax, %r12
movzbl -0x68(%r12), %eax
cmpl $0x1, %eax
je 0x767f
testl %eax, %eax
jne 0x768a
cmpq %r15, -0x70(%r12)
jl 0x77bc
cmpb $0x1, %al
jne 0x768a
cmpq %r14, -0x70(%r12)
jl 0x77bc
movzbl -0x20(%r12), %eax
cmpl $0x1, %eax
je 0x76a8
testl %eax, %eax
jne 0x76b3
cmpq %r15, -0x28(%r12)
jl 0x77c5
cmpb $0x1, %al
jne 0x76b3
cmpq %r14, -0x28(%r12)
jl 0x77c5
movzbl 0x28(%r12), %eax
cmpl $0x1, %eax
je 0x76d1
testl %eax, %eax
jne 0x76dc
cmpq %r15, 0x20(%r12)
jl 0x77cf
cmpb $0x1, %al
jne 0x76dc
cmpq %r14, 0x20(%r12)
jl 0x77cf
movzbl 0x70(%r12), %eax
cmpl $0x1, %eax
je 0x76fa
testl %eax, %eax
jne 0x7705
cmpq %r15, 0x68(%r12)
jl 0x77cb
cmpb $0x1, %al
jne 0x7705
cmpq %r14, 0x68(%r12)
jl 0x77cb
decq %rcx
addq $0x120, %r12            # imm = 0x120
cmpq $0x1, %rcx
jg 0x7661
movq %rdx, %rax
movq %r13, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x71c71c71c71c71c7, %rdx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
cmpq $0x1, %rcx
je 0x7791
cmpq $0x2, %rcx
je 0x776f
movq %r13, %r12
cmpq $0x3, %rcx
jne 0x77cf
movzbl 0x28(%rax), %ecx
cmpl $0x1, %ecx
je 0x7765
testl %ecx, %ecx
jne 0x776b
cmpq %r15, 0x20(%rax)
jl 0x77b7
cmpb $0x1, %cl
jne 0x776b
cmpq %r14, 0x20(%rax)
jl 0x77b7
addq $0x48, %rax
movzbl 0x28(%rax), %ecx
cmpl $0x1, %ecx
je 0x7787
testl %ecx, %ecx
jne 0x778d
cmpq %r15, 0x20(%rax)
jl 0x77b7
cmpb $0x1, %cl
jne 0x778d
cmpq %r14, 0x20(%rax)
jl 0x77b7
addq $0x48, %rax
movzbl 0x28(%rax), %ecx
cmpl $0x1, %ecx
je 0x77af
movq %r13, %r12
testl %ecx, %ecx
jne 0x77cf
cmpq %r15, 0x20(%rax)
jl 0x77b7
movq %r13, %r12
cmpb $0x1, %cl
jne 0x77cf
cmpq %r14, 0x20(%rax)
cmovgeq %r13, %rax
movq %rax, %r12
jmp 0x77cf
addq $-0x90, %r12
jmp 0x77cf
addq $-0x48, %r12
jmp 0x77cf
addq $0x48, %r12
leaq 0x28(%rbx), %rax
movq %rax, (%rsp)
cmpq %r13, %r12
sete %al
leaq 0x48(%r12), %rcx
cmpq %r13, %rcx
sete %cl
orb %al, %cl
jne 0x784c
leaq 0x78(%r12), %rbp
movzbl -0x8(%rbp), %eax
cmpl $0x1, %eax
je 0x7808
testl %eax, %eax
jne 0x780e
cmpq %r15, -0x10(%rbp)
jl 0x783c
cmpb $0x1, %al
jne 0x780e
cmpq %r14, -0x10(%rbp)
jl 0x783c
leaq -0x30(%rbp), %rsi
movq %r12, %rdi
callq 0x4390
movq -0x10(%rbp), %rax
movq %rax, 0x20(%r12)
movb -0x8(%rbp), %al
movb %al, 0x28(%r12)
leaq 0x30(%r12), %rdi
movq %rbp, %rsi
callq 0xb164
addq $0x48, %r12
leaq 0x48(%rbp), %rax
addq $0x18, %rbp
cmpq %r13, %rbp
movq %rax, %rbp
jne 0x77f1
movq 0x30(%rbx), %rdx
movq (%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0xb360
movq 0x38(%rbx), %rax
cmpq 0x30(%rbx), %rax
je 0x7871
movq %r14, %rdi
callq 0xb440
movq $0x0, 0x58(%rbx)
movl $0x0, 0x60(%rbx)
movq 0x10(%rbx), %r14
movq 0x18(%rbx), %rdx
cmpq %rdx, %r14
je 0x78a9
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 0x78ec
movq %rbx, %rdi
movq %r15, %rsi
callq 0x632e
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 0x78e3
testl %eax, %eax
jne 0x78e6
incl 0x5c(%rbx)
jmp 0x78e6
incl 0x60(%rbx)
addq $0x48, %r15
jmp 0x78b1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop