// File: /workspace/github_cpp_makefile_star2_O1/nightmeng[P]net/src/acceptor.cpp
// Function: acceptor::ievent()
void acceptor::ievent(){
	if(!status)
		return;

	int fd;
	while(true){
		std::shared_ptr<struct sockaddr_in> addr(new struct sockaddr_in());
		socklen_t len = sizeof(struct sockaddr_in);

		fd = ::accept(sock, reinterpret_cast<struct sockaddr*>(addr.get()),
				&len);
		
		if(fd > 0){
			singleton<scheduler>::instance()->arrange(std::bind(acb, 0, std::shared_ptr<class socket>(
							new class socket(fd, addr))));
		}
		else{
			if(errno != EAGAIN && errno != ECONNABORTED && errno != EPROTO
					&& errno != EINTR){
				singleton<scheduler>::instance()->arrange(std::bind(acb, errno, nullptr));
				return;
			}
			else{
				return;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, -0x60(%rbp)
cmpb $0x1, 0x30(%rdi)
jne 0x4140
movq -0x60(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
leaq -0x98(%rbp), %rbx
leaq -0xf8(%rbp), %r12
movl $0x10, %edi
callq 0x3200
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x44b2
movl $0x10, -0x30(%rbp)
movq -0x60(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x30b0
movl %eax, %r13d
testl %eax, %eax
jle 0x3f10
callq 0x42be
movq %rax, %r14
movl $0x228, %edi            # imm = 0x228
callq 0x3200
movq %rax, %r15
movl %r13d, -0x2c(%rbp)
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0xd0(%rbp)
movq %rax, -0xc8(%rbp)
testq %rax, %rax
je 0x3fbc
movq 0xb0c1(%rip), %rcx      # 0xefc0
cmpb $0x0, (%rcx)
je 0x3fb8
incl 0x8(%rax)
jmp 0x3fbc
callq 0x3040
movq %rax, %r14
movl (%rax), %eax
cmpl $0x46, %eax
jg 0x3f33
cmpl $0x4, %eax
je 0x4129
cmpl $0xb, %eax
je 0x4129
jmp 0x3f45
cmpl $0x47, %eax
je 0x4129
cmpl $0x67, %eax
je 0x4129
callq 0x42be
movq %rax, %r15
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
callq 0x444c
movq $0x0, -0x78(%rbp)
movl (%r14), %eax
movl %eax, -0x70(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x43c6
movq %r15, %rdi
movq %r12, %rsi
callq 0x4a9e
movq -0xe8(%rbp), %rax
testq %rax, %rax
je 0x3f96
movq %r12, %rdi
movq %r12, %rsi
movl $0x3, %edx
callq *%rax
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x4129
movq %rbx, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x4129
lock
incl 0x8(%rax)
movq %r12, %r13
movb $0x1, %r12b
movq %r15, %rdi
movl -0x2c(%rbp), %esi
leaq -0xd0(%rbp), %rdx
movq %r15, -0xd8(%rbp)
callq 0x536e
movq %r15, -0x40(%rbp)
xorl %r12d, %r12d
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x4628
movq %rbx, %r15
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
callq 0x444c
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %r12
movq %rbx, -0x78(%rbp)
movq %r12, -0x70(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0x40(%rbp)
movl $0x0, -0x68(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps %xmm0, -0xb0(%rbp)
movl $0x38, %edi
callq 0x3200
xorps %xmm1, %xmm1
movups %xmm1, (%rax)
movq $0x0, 0x10(%rax)
movq -0x80(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x88(%rbp), %rcx
testq %rcx, %rcx
je 0x406d
movups -0x98(%rbp), %xmm0
movups %xmm0, (%rax)
movq %rcx, 0x10(%rax)
leaq -0x88(%rbp), %rcx
movups %xmm1, (%rcx)
movq %rbx, 0x20(%rax)
xorl %ecx, %ecx
movq %rcx, 0x28(%rax)
movq %rcx, -0x70(%rbp)
movq %r12, 0x28(%rax)
movq %rcx, -0x78(%rbp)
movl $0x0, 0x30(%rax)
movq %rax, -0xc0(%rbp)
leaq 0x63e(%rip), %rax       # 0x46d6
movq %rax, -0xa8(%rbp)
leaq 0x646(%rip), %rax       # 0x46ec
movq %rax, -0xb0(%rbp)
movq %r14, %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4a9e
movq -0xb0(%rbp), %rax
testq %rax, %rax
movq %r15, %rbx
movq %r13, %r12
je 0x40df
leaq -0xc0(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
movl -0x2c(%rbp), %r13d
je 0x40f1
callq 0x3a4e
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x410a
movq %rbx, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq *%rax
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x4118
callq 0x3a4e
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x4129
callq 0x3a4e
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x4137
callq 0x3a4e
testl %r13d, %r13d
jg 0x3e7e
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x41cd
jmp 0x41cd
movq %rax, %rbx
movq -0xe8(%rbp), %rax
testq %rax, %rax
je 0x417d
leaq -0xf8(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x417d
jmp 0x41cd
movq %rax, %rbx
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x4228
leaq -0x98(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x4228
jmp 0x41cd
jmp 0x4225
jmp 0x41cd
jmp 0x41cd
movq %rax, %rbx
movq -0xb0(%rbp), %rax
testq %rax, %rax
je 0x41dd
leaq -0xc0(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x41dd
movq %rax, %rdi
callq 0x3a3f
movq %rax, %rbx
jmp 0x41e9
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x438a
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x41f7
callq 0x3a4e
xorl %r12d, %r12d
jmp 0x4201
jmp 0x4225
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x4212
callq 0x3a4e
testb %r12b, %r12b
je 0x4228
movq -0xd8(%rbp), %rdi
callq 0x31e0
jmp 0x4228
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x4236
callq 0x3a4e
movq %rbx, %rdi
callq 0x3330