// File: ixchow[P]http-tweak/./http.hpp
// Function: http::response::~response()
inline response::~response() {
	//does the message slot still exist?
	std::shared_ptr< message > shared_message = weak_message.lock();
	if (!shared_message) return;

	//if so, build the message:
	std::string message;
	message += "HTTP/1.1 " + std::to_string(status.code) + " " + status.message + "\r\n";
	for (auto const &kv : headers) {
		message += kv.first + ": " + kv.second + "\r\n";
	}
	message += "Content-Length: " + std::to_string(body.size()) + "\r\n";
	message += "\r\n";
	message += body;

	{ //mark ready to send:
		shared_message->data = std::move(message);
		shared_message->ready.store(true, std::memory_order_release);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x1c8(%rbp)
addq $0x60, %rsi
leaq -0x18(%rbp), %rdi
callq 0xc910
leaq -0x18(%rbp), %rdi
callq 0xc940
testb $0x1, %al
jne 0xc5d0
movl $0x1, -0x1c(%rbp)
jmp 0xc8a1
leaq -0x40(%rbp), %rdi
callq 0x45f0
movq -0x1c8(%rbp), %rax
movl (%rax), %esi
leaq -0xe0(%rbp), %rdi
callq 0xc960
jmp 0xc5f0
leaq 0xbc72(%rip), %rsi      # 0x18269
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0xba60
jmp 0xc60c
leaq 0xbc5e(%rip), %rdx      # 0x18271
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xb940
jmp 0xc628
movq -0x1c8(%rbp), %rdx
addq $0x8, %rdx
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xbc80
jmp 0xc645
leaq 0xbc27(%rip), %rdx      # 0x18273
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xb940
jmp 0xc65b
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4580
jmp 0xc66a
leaq -0x60(%rbp), %rdi
callq 0x42f0
leaq -0x80(%rbp), %rdi
callq 0x42f0
leaq -0xa0(%rbp), %rdi
callq 0x42f0
leaq -0xc0(%rbp), %rdi
callq 0x42f0
leaq -0xe0(%rbp), %rdi
callq 0x42f0
movq -0x1c8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdi
callq 0xca80
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rdi
callq 0xcab0
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xcae0
testb $0x1, %al
jne 0xc6f4
jmp 0xc7a6
leaq -0xf0(%rbp), %rdi
callq 0xcb20
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rsi
leaq 0xb943(%rip), %rdx      # 0x18058
leaq -0x160(%rbp), %rdi
callq 0xcb40
jmp 0xc723
movq -0x100(%rbp), %rdx
addq $0x20, %rdx
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xbc80
jmp 0xc743
leaq 0xbb29(%rip), %rdx      # 0x18273
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xb940
jmp 0xc75f
leaq -0x40(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x4580
jmp 0xc771
leaq -0x120(%rbp), %rdi
callq 0x42f0
leaq -0x140(%rbp), %rdi
callq 0x42f0
leaq -0x160(%rbp), %rdi
callq 0x42f0
leaq -0xf0(%rbp), %rdi
callq 0xcbc0
jmp 0xc6d8
movq -0x1c8(%rbp), %rdi
addq $0x40, %rdi
callq 0x4370
movq %rax, %rsi
leaq -0x1c0(%rbp), %rdi
callq 0xcbe0
jmp 0xc7c7
leaq 0xbaa8(%rip), %rsi      # 0x18276
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rdx
callq 0xba60
jmp 0xc7e3
leaq 0xba89(%rip), %rdx      # 0x18273
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0xb940
jmp 0xc7ff
leaq -0x40(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x4580
jmp 0xc811
leaq -0x180(%rbp), %rdi
callq 0x42f0
leaq -0x1a0(%rbp), %rdi
callq 0x42f0
leaq -0x1c0(%rbp), %rdi
callq 0x42f0
leaq 0xba37(%rip), %rsi      # 0x18273
leaq -0x40(%rbp), %rdi
callq 0x4460
jmp 0xc847
movq -0x1c8(%rbp), %rsi
addq $0x40, %rsi
leaq -0x40(%rbp), %rdi
callq 0x4580
jmp 0xc85d
leaq -0x18(%rbp), %rdi
callq 0xccc0
movq %rax, %rdi
addq $0x8, %rdi
leaq -0x40(%rbp), %rsi
callq 0x4550
leaq -0x18(%rbp), %rdi
callq 0xccc0
movq %rax, %rdi
movl $0x1, %esi
movl $0x3, %edx
callq 0xcce0
leaq -0x40(%rbp), %rdi
callq 0x42f0
movl $0x0, -0x1c(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xcd80
movl -0x1c(%rbp), %eax
testl %eax, %eax
jne 0xc8ba
jmp 0xc8b3
movl $0x0, -0x1c(%rbp)
movq -0x1c8(%rbp), %rdi
addq $0x60, %rdi
callq 0xcda0
movq -0x1c8(%rbp), %rdi
addq $0x40, %rdi
callq 0x42f0
movq -0x1c8(%rbp), %rdi
addq $0x28, %rdi
callq 0xcdc0
movq -0x1c8(%rbp), %rdi
callq 0xce20
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq %rax, %rdi
callq 0x5490
nopw (%rax,%rax)