// File: /workspace/github_cpp_makefile_star2_O3/gasparfm[P]anapache/anapacheapp.cpp
// Function: AnapacheApp::readLog(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void AnapacheApp::readLog(std :: string file)
{
  std::ifstream ifs(file);
  std::string line;
  std::map < std::string, std::string> parsed;
  struct tm tm;
  AnalizerOptions opts;

  /* std::cout << "READING\n"; */
  if (ifs.fail())
    panic ("Couldn't open log file: "+file);

  std::getline(ifs, line);
  /* Initialize analysis */
  totalQuery_Initialize(opts);
  ipCount_Initialize(opts);
  /* Initialize analysis */
  while (!ifs.eof())
    {
      /* std::cout << line << std::endl; */
      parseLine(line, parsed);
      strptime(parsed["t"].c_str(), "%d/%b/%Y:%T", &tm);
      time_t linetime = mktime(&tm);
      /* std::cout << linetime << " ("<<GCommon::put_time("%d/%h/%Y %H:%M:%S", linetime)<<") : "<<fromDate<<"("<<GCommon::put_time("%d/%h/%Y %H:%M:%S", fromDate)<<"):"<<toDate<<"("<<GCommon::put_time("%d/%h/%Y %H:%M:%S", toDate)<<")"<<std::endl; */
      if ( (toDate) && (linetime>toDate) )
	break;
      if ( (!fromDate) || (linetime>=fromDate) )
	{
	  /* Run Analysis  */
	  /* We should have plugins and so, but now, run all
	     analysis rude mode. */
	  totalQuery_Input(linetime, parsed, opts);
	  ipCount_Input(linetime, parsed, opts);
	}
      /* std::cout << "FECHA2: "<<res<<std::endl; */
      /* for (auto k : parsed) */
      /* 	{ */
      /* 	  std::cout << "KW: "<<k.first<< " = "<<k.second<<std::endl; */
      /* 	} */
      std::getline(ifs, line);
    }

  std::cout << "END OF QUERY\n";

  /* Analyzer results */
  totalQuery_Results(opts);
  ipCount_Results(opts);
  /* Analyzer results */
  ifs.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x90(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x3520
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x68(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xb0(%rsp,%rax)
jne 0x4c48
leaq (%rsp,%rax), %rdi
addq $0x90, %rdi
movl $0xa, %esi
callq 0x3340
movsbl %al, %edx
leaq 0x90(%rsp), %rdi
movq %rsp, %rsi
callq 0x35d0
movq $0x0, 0x38(%rbx)
movb $0x0, 0x40(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
leaq 0x78(%rbx), %rdi
callq 0x7b06
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0xb0(%rsp,%rax)
je 0x4c66
movq 0x93da(%rip), %rdi      # 0xdfb8
leaq 0x5608(%rip), %rsi      # 0xa1ed
movl $0xd, %edx
callq 0x33f0
movq %rbx, %rdi
callq 0x51b8
movq %rbx, %rdi
callq 0x5692
leaq 0x90(%rsp), %rdi
callq 0x30c0
leaq 0x60(%rsp), %rdi
callq 0x7876
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x4c2c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x90(%rsp), %rdi
callq 0x30e0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5585(%rip), %rsi      # 0xa1d4
leaq 0x40(%rsp), %rdi
movq %r14, %rdx
callq 0x6246
leaq 0x40(%rsp), %rsi
callq 0x4a84
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x78d2
leaq 0x20(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbx, %rdi
callq 0x4d2a
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x4cce
movq 0x30(%rsp), %rsi
jmp 0x4cc1
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4cce
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x4cce
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x7876
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x4cee
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x90(%rsp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3590
nop