// File: enbock[P]Warp10Server/warp10server/src/Network/WebListener.cpp
// Function: Warp10::Network::WebListener::onConnectionClosed(u::Object*)
void WebListener::onConnectionClosed(Object *arg)
{
	u::Network::Event* event = ((u::Network::Event*)arg);
	IConnection* connection  = ((IConnection*)event->target());
	lock();
	int64 index = _connections.erase(connection);
	if (index != -1) {
		trace(
			className() + "::onConnectionClosed: Removed connection from list."
		);
		connection->removeEventListener(
			u::Network::Event::CLOSED
			, Callback(this, cb_cast(&WebListener::onConnectionClosed))
		);
		connection->destroy();
	}
	bool isClosed = _isClosed;
	unlock();
	if (isClosed == true) {
		checkClosed();
	}

	event->destroy();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x411090
movq -0x130(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0x417410
movq -0x130(%rbp), %rdi
addq $0x98, %rdi
movq -0x20(%rbp), %rsi
callq 0x40dd10
movq %rax, -0x28(%rbp)
cmpq $-0x1, -0x28(%rbp)
je 0x40db3a
movq $0x668c60, %rdi         # imm = 0x668C60
leaq 0x1cd77e(%rip), %rsi    # 0x5db091
callq 0x49dd60
movq %rax, -0x138(%rbp)
movb $0x0, -0xa1(%rbp)
movb $0x0, -0xb6(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x40d935
jmp 0x40d96b
movq -0x130(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0xa0(%rbp), %rdi
callq *%rax
movb $0x1, -0xa1(%rbp)
leaq -0x68(%rbp), %rsi
leaq 0x1ce2b5(%rip), %rdx    # 0x5dbc13
leaq -0x48(%rbp), %rdi
callq 0x405d00
jmp 0x40d969
jmp 0x40d9a0
leaq -0xb5(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x435b90
movq -0x140(%rbp), %rdx
movb $0x1, -0xb6(%rbp)
leaq 0x1f300f(%rip), %rsi    # 0x6009a2
leaq -0x48(%rbp), %rdi
callq 0x407e60
jmp 0x40d99e
jmp 0x40d9a0
movq -0x138(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4b05e0
movq %rax, -0x148(%rbp)
jmp 0x40d9b9
movq -0x148(%rbp), %rdi
leaq 0x1cd709(%rip), %rsi    # 0x5db0d0
callq 0x49dd60
movq %rax, -0x150(%rbp)
jmp 0x40d9d5
movq -0x150(%rbp), %rdi
movq $0x49d640, %rsi         # imm = 0x49D640
callq 0x49c850
jmp 0x40d9ea
leaq -0x48(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0xb6(%rbp)
jne 0x40d9fe
jmp 0x40da0a
leaq -0xb5(%rbp), %rdi
callq 0x435bb0
testb $0x1, -0xa1(%rbp)
jne 0x40da15
jmp 0x40da21
leaq -0xa0(%rbp), %rdi
callq 0x405650
movq -0x130(%rbp), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x160(%rbp)
movq $0x0, -0x118(%rbp)
movq $0x49, -0x120(%rbp)
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x110(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x410a10
movq -0x160(%rbp), %rdi
movq -0x158(%rbp), %rdx
movq $0x667c80, %rsi         # imm = 0x667C80
callq 0x4126f0
jmp 0x40da8b
leaq -0x110(%rbp), %rdi
callq 0x407e40
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *(%rax)
jmp 0x40db3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x40db01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x40dae8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0xb6(%rbp)
jne 0x40daf3
jmp 0x40daff
leaq -0xb5(%rbp), %rdi
callq 0x435bb0
jmp 0x40db01
testb $0x1, -0xa1(%rbp)
jne 0x40db0c
jmp 0x40db18
leaq -0xa0(%rbp), %rdi
callq 0x405650
jmp 0x40db83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x407e40
jmp 0x40db83
movq -0x130(%rbp), %rdi
movb 0xe8(%rdi), %al
andb $0x1, %al
movb %al, -0x121(%rbp)
callq 0x417380
movb -0x121(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x40db71
movq -0x130(%rbp), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *(%rax)
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x4deb40
nop