// File: /workspace/github_cpp_makefile_star2_O1/mbourand[P]webserv/srcs/Request.cpp
// Function: operator<<(std::ostream&, Request const&)
std::ostream& operator<<(std::ostream& out, const Request& request)
{
	if (request._error_code < 400)
	{
		out <<	"Method: " << request._method->getType() << '\n' <<
				"Path: " << request._url._path << '\n' <<
				"Protocol Version: " << request._protocolVersion << '\n' <<
				"Headers: " << std::endl;
		for (Request::HeadersVector::const_iterator it = request._headers.begin(); it != request._headers.end(); it++)
			out << "  \"" << (*it)->getType() << "\" -> \"" << (*it)->getValue() << '"' << std::endl;
		if (request._body.size() < 100)
			out << "Body:\n\"" << request._body << "\"" << std::endl;
		else
			out << "Body:\n\"" << "<<<BODY TOO LONG>>>" << "\"" << std::endl;
	}
	return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpl $0x18f, 0x188(%rsi)     # imm = 0x18F
jg 0x3645c
movq %rsi, %r14
leaq 0x76f3(%rip), %rsi      # 0x3d8a4
movl $0x8, %edx
movq %rbx, %rdi
callq 0x7510
movq 0x28(%r14), %rsi
movq (%rsi), %rax
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq *0x10(%rax)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x7510
leaq 0x7(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x7510
movq %rax, %r15
leaq 0x76af(%rip), %rsi      # 0x3d8ad
movl $0x6, %edx
movq %rax, %rdi
callq 0x7510
movq 0xb8(%r14), %rsi
movq 0xc0(%r14), %rdx
movq %r15, %rdi
callq 0x7510
leaq 0x7(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x7510
movq %rax, %r15
leaq 0x7674(%rip), %rsi      # 0x3d8b4
movl $0x12, %edx
movq %rax, %rdi
callq 0x7510
movq 0x120(%r14), %rsi
movq 0x128(%r14), %rdx
movq %r15, %rdi
callq 0x7510
leaq 0x7(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x7510
movq %rax, %r15
leaq 0x7645(%rip), %rsi      # 0x3d8c7
movl $0x9, %edx
movq %rax, %rdi
callq 0x7510
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x7490
movsbl %al, %esi
movq %r15, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7340
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x362d1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x140(%r14), %r12
cmpq 0x148(%r14), %r12
je 0x363bd
leaq 0x75e9(%rip), %r13      # 0x3d8d5
leaq 0x7(%rsp), %rbp
movl $0x3, %edx
movq %rbx, %rdi
leaq 0x75d1(%rip), %rsi      # 0x3d8d1
callq 0x7510
movq (%r12), %rsi
movq (%rsi), %rax
leaq 0x8(%rsp), %rdi
callq *0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x7510
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x7510
movq (%r12), %rdi
callq 0x8e44
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x7510
movb $0x22, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x7510
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x7490
movsbl %al, %esi
movq %r15, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x363ac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
addq $0x8, %r12
cmpq 0x148(%r14), %r12
jne 0x362f1
cmpq $0x64, 0x160(%r14)
jae 0x363f6
leaq 0x750e(%rip), %rsi      # 0x3d8dc
movl $0x7, %edx
movq %rbx, %rdi
callq 0x7510
movq 0x158(%r14), %rsi
movq 0x160(%r14), %rdx
movq %rbx, %rdi
callq 0x7510
movq %rax, %r14
jmp 0x36421
leaq 0x74df(%rip), %rsi      # 0x3d8dc
movl $0x7, %edx
movq %rbx, %rdi
callq 0x7510
leaq 0x731a(%rip), %rsi      # 0x3d72b
movl $0x13, %edx
movq %rbx, %rdi
callq 0x7510
movq %rbx, %r14
leaq 0x74ba(%rip), %rsi      # 0x3d8e2
movl $0x1, %edx
movq %r14, %rdi
callq 0x7510
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7490
movsbl %al, %esi
movq %r14, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7340
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x36489
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3649b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rdi
callq 0x7810
nop