// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0xcabe
movq %r14, %rdi
callq 0xcad6
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x30(%rbp)
cmpl $0x1, %edx
jne 0xc4c9
movq -0x30(%rbp), %rdi
callq 0x41d0
movq %rax, -0x30(%rbp)
movslq (%rbx), %rsi
leaq -0x90(%rbp), %rdi
callq 0x1378a
leaq 0x9389(%rip), %rsi      # 0x15404
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x51d5
leaq 0x9536(%rip), %rsi      # 0x155cb
leaq -0xb0(%rbp), %rdi
callq 0x4760
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc0c5
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xc0cd
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x960e(%rip), %rdx      # 0x15701
leaq -0x70(%rbp), %rdi
movq %rdx, %rsi
callq 0x5790
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x13ed0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc125
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc13a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc159
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x80(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0xc173
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43e0
movslq (%rbx), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x1378a
leaq 0x927b(%rip), %rsi      # 0x15404
leaq -0x70(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x51d5
leaq 0x943f(%rip), %rsi      # 0x155df
leaq -0x70(%rbp), %rdi
callq 0x4760
movq %r12, -0x90(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc1cf
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0xc1d7
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x88(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0xca9c
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq %rax, %rdx
callq 0xc4e7
leaq 0x91a9(%rip), %rsi      # 0x153bf
leaq -0xb0(%rbp), %rdi
callq 0x4760
movq %r13, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc242
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xc24a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xc0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x948e(%rip), %rdx      # 0x15701
leaq -0xd0(%rbp), %rdi
movq %rdx, %rsi
callq 0x5790
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x13ed0
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
je 0xc2ad
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc2c2
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2e4
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0xc2fc
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc315
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0xe0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc334
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq 0xf0(%rbx), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xe786
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0xe790
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0xe7e4
movq %r12, %rdi
callq 0xe83a
callq 0x4660
jmp 0xc037
movq %rax, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
je 0xc395
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc395
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc3b0
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc3b0
movq %rax, -0x30(%rbp)
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc46e
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc46e
movq %rax, -0x30(%rbp)
jmp 0xc486
movq %rax, -0x30(%rbp)
jmp 0xc49f
jmp 0xc4c0
movq %rax, -0x30(%rbp)
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc415
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc415
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc430
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc430
movq %rax, -0x30(%rbp)
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc455
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc455
movq %rax, -0x30(%rbp)
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc4c4
movq -0x80(%rbp), %rsi
jmp 0xc4b6
jmp 0xc4c0
movq %rax, -0x30(%rbp)
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0xc486
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc49f
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0xe0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc4c4
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc4c4
movq %rax, -0x30(%rbp)
callq 0x4660
movq -0x30(%rbp), %rdi
callq 0x46d0
movq %rax, %rdi
callq 0x51c7