// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x98(%rsp), %r15
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x34f0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x70(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xb8(%rsp,%rax)
jne 0x45a2
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x30b0
andq $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 0x695a
movq 0x98(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x2, 0xb8(%rsp,%rax)
je 0x45c0
movq 0x9a65(%rip), %rdi      # 0xdfb0
leaq 0x4c9b(%rip), %rsi      # 0x91ed
callq 0x3330
movq %rbx, %rdi
callq 0x49bc
movq %rbx, %rdi
callq 0x4ca6
leaq 0x98(%rsp), %rdi
callq 0x30c0
leaq 0x68(%rsp), %rdi
callq 0x679c
leaq 0x8(%rsp), %rdi
callq 0x35d8
leaq 0x98(%rsp), %rdi
callq 0x30e0
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4c2b(%rip), %rsi      # 0x91d4
leaq 0x48(%rsp), %rdi
movq %r14, %rdx
callq 0x5439
leaq 0x48(%rsp), %rsi
callq 0x4428
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3460
leaq 0x28(%rsp), %rsi
leaq 0x68(%rsp), %rdx
movq %rbx, %rdi
callq 0x464a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x45f3
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x35d8
jmp 0x45fd
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x679c
leaq 0x8(%rsp), %rdi
callq 0x35d8
leaq 0x98(%rsp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3530