// File: /workspace/github_cpp_makefile_star2_O1/gasparfm[P]anapache/anapache.cc
// Function: main
int main(int argc, char* argv[])
{
  AnapacheApp anapache(argv[0]);

  /* anapache.readLog("/var/log/apache2/access.log"); */
  /* anapache.readLog("alog.log"); */
  int verbose = 0;      /* flag */
  char *user=NULL, *pass=NULL, *host=NULL;
  int port = 0;
  int i;
  int l;
  int c;
  int oindex;
  char output[10]="none";
  /* getopt vars */
  extern char* optarg;
  extern int optind;
  extern int optopt;
  extern int opterr;
  opterr = 0;
  struct option cli_options[] = {
    {"verbose", 0, NULL, 'v'},
    {"from", 1, NULL, 'f'},
    {"to", 1, NULL, 't'},
    {"all", 0, NULL, 'a'},
    {"help", 0, NULL, 'h'},
    {NULL, 0, NULL, 0}
  };

  try
    {
      while ((c = getopt_long (argc, argv, "vahf:t:", cli_options, &oindex)) != -1)
	{
	  //      printf ("c = %d(%c) index = %d\n", c, c, oindex);
	  switch (c)
	    {
	    case 0:
	      cerr << "Wrong argument!!"<<endl;
	      break;
	    case 'v':
	      verbose=1;
	      break;
	    case 'f':
	      anapache.setFromDate(optarg);
	      break;
	    case 't':
	      anapache.setToDate(optarg);
	      break;
	    case 'a':
	      cout << "ALL ANALYSIS, IT'S THE ONLY WAY NOW\n";
	      break;
	    case 'h':
	      help(argv[0]);
	      break;
	    case '?':
	      if (((string)"ft").find(optopt) != string::npos)
		cerr << "Option -"<<(char)optopt<<" requires an argument.\n";
	      else if (optopt=='?')
		help(argv[0]);
	      else if (isprint (optopt))
		cerr << "Unknown option '-"<<(char)optopt<<"'.\n";
	      else
		cerr << "Invalid char '"<<(char)optopt<<"'.\n";

	      help(argv[0]);
	    default:
	      std::exit(1);
	    }
	}
    } 
  catch (AnaException &e)
    {
      cerr << "An error ocurred: "<< e.what() << std::endl;
      exit(4);
    }

  anapache.summary();

  /* Several files in the future */
  /* for (i = optind; i < argc; i++) */
  /*   anapache.readLog(argv[i]); */

  if (optind < argc)
    anapache.readLog(argv[optind]);
  else
    cerr << "No log files specified" << std::endl;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rsi
leaq 0x88(%rsp), %rdi
leaq 0x150(%rsp), %rdx
callq 0x402c
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x4104
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b66
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xa45b(%rip), %rax      # 0xdfc8
movl $0x0, (%rax)
leaq 0xa0a6(%rip), %rsi      # 0xdc20
leaq 0x150(%rsp), %r14
movl $0xc0, %edx
movq %r14, %rdi
callq 0x32d0
leaq 0x6498(%rip), %r15      # 0xa02e
leaq 0x24(%rsp), %r12
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %r12, %r8
callq 0x3550
cmpl $0x65, %eax
jle 0x3bcf
cmpl $0x73, %eax
jle 0x3c51
cmpl $0x74, %eax
je 0x3c9e
cmpl $0x76, %eax
je 0x3b9b
jmp 0x3e6c
cmpl $0x3e, %eax
jg 0x3c2b
testl %eax, %eax
jne 0x3ced
movl $0x10, %edx
movq 0xa400(%rip), %rdi      # 0xdfe8
leaq 0x6447(%rip), %rsi      # 0xa036
callq 0x33f0
movq 0xa3ed(%rip), %rcx      # 0xdfe8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x3340
movsbl %al, %esi
movq 0xa3cf(%rip), %rdi      # 0xdfe8
callq 0x3040
movq %rax, %rdi
callq 0x3240
jmp 0x3b9b
cmpl $0x61, %eax
jne 0x3db8
movl $0x24, %edx
movq 0xa378(%rip), %rdi      # 0xdfb8
leaq 0x6400(%rip), %rsi      # 0xa047
callq 0x33f0
jmp 0x3b9b
cmpl $0x66, %eax
jne 0x3e62
movq 0xa337(%rip), %rax      # 0xdf98
movq (%rax), %rsi
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq %rsp, %rdx
callq 0x402c
leaq 0xa8(%rsp), %rdi
movq %r13, %rsi
callq 0x5c12
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3b9b
movq 0x58(%rsp), %rsi
jmp 0x3ce0
movq 0xa2f3(%rip), %rax      # 0xdf98
movq (%rax), %rsi
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %rsp, %rdx
callq 0x402c
leaq 0xa8(%rsp), %rdi
movq %r13, %rsi
callq 0x5e02
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3b9b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x3b9b
cmpl $-0x1, %eax
jne 0x3e6c
leaq 0xa8(%rsp), %rdi
callq 0x5ec4
movq 0xa2b6(%rip), %rax      # 0xdfc0
movslq (%rax), %rax
cmpl %ebp, %eax
jge 0x3d51
movq (%rbx,%rax,8), %rsi
leaq 0x68(%rsp), %rdi
movq %rsp, %rdx
callq 0x402c
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x4b02
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3d97
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x3d97
movq 0xa290(%rip), %rbx      # 0xdfe8
leaq 0x6369(%rip), %rsi      # 0xa0c8
movl $0x16, %edx
movq %rbx, %rdi
callq 0x33f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3340
movsbl %al, %esi
movq 0xa25e(%rip), %rdi      # 0xdfe8
callq 0x3040
movq %rax, %rdi
callq 0x3240
leaq 0xa8(%rsp), %rdi
callq 0x4ab8
xorl %eax, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
jne 0x3e6c
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x629a(%rip), %rsi      # 0xa06c
leaq 0x6295(%rip), %rdx      # 0xa06e
movq %rsp, %rdi
callq 0x4074
movq 0xa1c8(%rip), %r15      # 0xdfb0
movsbl (%r15), %esi
movq %rsp, %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x3470
movq %rax, %rbx
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x3e11
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
cmpq $-0x1, %rbx
jne 0x3e76
movl (%r15), %edi
cmpl $0x3f, %edi
je 0x3e67
callq 0x35a0
testl %eax, %eax
jne 0x3eb5
movq 0xa1b5(%rip), %rdi      # 0xdfe8
leaq 0x626c(%rip), %rsi      # 0xa0a6
movl $0xe, %edx
callq 0x33f0
movb (%r15), %al
movq %rsp, %rsi
movb %al, (%rsi)
movq 0xa195(%rip), %rdi      # 0xdfe8
movl $0x1, %edx
callq 0x33f0
jmp 0x3ee6
cmpl $0x68, %eax
jne 0x3e6c
callq 0x3adc
movl $0x1, %edi
callq 0x3440
movq 0xa16b(%rip), %rdi      # 0xdfe8
leaq 0x61eb(%rip), %rsi      # 0xa06f
movl $0x8, %edx
callq 0x33f0
movb (%r15), %al
movq %rsp, %rsi
movb %al, (%rsi)
movq 0xa14b(%rip), %rdi      # 0xdfe8
movl $0x1, %edx
callq 0x33f0
movl $0x17, %edx
leaq 0x61c5(%rip), %rsi      # 0xa078
jmp 0x3ef2
movq 0xa12c(%rip), %rdi      # 0xdfe8
leaq 0x61cd(%rip), %rsi      # 0xa090
movl $0x11, %edx
callq 0x33f0
movb (%r15), %al
movq %rsp, %rsi
movb %al, (%rsi)
movq 0xa10c(%rip), %rdi      # 0xdfe8
movl $0x1, %edx
callq 0x33f0
movl $0x3, %edx
leaq 0x61b0(%rip), %rsi      # 0xa0a2
movq %rax, %rdi
callq 0x33f0
jmp 0x3e67
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x400e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x400e
jmp 0x3f5d
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x401b
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x401b
movq %rax, %rbx
jmp 0x401b
movq %rax, %rbx
jmp 0x400e
jmp 0x3fad
jmp 0x3fad
jmp 0x3fad
movq %rdx, %r14
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3fb3
movq 0x58(%rsp), %rsi
jmp 0x3fa1
movq %rdx, %r14
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3fb3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x3fb3
jmp 0x3fad
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x400e
movq %rbx, %rdi
callq 0x3180
movq %rax, %rbx
movq 0xa01d(%rip), %rdi      # 0xdfe8
leaq 0x60e3(%rip), %rsi      # 0xa0b5
movl $0x12, %edx
callq 0x33f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x9ffc(%rip), %rdi      # 0xdfe8
movq %rax, %rsi
callq 0x3360
movq %rax, %rdi
callq 0x31b0
movl $0x4, %edi
callq 0x3440
movq %rax, %rbx
callq 0x3540
leaq 0xa8(%rsp), %rdi
callq 0x4ab8
movq %rbx, %rdi
callq 0x3590
movq %rax, %rdi
callq 0x4069
nop