// File: /workspace/github_cpp_makefile_star2_O3/mbourand[P]webserv/srcs/Response.cpp
// Function: Response::getResponseText[abi:cxx11](ConfigContext const&, bool)
std::string Response::getResponseText(const ConfigContext& config, bool generate_body)
{
	if (_code >= 300)
	{
		if ((_candeflate || _cangzip) && (g_webserv.compression_deflate || g_webserv.compression_gzip))
		{
			this->addHeader("Transfer-Encoding", "chunked");

			std::string errorPage = config.getErrorPage(_code);
			if (errorPage.size() > MIN_COMPRESS_SIZE)
				this->compressBody(errorPage);
			else
				_body = errorPage;

			if (!_body.empty())
				_body = Chunk(_body);
		}
		else
			this->addHeader("Content-Length", ft::toString(config.getErrorPage(_code).size()));
		this->addHeader("Content-Type", "text/html; charset=UTF-8");
		this->addHeader("Connection", "keep-alive");
		this->addDateHeader();
		this->addHeader("Server", "Webserv");
	}
	else
	{
		if (_body.size() > MIN_COMPRESS_SIZE && (g_webserv.compression_deflate || g_webserv.compression_gzip))
		{
			compressBody(_body);
			this->addHeader("Content-Length", ft::toString(_body.size()));
		}
	}
	std::stringstream ss;
	ss << _code;
	std::string code_str = ss.str();
	std::string str = "HTTP/1.1 " + code_str + " " + ft::getErrorMessage(_code) + "\r\n";

	for (std::map<std::string, std::string>::iterator it = _headers.begin(); it != _headers.end(); it++)
	{
		str += it->first + ": " + it->second + "\r\n";
	}
	str += "\r\n";


	if (!_body.empty() && generate_body)
		str += _body;
	if (_body.empty() && _code >= 300)
		str += config.getErrorPage(_code);

	return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %ecx, 0x7c(%rsp)
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r13
cmpl $0x12c, 0x8(%rsi)       # imm = 0x12C
movq %rsi, 0x48(%rsp)
jl 0x37e09
cmpb $0x0, 0xc(%r15)
jne 0x37d1a
cmpb $0x1, 0xd(%r15)
jne 0x37ec1
leaq 0x16847(%rip), %rax     # 0x4e568
cmpb $0x0, 0xc8(%rax)
jne 0x37d37
cmpb $0x1, 0xc9(%rax)
jne 0x37ec1
leaq 0xe0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2563(%rip), %rsi      # 0x3a2ad
leaq 0x256d(%rip), %rdx      # 0x3a2be
leaq 0xd0(%rsp), %rdi
callq 0x80f4
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x5b2d(%rip), %rsi      # 0x3d89c
leaq 0x5b2d(%rip), %rdx      # 0x3d8a3
leaq 0x8(%rsp), %rdi
callq 0x80f4
leaq 0x30(%r15), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x388ac
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x72c0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x37db5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x37dd2
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
movl 0x8(%r15), %edx
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2b1f8
cmpq $0x65, 0x8(%r14)
jb 0x37f55
leaq 0xd0(%rsp), %rsi
movq %r15, %rdi
callq 0x3756e
jmp 0x37f66
cmpq $0x65, 0x68(%r15)
jb 0x38185
leaq 0x1674d(%rip), %rax     # 0x4e568
cmpb $0x0, 0xc8(%rax)
jne 0x37e31
cmpb $0x1, 0xc9(%rax)
jne 0x38185
leaq 0x60(%r15), %rsi
movq %r15, %rdi
callq 0x3756e
leaq 0xe0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x22b4(%rip), %rsi      # 0x3a104
leaq 0x22bb(%rip), %rdx      # 0x3a112
leaq 0xd0(%rsp), %rdi
callq 0x80f4
movl 0x68(%r15), %esi
leaq 0x8(%rsp), %rdi
callq 0x1bd7d
leaq 0x30(%r15), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x388ac
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x72c0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37eab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x38175
jmp 0x38185
leaq 0xe0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2230(%rip), %rsi      # 0x3a104
leaq 0x2237(%rip), %rdx      # 0x3a112
leaq 0xd0(%rsp), %rdi
callq 0x80f4
movl 0x8(%r15), %edx
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x2b1f8
movl 0x30(%rsp), %esi
leaq 0x8(%rsp), %rdi
callq 0x1bd7d
leaq 0x30(%r15), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x388ac
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x72c0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37f40
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37fa3
movq 0x38(%rsp), %rsi
jmp 0x37f9b
leaq 0x60(%r15), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x72c0
cmpq $0x0, 0x68(%r15)
je 0x37fa3
leaq 0x60(%r15), %r14
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x37056
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7590
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x37fa3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x37fc0
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0xe0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x217f(%rip), %rsi      # 0x3a152
leaq 0x2184(%rip), %rdx      # 0x3a15e
leaq 0xd0(%rsp), %rdi
callq 0x80f4
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x26ec(%rip), %rsi      # 0x3a6e3
leaq 0x26fd(%rip), %rdx      # 0x3a6fb
leaq 0x8(%rsp), %rdi
callq 0x80f4
movq 0x48(%rsp), %rax
leaq 0x30(%rax), %r12
leaq 0xd0(%rsp), %rsi
movq %r12, %rdi
callq 0x388ac
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x72c0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x38045
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x38062
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0xd0(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0x512e(%rip), %rsi      # 0x3d1a2
leaq 0x5131(%rip), %rdx      # 0x3d1ac
callq 0x80f4
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x511e(%rip), %rsi      # 0x3d1ad
leaq 0x5121(%rip), %rdx      # 0x3d1b7
callq 0x80f4
leaq 0xd0(%rsp), %rsi
movq %r12, %rdi
callq 0x388ac
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x72c0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x380cf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x380ec
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x48(%rsp), %rdi
callq 0x373a0
leaq 0xd0(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0x218f(%rip), %rsi      # 0x3a297
leaq 0x218e(%rip), %rdx      # 0x3a29d
callq 0x80f4
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2ab9(%rip), %rsi      # 0x3abdc
leaq 0x2ab9(%rip), %rdx      # 0x3abe3
callq 0x80f4
leaq 0xd0(%rsp), %rsi
movq %r12, %rdi
callq 0x388ac
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x72c0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x38163
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
movq 0x48(%rsp), %r15
je 0x38185
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0xd0(%rsp), %rdi
callq 0x7360
leaq 0xe0(%rsp), %rdi
movl 0x8(%r15), %esi
callq 0x77e0
leaq 0xe8(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x7710
leaq 0x5775(%rip), %rsi      # 0x3d931
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xe2cb
leaq 0x543f(%rip), %rsi      # 0x3d614
leaq 0x80(%rsp), %rdi
callq 0x78d0
leaq 0x60(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x38209
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x3820f
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x8(%r15), %esi
leaq 0xa0(%rsp), %rdi
callq 0x1c629
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
leaq 0x60(%rsp), %rsi
cmpq %rsi, %rcx
je 0x38262
movq 0x60(%rsp), %rdi
movq 0xa0(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x3828e
leaq 0xb0(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x38289
movq 0xb0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x3829a
leaq 0x50(%rsp), %rdi
callq 0x7190
jmp 0x382ab
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7500
leaq 0x38(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x382cf
movq %rsi, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x382d5
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x55f7(%rip), %rsi      # 0x3d8f0
leaq 0x28(%rsp), %rdi
callq 0x78d0
leaq 0x10(%r13), %rsi
movq %rsi, (%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %rsi, 0xc0(%rsp)
je 0x3832f
movq %rdx, (%r13)
movq (%rcx), %rdx
movq %rdx, 0x10(%r13)
jmp 0x38335
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%r13)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x38(%rsp), %rbx
movq -0x10(%rbx), %rdi
cmpq %rbx, %rdi
je 0x38367
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38388
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, 0x70(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x383a9
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbp, 0xc8(%rsp)
leaq 0x90(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x383d2
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x48(%rsp), %rax
movq 0x48(%rax), %r12
leaq 0x38(%rax), %rbp
cmpq %rbp, %r12
je 0x38541
leaq 0x80(%rsp), %r13
leaq 0x50(%rsp), %r15
movq %r14, 0x80(%rsp)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x8a92
movq %r13, %rdi
leaq 0x547d(%rip), %rsi      # 0x3d899
callq 0x78d0
movq 0x40(%r12), %rsi
movq 0x48(%r12), %rdx
movq %r13, %rdi
callq 0x7190
leaq 0x60(%rsp), %rsi
movq %rsi, 0x50(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3845b
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x38461
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r15, %rdi
leaq 0x546d(%rip), %rsi      # 0x3d8f0
callq 0x78d0
movq %rbx, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x384ab
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x384b1
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x70(%rsp), %rdi
callq 0x7190
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x384f4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x38510
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x3852d
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r12, %rdi
callq 0x7350
movq %rax, %r12
cmpq %rbp, %rax
jne 0x383f5
leaq 0x53a8(%rip), %rsi      # 0x3d8f0
movq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x78d0
movq 0xc8(%rsp), %r15
movq 0x48(%rsp), %rcx
movq 0x68(%rcx), %rdx
testq %rdx, %rdx
sete %al
movl 0x7c(%rsp), %esi
xorb $0x1, %sil
orb %al, %sil
jne 0x3858e
movq 0x60(%rcx), %rsi
movq %r14, %rdi
callq 0x7190
movq 0x48(%rsp), %rcx
movq 0x68(%rcx), %rdx
testq %rdx, %rdx
sete %al
movl 0x8(%rcx), %edx
cmpl $0x12c, %edx            # imm = 0x12C
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x385dd
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x2b1f8
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r14, %rdi
callq 0x7190
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x385dd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x385f8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x15971(%rip), %rsi     # 0x4df70
leaq 0xd0(%rsp), %rdi
callq 0x73b0
leaq 0x150(%rsp), %rdi
callq 0x71c0
movq %r14, %rax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x386d7
jmp 0x386d7
jmp 0x386df
movq %rax, %r15
jmp 0x38693
jmp 0x386d7
jmp 0x386df
jmp 0x386d7
jmp 0x386d7
jmp 0x386df
movq %rax, %r15
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x387af
jmp 0x387bc
movq %rax, %r15
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38693
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x387bc
movq 0x38(%rsp), %rsi
jmp 0x387b4
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x38848
movq 0x38(%rsp), %rsi
jmp 0x38840
jmp 0x387e4
jmp 0x386d7
jmp 0x386df
jmp 0x386d7
jmp 0x386df
movq %rax, %r15
jmp 0x387bc
movq %rax, %r15
jmp 0x388a4
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x387af
jmp 0x387bc
jmp 0x387a2
movq %rax, %r15
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38725
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x38725
movq %rax, %r15
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3874b
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x3874b
movq %rax, %r15
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3876c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x3876c
movq %rax, %r15
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38868
movq 0x90(%rsp), %rsi
jmp 0x38860
jmp 0x387a2
movq %rax, %r15
jmp 0x38868
jmp 0x3879a
movq %rax, %r15
jmp 0x38883
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x387bc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x388a4
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x388a4
jmp 0x387e4
movq %rax, %r15
jmp 0x38848
jmp 0x387eb
movq %rax, %r15
jmp 0x3882b
movq %rax, %r15
jmp 0x3880f
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3880f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x3882b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x38848
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rsp), %rax
movq (%rax), %rdi
movq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x38868
movq (%rax), %rsi
incq %rsi
callq 0x74b0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38883
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x156e6(%rip), %rsi     # 0x4df70
leaq 0xd0(%rsp), %rdi
callq 0x73b0
leaq 0x150(%rsp), %rdi
callq 0x71c0
movq %r15, %rdi
callq 0x7810