// File: burakbugrul[P]NginxLogParser/NginxParser.cpp
// Function: NginxParser::findIP[abi:cxx11](char*)
inline string NginxParser::findIP(char *line){
	
	int number=0;
	int point_count = 0;
	string result;
	
	for( int i=0 ; line[i] != ' ' && line[i] != '-' && line[i] != '\0' ; i++ ){
		
		if( isdigit(line[i]) )
			number = number*10 + (line[i]-'0');
		else if( number > 255 )
			return "-1";
		else if( line[i] == '.' ){
			number = 0;
			point_count++;
		}
		else
			return "-1";
		
		result += line[i];
	}
	
	if( point_count == 3 )
		return result;
	return "-1";
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movl $0x0, 0x7c(%rsp)
movl $0x0, 0x78(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x2270
movl $0x0, 0x54(%rsp)
movq 0x80(%rsp), %rax
movslq 0x54(%rsp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, 0x27(%rsp)
je 0x4c91
movq 0x80(%rsp), %rax
movslq 0x54(%rsp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x2d, %ecx
movb %al, 0x27(%rsp)
je 0x4c91
movq 0x80(%rsp), %rax
movslq 0x54(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x4c9e
jmp 0x4e0e
movq 0x80(%rsp), %rax
movslq 0x54(%rsp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x21a0
cmpl $0x0, %eax
je 0x4cdd
imull $0xa, 0x7c(%rsp), %eax
movq 0x80(%rsp), %rcx
movslq 0x54(%rsp), %rdx
movsbl (%rcx,%rdx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, 0x7c(%rsp)
jmp 0x4dcc
cmpl $0xff, 0x7c(%rsp)
jle 0x4d42
leaq 0x53(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x2310
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x3372(%rip), %rsi      # 0x8079
callq 0x2260
jmp 0x4d0e
leaq 0x53(%rsp), %rdi
callq 0x21e0
movl $0x1, 0x40(%rsp)
jmp 0x4e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x53(%rsp), %rdi
callq 0x21e0
jmp 0x4e9a
movq 0x80(%rsp), %rax
movslq 0x54(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jne 0x4d6d
movl $0x0, 0x7c(%rsp)
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x4dc8
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x2310
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x32ec(%rip), %rsi      # 0x8079
callq 0x2260
jmp 0x4d94
leaq 0x3f(%rsp), %rdi
callq 0x21e0
movl $0x1, 0x40(%rsp)
jmp 0x4e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x3f(%rsp), %rdi
callq 0x21e0
jmp 0x4e9a
jmp 0x4dca
jmp 0x4dcc
movq 0x80(%rsp), %rax
movslq 0x54(%rsp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0x58(%rsp), %rdi
callq 0x2150
jmp 0x4de9
jmp 0x4deb
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x4c3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x4e9a
cmpl $0x3, 0x78(%rsp)
jne 0x4e2e
movq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x2130
movl $0x1, 0x40(%rsp)
jmp 0x4e83
leaq 0x3e(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2310
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rdx
leaq 0x322b(%rip), %rsi      # 0x8079
callq 0x2260
jmp 0x4e55
leaq 0x3e(%rsp), %rdi
callq 0x21e0
movl $0x1, 0x40(%rsp)
jmp 0x4e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x3e(%rsp), %rdi
callq 0x21e0
jmp 0x4e9a
leaq 0x58(%rsp), %rdi
callq 0x2140
movq 0x30(%rsp), %rax
addq $0x98, %rsp
retq
leaq 0x58(%rsp), %rdi
callq 0x2140
movq 0x48(%rsp), %rdi
callq 0x2300
nop