// File: /workspace/github_cpp_makefile_star2_O2/roberto-bayardo[P]google-extremal-sets/main-lexicographic.cc
// Function: main
int main(int argc, char** argv) {
  time_t start_time;
  time(&start_time);

  // Verify input arguments.
  if (argc != 2) {
    std::cerr << "ERROR: Usage is: ./ams-lexicographic <dataset_path>\n";
    return 1;
  }

  {
    std::auto_ptr<DataSourceIterator> data(DataSourceIterator::Get(argv[1]));
    if (!data.get())
      return 2;

    google_extremal_sets::AllMaximalSetsLexicographic ap;
    ap.SetMaxItemsInRam(1000000000);
    ap.SetOutputMode(google_extremal_sets::COUNT_ONLY);
    //ap.SetOutputMode(google_extremal_sets::ID_AND_ITEMS);

    bool result = ap.FindAllMaximalSets(data.get(), 8000000/*max_item_id*/);

    if (!result) {
      std::cerr << "IO ERROR: " << data->GetErrorMessage() << "\n";
      return 3;
    }

    std::cerr << "; Found " << ap.MaximalSetsCount() << " maximal itemsets.\n"
              << "; Number of itemsets in the input: " << ap.InputSetsCount()
              << "\n"
              << "; Number of candidate seeks performed: "
              << ap.CandidateSeekCount() << "\n";
  }

  time_t end_time;
  time(&end_time);
  std::cerr << "; Total running time: " << (end_time - start_time)
            << " seconds" << std::endl;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8(%rsp), %rdi
callq 0x2180
cmpl $0x2, %ebp
jne 0x358d
movq 0x8(%rbx), %rdi
callq 0x3710
movq %rax, (%rsp)
testq %rax, %rax
je 0x35a8
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movq $0x3b9aca00, 0x54(%rdi) # imm = 0x3B9ACA00
movq %rax, %rsi
movl $0x7a1200, %edx         # imm = 0x7A1200
callq 0x24bc
movl %eax, %ebx
testb %al, %al
je 0x35af
movq 0x4ae5(%rip), %rdi      # 0x7ff0
leaq 0x2260(%rip), %rsi      # 0x5772
callq 0x21b0
movq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x21a0
leaq 0x1b40(%rip), %rsi      # 0x506b
movq %rax, %rdi
callq 0x21b0
leaq 0x2241(%rip), %rsi      # 0x577b
movq %rax, %rdi
callq 0x21b0
movq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x2090
leaq 0x1b27(%rip), %rsi      # 0x507d
movq %rax, %rdi
callq 0x21b0
leaq 0x223a(%rip), %rsi      # 0x579f
movq %rax, %rdi
callq 0x21b0
movq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x2090
xorl %ebp, %ebp
leaq 0x1afa(%rip), %rsi      # 0x507d
movq %rax, %rdi
callq 0x21b0
jmp 0x3600
movq 0x4a5c(%rip), %rdi      # 0x7ff0
leaq 0x2197(%rip), %rsi      # 0x5732
callq 0x21b0
pushq $0x1
popq %rbp
jmp 0x365f
pushq $0x2
popq %rbp
xorl %ebx, %ebx
jmp 0x360a
movq 0x4a3a(%rip), %rdi      # 0x7ff0
leaq 0x21aa(%rip), %rsi      # 0x5767
callq 0x21b0
movq %rax, %r14
movq (%rsp), %rsi
addq $0x10, %rsi
leaq 0x10(%rsp), %rdi
callq 0x2240
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
leaq 0x1a92(%rip), %rsi      # 0x507d
movq %rax, %rdi
callq 0x21b0
leaq 0x10(%rsp), %rdi
callq 0x20c0
pushq $0x3
popq %rbp
leaq 0x30(%rsp), %rdi
callq 0x369c
movq %rsp, %rdi
callq 0x36b6
testb %bl, %bl
je 0x365f
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x2180
movq 0x49c6(%rip), %rdi      # 0x7ff0
leaq 0x2196(%rip), %rsi      # 0x57c7
callq 0x21b0
movq (%rbx), %rsi
subq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x21a0
leaq 0x2191(%rip), %rsi      # 0x57de
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x367e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20c0
jmp 0x3681
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x369c
movq %rsp, %rdi
callq 0x36b6
movq %rbx, %rdi
callq 0x22b0
nop