// File: zakimjz[P]SLEUTH/treeminer.cpp
// Function: parse_args(int, char**)
void parse_args(int argc, char **argv)
{
   extern char * optarg;
   int c;

   if (argc < 2)
     cout << "usage: treeminer -i<infile> -s <support>\n";
   else{
     while ((c=getopt(argc,argv,"a:bfi:IlOop:s:S:uz:"))!=-1){
       switch(c){
       case 'a':
          alg_type = (alg_vals) atoi(optarg);
          break;
       case 'b':
          Dbase_Ctrl_Blk::binary_input= true;
          break;
        case 'f':
          use_fullpath = true;
          break;
       case 'i': //input files
	 sprintf(infile,"%s",optarg);
	 break;
       case 'I':
          mine_induced = true;
          break;
       case 'l': //print idlists along with freq subtrees
          output=true;
          output_idlist = true;
          break;
       case 'o': //print freq subtrees
	 output = true;
	 break;
       case 'O': //mine ordered
	 mine_ordered = true;
         break;
       case 'p':
          prune_type = (prune_vals) atoi(optarg);
          break;
        case 's': //support value for L2
	 MINSUP_PER = atof(optarg);
	 break;
       case 'S': //absolute support
	 MINSUPPORT = atoi(optarg);
	 break;
       case 'u': //count support multiple times per tree
	 count_unique = false;
	 break;
       case 'z':
          sort_type = (sort_vals) atoi(optarg);
          break;
       }               
     }
   }
   if (mine_induced && !count_unique){
      cout << "incuded and multiple counts not supported yet!\n";
      exit(-1);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x4(%rbp)
jge 0x92ed
movq 0x14cf4(%rip), %rdi     # 0x1dfd0
leaq 0xaea5(%rip), %rsi      # 0x14188
callq 0x2160
jmp 0x942a
jmp 0x92ef
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0xaeb5(%rip), %rdx      # 0x141b2
callq 0x2070
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x9428
movl -0x14(%rbp), %eax
addl $-0x49, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x31, %eax
ja 0x9423
movq -0x20(%rbp), %rax
leaq 0xad76(%rip), %rcx      # 0x140a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x14c82(%rip), %rax     # 0x1dfc0
movq (%rax), %rdi
callq 0x2250
movl %eax, 0x15090(%rip)     # 0x1e3dc
jmp 0x9423
leaq 0x14ed0(%rip), %rax     # 0x1e228
movb $0x1, (%rax)
jmp 0x9423
movb $0x1, 0x1506b(%rip)     # 0x1e3d2
jmp 0x9423
movq 0x14c4d(%rip), %rax     # 0x1dfc0
movq (%rax), %rdx
leaq 0x14ef3(%rip), %rdi     # 0x1e270
leaq 0xae42(%rip), %rsi      # 0x141c6
movb $0x0, %al
callq 0x2050
jmp 0x9423
movb $0x1, 0x1503c(%rip)     # 0x1e3d3
jmp 0x9423
movb $0x1, 0x1502d(%rip)     # 0x1e3d0
movb $0x1, 0x15027(%rip)     # 0x1e3d1
jmp 0x9423
movb $0x1, 0x1501d(%rip)     # 0x1e3d0
jmp 0x9423
movb $0x1, 0x15018(%rip)     # 0x1e3d4
jmp 0x9423
movq 0x14bfb(%rip), %rax     # 0x1dfc0
movq (%rax), %rdi
callq 0x2250
movl %eax, 0x1500d(%rip)     # 0x1e3e0
jmp 0x9423
movq 0x14be4(%rip), %rax     # 0x1dfc0
movq (%rax), %rdi
callq 0x21d0
movsd %xmm0, 0x14fd4(%rip)    # 0x1e3c0
jmp 0x9423
movq 0x14bcb(%rip), %rax     # 0x1dfc0
movq (%rax), %rdi
callq 0x2250
movl %eax, 0x14dcd(%rip)     # 0x1e1d0
jmp 0x9423
movb $0x0, 0x14dc8(%rip)     # 0x1e1d4
jmp 0x9423
movq 0x14bab(%rip), %rax     # 0x1dfc0
movq (%rax), %rdi
callq 0x2250
movl %eax, 0x14fb5(%rip)     # 0x1e3d8
jmp 0x92ef
jmp 0x942a
testb $0x1, 0x14fa2(%rip)     # 0x1e3d3
je 0x9459
testb $0x1, 0x14d9a(%rip)     # 0x1e1d4
jne 0x9459
movq 0x14b8d(%rip), %rdi     # 0x1dfd0
leaq 0xad7f(%rip), %rsi      # 0x141c9
callq 0x2160
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21c0
addq $0x20, %rsp
popq %rbp
retq
nop