LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x7a63
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7afd
movq 0x10(%rbx), %r12
movabsq $0x2000000000024, %rax  # imm = 0x2000000000024
testq %rax, 0x8(%rbx)
je 0x7aef
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7adf
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x4fc8
testl %eax, %eax
je 0x7adf
leaq 0xa7e6(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7b0d
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x9f0a
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7afd
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7afd
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7afd
// File: /workspace/github_c_makefile_star2_O1/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 0x7b3e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7bf3
movq 0x10(%rbx), %r12
movabsq $0x4000000000024, %rax  # imm = 0x4000000000024
testq %rax, 0x8(%rbx)
je 0x7be5
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7bd5
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x4e66
testl %eax, %eax
je 0x7bd5
leaq 0xa707(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7c03
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x9fa4
testl %eax, %eax
je 0x7bc5
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7bf3
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7bf3
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7bf3
// File: /workspace/github_c_makefile_star2_O1/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 0x7c34
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7ce9
movq 0x10(%rbx), %r12
movabsq $0x8000000000024, %rax  # imm = 0x8000000000024
testq %rax, 0x8(%rbx)
je 0x7cdb
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7ccb
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x4fc8
testl %eax, %eax
je 0x7ccb
leaq 0xa611(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7cf9
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xa09b
testl %eax, %eax
je 0x7cbb
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
callq 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7ce9
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7ce9
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7ce9
// File: /workspace/github_c_makefile_star2_O1/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 0x7d2a
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7dcb
movq 0x10(%rbx), %r15
movabsq $0x10000000000024, %rax # imm = 0x10000000000024
testq %rax, 0x8(%rbx)
je 0x7d99
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7da8
leaq 0xa536(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7db7
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x88db
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x7dc6
movl $0x1, %edx
jmp 0x7dcb
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x7dcb
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7dcb
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7dcb
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/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 0x4376
movq %rax, %r15
movabsq $0x40012d0090, %rax     # imm = 0x40012D0090
movq %rax, (%r15)
leaq 0x8(%r15), %r12
movq %rbx, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2290
movq %r14, %rdi
movq %r15, %rsi
movl $0x48, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5396
// File: /workspace/github_c_makefile_star2_O1/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 0x4376
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 0x2160
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2290
movq %r14, %rdi
movq %r12, %rsi
movl $0x48, %edx
callq 0x5396
movq (%rbx), %rsi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6522
// File: /workspace/github_c_makefile_star2_O1/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 0x4376
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 0x2160
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2290
leaq 0x48(%r12), %r13
movq %r15, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2290
movq %r14, %rdi
movq %r12, %rsi
movl $0x68, %edx
callq 0x5396
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6522
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_client_event_pattern_message
void channel_client_event_pattern_message(EagleClient *client, Channel_t *channel,
	const char *topic, const char *pattern, Object *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_CHANNEL_PSUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 128 + EG_OBJECT_SIZE(msg));

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movq 0x8(%r8), %rbx
movl $0x88, %edi
callq 0x4376
movq %rax, %r12
shlq $0x20, %rbx
movabsq $0x8002400090, %rax     # imm = 0x8002400090
addq %rbx, %rax
movq %rax, (%r12)
leaq 0x8(%r12), %rbx
movq %rbp, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2290
leaq 0x48(%r12), %rbx
movq %r13, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2290
leaq 0x68(%r12), %rbx
movq %r15, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2290
movq %r14, %rdi
movq %r12, %rsi
movl $0x88, %edx
callq 0x5396
movq %r14, %rdi
movq (%rsp), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6522
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: read_request
void read_request(EventLoop *loop, int fd, void *data, int mask)
{
	EagleClient *client = (EagleClient*)data;
	int nread;

	EG_NOTUSED(loop);
	EG_NOTUSED(mask);

	nread = read(fd, client->buffer, EG_BUF_SIZE);

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

	if (nread) {
		client->nread = nread;
		client->last_action = time(NULL);
	} else {
		return;
	}

	process_request(client);
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl %esi, %edi
movq 0x30(%rdx), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x2210
testl %eax, %eax
je 0x8261
cmpl $-0x1, %eax
jne 0x8243
callq 0x2050
movq %rax, %rcx
xorl %eax, %eax
cmpl $0xb, (%rcx)
jne 0x8261
testl %eax, %eax
je 0x826a
cltq
movq %rax, 0x40(%rbx)
xorl %edi, %edi
callq 0x22b0
movq %rax, 0x78(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x8011
movq %rbx, %rdi
popq %rbx
jmp 0x5649
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa016(%rip), %r14      # 0x12290
movq (%r14), %rax
cmpl $0x0, 0x58(%rax)
je 0x82d6
movq 0x160(%rax), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x8a40
movq %rbx, %rdi
callq 0x89ff
testq %rax, %rax
je 0x82d6
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 0x82c9
callq 0x5649
movq %rbx, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x82a9
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x42f0
movq %rax, %rbx
xorl %edi, %edi
movl %ebp, %esi
callq 0x3e4c
xorl %edi, %edi
movl %ebp, %esi
callq 0x3f4a
leaq 0x9f83(%rip), %r14      # 0x12290
movq (%r14), %rax
movq (%rax), %rdi
leaq -0x103(%rip), %rcx      # 0x8217
movl %ebp, %esi
movl $0x1, %edx
movq %rbx, %r8
callq 0x3712
cmpl $-0x1, %eax
je 0x83cc
movl %ebp, (%rbx)
xorl %r15d, %r15d
movq %r15, 0x8(%rbx)
movl $0x8000, %edi           # imm = 0x8000
callq 0x42f0
movq %rax, 0x10(%rbx)
movq $0x8000, 0x18(%rbx)     # imm = 0x8000
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movl $0x8000, %edi           # imm = 0x8000
callq 0x42f0
movq %rax, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
callq 0x87cc
movq %rax, 0x48(%rbx)
callq 0x87cc
movq %rax, 0x50(%rbx)
callq 0x87cc
movq %rax, 0x58(%rbx)
callq 0x85f8
movq %rax, 0x60(%rbx)
callq 0x85f8
movq %rax, 0x68(%rbx)
movq %r15, 0x70(%rbx)
xorl %edi, %edi
callq 0x22b0
movq %rax, 0x78(%rbx)
movq 0x48(%rbx), %rax
leaq -0x32cb(%rip), %rcx     # 0x50e9
movq %rcx, 0x10(%rax)
movq (%r14), %rax
movq 0x160(%rax), %rdi
movq %rbx, %rsi
callq 0x8886
jmp 0x83dd
movl %ebp, %edi
callq 0x21e0
movq %rbx, %rdi
callq 0x44fe
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9e96(%rip), %rbx      # 0x12290
movq (%rbx), %rdi
addq $0x60, %rdi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x4210
cmpl $-0x1, %eax
je 0x841e
movl %eax, %edi
callq 0x843c
jmp 0x8433
movq (%rbx), %rsi
addq $0x60, %rsi
leaq 0x42c8(%rip), %rdi      # 0xc6f4
xorl %eax, %eax
callq 0x4734
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x82de
testq %rax, %rax
je 0x846c
leaq 0x9e40(%rip), %rcx      # 0x12290
movq (%rcx), %rcx
movq 0x160(%rcx), %rdx
movl 0x20(%rdx), %edx
cmpq %rdx, 0x48(%rcx)
jae 0x8474
movq %rax, %rdi
popq %rbx
jmp 0x5649
movl %ebx, %edi
popq %rbx
jmp 0x21e0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9e12(%rip), %rbx      # 0x12290
movq (%rbx), %rdi
addq $0x60, %rdi
callq 0x42d1
cmpl $-0x1, %eax
je 0x8494
movl %eax, %edi
popq %rbx
jmp 0x843c
movq (%rbx), %rsi
addq $0x60, %rsi
leaq 0x426a(%rip), %rdi      # 0xc70c
xorl %eax, %eax
popq %rbx
jmp 0x4734
// File: /workspace/github_c_makefile_star2_O1/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 0x84ee
movq %rdi, %r14
leaq 0x9dcd(%rip), %rax      # 0x12290
movq (%rax), %rax
movq (%rax), %rdi
leaq 0x28(%rip), %rcx        # 0x84f8
movl $0x2, %edx
movq %r14, %r8
callq 0x3712
cmpl $-0x1, %eax
jne 0x84ec
movq 0x48(%r14), %rax
cmpl $0x0, 0x20(%rax)
je 0x84ee
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8584
movl %esi, %ebp
xorl %r15d, %r15d
xorl %r14d, %r14d
movq (%rdi), %rsi
movq 0x10(%rsi), %r12
movq 0x8(%r12), %rdx
testq %rdx, %rdx
jne 0x8537
callq 0x897a
movq 0x48(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
jne 0x8515
jmp 0x858a
movq 0x70(%rbx), %rax
movq (%r12), %rsi
addq %rax, %rsi
subq %rax, %rdx
movl %ebp, %edi
callq 0x2100
movq %rax, %r14
testl %r14d, %r14d
jle 0x858a
movl %r14d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq 0x70(%rbx), %rax
movq %rax, 0x70(%rbx)
cmpq 0x8(%r12), %rax
jne 0x857f
movq 0x48(%rbx), %rdi
movq (%rdi), %rsi
callq 0x897a
movq $0x0, 0x70(%rbx)
addl %r14d, %r15d
jmp 0x852b
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpl $-0x1, %r14d
jne 0x859a
callq 0x2050
cmpl $0xb, (%rax)
jne 0x85e6
testl %r15d, %r15d
jle 0x85aa
xorl %edi, %edi
callq 0x22b0
movq %rax, 0x78(%rbx)
movq 0x48(%rbx), %rax
cmpl $0x0, 0x20(%rax)
je 0x85bd
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x70(%rbx)
leaq 0x9cc4(%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 0x37d7
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5649
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x8652
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8641
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x44fe
movq %r15, %r14
testl %ebp, %ebp
jne 0x862a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x44fe
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r12
movq %r12, %r15
testq %r12, %r12
je 0x8681
movq 0x8(%r15), %r12
testq %r15, %r15
je 0x86a5
movq 0x18(%r14), %rax
movq 0x10(%r15), %rdi
testq %rax, %rax
je 0x869e
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x8675
jmp 0x86a8
cmpq %rbx, %rdi
jne 0x8675
jmp 0x86a8
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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), %r13
movq %r13, %r12
testq %r13, %r13
je 0x86f0
movq 0x8(%r12), %r13
testq %r12, %r12
je 0x8715
movq 0x18(%rbx), %rax
movq 0x10(%r12), %rdi
testq %rax, %rax
je 0x870e
movq %r15, %rsi
callq *%rax
testl %eax, %eax
je 0x86e3
jmp 0x8718
cmpq %r15, %rdi
jne 0x86e3
jmp 0x8718
xorl %r12d, %r12d
testq %r12, %r12
je 0x8724
movq %r14, 0x18(%r12)
jmp 0x8768
movl $0x20, %edi
callq 0x42f0
movq %r15, 0x10(%rax)
movq %r14, 0x18(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x8756
movq 0x8(%rbx), %rdx
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x8763
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%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_O1/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
movq %rcx, (%rdx)
movq 0x8(%rsi), %rcx
leaq 0x8(%rdi), %rdx
testq %rcx, %rcx
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x87b9
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
callq *%rax
movq %r14, %rdi
callq 0x44fe
decl 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8822
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8811
movq 0x10(%r14), %rdi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x44fe
movq %r15, %r14
testl %ebp, %ebp
jne 0x87fe
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x44fe
// File: /workspace/github_c_makefile_star2_O1/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 0x42f0
movq %r14, 0x10(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x8869
movq $0x0, (%rax)
movq (%rbx), %rdx
movq %rdx, 0x8(%rax)
movq %rax, (%rdx)
movq %rax, (%rbx)
jmp 0x8876
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incl %ecx
movl %ecx, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x42f0
movq %r14, 0x10(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x88be
movq 0x8(%rbx), %rdx
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x88cb
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incl %ecx
movl %ecx, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdi, %r12
movl $0x10, %edi
callq 0x42f0
movq %rax, %rbx
movq (%r12), %r14
movq %r14, (%rax)
movl $0x0, 0x8(%rax)
testq %r14, %r14
je 0x8960
xorl %eax, %eax
cmpl $0x0, 0x8(%rbx)
sete %al
movq (%r14,%rax,8), %rax
movq %rax, (%rbx)
movq 0x18(%r12), %rax
movq 0x10(%r14), %rdi
testq %rax, %rax
je 0x8956
movq %r15, %rsi
callq *%rax
testl %eax, %eax
je 0x895b
jmp 0x8963
cmpq %r15, %rdi
je 0x8963
movq (%rbx), %r14
jmp 0x8928
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x44fe
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8a9f
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8a8e
movq 0x10(%r14), %rdi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x44fe
movq %r15, %r14
testl %ebp, %ebp
jne 0x8a7b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x44fe
// File: /workspace/github_c_makefile_star2_O1/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 0x42f0
movq %r14, 0x10(%rax)
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
je 0x8ae6
movq $0x0, (%rax)
movq (%rbx), %rdx
movq %rdx, 0x8(%rax)
movq %rax, (%rdx)
movq %rax, (%rbx)
jmp 0x8af3
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incl %ecx
movl %ecx, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x42f0
movq %r14, 0x10(%rax)
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
je 0x8b3b
movq 0x8(%rbx), %rdx
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x8b48
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incl %ecx
movl %ecx, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8b92
movq %rdi, %r14
movq 0x8(%rdi), %rdi
movq (%rdi), %r15
movq 0x10(%rdi), %rbx
callq 0x44fe
movq %r15, 0x8(%r14)
decl 0x18(%r14)
jmp 0x8b94
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8bd5
movq (%rbx), %r14
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8bc4
movq 0x10(%r14), %rdi
callq *%rax
decl %ebp
movq %r14, %rdi
callq 0x44fe
movq %r15, %r14
testl %ebp, %ebp
jne 0x8bb1
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_O1/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
movq %rcx, (%rdx)
movq 0x8(%rsi), %rcx
leaq 0x8(%rdi), %rdx
testq %rcx, %rcx
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x8c2a
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x44fe
decl 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x42f0
movq %rax, %r12
movq %r15, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2290
leaq 0x20(%r12), %r15
movq %r14, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2290
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_O1/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 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x8d68
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2240
testq %rbx, %rbx
je 0x8d57
testl %eax, %eax
jne 0x8d5b
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x2240
testl %eax, %eax
je 0x8d6b
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x8d32
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4376
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_O1/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 0x42f0
movq %rax, %rbx
movq %r12, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2290
movl %r15d, 0x40(%rbx)
movl %r14d, 0x44(%rbx)
movl %ebp, 0x48(%rbx)
movq $0x0, 0x4c(%rbx)
movl $0x0, 0x54(%rbx)
testb $0x1, %bpl
je 0x8e6a
movl $0x1, 0x4c(%rbx)
testb $0x2, %bpl
je 0x8e77
movl $0x1, 0x50(%rbx)
testb $0x4, %bpl
je 0x8e84
movl $0x1, 0x54(%rbx)
callq 0x8a50
movq %rax, 0x58(%rbx)
callq 0x87cc
movq %rax, 0x60(%rbx)
callq 0x87cc
movq %rax, 0x68(%rbx)
callq 0x87cc
movq %rax, 0x70(%rbx)
callq 0x87cc
movq %rax, 0x78(%rbx)
callq 0x87cc
movq %rax, 0x80(%rbx)
callq 0x85f8
movq %rax, 0x88(%rbx)
movq 0x58(%rbx), %rcx
leaq -0xdd(%rip), %rdx       # 0x8df7
movq %rdx, 0x10(%rcx)
leaq 0x1b(%rip), %rcx        # 0x8efa
movq %rcx, 0x10(%rax)
leaq 0x22(%rip), %rcx        # 0x8f0c
movq %rcx, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x8f73
movq %rsp, %r14
movq 0x10(%rax), %r15
movq 0x50(%r15), %rdi
movq %rbx, %rsi
callq 0x88db
movq 0x70(%rbx), %rdi
movq %r15, %rsi
callq 0x88db
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x8f4a
movq 0x78(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x8fc1
movq %rax, %r15
movq %rsp, %r14
movq 0x10(%r15), %rax
movq 0x58(%rax), %rdi
movq %rbx, %rsi
callq 0x88db
movq 0x78(%rbx), %rdi
movq %r15, %rsi
callq 0x897a
movq %r14, %rdi
callq 0x89ff
movq %rax, %r15
testq %rax, %rax
jne 0x8f95
movq 0x80(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9015
movq %rax, %r15
movq %rsp, %r14
movq 0x10(%r15), %rax
movq 0x58(%rax), %rdi
movq %rbx, %rsi
callq 0x88db
movq 0x80(%rbx), %rdi
movq %r15, %rsi
callq 0x897a
movq %r14, %rdi
callq 0x89ff
movq %rax, %r15
testq %rax, %rax
jne 0x8fe6
movq 0x88(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x86b7
movq %r14, %rdi
callq 0x86be
testq %rax, %rax
je 0x9079
movq %rsp, %r14
leaq 0x10(%rsp), %r15
movq 0x10(%rax), %r12
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x906c
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9974
jmp 0x904e
movq %r15, %rdi
callq 0x86be
testq %rax, %rax
jne 0x903e
movq 0x60(%rbx), %rdi
callq 0x87ea
movq 0x68(%rbx), %rdi
callq 0x87ea
movq 0x70(%rbx), %rdi
callq 0x87ea
movq 0x78(%rbx), %rdi
callq 0x87ea
movq 0x80(%rbx), %rdi
callq 0x87ea
movq 0x88(%rbx), %rdi
callq 0x8616
movq 0x58(%rbx), %rdi
callq 0x8a67
movq %rbx, %rdi
callq 0x44fe
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x91a3(%rip), %rax      # 0x12290
movq (%rax), %rax
movl 0x190(%rax), %esi
movl 0x1b4(%rax), %edi
leal 0x1(%rdi), %ecx
movl %ecx, 0x1b4(%rax)
callq 0x4d28
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x8db4
movq %rax, %r14
movq (%rax), %rax
movl 0x44(%rbx), %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %rcx, 0x8(%rax)
ja 0x923f
movq 0x78(%rbx), %rdi
movb $0x1, %r12b
cmpl $0x0, 0x20(%rdi)
je 0x9199
cmpl $0x0, 0x54(%rbx)
je 0x915f
callq 0x8a18
movq 0x78(%rbx), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7e39
jmp 0x9196
movq %rsp, %r15
movq %r15, %rsi
callq 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9199
movq %rsp, %r15
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7e39
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x917a
xorl %r12d, %r12d
movq 0x80(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x91da
movq %rsp, %r15
movq %r15, %rsi
callq 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x91da
movq %rsp, %r15
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x7ddb
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x91c1
testb %r12b, %r12b
je 0x9235
movq 0x58(%rbx), %rax
movl 0x18(%rax), %eax
cmpl 0x40(%rbx), %eax
jb 0x91fb
cmpl $0x0, 0x50(%rbx)
je 0x923f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x924e
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x8ab1
xorl %ebp, %ebp
cmpl $0x0, 0x14(%r14)
je 0x923f
movq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x8886
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%r14)
movq 0x58(%rbx), %rax
movq (%rax), %rax
movq %rax, 0x20(%r14)
jmp 0x923f
movq %r14, %rdi
callq 0x8de2
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq