// File: /workspace/github_cpp_makefile_star2_O2/enbock[P]Warp10Server/ulib/src/Socket.cpp
// Function: u::Socket::listen()
bool u::Socket::listen()
{
	if(isConnected()) return false;

	lock();
	_con = ::bind(_descriptor, (const struct sockaddr*)_addr, _addrLen);
	unlock();

	if(!isConnected())
	{
		error(className()+"::listen: Socket bind error. ["+int2string(_descriptor)+"]");
		return false; // bind error
	}

	lock();
	_con = ::listen(_descriptor, maxWaitingClients);
	unlock();
	if(!isConnected())
	{
		error(className()+"::listen: Socket listen error. ["+int2string(_descriptor)+"]");
		return false;
	}

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
callq 0x40dc34
testb %al, %al
jne 0x40e1e5
movq %rbx, %rdi
callq 0x40c442
movl 0x34(%rbx), %edi
movq 0x48(%rbx), %rsi
movl 0x50(%rbx), %edx
callq 0x559f50
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
callq 0x40c3fe
movq %rbx, %rdi
callq 0x40dc34
testb %al, %al
je 0x40e112
movq %rbx, %rdi
callq 0x40c442
movl 0x34(%rbx), %edi
movl 0xbc(%rbx), %esi
callq 0x55a050
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
callq 0x40c3fe
movq %rbx, %rdi
callq 0x40dc34
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x40e1e7
movq $0x64eb00, %rdi         # imm = 0x64EB00
leaq 0x1b90d6(%rip), %rsi    # 0x5c7153
callq 0x489b70
movq %rax, %r14
movq (%rbx), %rax
leaq 0xc0(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0xf8(%rsp), %rsi
leaq 0x1b9c65(%rip), %rdx    # 0x5c7d0a
leaq 0x8(%rsp), %rdi
callq 0x405349
movl 0x34(%rbx), %esi
leaq 0x68(%rsp), %rdi
callq 0x40c712
leaq 0xa0(%rsp), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x406c55
leaq 0x1ddccc(%rip), %rdx    # 0x5ebda6
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x405349
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x49c3f0
leaq 0x1b8fae(%rip), %rsi    # 0x5c70ab
movq %rax, %rdi
callq 0x489b70
movq %rax, %rdi
callq 0x489450
jmp 0x40e1b0
movq $0x64eb00, %rdi         # imm = 0x64EB00
leaq 0x1b9033(%rip), %rsi    # 0x5c7153
callq 0x489b70
movq %rax, %r14
movq (%rbx), %rax
leaq 0xc0(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0xf8(%rsp), %rsi
leaq 0x1b9ba3(%rip), %rdx    # 0x5c7ceb
leaq 0x8(%rsp), %rdi
callq 0x405349
movl 0x34(%rbx), %esi
leaq 0x68(%rsp), %rdi
callq 0x40c712
leaq 0xa0(%rsp), %rdx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x406c55
leaq 0x1ddc29(%rip), %rdx    # 0x5ebda6
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x405349
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x49c3f0
leaq 0x1b8f0b(%rip), %rsi    # 0x5c70ab
movq %rax, %rdi
callq 0x489b70
movq %rax, %rdi
callq 0x489450
leaq 0x48(%rsp), %rdi
callq 0x499a70
leaq 0x28(%rsp), %rdi
callq 0x499a70
leaq 0x68(%rsp), %rdi
callq 0x4050e8
leaq 0x8(%rsp), %rdi
callq 0x499a70
leaq 0xc0(%rsp), %rdi
callq 0x4050e8
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
jmp 0x40e1fa
jmp 0x40e1ff
jmp 0x40e204
jmp 0x40e209
movq %rax, %rbx
jmp 0x40e21d
movq %rax, %rbx
jmp 0x40e227
movq %rax, %rbx
jmp 0x40e231
movq %rax, %rbx
jmp 0x40e23b
jmp 0x40e210
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x499a70
leaq 0x28(%rsp), %rdi
callq 0x499a70
leaq 0x68(%rsp), %rdi
callq 0x4050e8
leaq 0x8(%rsp), %rdi
callq 0x499a70
leaq 0xc0(%rsp), %rdi
callq 0x4050e8
movq %rbx, %rdi
callq 0x4ca950