// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/ClientSocket.cpp
// Function: ClientSocket::receiveRequest(char const*)
int ClientSocket::receiveRequest(const char* buffer)
{
	try
	{
		_request += buffer;
		_request.parsingCheck();
	}

	// Setting the response with the StatusLine previously sent, and with this request
	// object containing the full request
	catch (const StatusLine& staLine)
	{
		printLog(" >> FD " + convertNbToString(getFd()) + ": Request received\n");
		printLog(" >> FD " + convertNbToString(getFd()) + ": URI: " + _request.getPath() + "\n");

        // Constructing response
        _response.setRequest(&_request);
        _response.setStatusLine(staLine);
        _response.setInfoVirtualServs(_infoVirServs);
		_response.fillBuffer();
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0xb3ce
movq %r14, %rdi
callq 0xb3e6
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
cmpl $0x1, %edx
jne 0xaf15
movq %r15, %rdi
callq 0x41e0
movq %rax, %r15
movslq (%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0xfc62
leaq 0x671e(%rip), %rsi      # 0x113fd
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x4f60
leaq 0x68ce(%rip), %rdx      # 0x115c4
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4f37
leaq 0x69ea(%rip), %rsi      # 0x116fa
leaq -0x48(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x4ec8
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x10271
leaq -0x48(%rbp), %rdi
callq 0x47d8
leaq -0xa8(%rbp), %rdi
callq 0x47d8
leaq -0x88(%rbp), %rdi
callq 0x47d8
leaq -0x68(%rbp), %rdi
callq 0x47d8
movslq (%rbx), %rsi
leaq -0xc8(%rbp), %rdi
callq 0xfc62
leaq 0x668d(%rip), %rsi      # 0x113fd
leaq -0x48(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x4f60
leaq 0x6851(%rip), %rdx      # 0x115d8
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4f37
movq %r14, %rdi
callq 0xb3ac
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movq %rax, %rdx
callq 0xaf33
leaq 0x65ed(%rip), %rdx      # 0x113a3
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4f37
leaq 0x692a(%rip), %rsi      # 0x116fa
leaq -0xe8(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x4ec8
leaq -0xa8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x10271
leaq -0xe8(%rbp), %rdi
callq 0x47d8
leaq -0xa8(%rbp), %rdi
callq 0x47d8
leaq -0x88(%rbp), %rdi
callq 0x47d8
leaq -0x68(%rbp), %rdi
callq 0x47d8
leaq -0x48(%rbp), %rdi
callq 0x47d8
leaq -0xc8(%rbp), %rdi
callq 0x47d8
leaq 0xf0(%rbx), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xcb6c
movq %r12, %rdi
movq %r15, %rsi
callq 0xcb76
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0xcbb0
movq %r12, %rdi
callq 0xcc06
callq 0x4680
jmp 0xaca3
movq %rax, %r15
leaq -0xe8(%rbp), %rdi
callq 0x47d8
jmp 0xae84
movq %rax, %r15
leaq -0xa8(%rbp), %rdi
callq 0x47d8
jmp 0xae95
movq %rax, %r15
leaq -0x88(%rbp), %rdi
callq 0x47d8
jmp 0xaeed
movq %rax, %r15
jmp 0xaef6
movq %rax, %r15
jmp 0xaeff
jmp 0xaf0d
movq %rax, %r15
leaq -0x48(%rbp), %rdi
callq 0x47d8
jmp 0xaec0
movq %rax, %r15
leaq -0xa8(%rbp), %rdi
callq 0x47d8
jmp 0xaed1
movq %rax, %r15
leaq -0x88(%rbp), %rdi
callq 0x47d8
jmp 0xaee2
movq %rax, %r15
leaq -0x68(%rbp), %rdi
jmp 0xaf06
jmp 0xaf0d
movq %rax, %r15
leaq -0x68(%rbp), %rdi
callq 0x47d8
leaq -0x48(%rbp), %rdi
callq 0x47d8
leaq -0xc8(%rbp), %rdi
callq 0x47d8
jmp 0xaf10
movq %rax, %r15
callq 0x4680
movq %r15, %rdi
callq 0x46d0
movq %rax, %rdi
callq 0x4f03
nop