// File: roberto-bayardo[P]google-extremal-sets/all-maximal-sets-lexicographic.cc
// Function: google_extremal_sets::AllMaximalSetsLexicographic::ReadNextChunk(google_extremal_sets::DataSourceIterator*, long*)
bool AllMaximalSetsLexicographic::ReadNextChunk(
    DataSourceIterator* data, off_t* resume_offset) {
  *resume_offset = 0;
  items_in_ram_ = 0;
  ItemSet current_set;
  uint32_t set_id;
  bool result;
  while ((result = data->Next(&set_id, &current_set)) > 0) {
    candidates_.push_back(SetProperties::Create(set_id, current_set));
    items_in_ram_ += current_set.size();
    ++input_sets_count_;
    // Check if we've exceeded the RAM limit and if so stop
    // retaining any further itemsets in memory until the next
    // scan.
    if (items_in_ram_ >= max_items_in_ram_) {
      *resume_offset = data->Tell();
      std::cerr << "; Halted scan at input set number "
                << input_sets_count_ << " with id " << set_id << std::endl;
      return true;
    }
  }  // while ((result = data->Next() ...
  return result == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rcx
movq $0x0, (%rcx)
movl $0x0, 0x50(%rax)
leaq -0x38(%rbp), %rdi
callq 0x3980
movq -0x18(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x6b40
movl %eax, -0x6c(%rbp)
jmp 0x2a30
movl -0x6c(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, %cl
andb $0x1, %cl
movb %cl, -0x3d(%rbp)
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jle 0x2b80
movq -0x68(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x80(%rbp)
movl -0x3c(%rbp), %edi
leaq -0x38(%rbp), %rsi
callq 0x8480
movq %rax, -0x78(%rbp)
jmp 0x2a6d
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x3a40
jmp 0x2a84
leaq -0x38(%rbp), %rdi
callq 0x3a70
movq -0x68(%rbp), %rcx
movq %rax, %rdx
movl 0x50(%rcx), %eax
addq %rdx, %rax
movl %eax, 0x50(%rcx)
movq 0x8(%rcx), %rax
addq $0x1, %rax
movq %rax, 0x8(%rcx)
movl 0x50(%rcx), %eax
cmpl 0x54(%rcx), %eax
jb 0x2b7b
movq -0x18(%rbp), %rdi
callq 0x6b20
movq %rax, -0x88(%rbp)
jmp 0x2ac7
movq -0x88(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq 0xb514(%rip), %rdi      # 0xdff0
leaq 0x65f0(%rip), %rsi      # 0x90d3
callq 0x2200
movq %rax, -0x90(%rbp)
jmp 0x2af1
movq -0x90(%rbp), %rdi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x23a0
movq %rax, -0x98(%rbp)
jmp 0x2b0e
movq -0x98(%rbp), %rdi
leaq 0x65da(%rip), %rsi      # 0x90f6
callq 0x2200
movq %rax, -0xa0(%rbp)
jmp 0x2b2a
movq -0xa0(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x22e0
movq %rax, -0xa8(%rbp)
jmp 0x2b42
movq -0xa8(%rbp), %rdi
movq 0xb468(%rip), %rsi      # 0xdfb8
callq 0x2240
jmp 0x2b57
movb $0x1, -0x1(%rbp)
movl $0x1, -0x5c(%rbp)
jmp 0x2b9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x39e0
jmp 0x2bb1
jmp 0x2a1a
movb -0x3d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0x5c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x39e0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xb0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2370
nopw (%rax,%rax)