// File: mrGoncharuk[P]foldermonitor/src/FileReader.cpp
// Function: FileReader::extractData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string FileReader::extractData(const std::string &fname)
{
	syslog(LOG_NOTICE, "FR> Start processing <%s>", fname.c_str());
	std::string		query = "INSERT INTO filedata VALUES('";
	std::ifstream 	ifs(fname.c_str());
	std::string		data;
	if (ifs)
	{
		std::getline(ifs, data, ':');
		query = query + data + "','";
		std::getline(ifs, data, ':');
		query = query + data + "');";
		ifs.close();
		syslog(LOG_NOTICE, "FR> first query <%s>", query.c_str());
		syslog(LOG_NOTICE, "FR> File <%s>, processed successfully.", fname.c_str());
	}
	else
		syslog(LOG_ERR, "FR> Error while opening file <%s>", fname.c_str());
	return (query);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x2e0(%rbp)
movq %rdi, %rax
movq %rax, -0x2e8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x30f0
movq %rax, %rdx
leaq 0x2601(%rip), %rsi      # 0x85c8
xorl %eax, %eax
movl $0x5, %edi
callq 0x3060
movb $0x0, -0x11(%rbp)
leaq -0x12(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x3370
movq -0x2e0(%rbp), %rdi
movq -0x2d8(%rbp), %rdx
leaq 0x25e6(%rip), %rsi      # 0x85e2
callq 0x32a0
jmp 0x6003
leaq -0x12(%rbp), %rdi
callq 0x3230
movq -0x10(%rbp), %rdi
callq 0x30f0
movq %rax, %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x33a0
jmp 0x602b
leaq -0x250(%rbp), %rdi
callq 0x32c0
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x230(%rbp,%rax), %rdi
callq 0x3280
movb %al, -0x2e9(%rbp)
jmp 0x6057
movb -0x2e9(%rbp), %al
testb $0x1, %al
jne 0x6066
jmp 0x6233
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x3a, %edx
callq 0x33b0
jmp 0x6080
movq -0x2e0(%rbp), %rsi
leaq -0x290(%rbp), %rdi
leaq -0x250(%rbp), %rdx
callq 0x6320
jmp 0x609c
leaq 0x255d(%rip), %rdx      # 0x8600
leaq -0x270(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x62d0
jmp 0x60b8
movq -0x2e0(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movq %rsi, -0x2f8(%rbp)
callq 0x3260
movq -0x2f8(%rbp), %rdi
callq 0x3170
leaq -0x290(%rbp), %rdi
callq 0x3170
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x3a, %edx
callq 0x33b0
jmp 0x6104
movq -0x2e0(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
leaq -0x250(%rbp), %rdx
callq 0x6320
jmp 0x6120
leaq 0x24dd(%rip), %rdx      # 0x8604
leaq -0x2b0(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x62d0
jmp 0x613c
movq -0x2e0(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
movq %rsi, -0x300(%rbp)
callq 0x3260
movq -0x300(%rbp), %rdi
callq 0x3170
leaq -0x2d0(%rbp), %rdi
callq 0x3170
leaq -0x230(%rbp), %rdi
callq 0x3070
jmp 0x617c
movq -0x2e0(%rbp), %rdi
callq 0x30f0
movq %rax, %rdx
leaq 0x2476(%rip), %rsi      # 0x8608
xorl %eax, %eax
movl $0x5, %edi
callq 0x3060
jmp 0x61a0
movq -0x10(%rbp), %rdi
callq 0x30f0
movq %rax, %rdx
leaq 0x246a(%rip), %rsi      # 0x861d
xorl %eax, %eax
movl $0x5, %edi
callq 0x3060
jmp 0x61c1
jmp 0x6256
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x12(%rbp), %rdi
callq 0x3230
jmp 0x62bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x62b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x627a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x3170
jmp 0x627a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x3170
jmp 0x627a
movq -0x10(%rbp), %rdi
callq 0x30f0
movq %rax, %rdx
leaq 0x23fe(%rip), %rsi      # 0x8644
xorl %eax, %eax
movl $0x3, %edi
callq 0x3060
jmp 0x6254
jmp 0x6256
movb $0x1, -0x11(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x3170
leaq -0x230(%rbp), %rdi
callq 0x3080
testb $0x1, -0x11(%rbp)
jne 0x62a0
jmp 0x6294
leaq -0x250(%rbp), %rdi
callq 0x3170
leaq -0x230(%rbp), %rdi
callq 0x3080
jmp 0x62b0
movq -0x2e0(%rbp), %rdi
callq 0x3170
movq -0x2e8(%rbp), %rax
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
movq -0x2e0(%rbp), %rdi
callq 0x3170
movq -0x20(%rbp), %rdi
callq 0x3360
nopw %cs:(%rax,%rax)
nop