// File: roberto-bayardo[P]google-extremal-sets/all-maximal-sets-lexicographic.cc
// Function: google_extremal_sets::AllMaximalSetsLexicographic::GetNewBeginRangeIt(__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, unsigned int)
inline
AllMaximalSetsLexicographic::CandidateList::iterator AllMaximalSetsLexicographic::GetNewBeginRangeIt(
    CandidateList::iterator begin_range_it,
    CandidateList::iterator end_range_it,
    uint32_t current_item,
    unsigned int depth) {
  ++canidate_seek_count_;
  if (depth == 0) {
    // At depth 0 we can use the index rather than binary search.
    if (current_item >= index_.size())
      return end_range_it;
    if (candidates_.begin() + index_[current_item] > begin_range_it) {
      begin_range_it = candidates_.begin() + index_[current_item];
    }
    while (begin_range_it != end_range_it && !*begin_range_it)
      ++begin_range_it;
  } else {
    begin_range_it = find_new_it(
        begin_range_it,
        end_range_it,
        current_item,
        depth,
        std::greater<uint32_t>());
  }
  return begin_range_it;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rdi, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
cmpl $0x0, -0x28(%rbp)
jne 0x41f2
movq -0x70(%rbp), %rdi
movl -0x24(%rbp), %eax
movq %rax, -0x78(%rbp)
addq $0x30, %rdi
callq 0x4330
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jb 0x4129
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4229
movq -0x70(%rbp), %rdi
addq $0x18, %rdi
callq 0x3c30
movq -0x70(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x30, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x3b60
movq (%rax), %rsi
leaq -0x38(%rbp), %rdi
callq 0x3c60
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x4470
testb $0x1, %al
jne 0x416f
jmp 0x41aa
movq -0x70(%rbp), %rdi
addq $0x18, %rdi
callq 0x3c30
movq -0x70(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x30, %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x3b60
movq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3c60
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x41ac
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3cd0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x79(%rbp)
jne 0x41c7
jmp 0x41dc
leaq -0x10(%rbp), %rdi
callq 0x3eb0
cmpq $0x0, (%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x79(%rbp)
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x41e5
jmp 0x41f0
leaq -0x10(%rbp), %rdi
callq 0x40a0
jmp 0x41ac
jmp 0x4221
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x3770
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)