// File: burakbugrul[P]NginxLogParser/main.cpp
// Function: main
int main(int argc, char **argv){
	
	ios::sync_with_stdio(false); // For speed boost
	
	if( argc == 3 ){
		NginxParser parser(argv[1],argv[2]);
		parser.parse();
		parser.statistics();
	}
	else{
		
		string input_file, output_file;
		
		cerr << "Please enter path of the log file: ";
		cin >> input_file;
		cerr << "Please enter path of the output file: ";
		cin >> output_file;
		
		NginxParser parser(input_file,output_file);
		parser.parse();
		parser.statistics();
	}
	
	return 0;
}

// Assembly:
subq $0x3b8, %rsp            # imm = 0x3B8
movl $0x0, 0x3b4(%rsp)
movl %edi, 0x3b0(%rsp)
movq %rsi, 0x3a8(%rsp)
xorl %edi, %edi
callq 0x20d0
cmpl $0x3, 0x3b0(%rsp)
jne 0x26a0
movq 0x3a8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
leaq 0x237(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x2310
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x238(%rsp), %rdi
callq 0x2260
jmp 0x2542
movq 0x3a8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
leaq 0x1ff(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x2310
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x200(%rsp), %rdi
callq 0x2260
jmp 0x257e
leaq 0x258(%rsp), %rdi
leaq 0x238(%rsp), %rsi
leaq 0x200(%rsp), %rdx
callq 0x3270
jmp 0x259d
leaq 0x200(%rsp), %rdi
callq 0x2140
leaq 0x1ff(%rsp), %rdi
callq 0x21e0
leaq 0x238(%rsp), %rdi
callq 0x2140
leaq 0x237(%rsp), %rdi
callq 0x21e0
leaq 0x258(%rsp), %rdi
callq 0x33d0
jmp 0x25e0
leaq 0x258(%rsp), %rdi
callq 0x40a0
jmp 0x25ef
leaq 0x258(%rsp), %rdi
callq 0x2850
jmp 0x2833
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x2668
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x264e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x200(%rsp), %rdi
callq 0x2140
leaq 0x1ff(%rsp), %rdi
callq 0x21e0
leaq 0x238(%rsp), %rdi
callq 0x2140
leaq 0x237(%rsp), %rdi
callq 0x21e0
jmp 0x283d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x258(%rsp), %rdi
callq 0x2850
jmp 0x283d
leaq 0x1d8(%rsp), %rdi
callq 0x2270
leaq 0x1b8(%rsp), %rdi
callq 0x2270
movq 0x992f(%rip), %rdi      # 0xbff0
leaq 0x593c(%rip), %rsi      # 0x8004
callq 0x21b0
jmp 0x26cf
movq 0x9902(%rip), %rdi      # 0xbfd8
leaq 0x1d8(%rsp), %rsi
callq 0x2220
jmp 0x26e5
movq 0x9904(%rip), %rdi      # 0xbff0
leaq 0x5935(%rip), %rsi      # 0x8028
callq 0x21b0
jmp 0x26fa
movq 0x98d7(%rip), %rdi      # 0xbfd8
leaq 0x1b8(%rsp), %rsi
callq 0x2220
jmp 0x2710
leaq 0x48(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x20e0
jmp 0x2724
leaq 0x28(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x20e0
jmp 0x2738
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x3270
jmp 0x274e
leaq 0x28(%rsp), %rdi
callq 0x2140
leaq 0x48(%rsp), %rdi
callq 0x2140
leaq 0x68(%rsp), %rdi
callq 0x33d0
jmp 0x276e
leaq 0x68(%rsp), %rdi
callq 0x40a0
jmp 0x277a
leaq 0x68(%rsp), %rdi
callq 0x2850
leaq 0x1b8(%rsp), %rdi
callq 0x2140
leaq 0x1d8(%rsp), %rdi
callq 0x2140
jmp 0x2833
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x2817
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
jmp 0x27ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x2140
leaq 0x48(%rsp), %rdi
callq 0x2140
jmp 0x2817
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x228(%rsp)
movl %eax, 0x224(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x2850
leaq 0x1b8(%rsp), %rdi
callq 0x2140
leaq 0x1d8(%rsp), %rdi
callq 0x2140
jmp 0x283d
xorl %eax, %eax
addq $0x3b8, %rsp            # imm = 0x3B8
retq
movq 0x228(%rsp), %rdi
callq 0x2300
nopw (%rax,%rax)