// File: 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 %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rsi, -0x358(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x350(%rbp)
leaq -0x218(%rbp), %rdi
movl $0x8, %edx
callq 0x4660
leaq -0x238(%rbp), %rdi
callq 0x45e0
leaq -0x268(%rbp), %rdi
callq 0x8620
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x4040
movb %al, -0x341(%rbp)
jmp 0x660e
movb -0x341(%rbp), %al
testb $0x1, %al
jne 0x661a
jmp 0x6693
movq -0x358(%rbp), %rdx
leaq 0xcbbc(%rip), %rsi      # 0x131e4
leaq -0x2d8(%rbp), %rdi
callq 0x8640
jmp 0x6636
movq -0x350(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x64e0
jmp 0x664b
leaq -0x2d8(%rbp), %rdi
callq 0x47a8
jmp 0x6693
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
jmp 0x69aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x47a8
jmp 0x69aa
leaq -0x218(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x40e0
jmp 0x66a8
movq -0x350(%rbp), %rdi
movl -0x2a4(%rbp), %eax
movl %eax, -0x2dc(%rbp)
movl -0x2dc(%rbp), %esi
callq 0x69e0
jmp 0x66c8
movq -0x350(%rbp), %rdi
movl -0x2a4(%rbp), %eax
movl %eax, -0x2e0(%rbp)
movl -0x2e0(%rbp), %esi
callq 0x6a30
jmp 0x66e8
jmp 0x66ea
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x4700
movb %al, -0x359(%rbp)
jmp 0x670a
movb -0x359(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x671b
jmp 0x691a
leaq -0x300(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x41e0
jmp 0x6730
movq -0x350(%rbp), %rdi
leaq -0x300(%rbp), %rsi
leaq -0x268(%rbp), %rdx
callq 0x6a60
jmp 0x674c
leaq -0x300(%rbp), %rdi
callq 0x47a8
leaq -0x321(%rbp), %rdi
movq %rdi, -0x368(%rbp)
callq 0x46e0
movq -0x368(%rbp), %rdx
leaq 0xca4f(%rip), %rsi      # 0x131c8
leaq -0x320(%rbp), %rdi
callq 0x5700
jmp 0x6787
leaq -0x268(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x8750
movq %rax, -0x370(%rbp)
jmp 0x67a3
movq -0x370(%rbp), %rdi
callq 0x41d0
movq %rax, %rdi
leaq 0xca44(%rip), %rsi      # 0x131fd
leaq -0x2a0(%rbp), %rdx
callq 0x4090
leaq -0x320(%rbp), %rdi
callq 0x47a8
leaq -0x321(%rbp), %rdi
callq 0x4490
leaq -0x2a0(%rbp), %rdi
callq 0x42a0
movq %rax, %rcx
movq -0x350(%rbp), %rax
movq %rcx, -0x330(%rbp)
cmpq $0x0, 0x30(%rax)
je 0x6880
movq -0x350(%rbp), %rcx
movq -0x330(%rbp), %rax
cmpq 0x30(%rcx), %rax
jle 0x6880
jmp 0x691a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x47a8
jmp 0x69aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
jmp 0x686f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2b0(%rbp)
movl %eax, -0x2b4(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x47a8
leaq -0x321(%rbp), %rdi
callq 0x4490
jmp 0x69aa
movq -0x350(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x68a2
movq -0x350(%rbp), %rcx
movq -0x330(%rbp), %rax
cmpq 0x28(%rcx), %rax
jl 0x6900
movq -0x350(%rbp), %rdi
movq -0x330(%rbp), %rsi
movl -0x2a4(%rbp), %eax
movl %eax, -0x334(%rbp)
movl -0x334(%rbp), %ecx
leaq -0x268(%rbp), %rdx
callq 0x6f40
jmp 0x68d0
movq -0x350(%rbp), %rdi
movq -0x330(%rbp), %rsi
movl -0x2a4(%rbp), %eax
movl %eax, -0x338(%rbp)
movl -0x338(%rbp), %ecx
leaq -0x268(%rbp), %rdx
callq 0x6fe0
jmp 0x68fe
jmp 0x6900
leaq -0x218(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x40e0
jmp 0x6915
jmp 0x66ea
movq 0x1568f(%rip), %rdi     # 0x1bfb0
leaq 0xc8e1(%rip), %rsi      # 0x13209
callq 0x4410
jmp 0x692f
movq -0x350(%rbp), %rdi
movl -0x2a4(%rbp), %eax
movl %eax, -0x33c(%rbp)
movl -0x33c(%rbp), %esi
callq 0x7220
jmp 0x694f
movq -0x350(%rbp), %rdi
movl -0x2a4(%rbp), %eax
movl %eax, -0x340(%rbp)
movl -0x340(%rbp), %esi
callq 0x7730
jmp 0x696f
leaq -0x218(%rbp), %rdi
callq 0x40f0
jmp 0x697d
leaq -0x268(%rbp), %rdi
callq 0x8830
leaq -0x238(%rbp), %rdi
callq 0x47a8
leaq -0x218(%rbp), %rdi
callq 0x4120
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
leaq -0x268(%rbp), %rdi
callq 0x8830
leaq -0x238(%rbp), %rdi
callq 0x47a8
leaq -0x218(%rbp), %rdi
callq 0x4120
movq -0x2b0(%rbp), %rdi
callq 0x46c0
nopw (%rax,%rax)