// File: /workspace/github_cpp_makefile_star2_O1/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>>>>>>::start()
void WebServer::ServerBase<socket_type>::start()
{
	// 默认资源回放在 vector 的末尾，用作默认应答
	// 默认的请求会在找不到匹配请求路径时, 进行访问,故在最后添加
	for(auto it = resource.begin(); it != resource.end(); it++)
		all_resources.push_back(it);

	for(auto it = default_resource.begin(); it != default_resource.end(); it++)
		all_resources.push_back(it);
	// 调用 socket 的连接方式，还需要子类来实现 accept() 逻辑
	accept();
	// 如果 num_threads>1, 那么 m_io_service.run()
	// 将运行 (num_threads-1) 线程成为线程池
	for(size_t c = 1; c<num_threads; c++)
	{
		threads.emplace_back([this]()
				{
					m_io_service.run();
				});
	}
	// 主线程
	m_io_service.run();

	// 等待其他线程, 如果有的话，就等待这些线程的结束
	for(auto &t :threads)
		t.join();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %rax
leaq 0x10(%rdi), %r12
movq %rax, (%rsp)
cmpq %r12, %rax
je 0x30629
leaq 0x108(%rbx), %r14
movq %rsp, %r15
movq 0x110(%rbx), %rsi
cmpq 0x118(%rbx), %rsi
je 0x3060c
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x110(%rbx)
jmp 0x30617
movq %r14, %rdi
movq %r15, %rdx
callq 0x313a0
movq (%rsp), %rdi
callq 0xa480
movq %rax, (%rsp)
cmpq %r12, %rax
jne 0x305eb
movq 0x50(%rbx), %rax
leaq 0x40(%rbx), %r12
movq %rax, (%rsp)
cmpq %r12, %rax
je 0x30682
leaq 0x108(%rbx), %r14
movq %rsp, %r15
movq 0x110(%rbx), %rsi
cmpq 0x118(%rbx), %rsi
je 0x30665
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x110(%rbx)
jmp 0x30670
movq %r14, %rdi
movq %r15, %rdx
callq 0x313a0
movq (%rsp), %rdi
callq 0xa480
movq %rax, (%rsp)
cmpq %r12, %rax
jne 0x30644
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
cmpq $0x2, 0xe8(%rbx)
jb 0x306c0
leaq 0xf0(%rbx), %r14
movl $0x1, %r12d
movq %rsp, %r15
movq %rbx, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x31374
incq %r12
cmpq 0xe8(%rbx), %r12
jb 0x306a5
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0xe892
movq 0x70(%rbx), %rdi
movq %r14, %rsi
callq 0xe8be
cmpb $0x1, 0x4(%r14)
je 0x3070d
movq 0xf0(%rbx), %r14
movq 0xf8(%rbx), %rbx
cmpq %rbx, %r14
je 0x30701
movq %r14, %rdi
callq 0xaa50
addq $0x8, %r14
jmp 0x306ee
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0x21cc(%rip), %rsi      # 0x328ea
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xab60
leaq 0x17db8(%rip), %rax     # 0x484e8
movq %rax, (%rbx)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0xd490
movq %rax, %rbx
movq %rsp, %rdi
callq 0xc2c6
movq %rbx, %rdi
callq 0xaa80
nop