// File: /workspace/github_cpp_makefile_star2_O2/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, -0x48(%rbp)
cmpb $0x1, 0x30(%rdi)
jne 0x3e41
movq -0x48(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x40(%rbp)
leaq -0x70(%rbp), %r14
pushq $0x10
popq %rdi
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x4124
movl $0x10, -0x34(%rbp)
movq -0x48(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x70(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x30a0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x3dc6
callq 0x3f48
movq %rax, %r13
andl $0x0, -0x30(%rbp)
movl $0x228, %edi            # imm = 0x228
callq 0x31f0
movq %rax, %rbx
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %r14, %r12
movq %r14, %rsi
callq 0x40be
movb $0x1, %r14b
movq %rbx, %rdi
movl -0x2c(%rbp), %esi
movq %r15, %rdx
movq %rbx, -0x60(%rbp)
callq 0x5010
leaq -0x58(%rbp), %r15
xorl %r14d, %r14d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x42e6
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
movq -0x40(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movq %r15, %rcx
callq 0x43a0
leaq -0xf8(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3fee
movq %r12, %r14
movq %r13, %rdi
movq %r15, %rsi
callq 0x4878
movq %r15, %rdi
callq 0x3862
leaq -0xb8(%rbp), %rdi
callq 0x4036
leaq -0x50(%rbp), %rdi
callq 0x3890
leaq -0x78(%rbp), %rdi
callq 0x3890
leaq -0x68(%rbp), %rdi
callq 0x3890
cmpl $0x0, -0x2c(%rbp)
jg 0x3cbe
jmp 0x3e41
callq 0x3030
movq %rax, %rbx
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3db1
cmpl $0xb, %eax
je 0x3db1
cmpl $0x47, %eax
je 0x3db1
cmpl $0x67, %eax
je 0x3db1
callq 0x3f48
movq %rax, %r15
andq $0x0, -0x58(%rbp)
leaq -0xb8(%rbp), %r12
movq %r12, %rdi
movq -0x40(%rbp), %rsi
movq %rbx, %rdx
leaq -0x58(%rbp), %rcx
callq 0x4674
leaq -0xd8(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4056
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4878
movq %rbx, %rdi
callq 0x3862
leaq -0xb8(%rbp), %rdi
callq 0x3862
jmp 0x3db1
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x3862
jmp 0x3e67
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x3862
jmp 0x3ecb
jmp 0x3ec8
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x3862
jmp 0x3e90
movq %rax, %rbx
jmp 0x3e9c
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x4036
leaq -0x50(%rbp), %rdi
callq 0x3890
xorl %r14d, %r14d
jmp 0x3eaf
jmp 0x3ec8
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3890
testb %r14b, %r14b
je 0x3ecb
movq -0x60(%rbp), %rdi
callq 0x31d0
jmp 0x3ecb
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3890
movq %rbx, %rdi
callq 0x3310