// File: mbourand[P]webserv/srcs/Utils/Credentials.cpp
// Function: Credentials::Parse_user_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void						Credentials::Parse_user_file(const std::string &path)
{
	Authentication_file		user_file;
	struct stat 			stats;

	if (lstat(path.c_str(), &stats) < 0 || !S_ISREG(stats.st_mode) || user_file.last_modified == stats.st_mtime)
		return ;
	std::ifstream 			inputFileStream(path.c_str());
	if (!inputFileStream.is_open())
		return ;
	std::string				line;
	while (!inputFileStream.eof()) {
		std::getline(inputFileStream, line);
		if (!line.empty())
			user_file.content.push_back(base64_encode(line.c_str(), line.size()));
	}
	user_file.file_path = path;
	user_file.last_modified = stats.st_mtime;
	m_credentials.push_back(user_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x348(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x23ad0
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x9c10
cmpl $0x0, %eax
jl 0x23403
movl -0xc8(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x23403
movq -0x18(%rbp), %rax
cmpq -0x88(%rbp), %rax
jne 0x23412
movl $0x1, -0xe4(%rbp)
jmp 0x235ea
movq -0x10(%rbp), %rdi
callq 0x92b0
movq %rax, %rsi
leaq -0x2f0(%rbp), %rdi
movl $0x8, %edx
callq 0x9b80
jmp 0x23431
leaq -0x2f0(%rbp), %rdi
callq 0x99f0
movb %al, -0x349(%rbp)
jmp 0x23445
movb -0x349(%rbp), %al
testb $0x1, %al
jne 0x2348e
jmp 0x23451
movl $0x1, -0xe4(%rbp)
jmp 0x235de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f8(%rbp)
movl %eax, -0x2fc(%rbp)
jmp 0x23614
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f8(%rbp)
movl %eax, -0x2fc(%rbp)
jmp 0x23608
leaq -0x320(%rbp), %rdi
callq 0x98c0
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x2f0(%rbp,%rax), %rdi
callq 0x9b90
movb %al, -0x34a(%rbp)
jmp 0x234ba
movb -0x34a(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x234cb
jmp 0x2359c
leaq -0x2f0(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x9130
jmp 0x234e0
leaq -0x320(%rbp), %rdi
callq 0x9a50
testb $0x1, %al
jne 0x23597
leaq -0x30(%rbp), %rax
movq %rax, -0x368(%rbp)
leaq -0x320(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x92b0
movq -0x360(%rbp), %rdi
movq %rax, -0x358(%rbp)
callq 0x9480
movq -0x358(%rbp), %rsi
movq %rax, %rdx
leaq -0x340(%rbp), %rdi
callq 0x1d5e0
jmp 0x2353d
movq -0x368(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x21a90
jmp 0x23552
leaq -0x340(%rbp), %rdi
callq 0x9c98
jmp 0x23597
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f8(%rbp)
movl %eax, -0x2fc(%rbp)
jmp 0x235fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f8(%rbp)
movl %eax, -0x2fc(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x9c98
jmp 0x235fc
jmp 0x2349a
movq -0x10(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x9070
jmp 0x235ab
movq -0x348(%rbp), %rdi
movq -0x88(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x23b00
jmp 0x235c8
leaq -0x320(%rbp), %rdi
callq 0x9c98
movl $0x0, -0xe4(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0x91d0
leaq -0x50(%rbp), %rdi
callq 0x23b40
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
leaq -0x320(%rbp), %rdi
callq 0x9c98
leaq -0x2f0(%rbp), %rdi
callq 0x91d0
leaq -0x50(%rbp), %rdi
callq 0x23b40
movq -0x2f8(%rbp), %rdi
callq 0x9af0
nopl (%rax)