LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_psubscribe_command_handler
void channel_psubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPatternSubscribe *req = (ProtocolRequestChannelPatternSubscribe*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_PSUBSCRIBE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer3(req->body.pattern, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	psubscribe_channel_t(channel, client, req->body.pattern);

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x67, 0x20(%rdi)
ja 0x7f07
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7fa1
movq 0x10(%rbx), %r12
movabsq $0x2000000000024, %rax  # imm = 0x2000000000024
testq %rax, 0x8(%rbx)
je 0x7f93
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x7f83
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x5458
testl %eax, %eax
je 0x7f83
leaq 0xa342(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
testq %rax, %rax
je 0x7fb1
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xa388
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7fa1
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7fa1
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7fa1
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_unsubscribe_command_handler
void channel_unsubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelUnsubscribe *req = (ProtocolRequestChannelUnsubscribe*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_UNSUBSCRIBE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer1(req->body.topic, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (unsubscribe_channel_t(channel, client, req->body.topic) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
	}

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x67, 0x20(%rdi)
ja 0x7fe2
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x8097
movq 0x10(%rbx), %r12
movabsq $0x4000000000024, %rax  # imm = 0x4000000000024
testq %rax, 0x8(%rbx)
je 0x8089
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x8079
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x52ce
testl %eax, %eax
je 0x8079
leaq 0xa263(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
testq %rax, %rax
je 0x80a7
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xa419
testl %eax, %eax
je 0x8069
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x8097
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x8097
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x8097
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_punsubscribe_command_handler
void channel_punsubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPatternUnsubscribe *req = (ProtocolRequestChannelPatternUnsubscribe*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_PUNSUBSCRIBE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64) || !check_input_buffer3(req->body.pattern, 32)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (punsubscribe_channel_t(channel, client, req->body.pattern) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
	}

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x67, 0x20(%rdi)
ja 0x80d8
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x818d
movq 0x10(%rbx), %r12
movabsq $0x8000000000024, %rax  # imm = 0x8000000000024
testq %rax, 0x8(%rbx)
je 0x817f
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x816f
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x5458
testl %eax, %eax
je 0x816f
leaq 0xa16d(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
testq %rax, %rax
je 0x819d
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xa510
testl %eax, %eax
je 0x815f
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x818d
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x818d
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x818d
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_delete_command_handler
void channel_delete_command_handler(EagleClient *client)
{
	ProtocolRequestChannelDelete *req = (ProtocolRequestChannelDelete*)client->request;
	Channel_t *channel;

	if (client->pos < sizeof(*req)) {
		add_status_response(client, 0, EG_PROTOCOL_STATUS_ERROR_PACKET);
		return;
	}

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_DELETE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (!check_input_buffer2(req->body.name, 64)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	channel = find_channel_t(server->channels, req->body.name);
	if (!channel) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (list_delete_value(server->channels, channel) == EG_STATUS_ERR) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x81ce
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x826f
movq 0x10(%rbx), %r15
movabsq $0x10000000000024, %rax # imm = 0x10000000000024
testq %rax, 0x8(%rbx)
je 0x823d
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x824c
leaq 0xa092(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
testq %rax, %rax
je 0x825b
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x8d73
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x826a
movl $0x1, %edx
jmp 0x826f
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x826f
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x826f
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x826f
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_client_event_notify
void queue_client_event_notify(EagleClient *client, Queue_t *queue_t)
{
	ProtocolEventQueueNotify *event = (ProtocolEventQueueNotify*)xcalloc(sizeof(*event));

	set_event_header(&event->header, EG_PROTOCOL_CMD_QUEUE_SUBSCRIBE, EG_PROTOCOL_EVENT_NOTIFY, sizeof(event->body));

	memcpy(event->body.name, queue_t->name, strlenz(queue_t->name));

	add_response(client, event, sizeof(*event));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x48, %edi
callq 0x47f6
movq %rax, %r15
movabsq $0x40012d0090, %rax     # imm = 0x40012D0090
movq %rax, (%r15)
leaq 0x8(%r15), %r12
movq %rbx, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2280
movq %r14, %rdi
movq %r15, %rsi
movl $0x48, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5836
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_client_event_message
void queue_client_event_message(EagleClient *client, Queue_t *queue_t, Message *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_QUEUE_SUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 64 + EG_MESSAGE_SIZE(msg));

	buffer = (char*)xcalloc(sizeof(header) + 64);

	memcpy(buffer, &header, sizeof(header));
	memcpy(buffer + sizeof(header), queue_t->name, strlenz(queue_t->name));

	add_response(client, buffer, sizeof(header) + 64);
	add_object_response(client, EG_MESSAGE_OBJECT(msg));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdx), %rax
movq 0x8(%rax), %r13
movl $0x48, %edi
callq 0x47f6
movq %rax, %r12
shlq $0x20, %r13
movabsq $0x40022d0090, %rax     # imm = 0x40022D0090
addq %r13, %rax
movq %rax, (%r12)
leaq 0x8(%r12), %r13
movq %r15, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2280
movq %r14, %rdi
movq %r12, %rsi
movl $0x48, %edx
callq 0x5836
movq (%rbx), %rsi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x69c6
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_client_event_message
void channel_client_event_message(EagleClient *client, Channel_t *channel, const char *topic, Object *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_CHANNEL_SUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 96 + EG_OBJECT_SIZE(msg));

	buffer = (char*)xcalloc(sizeof(header) + 96);

	memcpy(buffer, &header, sizeof(header));
	memcpy(buffer + sizeof(header), channel->name, strlenz(channel->name));
	memcpy(buffer + sizeof(header) + 64, topic, strlenz(topic));

	add_response(client, buffer, sizeof(header) + 96);
	add_object_response(client, msg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
movq 0x8(%rcx), %rbp
movl $0x68, %edi
callq 0x47f6
movq %rax, %r12
shlq $0x20, %rbp
movabsq $0x60023f0090, %rax     # imm = 0x60023F0090
addq %rbp, %rax
movq %rax, (%r12)
leaq 0x8(%r12), %rbp
movq %r13, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2280
leaq 0x48(%r12), %r13
movq %r15, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2280
movq %r14, %rdi
movq %r12, %rsi
movl $0x68, %edx
callq 0x5836
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x69c6
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: client_timeout
void client_timeout(void)
{
	EagleClient *client;
	ListIterator iterator;
	ListNode *node;

	if (server->client_timeout)
	{
		list_rewind(server->clients, &iterator);
		while ((node = list_next_node(&iterator)) != NULL)
		{
			client = EG_LIST_NODE_VALUE(node);
			if ((server->now_time - client->last_action) > server->client_timeout) {
				free_client(client);
			}
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x9b7d(%rip), %r14      # 0x12290
movq (%r14), %rax
cmpl $0x0, 0x58(%rax)
je 0x876f
movq 0x160(%rax), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x8ed9
movq %rbx, %rdi
callq 0x8e98
testq %rax, %rax
je 0x876f
leaq 0x8(%rsp), %rbx
movq 0x10(%rax), %rdi
movq (%r14), %rax
movq 0x188(%rax), %rcx
subq 0x78(%rdi), %rcx
movslq 0x58(%rax), %rax
cmpq %rax, %rcx
jle 0x8762
callq 0x5aed
movq %rbx, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x8742
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: create_client
EagleClient *create_client(int fd)
{
	EagleClient *client = (EagleClient*)xmalloc(sizeof(*client));

	net_set_nonblock(NULL, fd);
	net_tcp_nodelay(NULL, fd);

	if (create_file_event(server->loop, fd, EG_EVENT_READABLE, read_request, client) == EG_EVENT_ERR) {
		close(fd);
		xfree(client);
		return NULL;
	}

	client->fd = fd;
	client->perm = 0;
	client->request = (char*)xmalloc(EG_BUF_SIZE);
	client->length = EG_BUF_SIZE;
	client->pos = 0;
	client->noack = 0;
	client->offset = 0;
	client->buffer = (char*)xmalloc(EG_BUF_SIZE);
	client->bodylen = 0;
	client->nread = 0;
	client->responses = list_create();
	client->declared_queues = list_create();
	client->subscribed_queues = list_create();
	client->subscribed_topics = keylist_create();
	client->subscribed_patterns = keylist_create();
	client->sentlen = 0;
	client->last_action = time(NULL);

	EG_LIST_SET_FREE_METHOD(client->responses, free_object_list_handler);

	list_add_value_tail(server->clients, client);

	return client;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x80, %edi
callq 0x4770
movq %rax, %rbx
xorl %edi, %edi
movl %ebp, %esi
callq 0x42ec
xorl %edi, %edi
movl %ebp, %esi
callq 0x43ea
leaq 0x9aea(%rip), %r14      # 0x12290
movq (%r14), %rax
movq (%rax), %rdi
leaq -0xfa(%rip), %rcx       # 0x86b9
movl %ebp, %esi
movl $0x1, %edx
movq %rbx, %r8
callq 0x3c0f
cmpl $-0x1, %eax
je 0x8865
movl %ebp, (%rbx)
xorl %r15d, %r15d
movq %r15, 0x8(%rbx)
movl $0x8000, %edi           # imm = 0x8000
callq 0x4770
movq %rax, 0x10(%rbx)
movq $0x8000, 0x18(%rbx)     # imm = 0x8000
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movl $0x8000, %edi           # imm = 0x8000
callq 0x4770
movq %rax, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
callq 0x8c60
movq %rax, 0x48(%rbx)
callq 0x8c60
movq %rax, 0x50(%rbx)
callq 0x8c60
movq %rax, 0x58(%rbx)
callq 0x8a98
movq %rax, 0x60(%rbx)
callq 0x8a98
movq %rax, 0x68(%rbx)
movq %r15, 0x70(%rbx)
xorl %edi, %edi
callq 0x22a0
movq %rax, 0x78(%rbx)
movq 0x48(%rbx), %rax
leaq -0x32c4(%rip), %rcx     # 0x5589
movq %rcx, 0x10(%rax)
movq (%r14), %rax
movq 0x160(%rax), %rdi
movq %rbx, %rsi
callq 0x8d1a
jmp 0x8876
movl %ebp, %edi
callq 0x21d0
movq %rbx, %rdi
callq 0x4997
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: accept_tcp_handler
void accept_tcp_handler(EventLoop *loop, int fd, void *data, int mask)
{
	int port, cfd;
	char ip[128];

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);
	EG_NOTUSED(data);

	cfd = net_tcp_accept(server->error, fd, ip, &port);
	if (cfd == EG_NET_ERR) {
		warning("Error accept client: %s", server->error);
		return;
	}

	accept_common_handler(cfd);
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
leaq 0x99fd(%rip), %rbx      # 0x12290
movq (%rbx), %rdi
addq $0x60, %rdi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x4697
cmpl $-0x1, %eax
je 0x88b7
movl %eax, %edi
callq 0x88d5
jmp 0x88cc
movq (%rbx), %rsi
addq $0x60, %rsi
leaq 0x3e6b(%rip), %rdi      # 0xc730
xorl %eax, %eax
callq 0x4bc8
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: accept_common_handler
static void accept_common_handler(int fd)
{
	EagleClient *client;

	if ((client = create_client(fd)) == NULL) {
		close(fd);
		return;
	}

	if (EG_LIST_LENGTH(server->clients) > server->max_clients) {
		free_client(client);
	}
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x8777
testq %rax, %rax
je 0x8905
leaq 0x99a7(%rip), %rcx      # 0x12290
movq (%rcx), %rcx
movq 0x160(%rcx), %rdx
movl 0x20(%rdx), %edx
cmpq %rdx, 0x48(%rcx)
jae 0x890d
movq %rax, %rdi
popq %rbx
jmp 0x5aed
movl %ebx, %edi
popq %rbx
jmp 0x21d0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: accept_unix_handler
void accept_unix_handler(EventLoop *loop, int fd, void *data, int mask)
{
	int cfd;

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);
	EG_NOTUSED(data);

	cfd = net_unix_accept(server->error, fd);
	if (cfd == EG_NET_ERR) {
		warning("Accepting client connection: %s", server->error);
		return;
	}

	accept_common_handler(cfd);
}

// Assembly:
pushq %rbx
leaq 0x9979(%rip), %rbx      # 0x12290
movq (%rbx), %rdi
addq $0x60, %rdi
callq 0x474f
cmpl $-0x1, %eax
je 0x892d
movl %eax, %edi
popq %rbx
jmp 0x88d5
movq (%rbx), %rsi
addq $0x60, %rsi
leaq 0x3e0d(%rip), %rdi      # 0xc748
xorl %eax, %eax
popq %rbx
jmp 0x4bc8
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: set_write_event
static int set_write_event(EagleClient *client)
{
	if (client->fd <= 0) {
		return EG_STATUS_ERR;
	}

	if (create_file_event(server->loop, client->fd, EG_EVENT_WRITABLE, send_response, client) == EG_EVENT_ERR &&
			EG_LIST_LENGTH(client->responses) == 0) {
		return EG_STATUS_ERR;
	}

    return EG_STATUS_OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %esi
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %esi, %esi
jle 0x8987
movq %rdi, %r14
leaq 0x9934(%rip), %rax      # 0x12290
movq (%rax), %rax
movq (%rax), %rdi
leaq 0x28(%rip), %rcx        # 0x8991
movl $0x2, %edx
movq %r14, %r8
callq 0x3c0f
cmpl $-0x1, %eax
jne 0x8985
movq 0x48(%r14), %rax
cmpl $0x0, 0x20(%rax)
je 0x8987
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: send_response
static void send_response(EventLoop *loop, int fd, void *data, int mask)
{
	EagleClient *client = data;
	Object *object;
	int nwritten = 0, totwritten = 0;

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);

	while (EG_LIST_LENGTH(client->responses))
	{
		object = EG_LIST_NODE_VALUE(EG_LIST_FIRST(client->responses));

		if (EG_OBJECT_SIZE(object) == 0) {
			list_delete_node(client->responses, EG_LIST_FIRST(client->responses));
			continue;
		}

		nwritten = write(fd, ((char*)EG_OBJECT_DATA(object)) + client->sentlen, EG_OBJECT_SIZE(object) - client->sentlen);
		if (nwritten <= 0) {
			break;
		}

		client->sentlen += nwritten;
		totwritten += nwritten;

		if (client->sentlen == EG_OBJECT_SIZE(object)) {
			list_delete_node(client->responses, EG_LIST_FIRST(client->responses));
			client->sentlen = 0;
		}
	}

	if (nwritten == -1) {
		if (errno == EAGAIN) {
			nwritten = 0;
		} else {
			free_client(client);
			return;
		}
	}

	if (totwritten > 0) {
		client->last_action = time(NULL);
	}

	if (EG_LIST_LENGTH(client->responses) == 0) {
		client->sentlen = 0;
		delete_file_event(server->loop, client->fd, EG_EVENT_WRITABLE);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq 0x48(%rdx), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x8a4b
movl %esi, %ebp
xorl %r15d, %r15d
xorl %r14d, %r14d
movq (%rdi), %rsi
movq 0x10(%rsi), %r12
movq 0x8(%r12), %rdx
testq %rdx, %rdx
jne 0x89d4
callq 0x8e17
movq 0x48(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
jne 0x89b2
jmp 0x8a2b
movq 0x70(%rbx), %rax
movq (%r12), %rsi
addq %rax, %rsi
subq %rax, %rdx
movl %ebp, %edi
callq 0x20f0
movq %rax, %r14
testl %r14d, %r14d
jle 0x8a2b
movl %r14d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq 0x70(%rbx), %rax
movq %rax, 0x70(%rbx)
cmpq 0x8(%r12), %rax
jne 0x8a1c
movq 0x48(%rbx), %rdi
movq (%rdi), %rsi
callq 0x8e17
movq $0x0, 0x70(%rbx)
addl %r14d, %r15d
movq 0x48(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
jne 0x89b2
jmp 0x8a3b
cmpl $-0x1, %r14d
jne 0x8a3b
callq 0x2050
cmpl $0xb, (%rax)
jne 0x8a87
testl %r15d, %r15d
jle 0x8a4b
xorl %edi, %edi
callq 0x22a0
movq %rax, 0x78(%rbx)
movq 0x48(%rbx), %rax
cmpl $0x0, 0x20(%rax)
je 0x8a5e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x70(%rbx)
leaq 0x9823(%rip), %rax      # 0x12290
movq (%rax), %rax
movq (%rax), %rdi
movl (%rbx), %esi
movl $0x2, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3cd4
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5aed
nop
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_release
void keylist_release(Keylist *keylist)
{
	unsigned int len;
	KeylistNode *current, *next;

	current = keylist->head;
	len = keylist->len;

	while (len--) {
		next = current->next;

		if (keylist->free) {
			keylist->free(current->key, current->value);
		}

		xfree(current);
		current = next;
	}

	xfree(keylist);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x20(%rdi), %ebp
testl %ebp, %ebp
je 0x8af2
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8ae1
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x4997
movq %r15, %r14
testl %ebp, %ebp
jne 0x8aca
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4997
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_get_value
KeylistNode *keylist_get_value(Keylist *keylist, void *key)
{
	KeylistIterator iter;
	KeylistNode *node;

	keylist_rewind(keylist, &iter);
	while ((node = keylist_next_node(&iter)) != NULL)
	{
		if (keylist->match) {
			if (keylist->match(node->key, key)) {
				return node;
			}
		} else {
			if (node->key == key) {
				return node;
			}
		}
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x8b43
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rbx), %r12
movq 0x10(%rbx), %rdi
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x8b36
movq %r14, %rsi
callq *%rax
testl %eax, %eax
je 0x8b3b
jmp 0x8b45
cmpq %r14, %rdi
je 0x8b45
movq %r12, %rbx
testq %r12, %r12
jne 0x8b1a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_set_value
Keylist *keylist_set_value(Keylist *keylist, void *key, void *value)
{
	KeylistNode *node = keylist_get_value(keylist, key);

	if (node != NULL) {
		node->value = value;
		return keylist;
	}

	node = (KeylistNode*)xmalloc(sizeof(*node));

	node->key = key;
	node->value = value;

	if (keylist->len == 0) {
		keylist->head = keylist->tail = node;
		node->prev = node->next = NULL;
	} else {
		node->prev = keylist->tail;
		node->next = NULL;
		keylist->tail->next = node;
		keylist->tail = node;
	}

	keylist->len++;

	return keylist;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r12
testq %r12, %r12
je 0x8bb0
movq 0x8(%r12), %r13
movq 0x10(%r12), %rdi
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x8ba3
movq %r15, %rsi
callq *%rax
testl %eax, %eax
je 0x8ba8
jmp 0x8bdf
cmpq %r15, %rdi
je 0x8bdf
movq %r13, %r12
testq %r13, %r13
jne 0x8b85
movl $0x20, %edi
callq 0x4770
movq %r15, 0x10(%rax)
movq %r14, 0x18(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x8be6
movq 0x8(%rbx), %rdx
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x8bf7
movq %r14, 0x18(%r12)
jmp 0x8bff
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
movq $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, (%rax)
incl %ecx
movl %ecx, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/keylist.c
// Function: keylist_delete_node
void keylist_delete_node(Keylist *keylist, KeylistNode *node)
{
	if (node->prev) {
		node->prev->next = node->next;
	} else {
		keylist->head = node->next;
	}

	if (node->next) {
		node->next->prev = node->prev;
	} else {
		keylist->tail = node->prev;
	}

	if (keylist->free) {
		keylist->free(node->key, node->value);
	}

	xfree(node);
	keylist->len--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rdi, %rdx
leaq 0x8(%rdi), %rsi
testq %rcx, %rcx
cmovneq %rcx, %rsi
movq %rcx, (%rdx)
movq %rax, (%rsi)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x8c4c
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
callq *%rax
movq %r14, %rdi
callq 0x4997
decl 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/list.c
// Function: list_release
void list_release(List *list)
{
	unsigned int len;
	ListNode *current, *next;

	current = list->head;
	len = list->len;

	while (len--) {
		next = current->next;

		if (list->free) {
			list->free(current->value);
		}

		xfree(current);
		current = next;
	}

	xfree(list);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x20(%rdi), %ebp
testl %ebp, %ebp
je 0x8cb6
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8ca5
movq 0x10(%r14), %rdi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x4997
movq %r15, %r14
testl %ebp, %ebp
jne 0x8c92
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4997
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/list.c
// Function: list_add_value_head
List *list_add_value_head(List *list, void *value)
{
	ListNode *node;

	node = (ListNode*)xmalloc(sizeof(*node));

	node->value = value;

	if (list->len == 0) {
		list->head = list->tail = node;
		node->prev = node->next = NULL;
	} else {
		node->prev = NULL;
		node->next = list->head;
		list->head->prev = node;
		list->head = node;
	}

	list->len++;

	return list;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x4770
movq %r14, 0x10(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x8cf6
movq $0x0, (%rax)
movq (%rbx), %rdx
movq %rax, (%rdx)
jmp 0x8d03
movq %rax, 0x8(%rbx)
movq $0x0, (%rax)
xorl %edx, %edx
movq %rax, (%rbx)
movq %rdx, 0x8(%rax)
incl %ecx
movl %ecx, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/list.c
// Function: list_add_value_tail
List *list_add_value_tail(List *list, void *value)
{
	ListNode *node;

	node = (ListNode*)xmalloc(sizeof(*node));

	node->value = value;

	if (list->len == 0) {
		list->head = list->tail = node;
		node->prev = node->next = NULL;
	} else {
		node->prev = list->tail;
		node->next = NULL;
		list->tail->next = node;
		list->tail = node;
	}

	list->len++;

	return list;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x4770
movq %r14, 0x10(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x8d4f
movq 0x8(%rbx), %rdx
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x8d60
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
movq $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, (%rax)
incl %ecx
movl %ecx, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/list.c
// Function: list_search_node
ListNode *list_search_node(List *list, void *value)
{
	ListIterator *iter;
	ListNode *node;

	iter = list_get_iterator(list, EG_START_HEAD);

	while ((node = list_next_node(iter)) != NULL) {
		if (list->match) {
			if (list->match(node->value, value)) {
				list_release_iterator(iter);
				return node;
			}
		} else {
			if (node->value == value) {
				list_release_iterator(iter);
				return node;
			}
		}
	}

	list_release_iterator(iter);

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x10, %edi
callq 0x4770
movq %rax, %rbx
movq (%r15), %r12
movq %r12, (%rax)
movl $0x0, 0x8(%rax)
testq %r12, %r12
je 0x8dfd
xorl %eax, %eax
cmpl $0x0, 0x8(%rbx)
sete %al
movq (%r12,%rax,8), %rax
movq %rax, (%rbx)
movq 0x18(%r15), %rcx
movq 0x10(%r12), %rdi
testq %rcx, %rcx
je 0x8df0
movq %r14, %rsi
callq *%rcx
testl %eax, %eax
jne 0x8e00
movq (%rbx), %rax
jmp 0x8df5
cmpq %r14, %rdi
je 0x8e00
movq %rax, %r12
testq %rax, %rax
jne 0x8dc4
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x4997
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/list.c
// Function: list_delete_node
void list_delete_node(List *list, ListNode *node)
{
	if (node->prev) {
		node->prev->next = node->next;
	} else {
		list->head = node->next;
	}

	if (node->next) {
		node->next->prev = node->prev;
	} else {
		list->tail = node->prev;
	}

	if (list->free) {
		list->free(node->value);
	}

	xfree(node);
	list->len--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rdi, %rdx
leaq 0x8(%rdi), %rsi
testq %rcx, %rcx
cmovneq %rcx, %rsi
movq %rcx, (%rdx)
movq %rax, (%rsi)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x8e53
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x4997
decl 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue.c
// Function: queue_release
void queue_release(Queue *queue)
{
	unsigned int len;
	QueueNode *current, *next;

	current = queue->head;
	len = queue->len;

	while (len--) {
		next = current->next;

		if (queue->free) {
			queue->free(current->value);
		}

		xfree(current);
		current = next;
	}

    xfree(queue);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x18(%rdi), %ebp
testl %ebp, %ebp
je 0x8f37
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8f26
movq 0x10(%r14), %rdi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x4997
movq %r15, %r14
testl %ebp, %ebp
jne 0x8f13
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4997
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue.c
// Function: queue_push_value_head
Queue *queue_push_value_head(Queue *queue, void *value)
{
	QueueNode *node;

	node = (QueueNode*)xmalloc(sizeof(*node));

	node->value = value;

	if (queue->len == 0) {
		queue->head = queue->tail = node;
		node->prev = node->next = NULL;
	} else {
		node->prev = NULL;
		node->next = queue->head;
		queue->head->prev = node;
		queue->head = node;
	}

	queue->len++;

	return queue;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x4770
movq %r14, 0x10(%rax)
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
je 0x8f77
movq $0x0, (%rax)
movq (%rbx), %rdx
movq %rax, (%rdx)
jmp 0x8f84
movq %rax, 0x8(%rbx)
movq $0x0, (%rax)
xorl %edx, %edx
movq %rax, (%rbx)
movq %rdx, 0x8(%rax)
incl %ecx
movl %ecx, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue.c
// Function: queue_push_value_tail
Queue *queue_push_value_tail(Queue *queue, void *value)
{
	QueueNode *node;

	node = (QueueNode*)xmalloc(sizeof(*node));

	node->value = value;

	if (queue->len == 0) {
		queue->head = queue->tail = node;
		node->prev = node->next = NULL;
	} else {
		node->prev = queue->tail;
		node->next = NULL;
		queue->tail->next = node;
		queue->tail = node;
	}

	queue->len++;

	return queue;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x4770
movq %r14, 0x10(%rax)
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
je 0x8fd0
movq 0x8(%rbx), %rdx
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x8fe1
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
movq $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, (%rax)
incl %ecx
movl %ecx, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue.c
// Function: queue_pop_value
void *queue_pop_value(Queue *queue)
{
	QueueNode *prev;
	void *value;

	if (!queue->len) {
		return NULL;
	}

	value = EG_QUEUE_NODE_VALUE(queue->tail);
	prev = queue->tail->prev;

	xfree(queue->tail);

	queue->tail = prev;
	queue->len--;

	return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x18(%rdi)
je 0x902e
movq %rdi, %r14
movq 0x8(%rdi), %rdi
movq (%rdi), %r15
movq 0x10(%rdi), %rbx
callq 0x4997
movq %r15, 0x8(%r14)
decl 0x18(%r14)
jmp 0x9030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue.c
// Function: queue_purge
Queue *queue_purge(Queue *queue)
{
	unsigned int len;
	QueueNode *current, *next;

	current = queue->head;
	len = queue->len;

	while (len--) {
		next = current->next;

		if (queue->free) {
			queue->free(current->value);
		}

		xfree(current);
		current = next;
	}

	queue->len = 0;

	return queue;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x18(%rdi), %ebp
testl %ebp, %ebp
je 0x9071
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x9060
movq 0x10(%r14), %rdi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x4997
movq %r15, %r14
testl %ebp, %ebp
jne 0x904d
movl $0x0, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue.c
// Function: queue_delete_node
void queue_delete_node(Queue *queue, QueueNode *node)
{
	if (node->prev) {
		node->prev->next = node->next;
	} else {
		queue->head = node->next;
	}

	if (node->next) {
		node->next->prev = node->prev;
	} else {
		queue->tail = node->prev;
	}

	if (queue->free) {
		queue->free(node->value);
	}

	xfree(node);
	queue->len--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rdi, %rdx
leaq 0x8(%rdi), %rsi
testq %rcx, %rcx
cmovneq %rcx, %rsi
movq %rcx, (%rdx)
movq %rax, (%rsi)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x90c2
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x4997
decl 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/user.c
// Function: create_user
EagleUser *create_user(const char *name, const char *password, uint64_t perm)
{
	EagleUser *user = (EagleUser*)xmalloc(sizeof(*user));

	memcpy(user->name, name, strlenz(name));
	memcpy(user->password, password, strlenz(password));

	user->perm = perm;

	return user;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x48, %edi
callq 0x4770
movq %rax, %r12
movq %r15, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2280
leaq 0x20(%r12), %r15
movq %r14, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2280
movq %rbx, 0x40(%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/user.c
// Function: find_user
EagleUser *find_user(List *list, const char *name, const char *password)
{
	EagleUser *user;
	ListNode *node;
	ListIterator iterator;

	list_rewind(list, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		user = EG_LIST_NODE_VALUE(node);

		if (password != NULL) {
			if (!strcmp(user->name, name) && !strcmp(user->password, password)) {
				return user;
			}
		} else {
			if (!strcmp(user->name, name)) {
				return user;
			}
		}
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x8ed9
movq %r15, %rdi
callq 0x8e98
testq %rax, %rax
je 0x9200
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2230
testq %rbx, %rbx
je 0x91ef
testl %eax, %eax
jne 0x91f3
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x2230
testl %eax, %eax
je 0x9203
movq %r15, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x91ca
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/message.c
// Function: create_message
Message *create_message(Object *data, uint64_t tag, uint32_t expiration)
{
	Message *msg = (Message*)xcalloc(sizeof(*msg));

	msg->value = data;
	msg->tag = tag;
	msg->confirm = 0;
	msg->expiration = expiration;

	return msg;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl $0x28, %edi
callq 0x47f6
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl $0x0, 0x10(%rax)
movl %ebx, 0x14(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: create_queue_t
Queue_t *create_queue_t(const char *name, uint32_t max_msg, uint32_t max_msg_size, uint32_t flags)
{
	Queue_t *queue_t = (Queue_t*)xmalloc(sizeof(*queue_t));

	memcpy(queue_t->name, name, strlenz(name));

	queue_t->max_msg = max_msg;
	queue_t->max_msg_size = max_msg_size;
	queue_t->flags = flags;

	queue_t->auto_delete = 0;
	queue_t->force_push = 0;
	queue_t->round_robin = 0;

	if (BIT_CHECK(queue_t->flags, EG_QUEUE_AUTODELETE_FLAG)) {
		queue_t->auto_delete = 1;
	}

	if (BIT_CHECK(queue_t->flags, EG_QUEUE_FORCE_PUSH_FLAG)) {
		queue_t->force_push = 1;
	}

	if (BIT_CHECK(queue_t->flags, EG_QUEUE_ROUND_ROBIN_FLAG)) {
		queue_t->round_robin = 1;
	}

	queue_t->queue = queue_create();
	queue_t->expire_messages = list_create();
	queue_t->confirm_messages = list_create();
	queue_t->declared_clients = list_create();
	queue_t->subscribed_clients_msg = list_create();
	queue_t->subscribed_clients_notify = list_create();
	queue_t->routes = keylist_create();

	EG_QUEUE_SET_FREE_METHOD(queue_t->queue, free_message_list_handler);
	EG_KEYLIST_SET_FREE_METHOD(queue_t->routes, free_route_keylist_handler);
	EG_KEYLIST_SET_MATCH_METHOD(queue_t->routes, match_route_keylist_handler);

	return queue_t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
movl $0x90, %edi
callq 0x4770
movq %rax, %rbx
movq %r12, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2280
movl %r15d, 0x40(%rbx)
movl %r14d, 0x44(%rbx)
movl %ebp, 0x48(%rbx)
movq $0x0, 0x4c(%rbx)
movl $0x0, 0x54(%rbx)
testb $0x1, %bpl
je 0x9302
movl $0x1, 0x4c(%rbx)
testb $0x2, %bpl
je 0x930f
movl $0x1, 0x50(%rbx)
testb $0x4, %bpl
je 0x931c
movl $0x1, 0x54(%rbx)
callq 0x8ee8
movq %rax, 0x58(%rbx)
callq 0x8c60
movq %rax, 0x60(%rbx)
callq 0x8c60
movq %rax, 0x68(%rbx)
callq 0x8c60
movq %rax, 0x70(%rbx)
callq 0x8c60
movq %rax, 0x78(%rbx)
callq 0x8c60
movq %rax, 0x80(%rbx)
callq 0x8a98
movq %rax, 0x88(%rbx)
movq 0x58(%rbx), %rcx
leaq -0xdd(%rip), %rdx       # 0x928f
movq %rdx, 0x10(%rcx)
leaq 0x1b(%rip), %rcx        # 0x9392
movq %rcx, 0x10(%rax)
leaq 0x22(%rip), %rcx        # 0x93a4
movq %rcx, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: delete_queue_t
void delete_queue_t(Queue_t *queue_t)
{
	eject_clients_queue_t(queue_t);
	eject_routes_queue_t(queue_t);

	list_release(queue_t->expire_messages);
	list_release(queue_t->confirm_messages);
	list_release(queue_t->declared_clients);
	list_release(queue_t->subscribed_clients_msg);
	list_release(queue_t->subscribed_clients_notify);

	keylist_release(queue_t->routes);

	queue_release(queue_t->queue);

	xfree(queue_t);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x70(%rdi), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x940b
movq %rsp, %r14
movq 0x10(%rax), %r15
movq 0x50(%r15), %rdi
movq %rbx, %rsi
callq 0x8d73
movq 0x70(%rbx), %rdi
movq %r15, %rsi
callq 0x8d73
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x93e2
movq 0x78(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x9459
movq %rax, %r15
movq %rsp, %r14
movq 0x10(%r15), %rax
movq 0x58(%rax), %rdi
movq %rbx, %rsi
callq 0x8d73
movq 0x78(%rbx), %rdi
movq %r15, %rsi
callq 0x8e17
movq %r14, %rdi
callq 0x8e98
movq %rax, %r15
testq %rax, %rax
jne 0x942d
movq 0x80(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x94ad
movq %rax, %r15
movq %rsp, %r14
movq 0x10(%r15), %rax
movq 0x58(%rax), %rdi
movq %rbx, %rsi
callq 0x8d73
movq 0x80(%rbx), %rdi
movq %r15, %rsi
callq 0x8e17
movq %r14, %rdi
callq 0x8e98
movq %rax, %r15
testq %rax, %rax
jne 0x947e
movq 0x88(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x8b54
movq %r14, %rdi
callq 0x8b5b
testq %rax, %rax
je 0x9511
movq %rsp, %r14
leaq 0x10(%rsp), %r15
movq 0x10(%rax), %r12
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x9504
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9e03
jmp 0x94e6
movq %r15, %rdi
callq 0x8b5b
testq %rax, %rax
jne 0x94d6
movq 0x60(%rbx), %rdi
callq 0x8c7e
movq 0x68(%rbx), %rdi
callq 0x8c7e
movq 0x70(%rbx), %rdi
callq 0x8c7e
movq 0x78(%rbx), %rdi
callq 0x8c7e
movq 0x80(%rbx), %rdi
callq 0x8c7e
movq 0x88(%rbx), %rdi
callq 0x8ab6
movq 0x58(%rbx), %rdi
callq 0x8eff
movq %rbx, %rdi
callq 0x4997
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: push_message_queue_t
int push_message_queue_t(Queue_t *queue_t, Object *data, uint32_t expiration)
{
	Message *msg;
	uint64_t tag = make_message_tag(server->msg_counter++, server->now_timems);

	msg = create_message(data, tag, expiration);

	if (EG_MESSAGE_SIZE(msg) > queue_t->max_msg_size) {
		return EG_STATUS_ERR;
	}

	if (process_subscribed_clients(queue_t, msg)) {
		release_message(msg);
		return EG_STATUS_OK;
	}

	if (EG_QUEUE_LENGTH(queue_t->queue) >= queue_t->max_msg)
	{
		if (queue_t->force_push) {
			pop_message_queue_t(queue_t, 0);
		} else {
			return EG_STATUS_ERR;
		}
	}

	queue_push_value_head(queue_t->queue, msg);

	if (msg->expiration)
	{
		list_add_value_tail(queue_t->expire_messages, msg);
		EG_MESSAGE_SET_DATA(msg, 0, EG_LIST_LAST(queue_t->expire_messages));
		EG_MESSAGE_SET_DATA(msg, 1, EG_QUEUE_FIRST(queue_t->queue));
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8d0b(%rip), %rax      # 0x12290
movq (%rax), %rax
movl 0x190(%rax), %esi
movl 0x1b4(%rax), %edi
leal 0x1(%rdi), %ecx
movl %ecx, 0x1b4(%rax)
callq 0x51af
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x924c
movq %rax, %r14
movq (%rax), %rax
movl 0x44(%rbx), %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %rcx, 0x8(%rax)
ja 0x96d7
movq 0x78(%rbx), %rdi
movb $0x1, %r12b
cmpl $0x0, 0x20(%rdi)
je 0x9631
cmpl $0x0, 0x54(%rbx)
je 0x95f7
callq 0x8eb1
movq 0x78(%rbx), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x82dd
jmp 0x962e
movq %rsp, %r15
movq %r15, %rsi
callq 0x8ed9
movq %r15, %rdi
callq 0x8e98
testq %rax, %rax
je 0x9631
movq %rsp, %r15
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x82dd
movq %r15, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x9612
xorl %r12d, %r12d
movq 0x80(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x9672
movq %rsp, %r15
movq %r15, %rsi
callq 0x8ed9
movq %r15, %rdi
callq 0x8e98
testq %rax, %rax
je 0x9672
movq %rsp, %r15
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x827f
movq %r15, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x9659
testb %r12b, %r12b
je 0x96cd
movq 0x58(%rbx), %rdi
movl 0x18(%rdi), %eax
cmpl 0x40(%rbx), %eax
jb 0x9697
cmpl $0x0, 0x50(%rbx)
je 0x96d7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x96e6
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x8f49
xorl %ebp, %ebp
cmpl $0x0, 0x14(%r14)
je 0x96d7
movq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x8d1a
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%r14)
movq 0x58(%rbx), %rax
movq (%rax), %rax
movq %rax, 0x20(%r14)
jmp 0x96d7
movq %r14, %rdi
callq 0x927a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: pop_message_queue_t
void pop_message_queue_t(Queue_t *queue_t, uint32_t timeout)
{
	Message *msg = queue_pop_value(queue_t->queue);

	if (msg->expiration) {
		list_delete_node(queue_t->expire_messages, EG_MESSAGE_GET_DATA(msg, 0));
	}

	if (timeout) {
		EG_MESSAGE_SET_CONFIRM_TIME(msg, server->now_timems + timeout);
		list_add_value_tail(queue_t->confirm_messages, msg);
	} else {
		release_message(msg);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
callq 0x9006
movq %rax, %r14
cmpl $0x0, 0x14(%rax)
je 0x970e
movq 0x60(%rbx), %rdi
movq 0x18(%r14), %rsi
callq 0x8e17
testl %ebp, %ebp
je 0x9736
leaq 0x8b77(%rip), %rax      # 0x12290
movq (%rax), %rax
addl 0x190(%rax), %ebp
movl %ebp, 0x10(%r14)
movq 0x68(%rbx), %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x8d1a
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x927a
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: confirm_message_queue_t
int confirm_message_queue_t(Queue_t *queue_t, uint64_t tag)
{
	ListNode *node;
	ListIterator iterator;
	Message *msg;

	list_rewind(queue_t->confirm_messages, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		msg = EG_LIST_NODE_VALUE(node);

		if (EG_MESSAGE_GET_TAG(msg) == tag)
		{
			list_delete_node(queue_t->confirm_messages, node);
			release_message(msg);
			return EG_STATUS_OK;
		}
	}

	return EG_STATUS_ERR;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x8ed9
movq %r15, %rdi
callq 0x8e98
testq %rax, %rax
je 0x979d
movq 0x10(%rax), %r12
cmpq %r14, 0x8(%r12)
jne 0x976d
movq 0x68(%rbx), %rdi
movq %rax, %rsi
callq 0x8e17
movq %r12, %rdi
callq 0x927a
xorl %eax, %eax
jmp 0x97a2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq