// File: /workspace/github_cpp_makefile_star2_O2/DMLfor[P]TinyWebServer/./ServerBase.hpp
// Function: WebServer::ServerBase<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::execution::any_executor<boost::asio::execution::context_as_t<boost::asio::execution_context&>, boost::asio::execution::detail::blocking::never_t<0>, boost::asio::execution::prefer_only<boost::asio::execution::detail::blocking::possibly_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::tracked_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::untracked_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::fork_t<0>>, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::continuation_t<0>>>>>>::parse_request(std::istream&) const
WebServer::Request WebServer::ServerBase<socket_type>::parse_request(std::istream &stream) const
{
	Request request;
	// 使用正则表达式对请求报头进行解析
	// 可以解析出请求方法(GET/POST),请求路径以及 HTTP 版本
	std::regex e("^([^ ]*) ([^ ]*) HTTP/([^ ]*)$");

	std::smatch sub_match;
	// 从第一行中解析请求的方法, 路径和 HTTP 版本
	std::string line;
	getline(stream, line);
	line.pop_back();
	if(std::regex_match(line, sub_match, e))
	{
		request.method        = sub_match[1];
		request.path		  = sub_match[2];
		request.http_version  = sub_match[3];
		// 解析头部的其他信息
		bool matched = false;
		e = "^([^:]*): ?(.*)$";
		do
		{
			getline(stream, line);
			line.pop_back();
			matched = std::regex_match(line, sub_match, e);
			if(matched)
			{
				request.header[sub_match[1]] = sub_match[2];
			}
		} while(matched);
	}
	return request;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %rbx
movq %rdi, 0x28(%rsp)
callq 0x18e1e
leaq 0x13417(%rip), %rsi     # 0x2bb1e
leaq 0x78(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x18fca
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %rsi
movq %rbx, 0x30(%rsp)
movq %rbx, %rdi
callq 0xa120
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0xa7f0
movq %rsp, %rsi
leaq 0x78(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x19030
testb %al, %al
je 0x18950
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
pushq $0x18
popq %r13
subq %rsi, %rcx
je 0x18794
movq %rcx, %rax
cqto
idivq %r13
addq $-0x5, %rax
cmpq $-0x3, %rax
ja 0x18794
addq $0x18, %rsi
jmp 0x1879b
addq %rcx, %rsi
addq $-0x48, %rsi
leaq 0x38(%rsp), %rdi
movq 0x28(%rsp), %r14
callq 0x24342
leaq 0x38(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa800
movq %rbx, %rdi
callq 0xa370
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
subq %rsi, %rcx
je 0x187e8
movq %rcx, %rax
cqto
idivq %r13
addq $-0x6, %rax
cmpq $-0x4, %rax
ja 0x187e8
addq $0x30, %rsi
jmp 0x187ef
addq %rcx, %rsi
addq $-0x48, %rsi
leaq 0x38(%rsp), %rdi
callq 0x24342
leaq 0x20(%r14), %rdi
leaq 0x38(%rsp), %rbx
movq %rbx, %rsi
callq 0xa800
movq %rbx, %rdi
callq 0xa370
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
subq %rsi, %rcx
je 0x18838
movq %rcx, %rax
cqto
idivq %r13
addq $-0x7, %rax
cmpq $-0x5, %rax
ja 0x18838
addq $0x48, %rsi
jmp 0x1883f
addq %rcx, %rsi
addq $-0x48, %rsi
leaq 0x38(%rsp), %rdi
callq 0x24342
leaq 0x40(%r14), %rdi
leaq 0x38(%rsp), %rbx
movq %rbx, %rsi
callq 0xa800
movq %rbx, %rdi
callq 0xa370
leaq 0x132d4(%rip), %rsi     # 0x2bb3d
leaq 0x78(%rsp), %rdi
callq 0x19082
leaq 0x70(%r14), %r15
leaq 0x58(%rsp), %r12
leaq 0x78(%rsp), %rbp
leaq 0x38(%rsp), %rbx
leaq 0x98(%rsp), %r14
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xa120
movq %r12, %rdi
callq 0xa7f0
movq %r12, %rdi
movq %rsp, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x19030
testb %al, %al
je 0x18950
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
subq %rsi, %rcx
je 0x188e1
movq %rcx, %rax
cqto
idivq %r13
addq $-0x6, %rax
cmpq $-0x4, %rax
ja 0x188e1
addq $0x30, %rsi
jmp 0x188e8
addq %rcx, %rsi
addq $-0x48, %rsi
movq %rbx, %rdi
callq 0x24342
movq (%rsp), %rsi
movq 0x8(%rsp), %rcx
subq %rsi, %rcx
je 0x18916
movq %rcx, %rax
cqto
idivq %r13
addq $-0x5, %rax
cmpq $-0x3, %rax
ja 0x18916
addq $0x18, %rsi
jmp 0x1891d
addq %rcx, %rsi
addq $-0x48, %rsi
movq %r14, %rdi
callq 0x24342
movq %r15, %rdi
movq %r14, %rsi
callq 0x26330
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa800
movq %r14, %rdi
callq 0xa370
movq %rbx, %rdi
callq 0xa370
jmp 0x1888e
leaq 0x58(%rsp), %rdi
callq 0xa370
movq %rsp, %rdi
callq 0x228d2
leaq 0x78(%rsp), %rdi
callq 0x1908a
movq 0x28(%rsp), %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x189b5
jmp 0x189b5
jmp 0x189b5
jmp 0x189b5
movq %rax, %rbx
jmp 0x189d4
jmp 0x189b5
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xa370
jmp 0x189a7
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xa370
jmp 0x189b8
jmp 0x189b5
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xa370
movq %rsp, %rdi
callq 0x228d2
leaq 0x78(%rsp), %rdi
callq 0x1908a
movq 0x28(%rsp), %rdi
callq 0x18a46
movq %rbx, %rdi
callq 0xaac0