LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x417e
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 0x2150
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2280
leaq 0x48(%r12), %rbx
movq %r13, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2280
leaq 0x68(%r12), %rbx
movq %r15, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2280
movq %r14, %rdi
movq %r12, %rsi
movl $0x88, %edx
callq 0x512c
movq %r14, %rdi
movq (%rsp), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x60b7
// File: /workspace/github_c_makefile_star2_O2/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 0xa76a(%rip), %r14      # 0x12290
movq (%r14), %rax
cmpl $0x0, 0x58(%rax)
je 0x7b72
movq 0x160(%rax), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x8226
movq %rbx, %rdi
callq 0x81e5
testq %rax, %rax
je 0x7b72
movq 0x10(%rax), %rdi
movq (%r14), %rax
movq 0x188(%rax), %rcx
subq 0x78(%rdi), %rcx
movslq 0x58(%rax), %rax
cmpq %rax, %rcx
jle 0x7b43
callq 0x538f
jmp 0x7b43
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movl %edi, %ebp
movl $0x80, %edi
callq 0x40f8
movq %rax, %rbx
xorl %edi, %edi
movl %ebp, %esi
callq 0x3ca0
xorl %edi, %edi
movl %ebp, %esi
callq 0x3d99
leaq 0xa6ea(%rip), %r14      # 0x12290
movq (%r14), %rax
movq (%rax), %rdi
leaq -0xe7(%rip), %rcx       # 0x7acc
pushq $0x1
popq %rdx
movl %ebp, %esi
movq %rbx, %r8
callq 0x362e
cmpl $-0x1, %eax
je 0x7c62
movl %ebp, (%rbx)
andq $0x0, 0x8(%rbx)
movl $0x8000, %edi           # imm = 0x8000
callq 0x40f8
movq %rax, 0x10(%rbx)
movq $0x8000, 0x18(%rbx)     # imm = 0x8000
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movl $0x8000, %edi           # imm = 0x8000
callq 0x40f8
movq %rax, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
callq 0x7fec
movq %rax, 0x48(%rbx)
callq 0x7fec
movq %rax, 0x50(%rbx)
callq 0x7fec
movq %rax, 0x58(%rbx)
callq 0x7e6c
movq %rax, 0x60(%rbx)
callq 0x7e6c
movq %rax, 0x68(%rbx)
andq $0x0, 0x70(%rbx)
xorl %edi, %edi
callq 0x22a0
movq %rax, 0x78(%rbx)
movq 0x48(%rbx), %rax
leaq -0x2d97(%rip), %rcx     # 0x4eb3
movq %rcx, 0x10(%rax)
movq (%r14), %rax
movq 0x160(%rax), %rdi
movq %rbx, %rsi
callq 0x8096
jmp 0x7c73
movl %ebp, %edi
callq 0x21d0
movq %rbx, %rdi
callq 0x430e
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa606(%rip), %rbx      # 0x12290
movq (%rbx), %rdi
addq $0x60, %rdi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x4021
cmpl $-0x1, %eax
je 0x7cae
movl %eax, %edi
callq 0x7ccc
jmp 0x7cc3
movq (%rbx), %rsi
addq $0x60, %rsi
leaq 0x4a34(%rip), %rdi      # 0xc6f0
xorl %eax, %eax
callq 0x4548
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7b7a
testq %rax, %rax
je 0x7cfc
leaq 0xa5b0(%rip), %rcx      # 0x12290
movq (%rcx), %rcx
movq 0x160(%rcx), %rdx
movl 0x20(%rdx), %edx
cmpq %rdx, 0x48(%rcx)
jae 0x7d04
movq %rax, %rdi
popq %rbx
jmp 0x538f
movl %ebx, %edi
popq %rbx
jmp 0x21d0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa582(%rip), %rbx      # 0x12290
movq (%rbx), %rdi
addq $0x60, %rdi
callq 0x40d9
cmpl $-0x1, %eax
je 0x7d24
movl %eax, %edi
popq %rbx
jmp 0x7ccc
movq (%rbx), %rsi
addq $0x60, %rsi
leaq 0x49d6(%rip), %rdi      # 0xc708
xorl %eax, %eax
popq %rbx
jmp 0x4548
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %rbx
testl %esi, %esi
jle 0x7d7a
movq %rdi, %r14
leaq 0xa53f(%rip), %rax      # 0x12290
movq (%rax), %rax
movq (%rax), %rdi
leaq 0x26(%rip), %rcx        # 0x7d84
pushq $0x2
popq %rdx
movq %r14, %r8
callq 0x362e
cmpl $-0x1, %eax
jne 0x7d78
movq 0x48(%r14), %rax
cmpl $0x0, 0x20(%rax)
je 0x7d7a
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
movl %esi, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x48(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x7e03
movq (%rdi), %rsi
movq 0x10(%rsi), %r12
movq 0x8(%r12), %rdx
testq %rdx, %rdx
jne 0x7db9
callq 0x8166
jmp 0x7d97
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 0x7e03
movl %r14d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq 0x70(%rbx), %rax
movq %rax, 0x70(%rbx)
addl %r14d, %r15d
cmpq 0x8(%r12), %rax
jne 0x7d97
movq 0x48(%rbx), %rdi
movq (%rdi), %rsi
callq 0x8166
andq $0x0, 0x70(%rbx)
jmp 0x7d97
cmpl $-0x1, %r14d
jne 0x7e13
callq 0x2050
cmpl $0xb, (%rax)
jne 0x7e5a
testl %r15d, %r15d
jle 0x7e23
xorl %edi, %edi
callq 0x22a0
movq %rax, 0x78(%rbx)
movq 0x48(%rbx), %rax
cmpl $0x0, 0x20(%rax)
je 0x7e36
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
andq $0x0, 0x70(%rbx)
leaq 0xa44e(%rip), %rax      # 0x12290
movq (%rax), %rax
movq (%rax), %rdi
movl (%rbx), %esi
pushq $0x2
popq %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x36ee
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x538f
nop
// File: /workspace/github_c_makefile_star2_O2/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
movq (%rdi), %r14
movl 0x20(%rdi), %ebp
subl $0x1, %ebp
jb 0x7ebe
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x7eb1
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
callq *%rax
movq %r14, %rdi
callq 0x430e
movq %r15, %r14
jmp 0x7e95
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x430e
// File: /workspace/github_c_makefile_star2_O2/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 0x7f0a
movq 0x8(%r15), %r12
movq 0x10(%r15), %rdi
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x7f05
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x7ee1
jmp 0x7f0a
cmpq %rbx, %rdi
jne 0x7ee1
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x7ed0
testq %rax, %rax
je 0x7f4e
movq %r14, 0x18(%rax)
jmp 0x7f8e
pushq $0x20
popq %rdi
callq 0x40f8
movq %r15, 0x10(%rax)
movq %r14, 0x18(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x7f78
movq 0x8(%rbx), %rdx
andq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x7f86
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
andq $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, (%rax)
incl %ecx
movl %ecx, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7fd7
movq 0x10(%r14), %rdi
movq 0x18(%r14), %rsi
callq *%rax
movq %r14, %rdi
callq 0x430e
decl 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
movq (%rdi), %r14
movl 0x20(%rdi), %ebp
subl $0x1, %ebp
jb 0x803a
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x802d
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x430e
movq %r15, %r14
jmp 0x8015
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x430e
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x18
popq %rdi
callq 0x40f8
movq %r14, 0x10(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x8075
andq $0x0, (%rax)
movq (%rbx), %rdx
movq %rax, (%rdx)
jmp 0x807f
movq %rax, 0x8(%rbx)
andq $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_O2/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
pushq $0x18
popq %rdi
callq 0x40f8
movq %r14, 0x10(%rax)
movl 0x20(%rbx), %ecx
testl %ecx, %ecx
je 0x80c6
movq 0x8(%rbx), %rdx
andq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x80d4
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
andq $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_O2/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, %rbx
movq %rdi, %r14
xorl %esi, %esi
callq 0x81b5
movq %rax, %r15
movq %r15, %rdi
callq 0x81e5
movq %rax, %r12
testq %rax, %rax
je 0x814f
movq 0x18(%r14), %rax
movq 0x10(%r12), %rdi
testq %rax, %rax
je 0x814a
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x8121
jmp 0x814f
cmpq %rbx, %rdi
jne 0x8121
movq %r15, %rdi
callq 0x430e
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x81a2
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x430e
decl 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
movq (%rdi), %r14
movl 0x18(%rdi), %ebp
subl $0x1, %ebp
jb 0x827e
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8271
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x430e
movq %r15, %r14
jmp 0x8259
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x430e
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x18
popq %rdi
callq 0x40f8
movq %r14, 0x10(%rax)
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
je 0x82b9
andq $0x0, (%rax)
movq (%rbx), %rdx
movq %rax, (%rdx)
jmp 0x82c3
movq %rax, 0x8(%rbx)
andq $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_O2/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
pushq $0x18
popq %rdi
callq 0x40f8
movq %r14, 0x10(%rax)
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
je 0x830a
movq 0x8(%rbx), %rdx
andq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x8318
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
andq $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_O2/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 0x8365
movq %rdi, %r14
movq 0x8(%rdi), %rdi
movq (%rdi), %r15
movq 0x10(%rdi), %rbx
callq 0x430e
movq %r15, 0x8(%r14)
decl 0x18(%r14)
jmp 0x8367
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
movq (%rdi), %r14
movl 0x18(%rdi), %ebp
subl $0x1, %ebp
jb 0x83a5
movq 0x8(%r14), %r15
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x8398
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x430e
movq %r15, %r14
jmp 0x8380
andl $0x0, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x83f3
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x430e
decl 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x48
popq %rdi
callq 0x40f8
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_O2/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 0x8226
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x851a
movq 0x10(%rax), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x2230
testq %rbx, %rbx
je 0x8514
testl %eax, %eax
jne 0x84e2
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x2230
testl %eax, %eax
jne 0x84e2
jmp 0x851d
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rdi
callq 0x417e
movq %r15, (%rax)
movq %r14, 0x8(%rax)
andl $0x0, 0x10(%rax)
movl %ebx, 0x14(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x40f8
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)
andq $0x0, 0x4c(%rbx)
andl $0x0, 0x54(%rbx)
testb $0x1, %bpl
je 0x8600
movl $0x1, 0x4c(%rbx)
testb $0x2, %bpl
je 0x860d
movl $0x1, 0x50(%rbx)
testb $0x4, %bpl
je 0x861a
movl $0x1, 0x54(%rbx)
callq 0x8234
movq %rax, 0x58(%rbx)
callq 0x7fec
movq %rax, 0x60(%rbx)
callq 0x7fec
movq %rax, 0x68(%rbx)
callq 0x7fec
movq %rax, 0x70(%rbx)
callq 0x7fec
movq %rax, 0x78(%rbx)
callq 0x7fec
movq %rax, 0x80(%rbx)
callq 0x7e6c
movq %rax, 0x88(%rbx)
movq 0x58(%rbx), %rcx
leaq -0xc8(%rip), %rdx       # 0x85a2
movq %rdx, 0x10(%rcx)
leaq 0x1b(%rip), %rcx        # 0x8690
movq %rcx, 0x10(%rax)
leaq 0x22(%rip), %rcx        # 0x86a2
movq %rcx, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x8226
movq %r14, %rdi
callq 0x81e5
testq %rax, %rax
je 0x86eb
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x8b0e
jmp 0x86d0
movq 0x78(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8226
movq %r14, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8728
movq %rax, %r15
movq 0x10(%rax), %rax
movq 0x58(%rax), %rdi
movq %rbx, %rsi
callq 0x80e7
movq 0x78(%rbx), %rdi
movq %r15, %rsi
callq 0x8166
jmp 0x86fa
movq 0x80(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8226
movq %r14, %rdi
callq 0x81e5
testq %rax, %rax
je 0x876b
movq %rax, %r15
movq 0x10(%rax), %rax
movq 0x58(%rax), %rdi
movq %rbx, %rsi
callq 0x80e7
movq 0x80(%rbx), %rdi
movq %r15, %rsi
callq 0x8166
jmp 0x873a
movq 0x88(%rbx), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x7f19
movq %rsp, %r15
movq %r14, %rdi
callq 0x7f20
testq %rax, %rax
je 0x87bd
movq 0x10(%rax), %r12
movq 0x18(%rax), %rdi
movq %r15, %rsi
callq 0x8226
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8782
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x9049
jmp 0x879f
movq 0x60(%rbx), %rdi
callq 0x8005
movq 0x68(%rbx), %rdi
callq 0x8005
movq 0x70(%rbx), %rdi
callq 0x8005
movq 0x78(%rbx), %rdi
callq 0x8005
movq 0x80(%rbx), %rdi
callq 0x8005
movq 0x88(%rbx), %rdi
callq 0x7e85
movq 0x58(%rbx), %rdi
callq 0x8249
movq %rbx, %rdi
callq 0x430e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x9a5f(%rip), %rax      # 0x12290
movq (%rax), %rax
movl 0x190(%rax), %esi
movl 0x1b4(%rax), %edi
leal 0x1(%rdi), %ecx
movl %ecx, 0x1b4(%rax)
callq 0x4b0b
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x8564
movq %rax, %r14
movq (%rax), %rax
movl 0x44(%rbx), %ecx
pushq $-0x1
popq %rbp
cmpq %rcx, 0x8(%rax)
ja 0x8974
movq 0x78(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x88a1
cmpl $0x0, 0x54(%rbx)
je 0x88a6
callq 0x81fe
movq 0x78(%rbx), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7711
xorl %r12d, %r12d
jmp 0x88dc
movb $0x1, %r12b
jmp 0x88dc
movq %rsp, %r15
movq %r15, %rsi
callq 0x8226
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x88d5
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7711
decl %r12d
jmp 0x88b4
testl %r12d, %r12d
sete %r12b
movq 0x80(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x890f
movq %rsp, %r15
movq %r15, %rsi
callq 0x8226
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x890f
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x76b7
jmp 0x88f4
testb %r12b, %r12b
je 0x896a
movq 0x58(%rbx), %rdi
movl 0x18(%rdi), %eax
cmpl 0x40(%rbx), %eax
jb 0x8934
cmpl $0x0, 0x50(%rbx)
je 0x8974
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8983
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x8290
xorl %ebp, %ebp
cmpl $0x0, 0x14(%r14)
je 0x8974
movq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x8096
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%r14)
movq 0x58(%rbx), %rax
movq (%rax), %rax
movq %rax, 0x20(%r14)
jmp 0x8974
movq %r14, %rdi
callq 0x858d
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_O2/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 0x833d
movq %rax, %r14
cmpl $0x0, 0x14(%rax)
je 0x89ab
movq 0x60(%rbx), %rdi
movq 0x18(%r14), %rsi
callq 0x8166
testl %ebp, %ebp
je 0x89d3
leaq 0x98da(%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 0x8096
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x858d
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x8226
pushq $-0x1
popq %rbp
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8a3a
movq 0x10(%rax), %r12
cmpq %r14, 0x8(%r12)
jne 0x8a0c
movq 0x68(%rbx), %rdi
movq %rax, %rsi
callq 0x8166
movq %r12, %rdi
callq 0x858d
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_O2/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: find_queue_t
Queue_t *find_queue_t(List *list, const char *name)
{
	Queue_t *queue_t;
	ListNode *node;
	ListIterator iterator;

	list_rewind(list, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		queue_t = EG_LIST_NODE_VALUE(node);
		if (!strcmp(queue_t->name, name)) {
			return queue_t;
		}
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0x8226
movq %r14, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8a82
movq 0x10(%rax), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2230
testl %eax, %eax
jne 0x8a60
jmp 0x8a85
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: unsubscribe_client_queue_t
void unsubscribe_client_queue_t(Queue_t *queue_t, EagleClient *client)
{
	ListNode *node;
	ListIterator iterator;

	list_delete_value(client->subscribed_queues, queue_t);

	list_rewind(queue_t->subscribed_clients_msg, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		if (EG_LIST_NODE_VALUE(node) == client) {
			list_delete_node(queue_t->subscribed_clients_msg, node);
			return;
		}
	}

	list_rewind(queue_t->subscribed_clients_notify, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		if (EG_LIST_NODE_VALUE(node) == client) {
			list_delete_node(queue_t->subscribed_clients_notify, node);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x58(%rsi), %rdi
movq %rbx, %rsi
callq 0x80e7
movq 0x78(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x8226
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8bb8
cmpq %r14, 0x10(%rax)
jne 0x8b8f
movq 0x78(%rbx), %rdi
movq %rax, %rsi
callq 0x8166
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x80(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x8226
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8bae
cmpq %r14, 0x10(%rax)
jne 0x8bca
movq 0x80(%rbx), %rdi
movq %rax, %rsi
callq 0x8166
jmp 0x8bca
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: link_queue_route_t
void link_queue_route_t(Queue_t *queue_t, Route_t *route, const char *key)
{
	List *list;
	KeylistNode *node = keylist_get_value(queue_t->routes, (void*)key);

	if (!node)
	{
		list = list_create();
		keylist_set_value(queue_t->routes, xstrdup(key), list);
		list_add_value_tail(list, route);
	}
	else
	{
		list = EG_KEYLIST_NODE_VALUE(node);
		if (!list_search_node(list, route)) {
			list_add_value_tail(list, route);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movq 0x88(%rdi), %rdi
movq %rdx, %rsi
callq 0x7ed0
testq %rax, %rax
je 0x8c33
movq 0x18(%rax), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8109
testq %rax, %rax
je 0x8c59
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x7fec
movq %rax, %r14
movq 0x88(%r12), %r12
movq %r15, %rdi
callq 0x42e1
movq %r12, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x7f30
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8096
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: unlink_queue_route_t
void unlink_queue_route_t(Queue_t *queue_t, Route_t *route, const char *key)
{
	List *list;
	KeylistNode *node = keylist_get_value(queue_t->routes, (void*)key);

	if (node)
	{
		list = EG_KEYLIST_NODE_VALUE(node);
		list_delete_value(list, route);

		if (!EG_LIST_LENGTH(list)) {
			keylist_delete_node(queue_t->routes, node);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq 0x88(%rdi), %rdi
movq %rdx, %rsi
callq 0x7ed0
testq %rax, %rax
je 0x8cab
movq %rax, %r14
movq 0x18(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x80e7
cmpl $0x0, 0x20(%r12)
je 0x8cb7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x88(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7f97
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: process_expired_messages_queue_t
void process_expired_messages_queue_t(Queue_t *queue_t, uint32_t time)
{
	ListNode *node;
	ListIterator iterator;
	Message *msg;

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

		if (EG_MESSAGE_GET_EXPIRATION_TIME(msg) <= time) {
			list_delete_node(queue_t->expire_messages, node);
			queue_delete_node(queue_t->queue, EG_MESSAGE_GET_DATA(msg, 1));
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq 0x60(%rdi), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x8226
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8d50
movq 0x10(%rax), %r12
cmpl %ebx, 0x14(%r12)
ja 0x8d1c
movq 0x60(%r14), %rdi
movq %rax, %rsi
callq 0x8166
movq 0x58(%r14), %rdi
movq 0x20(%r12), %rsi
callq 0x83b7
jmp 0x8d1c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: process_unconfirmed_messages_queue_t
void process_unconfirmed_messages_queue_t(Queue_t *queue_t, uint32_t time)
{
	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_CONFIRM_TIME(msg) <= time)
		{
			list_delete_node(queue_t->confirm_messages, node);

			if (msg->expiration)
			{
				if (EG_MESSAGE_GET_EXPIRATION_TIME(msg) <= time) {
					continue;
				}

				queue_push_value_tail(queue_t->queue, msg);

				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_LAST(queue_t->queue));
			}
			else
			{
				queue_push_value_tail(queue_t->queue, msg);
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq 0x68(%rdi), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x8226
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8df0
movq 0x10(%rax), %r12
cmpl %ebx, 0x10(%r12)
ja 0x8d7d
movq 0x68(%r14), %rdi
movq %rax, %rsi
callq 0x8166
movl 0x14(%r12), %eax
testl %eax, %eax
je 0x8de2
cmpl %ebx, %eax
jbe 0x8d7d
movq 0x58(%r14), %rdi
movq %r12, %rsi
callq 0x82da
movq 0x60(%r14), %rdi
movq %r12, %rsi
callq 0x8096
movq 0x60(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%r12)
movq 0x58(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%r12)
jmp 0x8d7d
movq 0x58(%r14), %rdi
movq %r12, %rsi
callq 0x82da
jmp 0x8d7d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/route_t.c
// Function: create_route_t
Route_t *create_route_t(const char *name, uint32_t flags)
{
	Route_t *route = (Route_t*)xmalloc(sizeof(*route));

	memcpy(route->name, name, strlenz(name));
	route->flags = flags;

	route->auto_delete = 0;
	route->round_robin = 0;

	if (BIT_CHECK(route->flags, EG_ROUTE_AUTODELETE_FLAG)) {
		route->auto_delete = 1;
	}

	if (BIT_CHECK(route->flags, EG_ROUTE_ROUND_ROBIN_FLAG)) {
		route->round_robin = 1;
	}

	route->keys = keylist_create();

	EG_KEYLIST_SET_FREE_METHOD(route->keys, free_route_keylist_handler);
	EG_KEYLIST_SET_MATCH_METHOD(route->keys, match_route_keylist_handler);

	return route;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $0x58
popq %rdi
callq 0x40f8
movq %rax, %rbx
movq %r14, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2280
movl %ebp, 0x40(%rbx)
andq $0x0, 0x44(%rbx)
testb $0x1, %bpl
je 0x8e44
movl $0x1, 0x44(%rbx)
testb $0x2, %bpl
je 0x8e51
movl $0x1, 0x48(%rbx)
callq 0x7e6c
movq %rax, 0x50(%rbx)
leaq 0x17(%rip), %rcx        # 0x8e78
movq %rcx, 0x10(%rax)
leaq 0x1e(%rip), %rcx        # 0x8e8a
movq %rcx, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/route_t.c
// Function: push_message_route_t
int push_message_route_t(Route_t *route, const char *key, Object *msg, uint32_t expiration)
{
	KeylistNode *keylist_node;
	ListNode *list_node;
	ListIterator list_iterator;
	List *list;
	Queue_t *queue_t;
	int status = EG_STATUS_OK;

	keylist_node = keylist_get_value(route->keys, (void*)key);
	if (!keylist_node) {
		return EG_STATUS_ERR;
	}

	list = EG_KEYLIST_NODE_VALUE(keylist_node);

	if (route->round_robin)
	{
		list_rotate(list);

		queue_t = EG_LIST_NODE_VALUE(EG_LIST_FIRST(list));

		if (push_message_queue_t(queue_t, msg, expiration) != EG_STATUS_OK)
			status = EG_STATUS_ERR;

		increment_references_count(msg);
	}
	else
	{
		list_rewind(list, &list_iterator);
		while ((list_node = list_next_node(&list_iterator)) != NULL)
		{
			queue_t = EG_LIST_NODE_VALUE(list_node);

			if (push_message_queue_t(queue_t, msg, expiration) != EG_STATUS_OK)
				status = EG_STATUS_ERR;

			increment_references_count(msg);
		}
	}

	return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rdi, %r14
movq 0x50(%rdi), %rdi
callq 0x7ed0
testq %rax, %rax
je 0x8f6e
movq 0x18(%rax), %r12
cmpl $0x0, 0x48(%r14)
je 0x8f82
movq %r12, %rdi
callq 0x81fe
movq (%r12), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x8816
xorl %r14d, %r14d
negl %eax
sbbl %r14d, %r14d
movq %rbx, %rdi
callq 0x4e9d
jmp 0x8f72
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x8226
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x81e5
testq %rax, %rax
je 0x8f72
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x8816
negl %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %eax, %r14d
movq %rbx, %rdi
callq 0x4e9d
jmp 0x8f93
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/route_t.c
// Function: bind_route_t
void bind_route_t(Route_t *route, Queue_t *queue_t, const char *key)
{
	List *list;
	KeylistNode *node = keylist_get_value(route->keys, (void*)key);
	int link = 0;

	if (!node)
	{
		list = list_create();
		keylist_set_value(route->keys, xstrdup(key), list);
		link = 1;
	}
	else
	{
		list = EG_KEYLIST_NODE_VALUE(node);
		if (!list_search_node(list, queue_t))
			link = 1;
	}

	if (link)
	{
		list_add_value_tail(list, queue_t);
		link_queue_route_t(queue_t, route, key);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x50(%rdi), %rdi
movq %rdx, %rsi
callq 0x7ed0
testq %rax, %rax
je 0x9005
movq 0x18(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8109
testq %rax, %rax
je 0x9027
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x7fec
movq %rax, %r12
movq 0x50(%r14), %r13
movq %rbx, %rdi
callq 0x42e1
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x7f30
movq %r12, %rdi
movq %r15, %rsi
callq 0x8096
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8bee
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/route_t.c
// Function: unbind_route_t
int unbind_route_t(Route_t *route, Queue_t *queue_t, const char *key)
{
	List *list;
	KeylistNode *node = keylist_get_value(route->keys, (void*)key);

	if (!node) {
		return EG_STATUS_ERR;
	}

	list = EG_KEYLIST_NODE_VALUE(node);
	list_delete_value(list, queue_t);

	if (!EG_LIST_LENGTH(list)) {
		keylist_delete_node(route->keys, node);
	}

	unlink_queue_route_t(queue_t, route, key);

	if (route->auto_delete)
	{
		if (EG_KEYLIST_LENGTH(route->keys) == 0) {
			list_delete_value(server->routes, route);
		}
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
movq %rdx, %rsi
callq 0x7ed0
testq %rax, %rax
je 0x90ce
movq %rax, %r12
movq 0x18(%rax), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x80e7
cmpl $0x0, 0x20(%r13)
jne 0x9093
movq 0x50(%rbx), %rdi
movq %r12, %rsi
callq 0x7f97
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8c6f
xorl %ebp, %ebp
cmpl $0x0, 0x44(%rbx)
je 0x90d1
movq 0x50(%rbx), %rax
cmpl $0x0, 0x20(%rax)
jne 0x90d1
leaq 0x91d6(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x178(%rax), %rdi
movq %rbx, %rsi
callq 0x80e7
jmp 0x90d1
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq