// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rdi, %rbx
callq 0x410226
movl 0x54(%rbx), %ebp
movq %rbx, %rdi
callq 0x4101de
cmpl $-0x1, %ebp
jne 0x412b9d
movq %rbx, %rdi
callq 0x410226
movl 0x34(%rbx), %edi
movq 0x48(%rbx), %rsi
movl 0x50(%rbx), %edx
callq 0x5606d0
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
callq 0x4101de
movq %rbx, %rdi
callq 0x410226
movl 0x54(%rbx), %ebp
movq %rbx, %rdi
callq 0x4101de
cmpl $-0x1, %ebp
je 0x412915
movq %rbx, %rdi
callq 0x410226
movl 0x34(%rbx), %edi
movl 0xbc(%rbx), %esi
callq 0x5607d0
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
callq 0x4101de
movq %rbx, %rdi
callq 0x410226
movl 0x54(%rbx), %ebp
movq %rbx, %rdi
callq 0x4101de
movb $0x1, %al
cmpl $-0x1, %ebp
jne 0x412b9f
movq $0x653b20, %rdi         # imm = 0x653B20
leaq 0x1bb89b(%rip), %rsi    # 0x5ce153
movl $0x7, %edx
callq 0x490910
movq (%rbx), %rax
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0xf0(%rsp), %rdi
leaq 0x1bc473(%rip), %rsi    # 0x5ced55
callq 0x4a24f0
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x412baf
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x412bb6
movq $0x653b20, %rdi         # imm = 0x653B20
leaq 0x1bb830(%rip), %rsi    # 0x5ce153
movl $0x7, %edx
callq 0x490910
movq (%rbx), %rax
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq *0x8(%rax)
leaq 0xf0(%rsp), %rdi
leaq 0x1bc3e9(%rip), %rsi    # 0x5ced36
callq 0x4a24f0
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x412979
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x412980
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x34(%rbx), %esi
leaq 0x60(%rsp), %rdi
callq 0x410514
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0xa0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0x4129ca
movq 0x30(%rsp), %rdi
movq 0x98(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x4129f6
leaq 0xa8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x4129f1
movq 0xa8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x412a02
leaq 0x20(%rsp), %rdi
callq 0x4a23b0
jmp 0x412a13
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4a1d30
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x412a36
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x412a3c
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1e03a6(%rip), %rsi    # 0x5f2e06
movq %rsp, %rdi
callq 0x4a24f0
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x412a8f
movq %rsi, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x412a99
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %r15, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq $0x653b20, %rdi         # imm = 0x653B20
callq 0x490910
movq %rax, %rbx
leaq 0x1bb5e4(%rip), %rsi    # 0x5ce0ab
movl $0x4, %edx
movq %rax, %rdi
callq 0x490910
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x471a60
movsbl %al, %esi
movq %rbx, %rdi
callq 0x490410
movq %rax, %rdi
callq 0x48f9e0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x412b12
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x412b2d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x412b4e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x60(%rsp), %rdi
callq 0x410332
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x412b6f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x412b90
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0xb8(%rsp), %rdi
callq 0x410332
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x34(%rbx), %esi
leaq 0x60(%rsp), %rdi
callq 0x410514
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0xa0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0x412c00
movq 0x30(%rsp), %rdi
leaq 0xa8(%rsp), %r15
movq -0x10(%r15), %rsi
cmpq %rdi, %rax
jbe 0x412c28
movl $0xf, %edi
cmpq %r15, %rsi
je 0x412c23
movq 0xa8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x412c34
leaq 0x20(%rsp), %rdi
callq 0x4a23b0
jmp 0x412c45
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4a1d30
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x412c68
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x412c6e
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1e0174(%rip), %rsi    # 0x5f2e06
movq %rsp, %rdi
callq 0x4a24f0
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x412cc2
movq %rsi, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x412ccd
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %r12, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq $0x653b20, %rdi         # imm = 0x653B20
callq 0x490910
movq %rax, %rbx
leaq 0x1bb3b0(%rip), %rsi    # 0x5ce0ab
movl $0x4, %edx
movq %rax, %rdi
callq 0x490910
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x471a60
movsbl %al, %esi
movq %rbx, %rdi
callq 0x490410
movq %rax, %rdi
callq 0x48f9e0
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x412d46
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x412d61
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x426e30
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
jne 0x412b3e
jmp 0x412b4e
jmp 0x412d7f
jmp 0x412d84
jmp 0x412d89
jmp 0x412d8e
movq %rax, %rbx
jmp 0x412dbc
movq %rax, %rbx
jmp 0x412dd7
movq %rax, %rbx
jmp 0x412de1
movq %rax, %rbx
jmp 0x412df8
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
jne 0x412daf
jmp 0x412dbc
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x412dbc
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x412dd7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0x60(%rsp), %rdi
callq 0x40512c
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x412df8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x426e30
leaq 0xb8(%rsp), %rdi
callq 0x40512c
movq %rbx, %rdi
callq 0x4d10c0
nop