// File: /workspace/github_cpp_makefile_star2_O3/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 0x41173c
leaq 0x24250b(%rip), %rax    # 0x647d80
movq %rax, (%rbx)
leaq 0xc0(%rbx), %r14
movq %r14, %rdi
callq 0x416a28
leaq 0x2de(%rip), %r15       # 0x405b6c
movl $0x2, %edi
movq %r15, %rsi
callq 0x4ec020
movl $0x9, %edi
movq %r15, %rsi
callq 0x4ec020
movl $0x6, %edi
movq %r15, %rsi
callq 0x4ec020
movl $0xf, %edi
movq %r15, %rsi
callq 0x4ec020
movb $0x0, 0x228(%rbx)
leaq 0x318(%rip), %rdx       # 0x405be8
leaq 0x130(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x40bcd8
leaq 0x38(%rbx), %rdi
movq $0x6525f0, %rsi         # imm = 0x6525F0
leaq 0x130(%rsp), %rdx
callq 0x40ded4
leaq 0x130(%rsp), %rdi
callq 0x410332
leaq 0x491(%rip), %rdx       # 0x405da2
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x40bcd8
movq $0x652c60, %rsi         # imm = 0x652C60
leaq 0xd8(%rsp), %rdx
movq %r14, %rdi
callq 0x40ded4
leaq 0xd8(%rsp), %rdi
callq 0x410332
movq $0x653c40, %rdi         # imm = 0x653C40
leaq 0x1c8739(%rip), %rsi    # 0x5ce091
movl $0x4, %edx
callq 0x490910
movq (%rbx), %rax
leaq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0xb8(%rsp), %rdi
leaq 0x1c8714(%rip), %rsi    # 0x5ce096
callq 0x4a24f0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x4059af
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x4059ba
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %r12, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq $0x653c40, %rdi         # imm = 0x653C40
callq 0x490910
movq %rax, %r15
leaq 0x1c86c3(%rip), %rsi    # 0x5ce0ab
movl $0x4, %edx
movq %rax, %rdi
callq 0x490910
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x471a60
movsbl %al, %esi
movq %r15, %rdi
callq 0x490410
movq %rax, %rdi
callq 0x48f9e0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x405a33
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x405a54
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x80(%rsp), %rdi
callq 0x410332
movl $0x190, %edi            # imm = 0x190
callq 0x427e10
movq %rax, %r12
leaq 0x1c863b(%rip), %rsi    # 0x5ce0b0
leaq 0x28(%rsp), %rdi
callq 0x4107ee
leaq 0x28(%rsp), %rdx
movl $0x50, %ecx
movq %r12, %rdi
movq %r14, %rsi
callq 0x40662c
movq %r12, 0x230(%rbx)
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x405ab6
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x28(%rsp), %rdi
callq 0x410332
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 0x40512c
jmp 0x405aee
movq %rax, %r15
movl $0x190, %esi            # imm = 0x190
movq %r12, %rdi
callq 0x426e30
jmp 0x405b54
movq %rax, %r15
jmp 0x405b42
jmp 0x405b51
movq %rax, %r15
leaq 0xd8(%rsp), %rdi
jmp 0x405b1c
movq %rax, %r15
leaq 0x130(%rsp), %rdi
callq 0x410332
jmp 0x405b54
movq %rax, %r15
jmp 0x405b5c
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x405b42
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x80(%rsp), %rdi
callq 0x40512c
jmp 0x405b54
movq %rax, %r15
movq %r14, %rdi
callq 0x416bbe
movq %rbx, %rdi
callq 0x411b6e
movq %r15, %rdi
callq 0x4d10c0