// File: /workspace/github_cpp_makefile_star2_O2/guoxuanhan[P]NetServer/httpsession.cpp
// Function: HttpSession::HttpError(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, _HttpRequestContext const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void HttpSession::HttpError(const int err_num, const std::string short_msg, const HttpRequestContext &httprequestcontext, std::string &responsecontext)
{
    //这里string创建销毁应该会耗时间
    std::string responsebody;
    responsebody += "<html><title>出错了</title>";
    responsebody += "<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head>";
    responsebody += "<style>body{background-color:#f;font-size:14px;}h1{font-size:60px;color:#eeetext-align:center;padding-top:30px;font-weight:normal;}</style>";
    responsebody += "<body bgcolor=\"ffffff\"><h1>";
    responsebody += std::to_string(err_num) + " " + short_msg;
    responsebody += "</h1><hr><em> GuoJ's NetServer</em>\n</body></html>";

    std::string httpversion;
    if(httprequestcontext.version.empty())
    {
        httpversion = "HTTP/1.1";
    }
    else
    {
        httpversion = httprequestcontext.version;
    }

    responsecontext += httpversion + " " + std::to_string(err_num) + " " + short_msg + "\r\n";
    responsecontext += "Server: GuoJ's NetServer/0.1\r\n";
    responsecontext += "Content-Type: text/html\r\n";
    responsecontext += "Connection: Keep-Alive\r\n";
    responsecontext += "Content-Length: " + std::to_string(responsebody.size()) + "\r\n";
    responsecontext += "\r\n";
    responsecontext += responsebody;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %ebp
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x5d54(%rip), %rsi      # 0xebb4
leaq 0x48(%rsp), %rdi
callq 0x45b0
leaq 0x5d62(%rip), %rsi      # 0xebd3
leaq 0x48(%rsp), %rdi
callq 0x45b0
leaq 0x5da2(%rip), %rsi      # 0xec24
leaq 0x48(%rsp), %rdi
callq 0x45b0
leaq 0x5e1d(%rip), %rsi      # 0xecb0
leaq 0x48(%rsp), %rdi
callq 0x45b0
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x941b
leaq 0x559f(%rip), %rdx      # 0xe44f
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9301
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x93fc
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x45d0
leaq 0x68(%rsp), %rdi
callq 0x4170
leaq 0x28(%rsp), %rdi
callq 0x4170
leaq 0x8(%rsp), %rdi
callq 0x4170
leaq 0x5dc7(%rip), %rsi      # 0xeccc
leaq 0x48(%rsp), %rdi
callq 0x45b0
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpq $0x0, 0x48(%r15)
je 0x8f3a
addq $0x40, %r15
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x41e0
jmp 0x8f4b
leaq 0x5bbe(%rip), %rsi      # 0xeaff
leaq 0x68(%rsp), %rdi
callq 0x45c0
leaq 0x54fd(%rip), %rdx      # 0xe44f
leaq 0xc8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x92c9
leaq 0xa8(%rsp), %rdi
movl %ebp, %esi
callq 0x941b
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x9474
leaq 0x54b8(%rip), %rdx      # 0xe44f
leaq 0x88(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x9301
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
movq %r14, %rdx
callq 0x93fc
leaq 0x5a71(%rip), %rdx      # 0xea39
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9301
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x45d0
leaq 0x28(%rsp), %rdi
callq 0x4170
leaq 0x8(%rsp), %rdi
callq 0x4170
leaq 0x88(%rsp), %rdi
callq 0x4170
leaq 0xe8(%rsp), %rdi
callq 0x4170
leaq 0xa8(%rsp), %rdi
callq 0x4170
leaq 0xc8(%rsp), %rdi
callq 0x4170
leaq 0x5b0a(%rip), %rsi      # 0xeb3d
movq %rbx, %rdi
callq 0x45b0
leaq 0x5cbd(%rip), %rsi      # 0xecff
movq %rbx, %rdi
callq 0x45b0
leaq 0x5cc8(%rip), %rsi      # 0xed19
movq %rbx, %rdi
callq 0x45b0
movq 0x50(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x93ba
leaq 0x5b18(%rip), %rsi      # 0xeb8a
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x9396
leaq 0x59ae(%rip), %rdx      # 0xea39
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9301
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x45d0
leaq 0x28(%rsp), %rdi
callq 0x4170
leaq 0x8(%rsp), %rdi
callq 0x4170
leaq 0x88(%rsp), %rdi
callq 0x4170
leaq 0x596a(%rip), %rsi      # 0xea39
movq %rbx, %rdi
callq 0x45b0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x45d0
leaq 0x68(%rsp), %rdi
callq 0x4170
leaq 0x48(%rsp), %rdi
callq 0x4170
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4170
jmp 0x9118
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4170
jmp 0x9127
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0x9190
jmp 0x91cd
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4170
jmp 0x9148
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4170
jmp 0x9157
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4170
jmp 0x9169
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x4170
jmp 0x917b
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x4170
leaq 0xc8(%rsp), %rdi
callq 0x4170
jmp 0x91d0
movq %rax, %rbx
jmp 0x9188
jmp 0x91cd
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4170
jmp 0x91b0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4170
jmp 0x91bf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x91d5
jmp 0x91c8
movq %rax, %rbx
jmp 0x91da
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4170
leaq 0x48(%rsp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x4570