// File: /workspace/github_cpp_makefile_star2_O3/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 0xcafe
movq %r14, %rdi
callq 0xcb16
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 0xc509
movq -0x30(%rbp), %rdi
callq 0x41d0
movq %rax, -0x30(%rbp)
movslq (%rbx), %rsi
leaq -0x90(%rbp), %rdi
callq 0x136be
leaq 0x9349(%rip), %rsi      # 0x15404
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x51d5
leaq 0x94f6(%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 0xc105
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xc10d
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 0x95ce(%rip), %rdx      # 0x15701
leaq -0x70(%rbp), %rdi
movq %rdx, %rsi
callq 0x5796
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x13da7
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc165
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc17a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc199
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x80(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0xc1b3
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43e0
movslq (%rbx), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x136be
leaq 0x923b(%rip), %rsi      # 0x15404
leaq -0x70(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x51d5
leaq 0x93ff(%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 0xc20f
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0xc217
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 0xcadc
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq %rax, %rdx
callq 0xc527
leaq 0x9169(%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 0xc282
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xc28a
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 0x944e(%rip), %rdx      # 0x15701
leaq -0xd0(%rbp), %rdi
movq %rdx, %rsi
callq 0x5796
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x13da7
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
je 0xc2ed
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc302
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc324
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0xc33c
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc355
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0xe0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc374
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq 0xf0(%rbx), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xe752
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0xe75c
movq 0x8(%rbx), %rsi
movq %r12, %rdi
callq 0xe7b0
movq %r12, %rdi
callq 0xe806
callq 0x4660
jmp 0xc077
movq %rax, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
je 0xc3d5
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc3d5
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc3f0
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc3f0
movq %rax, -0x30(%rbp)
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xc4ae
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc4ae
movq %rax, -0x30(%rbp)
jmp 0xc4c6
movq %rax, -0x30(%rbp)
jmp 0xc4df
jmp 0xc500
movq %rax, -0x30(%rbp)
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc455
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc455
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xc470
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc470
movq %rax, -0x30(%rbp)
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc495
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc495
movq %rax, -0x30(%rbp)
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc504
movq -0x80(%rbp), %rsi
jmp 0xc4f6
jmp 0xc500
movq %rax, -0x30(%rbp)
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0xc4c6
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc4df
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0xe0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc504
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0xc504
movq %rax, -0x30(%rbp)
callq 0x4660
movq -0x30(%rbp), %rdi
callq 0x46d0
movq %rax, %rdi
callq 0x51c7