// File: /workspace/github_cpp_makefile_star2_O2/roberto-bayardo[P]google-extremal-sets/all-maximal-sets-lexicographic.cc
// Function: google_extremal_sets::AllMaximalSetsLexicographic::DeleteSubsumedFromRange(__gnu_cxx::__normal_iterator<google_extremal_sets::SetProperties**, std::vector<google_extremal_sets::SetProperties*, std::allocator<google_extremal_sets::SetProperties*>>>, __gnu_cxx::__normal_iterator<google_extremal_sets::SetProperties**, std::vector<google_extremal_sets::SetProperties*, std::allocator<google_extremal_sets::SetProperties*>>>, unsigned int const*, unsigned int)
void AllMaximalSetsLexicographic::DeleteSubsumedFromRange(
    CandidateList::iterator begin_range_it,
    CandidateList::iterator end_range_it,
    const uint32_t* current_set_it,
    unsigned int depth) {
  assert(begin_range_it != end_range_it);
  DeleteSubsumedSets(&begin_range_it, end_range_it, depth);
  if (begin_range_it == end_range_it || current_set_it == current_set_->end())
    return;

  do {  // while (begin_range_it != end_range_it)
    // First thing we do is find the next item in the current_set
    // that, if added to our prefix, could potentially subsume some
    // candidate within the remaining range.
    uint32_t candidate_item = (**begin_range_it)[depth];
    assert(current_set_it != current_set_->end());
    if (*current_set_it < candidate_item) {
      current_set_it = std::lower_bound(
          current_set_it, current_set_->end(), candidate_item);
    }
    if (current_set_it == current_set_->end())
      return;

    assert(*current_set_it >= candidate_item);

    if (*current_set_it == candidate_item) {
      // The item we found matches the next candidate set item, which
      // means we can extend the prefix. Before we recurse, we must
      // compute an end range for the extended prefix.
      CandidateList::iterator new_end_range_it = GetNewEndRangeIt(
          begin_range_it, end_range_it, candidate_item, depth);
      assert(new_end_range_it >= begin_range_it);
      if (begin_range_it != new_end_range_it) {
        DeleteSubsumedFromRange(
            begin_range_it, new_end_range_it, current_set_it + 1, depth + 1);
      }
      begin_range_it = new_end_range_it;
      while (begin_range_it != end_range_it && !*begin_range_it)
        ++begin_range_it;
    } else {
      // Advance the begin_range until we reach potentially subsumable candidates.
      begin_range_it = GetNewBeginRangeIt(
          begin_range_it, end_range_it, *current_set_it, depth);
    }
  } while (begin_range_it != end_range_it);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
cmpq %rdx, %rsi
je 0x2c32
movl %r8d, %ebx
movq %rcx, %r12
movq %rdx, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r13
movq %r13, %rsi
movl %r8d, %ecx
callq 0x2d28
movq (%r13), %rax
cmpq %r14, %rax
je 0x2bc6
movq 0x48(%r15), %rcx
movl 0x4(%rcx), %edx
leaq (%rcx,%rdx,4), %rsi
addq $0x8, %rsi
cmpq %r12, %rsi
je 0x2bc6
movl %ebx, %ebp
leal 0x1(%rbx), %esi
movl %esi, 0x14(%rsp)
movq (%rax), %rax
movl 0x8(%rax,%rbp,4), %edi
movl %edi, 0x10(%rsp)
movl %edx, %eax
leaq (%rcx,%rax,4), %rsi
addq $0x8, %rsi
cmpq %rsi, %r12
je 0x2bd5
cmpl %edi, (%r12)
jae 0x2b2f
movq %r12, %rdi
leaq 0x10(%rsp), %rdx
callq 0x345c
movq %rax, %r12
movq 0x48(%r15), %rcx
movl 0x4(%rcx), %eax
leaq (%rcx,%rax,4), %rax
addq $0x8, %rax
cmpq %rax, %r12
je 0x2bc6
movl (%r12), %ecx
cmpl 0x10(%rsp), %ecx
jb 0x2bf4
movq 0x8(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movl %ebx, %r8d
jne 0x2bab
callq 0x2d96
movq 0x8(%rsp), %rsi
cmpq %rsi, %rax
jb 0x2c13
movq %rax, %r13
je 0x2b8b
leaq 0x4(%r12), %rcx
movq %r15, %rdi
movq %r13, %rdx
movl 0x14(%rsp), %r8d
callq 0x2a8e
movq %r13, %rcx
movq %r13, %rax
movq %rcx, 0x8(%rsp)
cmpq %r14, %r13
je 0x2bb5
leaq 0x8(%rax), %r13
addq $0x8, %rcx
cmpq $0x0, (%rax)
je 0x2b8e
jmp 0x2bb5
callq 0x2e92
movq %rax, 0x8(%rsp)
cmpq %r14, %rax
je 0x2bc6
movq 0x48(%r15), %rcx
movl 0x4(%rcx), %edx
jmp 0x2af4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2720(%rip), %rdi      # 0x52fc
leaq 0x255a(%rip), %rsi      # 0x513d
leaq 0x2670(%rip), %rcx      # 0x525a
movl $0x162, %edx            # imm = 0x162
callq 0x2100
leaq 0x2727(%rip), %rdi      # 0x5322
leaq 0x253b(%rip), %rsi      # 0x513d
leaq 0x2651(%rip), %rcx      # 0x525a
movl $0x16a, %edx            # imm = 0x16A
callq 0x2100
leaq 0x272a(%rip), %rdi      # 0x5344
leaq 0x251c(%rip), %rsi      # 0x513d
leaq 0x2632(%rip), %rcx      # 0x525a
movl $0x172, %edx            # imm = 0x172
callq 0x2100
leaq 0x2602(%rip), %rdi      # 0x523b
leaq 0x24fd(%rip), %rsi      # 0x513d
leaq 0x2613(%rip), %rcx      # 0x525a
movl $0x158, %edx            # imm = 0x158
callq 0x2100
nop