LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::mapFlow(int, beyondy::Async::Connection*)
int EventManager::mapFlow(int flow, Connection *connection)
{
	assert(flow2Connection(flow) == NULL);
	Connection *ret = __insert(flow, &connection->flowEntry);
	if (ret == NULL) rb_insert_color(&connection->flowEntry, &flowRoot);

	SYSLOG_DEBUG("mapFlow=%d => %d", flow, connection->fd);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movl -0xc(%rbp), %esi
callq 0x7d60
cmpq $0x0, %rax
jne 0x794b
jmp 0x796a
leaq 0xaceb(%rip), %rdi      # 0x1263d
leaq 0xad02(%rip), %rsi      # 0x1265b
movl $0xdc, %edx
leaq 0xad07(%rip), %rcx      # 0x1266c
callq 0x3250
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
addq $0x38, %rdx
callq 0x7df0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x799e
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x48, %rsi
callq 0xcf40
jmp 0x79a0
leaq 0x12c41(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x79e1
leaq 0x12c28(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl 0x8(%rax), %r8d
movl $0x5, %esi
leaq 0xad35(%rip), %rdx      # 0x1270f
movb $0x0, %al
callq 0xbf40
jmp 0x79e3
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::addConnection(beyondy::Async::Connection*, int)
int EventManager::addConnection(Connection *connection, int events)
{
	if (addHandler(connection, events) < 0) {
		SYSLOG_ERROR("can not add connection fd=%d flow=%d", connection->fd, connection->flow);
		return -1;
	}

	/* init it */
	gettimeofday(&connection->tsLastRead, NULL);
	_list_add_tail(&connection->lruEntry, &lruHead);

	SYSLOG_DEBUG("addConneciton fd=%d flow=%d OK", connection->fd, connection->flow);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x7700
cmpl $0x0, %eax
jge 0x7a9e
jmp 0x7a4e
leaq 0x12b93(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x7a93
leaq 0x12b7a(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r8d
movl $0x2, %esi
leaq 0xaac2(%rip), %rdx      # 0x1254e
movb $0x0, %al
callq 0xbf40
jmp 0x7a95
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7b12
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
addq $0x20, %rsi
callq 0x79f0
leaq 0x12b1d(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x7b09
leaq 0x12b04(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r8d
movl $0x5, %esi
leaq 0xaa71(%rip), %rdx      # 0x12573
movb $0x0, %al
callq 0xbf40
jmp 0x7b0b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::modifyConnection(beyondy::Async::Connection*, int, int)
int EventManager::modifyConnection(Connection *connection, int add, int remove)
{
	struct epoll_event ee;
	int retval;

	ee.events = (connection->events | add) & ~remove;
	ee.data.ptr = (void *)(EventHandler *)connection;

	retval = epoll_ctl(epoll_fd, EPOLL_CTL_MOD, connection->fd, &ee);
	if (retval == 0) {
		connection->events = ee.events;
		SYSLOG_DEBUG("modifyConneciton fd=%d flow=%d events=%d OK", connection->fd, connection->flow, ee.events);
	}
	else {
		SYSLOG_DEBUG("modifyConneciton fd=%d flow=%d events=%d failed: %m", connection->fd, connection->flow, ee.events);
	}

	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
orl -0x14(%rbp), %ecx
movl -0x18(%rbp), %edx
xorl $-0x1, %edx
andl %edx, %ecx
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
movl $0x3, %esi
leaq -0x24(%rbp), %rcx
callq 0x3550
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x7bce
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
leaq 0x12a60(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x7bca
leaq 0x12a47(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %r8d
movl -0x24(%rbp), %r9d
movl $0x5, %esi
leaq 0xa9cf(%rip), %rdx      # 0x12592
movb $0x0, %al
callq 0xbf40
jmp 0x7bcc
jmp 0x7c1d
jmp 0x7bd0
leaq 0x12a11(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x7c19
leaq 0x129f8(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %r8d
movl -0x24(%rbp), %r9d
movl $0x5, %esi
leaq 0xa9ac(%rip), %rdx      # 0x125be
movb $0x0, %al
callq 0xbf40
jmp 0x7c1b
jmp 0x7c1d
movl -0x28(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::deleteConnection(beyondy::Async::Connection*)
int EventManager::deleteConnection(Connection *connection)
{
	struct epoll_event ee;
	int retval;

	ee.events = 0;
	ee.data.ptr = (void *)(EventHandler *)connection;

	if (!(retval = epoll_ctl(epoll_fd, EPOLL_CTL_DEL, connection->fd, &ee))) {
		_list_del(&connection->lruEntry);

		SYSLOG_ERROR("delete connection fd=%d flow=%d", connection->fd, connection->flow);
	}
	else {
		SYSLOG_ERROR("delete connection fd=%d flow=%d failed: %m", connection->fd, connection->flow);
	}
	
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
movl $0x2, %esi
leaq -0x1c(%rbp), %rcx
callq 0x3550
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
jne 0x7cc8
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x7d20
leaq 0x12962(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x7cc4
leaq 0x12949(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %r8d
movl $0x2, %esi
leaq 0xa935(%rip), %rdx      # 0x125f2
movb $0x0, %al
callq 0xbf40
jmp 0x7cc6
jmp 0x7d13
jmp 0x7cca
leaq 0x12917(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x7d0f
leaq 0x128fe(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %r8d
movl $0x2, %esi
leaq 0xa90a(%rip), %rdx      # 0x12612
movb $0x0, %al
callq 0xbf40
jmp 0x7d11
jmp 0x7d13
movl -0x20(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::flow2Connection(int)
Connection *EventManager::flow2Connection(int flow)
{
	struct rb_node *n = flowRoot.rb_node;
	Connection *connection;

	while (n != NULL) {
		connection = rb_entry(n, Connection, flowEntry);
		if (flow < connection->flow)
			n = n->rb_left;
		else if (flow > connection->flow)
			n = n->rb_right;
		else
			return connection;
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7dd8
movq -0x20(%rbp), %rax
movl $0x1, %ecx
addq $0x38, %rcx
subq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x7db0
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x7dd6
movl -0x14(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jle 0x7dca
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x7dd4
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7de0
jmp 0x7dd6
jmp 0x7d77
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::__insert(int, rb_node*)
Connection *EventManager::__insert(int flow, struct rb_node *node)
{
	struct rb_node **p = &flowRoot.rb_node;
	struct rb_node *parent = NULL;
	struct Connection *connection;

	while (*p != NULL) {
		parent = *p;
		connection = rb_entry(parent, Connection, flowEntry);
		if (flow > connection->flow)
			p = &(*p)->rb_right;
		else if (flow < connection->flow)
			p = &(*p)->rb_left;
		else
			return connection;
	}

	rb_link_node(node, parent, p);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
je 0x7e8c
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl $0x1, %ecx
addq $0x38, %rcx
subq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jle 0x7e61
movq -0x28(%rbp), %rax
movq (%rax), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
jmp 0x7e8a
movl -0x14(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x7e7e
movq -0x28(%rbp), %rax
movq (%rax), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
jmp 0x7e88
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7ea5
jmp 0x7e8a
jmp 0x7e17
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x7eb0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::unmapFlow(beyondy::Async::Connection*)
int EventManager::unmapFlow(Connection *connection)
{
	assert(flow2Connection(connection->flow) != NULL);
	SYSLOG_DEBUG("upmapFlow=%d => %d", connection->flow, connection->fd);
		
	rb_erase(&connection->flowEntry, &flowRoot);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x7d60
cmpq $0x0, %rax
je 0x7f1c
jmp 0x7f3b
leaq 0xa786(%rip), %rdi      # 0x126a9
leaq 0xa731(%rip), %rsi      # 0x1265b
movl $0xe6, %edx
leaq 0xa79d(%rip), %rcx      # 0x126d3
callq 0x3250
jmp 0x7f3d
leaq 0x126a4(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x7f82
leaq 0x1268b(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r8d
movl $0x5, %esi
leaq 0xa792(%rip), %rdx      # 0x1270d
movb $0x0, %al
callq 0xbf40
jmp 0x7f84
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
addq $0x48, %rsi
callq 0xd2e0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::waitingEvents()
int EventManager::waitingEvents()
{
	BPROF_TRACE(BPT_EM_WAITING)
	// TODO: wtime = min(gap-to-next-timer, 10ms)
	long wtime = 10; /* 1s */

	event_next = event_total = 0;
	int cnt = epoll_wait(epoll_fd, epoll_events, epoll_size, wtime);
	if (cnt >= 0) event_total = cnt;

	return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0xa, -0x10(%rbp)
movl $0x0, 0x8(%rax)
movl $0x0, 0x4(%rax)
movl (%rax), %edi
movq 0x10(%rax), %rsi
movl 0xc(%rax), %edx
movq -0x10(%rbp), %rax
movl %eax, %ecx
callq 0x3190
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x8001
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::handleEvent(int, beyondy::Async::EventHandler*, int)
void EventManager::handleEvent(int fd, EventHandler *handler, int event)
{
	BPROF_TRACE(BPT_EM_HEVENT)
	int retval = 0;

	if ((event & EVENT_OUT) && (retval = handler->onWritable(fd)) < 0) {
		SYSLOG_ERROR("fd=%d onWritable failed", handler->fd);
	}

	if (retval >= 0 && (event & EVENT_IN) && (retval = handler->onReadable(fd)) < 0) {
		SYSLOG_ERROR("fd=%d onReadable failed", handler->fd);
	}

	if (retval < 0 || (event & EVENT_ERR)) {
		SYSLOG_ERROR("fd=%d got retval=%d or ERR event=%d", fd, retval, event);
		retval = handler->onError(fd);
		// Note!!!
		// handler is not available now
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x1c(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x8090
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
jge 0x8090
jmp 0x804f
leaq 0x12592(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x808c
leaq 0x12579(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movl $0x2, %esi
leaq 0xa69b(%rip), %rdx      # 0x12720
movb $0x0, %al
callq 0xbf40
jmp 0x808e
jmp 0x8090
cmpl $0x0, -0x20(%rbp)
jl 0x80f9
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x80f9
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movq (%rdi), %rax
callq *0x10(%rax)
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
jge 0x80f9
jmp 0x80b8
leaq 0x12529(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x80f5
leaq 0x12510(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
movl $0x2, %esi
leaq 0xa64a(%rip), %rdx      # 0x12738
movb $0x0, %al
callq 0xbf40
jmp 0x80f7
jmp 0x80f9
cmpl $0x0, -0x20(%rbp)
jl 0x810a
movl -0x1c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x815f
jmp 0x810c
leaq 0x124d5(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x814d
leaq 0x124bc(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl -0xc(%rbp), %ecx
movl -0x20(%rbp), %r8d
movl -0x1c(%rbp), %r9d
movl $0x2, %esi
leaq 0xa60a(%rip), %rdx      # 0x12750
movb $0x0, %al
callq 0xbf40
jmp 0x814f
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movq (%rdi), %rax
callq *0x20(%rax)
movl %eax, -0x20(%rbp)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::handleEvents()
void EventManager::handleEvents()
{
	BPROF_TRACE(BPT_EM_HEVENTS)

	for (event_next = 0; event_next < event_total; ++event_next) {
		struct epoll_event *ee = &epoll_events[event_next];
		EventHandler *handler = static_cast<EventHandler *>(ee->data.ptr);
		handleEvent(handler->fd, handler, ee->events);
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, 0x4(%rax)
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %eax
cmpl 0x8(%rcx), %eax
jge 0x81df
movq -0x20(%rbp), %rdi
movq 0x10(%rdi), %rax
movslq 0x4(%rdi), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x4(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
callq 0x8010
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x818b
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::dispatchOutMessage()
void EventManager::dispatchOutMessage()
{
	BPROF_TRACE(BPT_EM_DISPATCH)

	for (int i = 0; i < perCheckOutQueue; ++i) {
		Message *msg = outQueue->pop();
		if (msg == NULL)
			break;

		gettimeofday(&msg->ts_dequeue, NULL);
		int flow = msg->flow;

		Connection *connection = flow2Connection(flow);
		if (connection == NULL) {
			SYSLOG_ERROR("can not find connection for fd=%d flow=%d discard it", msg->fd, msg->flow);
			// TODO: how to call proc-onSent(msg, SS_SOCKET_NON_EXIST)
			Message::destroy(msg);
			continue;
		}
		
		int retval = connection->sendMessage(msg);
		if (retval != 0) {
			// msg has been freed
			SYSLOG_ERROR("sendMessage to fd=%d flow=%d failed", connection->fd, flow);
			continue;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x38(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x54(%rcx), %eax
jge 0x8330
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x86e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x823c
jmp 0x8330
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0x7d60
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x82c2
jmp 0x8270
leaq 0x12371(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x82b5
leaq 0x12358(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x28(%rax), %r8d
movl $0x2, %esi
leaq 0xa4c6(%rip), %rdx      # 0x12774
movb $0x0, %al
callq 0xbf40
jmp 0x82b7
movq -0x18(%rbp), %rdi
callq 0xc3b0
jmp 0x8322
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq (%rdi), %rax
callq *0x28(%rax)
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x8320
jmp 0x82db
leaq 0x12306(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x831c
leaq 0x122ed(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
movl -0x1c(%rbp), %r8d
movl $0x2, %esi
leaq 0xa494(%rip), %rdx      # 0x127a9
movb $0x0, %al
callq 0xbf40
jmp 0x831e
jmp 0x8322
jmp 0x8322
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x820b
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::checkTimeout()
void EventManager::checkTimeout()
{
	BPROF_TRACE(BPT_EM_CHKTIMEOUT)
	struct timeval tNow;
	struct list_head *pl, *pn;

	gettimeofday(&tNow, NULL);
	list_for_each_safe(pl, pn, &lruHead) {
		Connection *connection = list_entry(pl, Connection, lruEntry);
		if (TV2MS(connection->tsLastRead, tNow) > connectionMaxIdle) {
			SYSLOG_ERROR("connection fd=%d flow=%d timed out. close it now.", connection->fd, connection->flow);
			connection->onError(connection->fd);
			continue;
		}

		// the rest should be more active
		// so no need check this time.
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
addq $0x20, %rcx
cmpq %rcx, %rax
je 0x8461
movq -0x38(%rbp), %rcx
xorl %eax, %eax
movl $0x1, %edx
addq $0x18, %rdx
subq %rdx, %rax
addq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rdx
subq 0x28(%rdx), %rax
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rdx
subq 0x30(%rdx), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq %rax, %rdx
movq -0x40(%rbp), %rax
addq %rdx, %rax
movslq 0x60(%rcx), %rcx
cmpq %rcx, %rax
jle 0x8447
jmp 0x83ed
leaq 0x121f4(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x8432
leaq 0x121db(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r8d
movl $0x2, %esi
leaq 0xa3a2(%rip), %rdx      # 0x127cd
movb $0x0, %al
callq 0xbf40
jmp 0x8434
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %esi
movq (%rdi), %rax
callq *0x20(%rax)
jmp 0x8449
jmp 0x8461
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x8378
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::reconnectWhenNecessary()
void EventManager::reconnectWhenNecessary()
{
	struct timeval tNow;
	struct list_head *pl, *pn;

	gettimeofday(&tNow, NULL);
	list_for_each_safe(pl, pn, &connectorsHead) {
		Connector *connector = list_entry(pl, Connector, connectorsEntry);
		if (connector->getStatus() == Connector::CONN_CLOSE
				&& TV2MS(connector->tsLastClosed, tNow) > (connector->cntRetryConnect + 1) * reconnectDelay) {
			SYSLOG_ERROR("connector flow=%d is closed, re-connecting it", connector->flow);
			if (connector->open() < 0) {
				SYSLOG_WARN("re-connecting for low=%ld failed: %m", connector->flow);
				// retry next time but update tsLastClosed to avoid connect too often
			}

		}

		connector->checkMessageExpiration();
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
addq $0x30, %rcx
cmpq %rcx, %rax
je 0x85ff
xorl %eax, %eax
movl $0x1, %ecx
addq $0x90, %rcx
subq %rcx, %rax
addq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x8780
cmpl $0x0, %eax
jne 0x85de
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
subq 0xa0(%rcx), %rax
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
subq 0xa8(%rcx), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq -0x38(%rbp), %rdx
movq %rax, %rcx
movq -0x40(%rbp), %rax
addq %rcx, %rax
movq -0x30(%rbp), %rcx
movl 0xb0(%rcx), %ecx
addl $0x1, %ecx
imull 0x6c(%rdx), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jle 0x85de
jmp 0x854c
leaq 0x12095(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x8589
leaq 0x1207c(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
movl $0x2, %esi
leaq 0xa27d(%rip), %rdx      # 0x127ff
movb $0x0, %al
callq 0xbf40
jmp 0x858b
movq -0x30(%rbp), %rdi
callq 0xb0f0
cmpl $0x0, %eax
jge 0x85dc
jmp 0x859b
leaq 0x12046(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x3, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x85d8
leaq 0x1202d(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
movl $0x3, %esi
leaq 0xa25c(%rip), %rdx      # 0x1282d
movb $0x0, %al
callq 0xbf40
jmp 0x85da
jmp 0x85dc
jmp 0x85de
movq -0x30(%rbp), %rdi
callq 0xa960
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x84a8
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/EventManager.cpp
// Function: beyondy::Async::EventManager::start()
int EventManager::start()
{
	/* start it */
	isRunning = 1;

	while (isRunning) {
		BPROF_TRACE(BPT_LOOP)

		waitingEvents();

		handleEvents();

		// check outQueue
		dispatchOutMessage();

		// timeout check
		checkTimeout();

		// re-connect for connectors if they are broken
		reconnectWhenNecessary();
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x1, 0x50(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x50(%rax)
je 0x8664
movq -0x10(%rbp), %rdi
callq 0x7fb0
movq -0x10(%rbp), %rdi
callq 0x8170
movq -0x10(%rbp), %rdi
callq 0x81f0
movq -0x10(%rbp), %rdi
callq 0x8340
movq -0x10(%rbp), %rdi
callq 0x8470
jmp 0x862b
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: roberty65[P]bServer/frame/main/./Queue.h
// Function: beyondy::Async::Queue<beyondy::Async::Message>::pop(long)
T* Queue<T>::pop(long ms) 
{
	pthread_mutex_lock(&lock);
	if (queue.empty() && ms > 0) {
		// TODO:		
		pthread_cond_wait(&cond, &lock);
	}

	T *obj = NULL;
	if (!queue.empty()) {
		obj = queue.front();
		queue.pop();
	}
	
	pthread_mutex_unlock(&lock);
	return obj;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
callq 0x35d0
movq -0x20(%rbp), %rdi
addq $0x60, %rdi
callq 0x87a0
testb $0x1, %al
jne 0x8710
jmp 0x8727
cmpq $0x0, -0x10(%rbp)
jle 0x8727
movq -0x20(%rbp), %rsi
movq %rsi, %rdi
addq $0x28, %rdi
callq 0x3600
movq -0x20(%rbp), %rdi
movq $0x0, -0x18(%rbp)
addq $0x60, %rdi
callq 0x87a0
testb $0x1, %al
jne 0x8761
movq -0x20(%rbp), %rdi
addq $0x60, %rdi
callq 0x87c0
movq -0x20(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x18(%rbp)
addq $0x60, %rdi
callq 0x87e0
movq -0x20(%rbp), %rdi
callq 0x32d0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: roberty65[P]bServer/frame/main/MtWorker.cpp
// Function: beyondy::Async::MtWorker::workerEntry()
void MtWorker::workerEntry()
{
	int no = workerId();
	SYSLOG_DEBUG("thread-%d (TID=%lu) start...", no, (unsigned long)pthread_self());

	while (isRunning) {
		Message *msg = inQueue->pop(10);
		if (msg == NULL) {
			// TODO: idle
			continue;
		}

		gettimeofday(&msg->ts_dequeue, NULL);
		proc->onMessage(msg);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
callq 0x8c00
movl %eax, -0xc(%rbp)
leaq 0x11a95(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x8b9b
leaq 0x11a7c(%rip), %rax     # 0x1a5e8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
callq 0x3360
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %ecx
movq %rax, %r8
movl $0x5, %esi
leaq 0x9cbe(%rip), %rdx      # 0x12852
movb $0x0, %al
callq 0xbf40
jmp 0x8b9d
jmp 0x8b9f
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0x8bee
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl $0xa, %esi
callq 0x86e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x8bc9
jmp 0x8b9f
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
jmp 0x8b9f
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/MtWorker.cpp
// Function: beyondy::Async::MtWorker::workerId()
int MtWorker::workerId()
{
	int no = -1;

	for (int i = 0; i < tcnt; ++i) {
		if (pthread_equal(tids[i], pthread_self())) {
			no = i;
			break;
		}
	}

	return no;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x10(%rbp)
movq -0x18(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0x14(%rcx), %eax
jge 0x8c6d
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
callq 0x3360
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x3680
cmpl $0x0, %eax
je 0x8c60
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x8c6d
jmp 0x8c62
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8c22
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/MtWorker.cpp
// Function: beyondy::Async::MtWorker::start()
int MtWorker::start()
{
	isRunning = 1;
	for (int i = 0; i < tcnt; ++i) {
		int retval = pthread_create(&tids[i], NULL, __workerEntry, (void *)this);
		if (retval != 0) {
			errno = retval;
			return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x1, 0x10(%rax)
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x14(%rcx), %eax
jge 0x8d00
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rdi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x1cc(%rip), %rdx      # 0x8b00
callq 0x36d0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x8cf3
movl -0x18(%rbp), %eax
movl %eax, -0x24(%rbp)
callq 0x3060
movl -0x24(%rbp), %ecx
movl %ecx, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8d07
jmp 0x8cf5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8ca2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: roberty65[P]bServer/frame/main/MtWorker.cpp
// Function: beyondy::Async::MtWorker::stop()
int MtWorker::stop()
{
	isRunning = 0;
	for (int i = 0; i < tcnt; ++i) {
		pthread_join(tids[i], NULL);
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, 0x10(%rax)
movl $0x0, -0xc(%rbp)
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x14(%rcx), %eax
jge 0x8d62
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3370
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8d32
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: roberty65[P]bServer/frame/main/Processor.cpp
// Function: beyondy::Async::async_send_delegator(beyondy::Async::Message*, void*)
int async_send_delegator(Message *msg, void *data)
{
	// set it
	gettimeofday(&msg->ts_enqueue, NULL);

	Queue<Message> *outQ = (Queue<Message> *)data;
	if (outQ->push(msg) < 0) {
		SYSLOG_ERROR("push msg(fd=%d, flow=%d size=%ld) into system queue overflow", msg->fd, msg->flow, (long)msg->getWptr());
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8e30
cmpl $0x0, %eax
jge 0x8e1d
jmp 0x8dad
leaq 0x11834(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0x8e12
leaq 0x1181b(%rip), %rax     # 0x1a5e8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8eb0
movq -0x30(%rbp), %rdi
movl -0x28(%rbp), %ecx
movl -0x24(%rbp), %r8d
movq %rax, %r9
movl $0x2, %esi
leaq 0x9a64(%rip), %rdx      # 0x1286f
movb $0x0, %al
callq 0xbf40
jmp 0x8e14
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8e24
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: roberty65[P]bServer/frame/main/./Queue.h
// Function: beyondy::Async::Queue<beyondy::Async::Message>::push(beyondy::Async::Message*)
int Queue<T>::push(T *obj)
{
	int retval = 0;

	pthread_mutex_lock(&lock);
	if (queue.size() < maxSize) queue.push(obj);
	else retval = -1;

	pthread_cond_signal(&cond);
	pthread_mutex_unlock(&lock);

	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
callq 0x35d0
movq -0x20(%rbp), %rdi
addq $0x60, %rdi
callq 0x8ed0
movq -0x20(%rbp), %rcx
cmpq 0x58(%rcx), %rax
jae 0x8e7e
movq -0x20(%rbp), %rdi
addq $0x60, %rdi
leaq -0x10(%rbp), %rsi
callq 0x8ef0
jmp 0x8e85
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
callq 0x3030
movq -0x20(%rbp), %rdi
callq 0x32d0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: roberty65[P]bServer/frame/main/Connection.cpp
// Function: beyondy::Async::Connection::Connection(int, int, beyondy::Async::EventManager*, beyondy::Async::Queue<beyondy::Async::Message>*, beyondy::Async::Processor*, int, void*)
Connection::Connection(int _fd, int _flow, EventManager *_emgr, Queue<Message> *_inQueue, Processor *_proc, int _creatorType, void *_parent)
	: EventHandler(_fd), flow(_flow),
	  inMsg(NULL), inQueue(_inQueue),
	  outMsg(NULL), outQueue(new std::deque<Message*>()),
	  emgr(_emgr), proc(_proc),
	  creatorType(_creatorType)
{
	if (creatorType == CT_LISTENER)
		this->parentListener = static_cast<Listener *>(_parent);
	else
		this->parentData = _parent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movl -0xc(%rbp), %esi
callq 0xaba0
movq -0x50(%rbp), %rax
leaq 0x104a0(%rip), %rcx     # 0x19c50
movq %rcx, (%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x10(%rax)
movq $0x0, 0x50(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq $0x0, 0x60(%rax)
addq $0x68, %rax
movq %rax, -0x48(%rbp)
movl $0x50, %edi
callq 0x33c0
movq %rax, -0x40(%rbp)
jmp 0x97e9
movq -0x40(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x6940
jmp 0x980a
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq %rdx, (%rcx)
movq -0x18(%rbp), %rcx
movq %rcx, 0x70(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x78(%rax)
movl 0x10(%rbp), %ecx
movl %ecx, 0x80(%rax)
cmpl $0x0, 0x80(%rax)
jne 0x9876
movq -0x50(%rbp), %rax
movq 0x18(%rbp), %rcx
movq %rcx, 0x88(%rax)
jmp 0x9885
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x988b
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x50, %esi
callq 0x33d0
jmp 0x988b
movq -0x50(%rbp), %rax
movq 0x18(%rbp), %rcx
movq %rcx, 0x88(%rax)
addq $0x50, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0xad50
movq -0x30(%rbp), %rdi
callq 0x3690
nopl (%rax)
// File: roberty65[P]bServer/frame/main/Connection.cpp
// Function: beyondy::Async::Connection::readN(unsigned long)
ssize_t Connection::readN(size_t size)
{
	assert(size > 0);
	ssize_t rlen = ::read(fd, inMsg->wb(), size);
	++inMsg->ioCount;

	if ((size_t)rlen == size) {
		inMsg->incWptr(rlen);
		return rlen;
	}
	else if (rlen > 0) {
		inMsg->incWptr(rlen);
		return rlen;
	}
	else if (rlen == 0) {
		/* closed by peer. reset errno */
		SYSLOG_ERROR("connection fd=%d flow=%d has been closed by peer", fd, flow);
		return errno = 0, -1;
	}

	/* error with errno set */
	SYSLOG_ERROR("connection fd=%d flow=%d read error: %m", fd, flow);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
jbe 0x9f91
jmp 0x9fb0
leaq 0x8eec(%rip), %rdi      # 0x12e84
leaq 0x894c(%rip), %rsi      # 0x128eb
movl $0x111, %edx            # imm = 0x111
leaq 0x8ee2(%rip), %rcx      # 0x12e8d
callq 0x3250
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
movl %ecx, -0x2c(%rbp)
movq 0x50(%rax), %rdi
callq 0xac80
movl -0x2c(%rbp), %edi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x35b0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x50(%rax), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0xa012
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xaca0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa0e9
cmpq $0x0, -0x20(%rbp)
jle 0xa037
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xaca0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa0e9
cmpq $0x0, -0x20(%rbp)
jne 0xa098
jmp 0xa040
leaq 0x105a1(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0xa081
movq -0x28(%rbp), %rax
leaq 0x10584(%rip), %rcx     # 0x1a5e8
movq (%rcx), %rdi
movl 0x8(%rax), %ecx
movl 0x10(%rax), %r8d
movl $0x2, %esi
leaq 0x8e45(%rip), %rdx      # 0x12ebf
movb $0x0, %al
callq 0xbf40
jmp 0xa083
callq 0x3060
movl $0x0, (%rax)
movq $-0x1, -0x8(%rbp)
jmp 0xa0e9
jmp 0xa09a
jmp 0xa09c
jmp 0xa09e
leaq 0x10543(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0xa0df
movq -0x28(%rbp), %rax
leaq 0x10526(%rip), %rcx     # 0x1a5e8
movq (%rcx), %rdi
movl 0x8(%rax), %ecx
movl 0x10(%rax), %r8d
movl $0x2, %esi
leaq 0x8e18(%rip), %rdx      # 0x12ef0
movb $0x0, %al
callq 0xbf40
jmp 0xa0e1
movq $-0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/Connection.cpp
// Function: beyondy::Async::Connection::writeN(beyondy::Async::Message*, unsigned long)
ssize_t Connection::writeN(Message *msg, size_t size) 
{
	BPROF_TRACE(BPT_CONN_WRITEN)

	assert(size > 0);
	ssize_t wlen = ::write(fd, msg->rb(), size);
	++msg->ioCount;

	if ((size_t)wlen == size) {
		msg->incRptr(wlen);
		return wlen;
	}
	else if (wlen > 0) {
		msg->incRptr(wlen);
		return wlen;
	}
	else {
		SYSLOG_ERROR("connection fd=%d flow=%d write error: %m", fd, flow);
	}

	/* error */
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jbe 0xa465
jmp 0xa484
leaq 0x8a18(%rip), %rdi      # 0x12e84
leaq 0x8478(%rip), %rsi      # 0x128eb
movl $0x12c, %edx            # imm = 0x12C
leaq 0x8a99(%rip), %rcx      # 0x12f18
callq 0x3250
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rdi
callq 0xacc0
movl -0x34(%rbp), %edi
movq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x3100
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0xa4d8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xace0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa547
cmpq $0x0, -0x28(%rbp)
jle 0xa4f6
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xace0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xa547
jmp 0xa4f8
leaq 0x100e9(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0xa539
movq -0x30(%rbp), %rax
leaq 0x100cc(%rip), %rcx     # 0x1a5e8
movq (%rcx), %rdi
movl 0x8(%rax), %ecx
movl 0x10(%rax), %r8d
movl $0x2, %esi
leaq 0x8a24(%rip), %rdx      # 0x12f56
movb $0x0, %al
callq 0xbf40
jmp 0xa53b
jmp 0xa53d
jmp 0xa53f
movq $-0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/Connection.cpp
// Function: beyondy::Async::Connection::onError(int)
int Connection::onError(int fd) {
	assert(this->fd == fd);
	SYSLOG_DEBUG("connection fd=%d flow=%d onError", fd, flow);

	int retval = destroy();
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x8(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0xa581
jmp 0xa5a0
leaq 0x8354(%rip), %rdi      # 0x128dc
leaq 0x835c(%rip), %rsi      # 0x128eb
movl $0xaa, %edx
leaq 0x8737(%rip), %rcx      # 0x12cd2
callq 0x3250
jmp 0xa5a2
leaq 0x1003f(%rip), %rax     # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0xa5e3
movq -0x18(%rbp), %rax
leaq 0x10022(%rip), %rcx     # 0x1a5e8
movq (%rcx), %rdi
movl -0xc(%rbp), %ecx
movl 0x10(%rax), %r8d
movl $0x5, %esi
leaq 0x872b(%rip), %rdx      # 0x12d07
movb $0x0, %al
callq 0xbf40
jmp 0xa5e5
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: roberty65[P]bServer/frame/main/Connection.cpp
// Function: beyondy::Async::Connection::checkMessageExpiration()
void Connection::checkMessageExpiration()
{
	struct timeval tNow;
	gettimeofday(&tNow, NULL);

	// TODO: how to check sending message?
	while (!outQueue->empty()) {
		Message *msg = outQueue->front();
		if (TV2MS(msg->ts_enqueue, tNow) < emgr->getOutMessageExpire())
			break;

		SYSLOG_ERROR("connection fd=%d flow=%d msg(size=%ld) expired in queue", fd, flow, (long)msg->getWptr());

		outQueue->pop_front();
		proc->onSent(msg, SS_TIMEDOUT);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x8800
xorb $-0x1, %al
testb $0x1, %al
jne 0xa999
jmp 0xaa8e
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x8860
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
subq 0x40(%rcx), %rax
imulq $0x3e8, %rax, %rcx      # imm = 0x3E8
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rdx
subq 0x48(%rdx), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq %rax, %rdx
movq -0x28(%rbp), %rax
addq %rdx, %rcx
movq %rcx, -0x30(%rbp)
movq 0x70(%rax), %rdi
callq 0xac60
movl %eax, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0xaa00
jmp 0xaa8e
jmp 0xaa02
leaq 0xfbdf(%rip), %rax      # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0xaa63
movq -0x28(%rbp), %rax
leaq 0xfbc2(%rip), %rcx      # 0x1a5e8
movq (%rcx), %rcx
movq %rcx, -0x40(%rbp)
movl 0x8(%rax), %ecx
movl %ecx, -0x38(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8eb0
movq -0x40(%rbp), %rdi
movl -0x38(%rbp), %ecx
movl -0x34(%rbp), %r8d
movq %rax, %r9
movl $0x2, %esi
leaq 0x83f0(%rip), %rdx      # 0x12e4c
movb $0x0, %al
callq 0xbf40
jmp 0xaa65
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x8920
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x20(%rbp), %rsi
movq (%rdi), %rax
movl $0x1, %edx
callq *0x38(%rax)
jmp 0xa981
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/Connection.cpp
// Function: beyondy::Async::Connection::destroy()
int Connection::destroy() {
	/* notify un-sent message */
	if (inMsg != NULL) {
		Message::destroy(inMsg);
		inMsg = NULL;
	}

	if (outMsg != NULL) {
		proc->onSent(outMsg, SS_DESTROY);
		outMsg = NULL;
	}

	while (!outQueue->empty()) {
		outMsg = outQueue->front(); outQueue->pop_front();
		proc->onSent(outMsg, SS_DESTROY);
	}
	
	if (this->creatorType == CT_LISTENER) {
		Listener *listener = this->parentListener;
		proc->onDisconnected(flow);
		listener->destroyConnection(this);
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, 0x50(%rax)
je 0xaad4
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xc3b0
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0xab02
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movq 0x60(%rax), %rsi
movq (%rdi), %rax
movl $0x5, %edx
callq *0x38(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x60(%rax)
jmp 0xab04
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x8800
xorb $-0x1, %al
testb $0x1, %al
jne 0xab19
jmp 0xab56
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x8860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, 0x60(%rax)
movq 0x68(%rax), %rdi
callq 0x8920
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movq 0x60(%rax), %rsi
movq (%rdi), %rax
movl $0x5, %edx
callq *0x38(%rax)
jmp 0xab04
movq -0x18(%rbp), %rax
cmpl $0x0, 0x80(%rax)
jne 0xab8d
movq -0x18(%rbp), %rsi
movq 0x88(%rsi), %rax
movq %rax, -0x10(%rbp)
movq 0x78(%rsi), %rdi
addq $0x10, %rsi
movq (%rdi), %rax
callq *0x48(%rax)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0xbd60
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: roberty65[P]bServer/frame/main/Connector.cpp
// Function: beyondy::Async::Connector::Connector(int, char const*, beyondy::Async::EventManager*, beyondy::Async::Queue<beyondy::Async::Message>*, beyondy::Async::Processor*)
Connector::Connector(int _flow, const char *_address, EventManager *_emgr, Queue<Message> *_inQueue, Processor *_proc)
	: Connection(-1, _flow, _emgr, _inQueue, _proc, CT_CONNECTOR, NULL), status(CONN_CLOSE)
{
	strncpy(address, _address, sizeof(address));
	address[sizeof(address) - 1] = 0;

	gettimeofday(&tsLastClosed, NULL);
	cntRetryConnect = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movl -0xc(%rbp), %edx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl $0x1, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x9770
movq -0x38(%rbp), %rdi
leaq 0xeecb(%rip), %rax      # 0x19ce8
addq $0x10, %rax
movq %rax, (%rdi)
movl $0x0, 0xb4(%rdi)
addq $0xb8, %rdi
movq -0x18(%rbp), %rsi
movl $0x80, %edx
callq 0x31b0
movq -0x38(%rbp), %rdi
movb $0x0, 0x137(%rdi)
addq $0xa0, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3630
movq -0x38(%rbp), %rax
movl $0x0, 0xb0(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: roberty65[P]bServer/frame/main/Connector.cpp
// Function: beyondy::Async::Connector::open()
int Connector::open()
{
	fd = XbsClient(address, O_NONBLOCK, 0);
	if (++cntRetryConnect >= 5) cntRetryConnect = 0;

	if (fd >= 0) {
		if (errno == EINPROGRESS) {
			events = EVENT_OUT;
			status = CONN_OPENNING;
		}
		else {
			cntRetryConnect = 0;
			events = EVENT_IN;
			status = CONN_ESTABLISHED;
		}
	} 
	else {
		return -1;
	}

	SYSLOG_DEBUG("connector(%s) open OK, fd=%d flow=%d, status=%d", address, fd, flow, (int)status);
	int retval = emgr->addConnection(this, events);
	if (retval < 0) {
		// TODO: 
		::close(fd); fd = -1;
		status = CONN_CLOSE;

		SYSLOG_ERROR("connector(%s) addConnection got error: %m", address);
		return retval;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0xb8, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
movl %eax, %edx
callq 0xce60
movq -0x20(%rbp), %rcx
movl %eax, 0x8(%rcx)
movl 0xb0(%rcx), %eax
addl $0x1, %eax
movl %eax, 0xb0(%rcx)
cmpl $0x5, %eax
jl 0xb142
movq -0x20(%rbp), %rax
movl $0x0, 0xb0(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jl 0xb18e
callq 0x3060
cmpl $0x73, (%rax)
jne 0xb16d
movq -0x20(%rbp), %rax
movl $0x4, 0xc(%rax)
movl $0x1, 0xb4(%rax)
jmp 0xb18c
movq -0x20(%rbp), %rax
movl $0x0, 0xb0(%rax)
movl $0x1, 0xc(%rax)
movl $0x2, 0xb4(%rax)
jmp 0xb19a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb27f
jmp 0xb19c
leaq 0xf445(%rip), %rax      # 0x1a5e8
movq (%rax), %rdi
movl $0x5, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0xb1f1
movq -0x20(%rbp), %rax
leaq 0xf428(%rip), %rcx      # 0x1a5e8
movq (%rcx), %rdi
movq %rax, %rcx
addq $0xb8, %rcx
movl 0x8(%rax), %r8d
movl 0x10(%rax), %r9d
movl 0xb4(%rax), %eax
movl $0x5, %esi
leaq 0x7eda(%rip), %rdx      # 0x130c1
movl %eax, (%rsp)
movb $0x0, %al
callq 0xbf40
jmp 0xb1f3
movq -0x20(%rbp), %rsi
movq 0x70(%rsi), %rdi
movl 0xc(%rsi), %edx
callq 0x7a20
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xb278
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x3710
movq -0x20(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl $0x0, 0xb4(%rax)
leaq 0xf3b4(%rip), %rax      # 0x1a5e8
movq (%rax), %rdi
movl $0x2, %esi
callq 0x4b50
cmpl $0x0, %eax
je 0xb26e
movq -0x20(%rbp), %rcx
leaq 0xf397(%rip), %rax      # 0x1a5e8
movq (%rax), %rdi
addq $0xb8, %rcx
movl $0x2, %esi
leaq 0x7e8a(%rip), %rdx      # 0x130f1
movb $0x0, %al
callq 0xbf40
jmp 0xb270
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xb27f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)