// File: /workspace/github_cpp_makefile_star2_O2/enbock[P]Warp10Server/warp10server/src/Network/WebListener.cpp
// Function: Warp10::Network::WebListener::checkClosed()
void WebListener::checkClosed()
{
	lock();
	int64 count   = _connections.length();
	bool isClosed = _isClosed;
	unlock();
	trace(
		className() + "::checkClosed: " + int2string(count)
		+ " connection left and socket is " 
		+ (isClosed == false ? "connected" : "disconnected")
		+ "."
	);
	if(
		count == 0 && isClosed == true
		&& hasEventListener(WebEvent::WILL_CLOSE) == false
	) {
		lock(); // sync canClose and connection closed here
		bool sent = _closeSent;
		_closeSent = true;
		unlock();
		if (sent  == false) {
			u::Network::Event closed(u::Network::Event::CLOSED);
			dispatchEvent(&closed);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
callq 0x40c442
movq 0xd0(%rbx), %r15
movq 0xd8(%rbx), %r12
movb 0xe8(%rbx), %bpl
movq %rbx, %rdi
callq 0x40c3fe
movq $0x64ec20, %rdi         # imm = 0x64EC20
leaq 0x1bee49(%rip), %rsi    # 0x5c7091
callq 0x489b70
movq %rax, %r14
movq (%rbx), %rax
leaq 0xf8(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0x130(%rsp), %rsi
leaq 0x1bf325(%rip), %rdx    # 0x5c7595
movq %rsp, %rdi
callq 0x405349
movq %r12, %rsi
subq %r15, %rsi
shrq $0x3, %rsi
leaq 0xa0(%rsp), %rdi
callq 0x40c712
leaq 0xd8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x406c55
leaq 0x1bf2fa(%rip), %rdx    # 0x5c75a5
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x405349
testb %bpl, %bpl
leaq 0x1bf304(%rip), %rax    # 0x5c75c8
leaq 0x1bf2fa(%rip), %rdx    # 0x5c75c5
cmoveq %rax, %rdx
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x405349
leaq 0x1c7548(%rip), %rdx    # 0x5cf82d
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x405349
leaq 0x80(%rsp), %rsi
movq %r14, %rdi
callq 0x49c3f0
leaq 0x1bed9d(%rip), %rsi    # 0x5c70ab
movq %rax, %rdi
callq 0x489b70
movq %rax, %rdi
callq 0x489450
leaq 0x80(%rsp), %rdi
callq 0x499a70
leaq 0x60(%rsp), %rdi
callq 0x499a70
leaq 0x40(%rsp), %rdi
callq 0x499a70
leaq 0x20(%rsp), %rdi
callq 0x499a70
leaq 0xa0(%rsp), %rdi
callq 0x4050e8
movq %rsp, %rdi
callq 0x499a70
leaq 0xf8(%rsp), %rdi
callq 0x4050e8
cmpq %r15, %r12
sete %al
andb %bpl, %al
cmpb $0x1, %al
jne 0x4083dd
movq $0x64d7a0, %rsi         # imm = 0x64D7A0
movq %rbx, %rdi
callq 0x40acfa
testb %al, %al
jne 0x4083dd
movq %rbx, %rdi
callq 0x40c442
movb 0xe9(%rbx), %bpl
movb $0x1, 0xe9(%rbx)
movq %rbx, %rdi
callq 0x40c3fe
testb %bpl, %bpl
jne 0x4083dd
movq $0x64dc40, %rsi         # imm = 0x64DC40
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
callq 0x40ffe2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40ad2c
leaq 0xf8(%rsp), %rdi
callq 0x4100e2
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x4100e2
jmp 0x40846d
movq %rax, %rbx
jmp 0x40842d
movq %rax, %rbx
jmp 0x408437
movq %rax, %rbx
jmp 0x408441
movq %rax, %rbx
jmp 0x40844b
movq %rax, %rbx
jmp 0x408458
movq %rax, %rbx
jmp 0x408460
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x499a70
leaq 0x60(%rsp), %rdi
callq 0x499a70
leaq 0x40(%rsp), %rdi
callq 0x499a70
leaq 0x20(%rsp), %rdi
callq 0x499a70
leaq 0xa0(%rsp), %rdi
callq 0x4050e8
movq %rsp, %rdi
callq 0x499a70
leaq 0xf8(%rsp), %rdi
callq 0x4050e8
movq %rbx, %rdi
callq 0x4ca950
nop