// File: /workspace/github_cpp_makefile_star2_O2/enbock[P]Warp10Server/warp10server/src/Server.cpp
// Function: Warp10::Server::Server(u::Vector<u::String>)
Server::Server(Vector<String> arg) : RoomOwner()
{
	// connect Ctrl+C with shutdown
	signal((int)SIGINT, OSEventHandler);
	signal((int)SIGKILL, OSEventHandler);
	signal((int)SIGABRT, OSEventHandler);
	signal((int)SIGTERM, OSEventHandler);

	_isShuttingDown = false;

	_room.addEventListener(
		ServerEvent::SHUTDOWN, 
		Callback(this, cb_cast(&Server::onShutdown))
	);

	_manager.addEventListener(
		u::Network::Event::CLOSED, 
		Callback(this, cb_cast(&Server::onManagerClosed))
	);

	trace(className() + ": Server is running.");

	_webService = new WebService(&_manager, "0.0.0.0", 80);
	_webService->registerNetwork();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, %rbx
callq 0x40d5b0
leaq 0x23d5df(%rip), %rax    # 0x642ce0
movq %rax, (%rbx)
leaq 0xc0(%rbx), %r14
movq %r14, %rdi
callq 0x410174
leaq 0x210(%rip), %r15       # 0x40592a
pushq $0x2
popq %rdi
movq %r15, %rsi
callq 0x4e58b0
pushq $0x9
popq %rdi
movq %r15, %rsi
callq 0x4e58b0
pushq $0x6
popq %rdi
movq %r15, %rsi
callq 0x4e58b0
pushq $0xf
popq %rdi
movq %r15, %rsi
callq 0x4e58b0
movb $0x0, 0x228(%rbx)
leaq 0x220(%rip), %rdx       # 0x405974
leaq 0x130(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x409b80
leaq 0x38(%rbx), %rdi
movq $0x64d5d0, %rsi         # imm = 0x64D5D0
leaq 0x130(%rsp), %rdx
callq 0x40abb6
leaq 0x130(%rsp), %rdi
callq 0x40c544
leaq 0x2e7(%rip), %rdx       # 0x405a7c
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x409b80
movq $0x64dc40, %rsi         # imm = 0x64DC40
leaq 0xd8(%rsp), %rdx
movq %r14, %rdi
callq 0x40abb6
leaq 0xd8(%rsp), %rdi
callq 0x40c544
movq $0x64ec20, %rdi         # imm = 0x64EC20
leaq 0x1c18b5(%rip), %rsi    # 0x5c7091
callq 0x489b70
movq %rax, %r15
movq (%rbx), %rax
leaq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0xb8(%rsp), %rsi
leaq 0x1c1892(%rip), %rdx    # 0x5c7096
leaq 0x8(%rsp), %rdi
callq 0x405349
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x49c3f0
leaq 0x1c1889(%rip), %rsi    # 0x5c70ab
movq %rax, %rdi
callq 0x489b70
movq %rax, %rdi
callq 0x489450
leaq 0x8(%rsp), %rdi
callq 0x499a70
leaq 0x80(%rsp), %rdi
callq 0x4050e8
movl $0x190, %edi            # imm = 0x190
callq 0x420b40
movq %rax, %r12
leaq 0x1c1853(%rip), %rsi    # 0x5c70b0
leaq 0x28(%rsp), %rdi
callq 0x40c908
leaq 0x28(%rsp), %rdx
pushq $0x50
popq %rcx
movq %r12, %rdi
movq %r14, %rsi
callq 0x405f98
movq %r12, 0x230(%rbx)
leaq 0x28(%rsp), %rdi
callq 0x4050e8
movq 0x230(%rbx), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x4050e8
jmp 0x4058b9
movq %rax, %r15
movl $0x190, %esi            # imm = 0x190
movq %r12, %rdi
callq 0x41fb60
jmp 0x405912
movq %rax, %r15
jmp 0x405900
jmp 0x40590f
movq %rax, %r15
leaq 0xd8(%rsp), %rdi
jmp 0x4058e7
movq %rax, %r15
leaq 0x130(%rsp), %rdi
callq 0x40c544
jmp 0x405912
movq %rax, %r15
jmp 0x40591a
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x499a70
leaq 0x80(%rsp), %rdi
callq 0x4050e8
jmp 0x405912
movq %rax, %r15
movq %r14, %rdi
callq 0x4102b6
movq %rbx, %rdi
callq 0x40d798
movq %r15, %rdi
callq 0x4ca950