// File: roberto-bayardo[P]google-extremal-sets/main-cardinality.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-cardinality <dataset_path>\n";
    return 1;
  }

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

    google_extremal_sets::AllMaximalSetsCardinality ap;
    bool result = ap.FindAllMaximalSets(
        data.get(),
        8000000/*max_item_id*/,
        1000000000/*max_items_in_ram*/,
        google_extremal_sets::COUNT_ONLY/*output_mode*/);
    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 subsumption checks performed: "
              << ap.SubsumptionChecksCount() << "\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
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x21e0
cmpl $0x2, -0x8(%rbp)
je 0x5347
movq 0x7cc1(%rip), %rdi      # 0xcff0
leaq 0x2e77(%rip), %rsi      # 0x81ad
callq 0x2200
movl $0x1, -0x4(%rbp)
jmp 0x564d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x59b0
movq %rax, %rsi
leaq -0x20(%rbp), %rdi
callq 0x5670
leaq -0x20(%rbp), %rdi
callq 0x5690
cmpq $0x0, %rax
jne 0x5382
movl $0x2, -0x4(%rbp)
movl $0x1, -0x24(%rbp)
jmp 0x55cc
leaq -0x58(%rbp), %rdi
callq 0x56b0
jmp 0x538d
leaq -0x20(%rbp), %rdi
callq 0x5690
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movl $0x7a1200, %edx         # imm = 0x7A1200
movl $0x3b9aca00, %ecx       # imm = 0x3B9ACA00
xorl %r8d, %r8d
callq 0x2600
movb %al, -0x91(%rbp)
jmp 0x53b7
movb -0x91(%rbp), %al
andb $0x1, %al
movb %al, -0x65(%rbp)
testb $0x1, -0x65(%rbp)
jne 0x5491
movq 0x7c1d(%rip), %rdi      # 0xcff0
leaq 0x2e06(%rip), %rsi      # 0x81e0
callq 0x2200
movq %rax, -0xa0(%rbp)
jmp 0x53e8
leaq -0x20(%rbp), %rdi
callq 0x56d0
movq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x56f0
jmp 0x5402
movq -0xa0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x21d0
movq %rax, -0xa8(%rbp)
jmp 0x541e
movq -0xa8(%rbp), %rdi
leaq 0x2dda(%rip), %rsi      # 0x8206
callq 0x2200
jmp 0x5433
leaq -0x88(%rbp), %rdi
callq 0x2130
movl $0x3, -0x4(%rbp)
movl $0x1, -0x24(%rbp)
jmp 0x55c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x5642
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x5639
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x2130
jmp 0x5639
movq 0x7b58(%rip), %rdi      # 0xcff0
leaq 0x2d4c(%rip), %rsi      # 0x81eb
callq 0x2200
movq %rax, -0xb0(%rbp)
jmp 0x54ad
leaq -0x58(%rbp), %rdi
callq 0x5720
movq %rax, -0xb8(%rbp)
jmp 0x54bf
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x23a0
movq %rax, -0xc0(%rbp)
jmp 0x54db
movq -0xc0(%rbp), %rdi
leaq 0x2d0b(%rip), %rsi      # 0x81f4
callq 0x2200
movq %rax, -0xc8(%rbp)
jmp 0x54f7
movq -0xc8(%rbp), %rdi
leaq 0x2d03(%rip), %rsi      # 0x8208
callq 0x2200
movq %rax, -0xd0(%rbp)
jmp 0x5513
leaq -0x58(%rbp), %rdi
callq 0x5740
movq %rax, -0xd8(%rbp)
jmp 0x5525
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdi
callq 0x20f0
movq %rax, -0xe0(%rbp)
jmp 0x5541
movq -0xe0(%rbp), %rdi
leaq 0x2cb7(%rip), %rsi      # 0x8206
callq 0x2200
movq %rax, -0xe8(%rbp)
jmp 0x555d
movq -0xe8(%rbp), %rdi
leaq 0x2cc1(%rip), %rsi      # 0x822c
callq 0x2200
movq %rax, -0xf0(%rbp)
jmp 0x5579
leaq -0x58(%rbp), %rdi
callq 0x5760
movq %rax, -0xf8(%rbp)
jmp 0x558b
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdi
callq 0x20f0
movq %rax, -0x100(%rbp)
jmp 0x55a7
movq -0x100(%rbp), %rdi
leaq 0x2c51(%rip), %rsi      # 0x8206
callq 0x2200
jmp 0x55bc
movl $0x0, -0x24(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5780
leaq -0x20(%rbp), %rdi
callq 0x57a0
movl -0x24(%rbp), %eax
testl %eax, %eax
je 0x55e0
jmp 0x55de
jmp 0x564d
leaq -0x90(%rbp), %rdi
callq 0x21e0
movq 0x79fd(%rip), %rdi      # 0xcff0
leaq 0x2c5d(%rip), %rsi      # 0x8257
callq 0x2200
movq %rax, %rdi
movq -0x90(%rbp), %rsi
subq -0x18(%rbp), %rsi
callq 0x23a0
movq %rax, %rdi
leaq 0x2c52(%rip), %rsi      # 0x826e
callq 0x2200
movq %rax, %rdi
movq 0x798d(%rip), %rsi      # 0xcfb8
callq 0x2240
movl $0x0, -0x4(%rbp)
jmp 0x564d
leaq -0x58(%rbp), %rdi
callq 0x5780
leaq -0x20(%rbp), %rdi
callq 0x57a0
jmp 0x5659
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2370
nopw %cs:(%rax,%rax)
nopl (%rax)