// File: /workspace/github_cpp_makefile_star2_O1/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::acceptor(int, int)
acceptor::acceptor(int _epoll_cnt, int _max_conn) {
	epoll_cnt = _epoll_cnt;
	max_conn = _max_conn;
	_INFO("epoll_cnt=%d,max_conn=%d", epoll_cnt, max_conn);
	listen_port = -1;
	stop_task = 0;
	conn_num = 0;
	wid = 0;
	epoll_fds = new int[epoll_cnt];
	epoll_ready_event_num = new int[epoll_cnt];
	pipe_read_fds = new int[epoll_cnt];
	pipe_write_fds = new int[epoll_cnt];
	add_sum = 2;
	for (int i = 0; i < epoll_cnt; i++) {
		epoll_ready_event_num[i] = 0;
	}
	epoll_mutexes = new pthread_mutex_t[epoll_cnt];
	for (int i = 0; i < epoll_cnt; i++) {
		pthread_mutex_init(&epoll_mutexes[i], NULL);
	}
	epoll_ready_events = new epoll_event*[epoll_cnt];
	for (int i = 0; i < epoll_cnt; i++) {
		epoll_ready_events[i] = new epoll_event[max_conn];
	}
	pthread_mutex_init(&epoll_idx_mutex, NULL);
	incoming_fd_cnt = 0;
	epoll_thread_cnt = 0;
	pthread_mutex_init(&conn_mutex, NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl %esi, 0x4(%rdi)
movl %edx, (%rdi)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
leaq 0x30(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2100
leaq 0x3baa(%rip), %rdx      # 0x6004
leaq 0x10(%rsp), %r14
pushq $0x12
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x2180
movq 0x6b64(%rip), %rax      # 0x8fd8
movq (%rax), %r15
callq 0x21b0
movl (%rbx), %ecx
movl 0x4(%rbx), %r9d
movl %ecx, (%rsp)
leaq 0x3b88(%rip), %rsi      # 0x6014
leaq 0x3ce8(%rip), %r8       # 0x617b
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x22e0
orl $-0x1, 0x8(%rbx)
andq $0x0, 0x18(%rbx)
andl $0x0, 0x20(%rbx)
movslq 0x4(%rbx), %rax
leaq (,%rax,4), %r15
testq %rax, %rax
pushq $-0x1
popq %r12
cmovsq %r12, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x10(%rbx)
movq %r15, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, 0x88(%rbx)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x90(%rbx)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x98(%rbx)
movl $0x2, 0xa8(%rbx)
movl 0x4(%rbx), %ebp
testl %ebp, %ebp
jle 0x252e
movl 0x4(%rbx), %ebp
cmpl $0x2, %ebp
pushq $0x1
popq %rdx
cmovgel %ebp, %edx
shlq $0x2, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2110
movslq %ebp, %rax
pushq $0x28
popq %rcx
mulq %rcx
cmovoq %r12, %rax
movq %rax, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
movl 0x4(%rbx), %r15d
testl %r15d, %r15d
jle 0x2574
xorl %r14d, %r14d
xorl %r13d, %r13d
movq 0x28(%rbx), %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x2320
incq %r13
movslq 0x4(%rbx), %r15
addq $0x28, %r14
cmpq %r15, %r13
jl 0x2556
movslq %r15d, %r14
leaq (,%r14,8), %rdi
testl %r14d, %r14d
cmovsq %r12, %rdi
callq 0x2030
movq %rax, 0x80(%rbx)
testl %r14d, %r14d
jle 0x25c8
movslq (%rbx), %rax
pushq $0xc
popq %rcx
mulq %rcx
movq %rax, %r14
cmovoq %r12, %r14
movl %r15d, %r15d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x2030
movq 0x80(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x25ad
leaq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x2320
andq $0x0, 0xa0(%rbx)
addq $0x30, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2320
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq