// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x26c2
xorl %eax, %eax
leaq 0x20(%rsp), %r15
movq %rax, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq 0x10(%rsp), %r13
movq %rbx, %rsi
movq %r13, %rdx
callq 0x2742
testb %al, %al
je 0x2671
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x10(%rsp), %rdx
callq 0x27ae
testb %al, %al
je 0x2671
movq %r14, %rdi
callq 0x291a
movq %r14, %rdi
callq 0x29f6
movl $0x1a, %edx
movq 0x5ae5(%rip), %rdi      # 0x7ff0
leaq 0x2af2(%rip), %rsi      # 0x5004
callq 0x21e0
movq 0x20(%r14), %rsi
subq 0x18(%r14), %rsi
sarq $0x3, %rsi
movq 0x5ac6(%rip), %rdi      # 0x7ff0
callq 0x20f0
movb $0xa, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0xf(%rsp), %rsi
callq 0x21e0
movq %rax, %rbp
movl $0x26, %edx
movq %rax, %rdi
leaq 0x2ac7(%rip), %rsi      # 0x501f
callq 0x21e0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
cmpq $0x8, %rcx
je 0x25c2
xorl %ebp, %ebp
cmpq $0x0, (%rax,%rbp,8)
je 0x25a9
movq %r14, %rdi
movl %ebp, %esi
callq 0x2b0a
incl %ebp
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rbp, %rcx
ja 0x2598
testq %r13, %r13
je 0x260f
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2742
testb %al, %al
je 0x2671
movq %rbx, %rdi
callq 0x3b18
cmpq %r13, %rax
jge 0x260a
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
movq %r15, %rdx
callq 0x3b20
movl %eax, %r12d
testl %eax, %eax
jle 0x260a
movq %r14, %rdi
movq %r15, %rsi
callq 0x2b5c
jmp 0x25d9
testl %r12d, %r12d
js 0x2671
movl $0x17, %edx
movq 0x59d5(%rip), %rdi      # 0x7ff0
leaq 0x2a24(%rip), %rsi      # 0x5046
callq 0x21e0
movq 0x59c2(%rip), %rcx      # 0x7ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq 0x59a4(%rip), %rdi      # 0x7ff0
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2b9a
cmpq $0x0, 0x10(%rsp)
jne 0x24bf
movb $0x1, %bl
jmp 0x2673
xorl %ebx, %ebx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x268a
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x269f
jmp 0x269f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x26b9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2270
nop