// File: /workspace/github_cpp_makefile_star2_O1/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 0x411740
leaq 0x24251f(%rip), %rax    # 0x647d80
movq %rax, (%rbx)
leaq 0xc0(%rbx), %r14
movq %r14, %rdi
callq 0x416aac
leaq 0x2e5(%rip), %r15       # 0x405b5f
movl $0x2, %edi
movq %r15, %rsi
callq 0x4ec110
movl $0x9, %edi
movq %r15, %rsi
callq 0x4ec110
movl $0x6, %edi
movq %r15, %rsi
callq 0x4ec110
movl $0xf, %edi
movq %r15, %rsi
callq 0x4ec110
movb $0x0, 0x228(%rbx)
leaq 0x31e(%rip), %rdx       # 0x405bda
leaq 0x130(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x40bd54
leaq 0x38(%rbx), %rdi
movq $0x6525f0, %rsi         # imm = 0x6525F0
leaq 0x130(%rsp), %rdx
callq 0x40dfba
leaq 0x130(%rsp), %rdi
callq 0x410354
leaq 0x49f(%rip), %rdx       # 0x405d9c
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x40bd54
movq $0x652c60, %rsi         # imm = 0x652C60
leaq 0xd8(%rsp), %rdx
movq %r14, %rdi
callq 0x40dfba
leaq 0xd8(%rsp), %rdi
callq 0x410354
movq $0x653c40, %rdi         # imm = 0x653C40
leaq 0x1c874d(%rip), %rsi    # 0x5ce091
movl $0x4, %edx
callq 0x490a00
movq (%rbx), %rax
leaq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0xb8(%rsp), %rdi
leaq 0x1c8728(%rip), %rsi    # 0x5ce096
callq 0x4a25e0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40599b
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x4059a3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq $0x653c40, %rdi         # imm = 0x653C40
callq 0x490a00
movq %rax, %r15
leaq 0x1c86d0(%rip), %rsi    # 0x5ce0ab
movl $0x4, %edx
movq %rax, %rdi
callq 0x490a00
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x471b50
movsbl %al, %esi
movq %r15, %rdi
callq 0x490500
movq %rax, %rdi
callq 0x48fad0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x405a26
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x426f20
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x405a47
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x426f20
leaq 0x80(%rsp), %rdi
callq 0x410354
movl $0x190, %edi            # imm = 0x190
callq 0x427f00
movq %rax, %r12
leaq 0x1c8648(%rip), %rsi    # 0x5ce0b0
leaq 0x28(%rsp), %rdi
callq 0x4107fc
leaq 0x28(%rsp), %rdx
movl $0x50, %ecx
movq %r12, %rdi
movq %r14, %rsi
callq 0x406644
movq %r12, 0x230(%rbx)
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x405aa9
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x426f20
leaq 0x28(%rsp), %rdi
callq 0x410354
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 0x40512a
jmp 0x405ae1
movq %rax, %r15
movl $0x190, %esi            # imm = 0x190
movq %r12, %rdi
callq 0x426f20
jmp 0x405b47
movq %rax, %r15
jmp 0x405b35
jmp 0x405b44
movq %rax, %r15
leaq 0xd8(%rsp), %rdi
jmp 0x405b0f
movq %rax, %r15
leaq 0x130(%rsp), %rdi
callq 0x410354
jmp 0x405b47
movq %rax, %r15
jmp 0x405b4f
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x405b35
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x426f20
leaq 0x80(%rsp), %rdi
callq 0x40512a
jmp 0x405b47
movq %rax, %r15
movq %r14, %rdi
callq 0x416c42
movq %rbx, %rdi
callq 0x411b7c
movq %r15, %rdi
callq 0x4d11b0