// File: /workspace/github_cpp_makefile_star2_O1/roberto-bayardo[P]google-extremal-sets/all-maximal-sets-cardinality.cc
// Function: google_extremal_sets::AllMaximalSetsCardinality::DeleteSubsumedCandidates(std::vector<unsigned int, std::allocator<unsigned int>> const&)
void AllMaximalSetsCardinality::DeleteSubsumedCandidates(
    const std::vector<uint32_t>& current_set) {
  std::vector<uint32_t>::const_iterator current_begin = current_set.begin();
  std::vector<uint32_t>::const_iterator current_end = current_set.end();
  SetProperties* candidate = 0;
  for (unsigned int i = 0; i < current_set.size(); ++i, ++current_begin) {
    if (candidates_.size() <= current_set[i])
      return;
    CandidateList& candidates = candidates_[current_set[i]];
    int candidate_index = -1;
    while ((candidate =
           NextCandidate(
               candidates,
               current_set,
               i,
               &candidate_index))) {
      // We must explicitly check subsumption. We need not check every
      // item in each set because we already know:
      // (1) the candidate does not contain any items within
      // current_set[0] through current_set[i - 1].
      // (2) the candidate's first item is already known to be
      // the same as current_set[i].
      // We adjust the iterators accordingly.
      if (DoesSubsume(
             current_begin, current_end,
             candidate->begin() + 1, candidate->end())) {
        // Candidate is not maximal, so we delete it. Note that we
        // must preserve the cardinality based ordering, so we NULL
        // out the pointer to the deleted entry rather than performing
        // any swapping. TODO: Occasionally it might be beneficial to
        // compress out the holes left by the NULL entries if we have
        // accumulated a significant number of them.
        candidates[candidate_index] = 0;
        SetProperties::Delete(candidate);
      }
      ++subsumption_checks_count_;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq (%rsi), %rax
movq %rsi, 0x8(%rsp)
movq 0x8(%rsi), %rbx
cmpq %rax, %rbx
je 0x2967
movabsq $0x100000000, %r12      # imm = 0x100000000
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, 0x10(%rsp)
xorl %esi, %esi
movq 0x20(%rsp), %rdx
movq 0x18(%rdx), %rcx
movq 0x20(%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rdx
movl (%rax,%rsi,4), %eax
cmpq %rax, %rdx
jbe 0x2967
movq %rsi, 0x18(%rsp)
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %r13
movq $-0x1, %rbp
movq (%r13), %rax
movq 0x8(%r13), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movslq %ebp, %rdi
shlq $0x20, %rbp
addq %r12, %rbp
incq %rdi
movq %rbp, %r8
movq %r8, %rcx
movq %rdi, %rbp
movl %ebp, %esi
cmpq %rsi, %rdx
je 0x288e
movq (%rax,%rbp,8), %rsi
leaq (%rcx,%r12), %r8
leaq 0x1(%rbp), %rdi
testq %rsi, %rsi
je 0x284a
movq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
subq (%rdi), %rdx
sarq $0x2, %rdx
subq 0x18(%rsp), %rdx
movl 0x4(%rsi), %edi
cmpq %rdi, %rdx
movl $0x0, %edi
cmovaeq %rsi, %rdi
jmp 0x2890
xorl %edi, %edi
testq %rdi, %rdi
je 0x293e
movl 0x4(%rdi), %esi
leaq 0x8(,%rsi,4), %rdx
cmpq $0xc, %rdx
sete %dl
je 0x291a
leaq (%rdi,%rsi,4), %rsi
addq $0x8, %rsi
leaq 0xc(%rdi), %r8
xorl %edx, %edx
movq 0x10(%rsp), %r9
movq %rbx, %r14
subq %r9, %r14
sarq $0x2, %r14
testq %r14, %r14
jle 0x28fd
movl (%r8), %r10d
movq %r14, %r15
shrq %r15
movq %r15, %r11
notq %r11
addq %r14, %r11
leaq (%r9,%r15,4), %r14
addq $0x4, %r14
cmpl %r10d, -0x4(%r14)
cmovbq %r14, %r9
cmovaeq %r15, %r11
movq %r11, %r14
testq %r11, %r11
jg 0x28d2
cmpq %rbx, %r9
je 0x291a
movl (%r9), %r10d
cmpl (%r8), %r10d
ja 0x291a
addq $0x4, %r9
addq $0x4, %r8
cmpq %rsi, %r8
sete %dl
jne 0x28c0
testb $0x1, %dl
je 0x2930
sarq $0x1d, %rcx
movq $0x0, (%rax,%rcx)
callq 0x417c
movq 0x20(%rsp), %rax
incq 0x10(%rax)
jmp 0x282b
movq 0x18(%rsp), %rsi
incl %esi
addq $0x4, 0x10(%rsp)
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rsi, %rcx
ja 0x27e9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq