// File: /workspace/github_cpp_makefile_star2_O2/roberto-bayardo[P]google-extremal-sets/all-maximal-sets-lexicographic.cc
// Function: google_extremal_sets::AllMaximalSetsLexicographic::FindAllMaximalSets(google_extremal_sets::DataSourceIterator*, unsigned int)
bool AllMaximalSetsLexicographic::FindAllMaximalSets(DataSourceIterator* data, uint32_t) {
  Init();

  // Vars set by the data source iterator.
  int result;
  uint32_t set_id;
  ItemSet current_set;

  // This outer loop supports multiple passes over the data in the
  // case where the dataset exceeds the bound on max_items_in_ram_. As
  // long as resume_offset == 0, we will continue retaining itemsets
  // in RAM.
  off_t start_offset = 0;
  off_t resume_offset = 0;
  do {  // while (resume_offset != 0)
    if (!PrepareForDataScan(data, resume_offset))
      return false;  // IO error
    start_offset = resume_offset;

    if (!ReadNextChunk(data, &resume_offset))
      return false;  // IO error

    DeleteTriviallySubsumedCandidates();

    BuildIndex();

    std::cerr << "; Potential maximal sets: " << candidates_.size() << '\n'
              << "; Beginning subsumption checking scan." << std::endl;
    for (unsigned int i = 0; i < candidates_.size() - 1; ++i) {
      if (candidates_[i])  // check to make sure not already deleted.
        DeleteSubsumedCandidates(i);
    }
    if (start_offset != 0) {
      if (!PrepareForDataScan(data, 0))
        return false;  // IO error
      while (data->Tell() < start_offset &&
             (result = data->Next(&set_id, &current_set)) > 0) {
        DeleteSubsumedCandidates(current_set);
      }
      if (result < 0)  // IO error
        return false;
    }
    std::cerr << "; Dumping maximal sets." << std::endl;
    DumpMaximalSets();
  } while (resume_offset != 0);
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2664
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
andq $0x0, 0x10(%r15)
movq %rsp, %rax
andq $0x0, (%rax)
movaps %xmm0, (%r15)
xorl %r13d, %r13d
movq 0x5af9(%rip), %rbp      # 0x7ff0
movq %rbx, %rsi
movq %r13, %rdx
callq 0x26aa
testb %al, %al
je 0x262e
movq %r14, %rdi
movq %rbx, %rsi
movq %rsp, %rdx
callq 0x26ec
testb %al, %al
je 0x262e
movq %r14, %rdi
callq 0x2804
movq %r14, %rdi
callq 0x28bc
movq %rbp, %rdi
leaq 0x2aca(%rip), %rsi      # 0x5004
callq 0x21b0
movq 0x20(%r14), %rsi
subq 0x18(%r14), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
pushq $0xa
popq %rsi
callq 0x21f0
movq %rax, %rdi
leaq 0x2ab7(%rip), %rsi      # 0x501f
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
xorl %ebp, %ebp
movl %ebp, %ebp
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rbp, %rcx
jbe 0x25a5
cmpq $0x0, (%rax,%rbp,8)
je 0x25a1
movq %r14, %rdi
movl %ebp, %esi
callq 0x299e
incl %ebp
jmp 0x2577
testq %r13, %r13
je 0x25f7
movq %rbx, %rsi
xorl %edx, %edx
callq 0x26aa
movq 0x5a35(%rip), %rbp      # 0x7ff0
testb %al, %al
je 0x262e
movq %rbx, %rdi
callq 0x3882
cmpq %r13, %rax
jge 0x25f0
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
movq %r15, %rdx
callq 0x388a
movl %eax, %r12d
testl %eax, %eax
jle 0x25f0
movq %r14, %rdi
movq %r15, %rsi
callq 0x29f0
jmp 0x25bf
testl %r12d, %r12d
jns 0x25fe
jmp 0x262e
movq 0x59f2(%rip), %rbp      # 0x7ff0
movq %rbp, %rdi
leaq 0x2a3e(%rip), %rsi      # 0x5046
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2a2e
movq (%rsp), %r13
testq %r13, %r13
jne 0x24f7
movb $0x1, %bl
jmp 0x2630
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
callq 0x2f8c
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x264f
jmp 0x264f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2f8c
movq %rbx, %rdi
callq 0x22b0