// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq (%rsi), %rcx
movq %rsi, 0x10(%rsp)
movq 0x8(%rsi), %r15
xorl %r14d, %r14d
movq %r15, %rax
movq %rcx, 0x8(%rsp)
movq %rdi, 0x18(%rsp)
movl %r14d, %r14d
subq %rcx, %rax
sarq $0x2, %rax
cmpq %r14, %rax
jbe 0x2854
movq 0x18(%rbx), %rbp
movq 0x20(%rbx), %rax
subq %rbp, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
movl (%rcx,%r14,4), %ecx
cmpq %rcx, %rax
jbe 0x2854
imulq $0x18, %rcx, %rax
addq %rax, %rbp
orl $-0x1, 0x4(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq 0x10(%rsp), %rdx
movl %r14d, %ecx
leaq 0x4(%rsp), %r8
callq 0x2a8c
testq %rax, %rax
je 0x283a
movq %rax, %r13
movl 0x4(%rax), %eax
shlq $0x2, %rax
pushq $0x4
popq %r12
subq %rax, %r12
pushq $0xc
popq %r14
movq 0x8(%rsp), %rax
leaq (%r12,%r14), %rcx
cmpq $0xc, %rcx
je 0x2811
leaq (%r14,%r13), %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2aea
cmpq %r15, %rax
je 0x2827
movl (%rax), %ecx
cmpl (%rbx), %ecx
ja 0x2827
addq $0x4, %rax
addq $0x4, %r14
jmp 0x27e0
movslq 0x4(%rsp), %rax
movq (%rbp), %rcx
andq $0x0, (%rcx,%rax,8)
movq %r13, %rdi
callq 0x3d08
movq 0x18(%rsp), %rbx
incq 0x10(%rbx)
movq 0x20(%rsp), %r14
jmp 0x27a9
incl %r14d
addq $0x4, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
jmp 0x2765
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop