LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x8b6a
movq %rax, %r14
cmpl $0x0, 0x14(%rax)
je 0x9276
movq 0x60(%rbx), %rdi
movq 0x18(%r14), %rsi
callq 0x897a
testl %ebp, %ebp
je 0x929e
leaq 0x900f(%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 0x8886
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x8de2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/queue_t.c
// Function: confirm_message_queue_t
int confirm_message_queue_t(Queue_t *queue_t, uint64_t tag)
{
	ListNode *node;
	ListIterator iterator;
	Message *msg;

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

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

	return EG_STATUS_ERR;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9305
movq 0x10(%rax), %r12
cmpq %r14, 0x8(%r12)
jne 0x92d5
movq 0x68(%rbx), %rdi
movq %rax, %rsi
callq 0x897a
movq %r12, %rdi
callq 0x8de2
xorl %eax, %eax
jmp 0x930a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
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: 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 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x934f
movq 0x10(%rax), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2240
testl %eax, %eax
jne 0x932d
jmp 0x9352
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x88db
movq 0x78(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x947d
cmpq %r14, 0x10(%rax)
jne 0x945c
movq 0x78(%rbx), %rdi
movq %rax, %rsi
callq 0x897a
jmp 0x94c1
movq 0x80(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x94c1
movq %rsp, %r15
cmpq %r14, 0x10(%rax)
jne 0x94b4
movq 0x80(%rbx), %rdi
movq %rax, %rsi
callq 0x897a
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x949f
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8664
testq %rax, %rax
je 0x9510
movq 0x18(%rax), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x88ff
testq %rax, %rax
je 0x9536
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x87cc
movq %rax, %r14
movq 0x88(%r12), %r12
movq %r15, %rdi
callq 0x44d1
movq %r12, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x86ce
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8886
// File: /workspace/github_c_makefile_star2_O1/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 0x8664
testq %rax, %rax
je 0x9588
movq %rax, %r14
movq 0x18(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x88db
cmpl $0x0, 0x20(%r12)
je 0x9594
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 0x8775
// File: /workspace/github_c_makefile_star2_O1/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 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x963d
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %r12
cmpl %ebx, 0x14(%r12)
ja 0x9630
movq 0x60(%r14), %rdi
movq %rax, %rsi
callq 0x897a
movq 0x58(%r14), %rdi
movq 0x20(%r12), %rsi
callq 0x8bea
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x960b
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: 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 0x8a40
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
je 0x96ed
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %r12
cmpl %ebx, 0x10(%r12)
ja 0x96e0
movq 0x68(%r14), %rdi
movq %rax, %rsi
callq 0x897a
movl 0x14(%r12), %eax
testl %eax, %eax
je 0x96d4
cmpl %ebx, %eax
jbe 0x96e0
movq 0x58(%r14), %rdi
movq %r12, %rsi
callq 0x8b03
movq 0x60(%r14), %rdi
movq %r12, %rsi
callq 0x8886
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 0x96e0
movq 0x58(%r14), %rdi
movq %r12, %rsi
callq 0x8b03
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x967c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x58, %edi
callq 0x42f0
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2290
movl %ebp, 0x40(%rbx)
movq $0x0, 0x44(%rbx)
testb $0x1, %bpl
je 0x9745
movl $0x1, 0x44(%rbx)
testb $0x2, %bpl
je 0x9752
movl $0x1, 0x48(%rbx)
callq 0x85f8
movq %rax, 0x50(%rbx)
leaq 0x17(%rip), %rcx        # 0x9779
movq %rcx, 0x10(%rax)
leaq 0x1e(%rip), %rcx        # 0x978b
movq %rcx, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rdi, %r14
movq 0x50(%rdi), %rdi
callq 0x8664
testq %rax, %rax
je 0x987c
movq 0x18(%rax), %r15
cmpl $0x0, 0x48(%r14)
je 0x9884
movq %r15, %rdi
callq 0x8a18
movq (%r15), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x90d2
xorl %r14d, %r14d
negl %eax
sbbl %r14d, %r14d
movq %rbx, %rdi
callq 0x50c1
jmp 0x98d8
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x98d8
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
xorl %r14d, %r14d
testq %rax, %rax
je 0x98d8
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x90d2
negl %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %eax, %r14d
movq %rbx, %rdi
callq 0x50c1
movq %r15, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x98a9
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8664
testq %rax, %rax
je 0x9920
movq 0x18(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x88ff
testq %rax, %rax
setne %al
jmp 0x9944
callq 0x87cc
movq %rax, %r12
movq 0x50(%r14), %r13
movq %rbx, %rdi
callq 0x44d1
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x86ce
xorl %eax, %eax
testb %al, %al
je 0x9952
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r12, %rdi
movq %r15, %rsi
callq 0x8886
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x94cb
// File: /workspace/github_c_makefile_star2_O1/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 0x8664
testq %rax, %rax
je 0x99f9
movq %rax, %r12
movq 0x18(%rax), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x88db
cmpl $0x0, 0x20(%r13)
jne 0x99be
movq 0x50(%rbx), %rdi
movq %r12, %rsi
callq 0x8775
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x954c
xorl %ebp, %ebp
cmpl $0x0, 0x44(%rbx)
je 0x99fe
movq 0x50(%rbx), %rax
cmpl $0x0, 0x20(%rax)
jne 0x99fe
leaq 0x88ab(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x178(%rax), %rdi
movq %rbx, %rsi
callq 0x88db
jmp 0x99fe
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/route_t.c
// Function: find_route_t
Route_t *find_route_t(List *list, const char *name)
{
	Route_t *route;
	ListNode *node;
	ListIterator iterator;

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

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9a48
movq 0x10(%rax), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2240
testl %eax, %eax
jne 0x9a26
jmp 0x9a4b
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/route_t.c
// Function: get_queue_number_route_t
uint32_t get_queue_number_route_t(Route_t *route)
{
	KeylistIterator iterator;
	KeylistNode *node;
	List *list;
	uint32_t queues = 0;

	keylist_rewind(route->keys, &iterator);
	while ((node = keylist_next_node(&iterator)) != NULL)
	{
		list = EG_KEYLIST_NODE_VALUE(node);
		queues += EG_LIST_LENGTH(list);
	}

	return queues;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x50(%rdi), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x86b7
movq %rbx, %rdi
callq 0x86be
xorl %ebx, %ebx
testq %rax, %rax
je 0x9ab9
movq %rsp, %r14
movq 0x18(%rax), %rax
addl 0x20(%rax), %ebx
movq %r14, %rdi
callq 0x86be
testq %rax, %rax
jne 0x9aa5
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: create_channel_t
Channel_t *create_channel_t(const char *name, uint32_t flags)
{
	Channel_t *channel = (Channel_t*)xmalloc(sizeof(*channel));

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

	channel->auto_delete = 0;
	channel->round_robin = 0;

	if (BIT_CHECK(channel->flags, EG_CHANNEL_AUTODELETE_FLAG)) {
		channel->auto_delete = 1;
	}

	if (BIT_CHECK(channel->flags, EG_CHANNEL_ROUND_ROBIN_FLAG)) {
		channel->round_robin = 1;
	}

	channel->topics = keylist_create();
	channel->patterns = keylist_create();

	EG_KEYLIST_SET_FREE_METHOD(channel->topics, free_channel_keylist_handler);
	EG_KEYLIST_SET_MATCH_METHOD(channel->topics, match_channel_keylist_handler);

	EG_KEYLIST_SET_FREE_METHOD(channel->patterns, free_channel_keylist_handler);
	EG_KEYLIST_SET_MATCH_METHOD(channel->patterns, match_channel_keylist_handler);

	return channel;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x60, %edi
callq 0x42f0
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2290
movl %ebp, 0x40(%rbx)
movq $0x0, 0x44(%rbx)
testb $0x1, %bpl
je 0x9b0d
movl $0x1, 0x44(%rbx)
testb $0x2, %bpl
je 0x9b1a
movl $0x1, 0x48(%rbx)
callq 0x85f8
movq %rax, 0x50(%rbx)
callq 0x85f8
movq %rax, 0x58(%rbx)
movq 0x50(%rbx), %rcx
leaq 0x1f(%rip), %rdx        # 0x9b56
movq %rdx, 0x10(%rcx)
leaq 0x26(%rip), %rsi        # 0x9b68
movq %rsi, 0x18(%rcx)
movq %rdx, 0x10(%rax)
movq %rsi, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: delete_channel_t
void delete_channel_t(Channel_t *channel)
{
	eject_clients_channel_t(channel);

	keylist_release(channel->topics);
	keylist_release(channel->patterns);

	xfree(channel);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x86b7
movq %r14, %rdi
callq 0x86be
testq %rax, %rax
je 0x9be9
movq %rax, %r15
leaq 0x8(%rsp), %r14
movq %rsp, %r12
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9bd9
movq 0x10(%rax), %rsi
movq 0x10(%r15), %rdx
movq %rbx, %rdi
callq 0x9fa4
jmp 0x9bba
movq %r12, %rdi
callq 0x86be
movq %rax, %r15
testq %rax, %rax
jne 0x9bae
movq 0x58(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x86b7
movq %r14, %rdi
callq 0x86be
testq %rax, %rax
je 0x9c4b
movq %rax, %r15
leaq 0x8(%rsp), %r14
movq %rsp, %r12
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9c3b
movq 0x10(%rax), %rsi
movq 0x10(%r15), %rdx
movq %rbx, %rdi
callq 0xa09b
jmp 0x9c1c
movq %r12, %rdi
callq 0x86be
movq %rax, %r15
testq %rax, %rax
jne 0x9c10
movq 0x50(%rbx), %rdi
callq 0x8616
movq 0x58(%rbx), %rdi
callq 0x8616
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/channel_t.c
// Function: publish_message_channel_t
void publish_message_channel_t(Channel_t *channel, const char *topic, Object *msg)
{
	EagleClient *client;
	KeylistIterator keylist_iterator;
	KeylistNode *keylist_node;
	ListNode *list_node;
	ListIterator list_iterator;
	List *list;
	char *pattern;

	keylist_node = keylist_get_value(channel->topics, (void*)topic);
	if (keylist_node)
	{
		list = EG_KEYLIST_NODE_VALUE(keylist_node);

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

			client = EG_LIST_NODE_VALUE(EG_LIST_FIRST(list));
			channel_client_event_message(client, channel, topic, msg);
		}
		else
		{
			list_rewind(list, &list_iterator);
			while ((list_node = list_next_node(&list_iterator)) != NULL)
			{
				client = EG_LIST_NODE_VALUE(list_node);
				channel_client_event_message(client, channel, topic, msg);
			}
		}
	}

	if (EG_KEYLIST_LENGTH(channel->patterns))
	{
		keylist_rewind(channel->patterns, &keylist_iterator);
		while ((keylist_node = keylist_next_node(&keylist_iterator)) != NULL)
		{
			pattern = EG_KEYLIST_NODE_KEY(keylist_node);

			if (pattern_match(topic, pattern, 0))
			{
				list = EG_KEYLIST_NODE_VALUE(keylist_node);

				list_rewind(list, &list_iterator);
				while ((list_node = list_next_node(&list_iterator)) != NULL)
				{
					client = EG_LIST_NODE_VALUE(list_node);
					channel_client_event_pattern_message(client, channel, topic, pattern, msg);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x50(%rdi), %rdi
callq 0x8664
testq %rax, %rax
je 0x9d02
movq 0x18(%rax), %r12
cmpl $0x0, 0x48(%r15)
je 0x9cc1
movq %r12, %rdi
callq 0x8a18
movq (%r12), %rax
movq 0x10(%rax), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x7eb4
jmp 0x9d02
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x8a40
movq %r13, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9d02
leaq 0x8(%rsp), %r12
movq 0x10(%rax), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x7eb4
movq %r12, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x9ce3
movq 0x58(%r15), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x9d83
movq %rsp, %r12
movq %r12, %rsi
callq 0x86b7
movq %r12, %rdi
callq 0x86be
testq %rax, %rax
je 0x9d83
movq %rax, %r12
leaq 0x8(%rsp), %r13
movq 0x10(%r12), %rbp
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x4cea
testl %eax, %eax
je 0x9d73
movq 0x18(%r12), %rdi
movq %r13, %rsi
callq 0x8a40
movq %r13, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9d73
movq 0x10(%rax), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %rbx, %r8
callq 0x7f52
jmp 0x9d4f
movq %rsp, %rdi
callq 0x86be
movq %rax, %r12
testq %rax, %rax
jne 0x9d2c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: find_channel_t
Channel_t *find_channel_t(List *list, const char *name)
{
	Channel_t *channel;
	ListNode *node;
	ListIterator iterator;

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

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rsp, %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x9dcb
movq 0x10(%rax), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2240
testl %eax, %eax
jne 0x9da9
jmp 0x9dce
xorl %r15d, %r15d
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: subscribe_channel_t
void subscribe_channel_t(Channel_t *channel, EagleClient *client, const char *topic)
{
	List *list;
	KeylistNode *node = keylist_get_value(channel->topics, (void*)topic);
	int subscribe = 0;

	if (!node)
	{
		list = list_create();
		keylist_set_value(channel->topics, xstrdup(topic), list);
		node = EG_KEYLIST_LAST(channel->topics);
		subscribe = 1;
	}
	else
	{
		list = EG_KEYLIST_NODE_VALUE(node);
		if (!list_search_node(list, client))
			subscribe = 1;
	}

	if (subscribe)
	{
		list_add_value_tail(list, client);
		add_keylist_channel_t(client->subscribed_topics, channel, node);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
movq %rdx, %rsi
callq 0x8664
testq %rax, %rax
je 0x9e40
movq %rax, %r12
movq 0x18(%rax), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x88ff
testq %rax, %rax
setne %al
jmp 0x9e6c
callq 0x87cc
movq %rax, %r15
movq 0x50(%rbx), %r12
movq %r13, %rdi
callq 0x44d1
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x86ce
movq 0x50(%rbx), %rax
movq 0x8(%rax), %r12
xorl %eax, %eax
testb %al, %al
je 0x9e7a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x8886
movq 0x60(%r14), %rdi
movq %rbx, %rsi
movq %r12, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9e9a
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: add_keylist_channel_t
static void add_keylist_channel_t(Keylist *keylist, Channel_t *channel, KeylistNode *keylist_node)
{
	List *list;
	KeylistNode *node = keylist_get_value(keylist, channel);
	int add = 0;

	if (!node)
	{
		list = list_create();
		keylist_set_value(keylist, channel, list);
		add = 1;
	}
	else
	{
		list = EG_KEYLIST_NODE_VALUE(node);
		if (!list_search_node(list, keylist_node))
			add = 1;
	}

	if (add)
	{
		list_add_value_tail(list, keylist_node);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
callq 0x8664
testq %rax, %rax
je 0x9ecc
movq 0x18(%rax), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x88ff
testq %rax, %rax
setne %al
jmp 0x9ee4
callq 0x87cc
movq %rax, %r14
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x86ce
xorl %eax, %eax
testb %al, %al
je 0x9ef4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8886
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: psubscribe_channel_t
void psubscribe_channel_t(Channel_t *channel, EagleClient *client, const char *pattern)
{
	List *list;
	KeylistNode *node = keylist_get_value(channel->patterns, (void*)pattern);
	int subscribe = 0;

	if (!node)
	{
		list = list_create();
		keylist_set_value(channel->patterns, xstrdup(pattern), list);
		node = EG_KEYLIST_LAST(channel->patterns);
		subscribe = 1;
	}
	else
	{
		list = EG_KEYLIST_NODE_VALUE(node);
		if (!list_search_node(list, client))
			subscribe = 1;
	}

	if (subscribe)
	{
		list_add_value_tail(list, client);
		add_keylist_channel_t(client->subscribed_patterns, channel, node);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
movq %rdx, %rsi
callq 0x8664
testq %rax, %rax
je 0x9f47
movq %rax, %r12
movq 0x18(%rax), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x88ff
testq %rax, %rax
setne %al
jmp 0x9f73
callq 0x87cc
movq %rax, %r15
movq 0x58(%rbx), %r12
movq %r13, %rdi
callq 0x44d1
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x86ce
movq 0x58(%rbx), %rax
movq 0x8(%rax), %r12
xorl %eax, %eax
testb %al, %al
je 0x9f81
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x8886
movq 0x68(%r14), %rdi
movq %rbx, %rsi
movq %r12, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9e9a
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: unsubscribe_channel_t
int unsubscribe_channel_t(Channel_t *channel, EagleClient *client, const char *topic)
{
	List *list;
	KeylistNode *node = keylist_get_value(channel->topics, (void*)topic);

	if (!node) {
		return EG_STATUS_ERR;
	}

	list = EG_KEYLIST_NODE_VALUE(node);

	list_delete_value(list, client);
	remove_keylist_channel_t(client->subscribed_topics, channel, node);

	if (!EG_LIST_LENGTH(list)) {
		keylist_delete_node(channel->topics, node);
	}

	if (channel->auto_delete)
	{
		if (EG_KEYLIST_LENGTH(channel->topics) == 0 &&
			EG_KEYLIST_LENGTH(channel->patterns) == 0) {
			list_delete_value(server->channels, channel);
		}
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x50(%rdi), %rdi
movq %rdx, %rsi
callq 0x8664
testq %rax, %rax
je 0xa02f
movq %rax, %r14
movq 0x18(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x88db
movq 0x60(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xa03f
cmpl $0x0, 0x20(%r12)
jne 0x9ff8
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x8775
xorl %ebp, %ebp
cmpl $0x0, 0x44(%rbx)
je 0xa034
movq 0x50(%rbx), %rax
cmpl $0x0, 0x20(%rax)
jne 0xa034
movq 0x58(%rbx), %rax
cmpl $0x0, 0x20(%rax)
jne 0xa034
leaq 0x8275(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %rbx, %rsi
callq 0x88db
jmp 0xa034
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: remove_keylist_channel_t
static int remove_keylist_channel_t(Keylist *keylist, Channel_t *channel, KeylistNode *keylist_node)
{
	List *list;
	KeylistNode *node = keylist_get_value(keylist, channel);

	if (!node) {
		return EG_STATUS_ERR;
	}

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

	if (!EG_LIST_LENGTH(list)) {
		list_release(list);
		keylist_delete_node(keylist, node);
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
callq 0x8664
testq %rax, %rax
je 0xa071
movq %rax, %r14
movq 0x18(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x88db
cmpl $0x0, 0x20(%r12)
je 0xa07d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r12, %rdi
callq 0x87ea
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8775
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/channel_t.c
// Function: punsubscribe_channel_t
int punsubscribe_channel_t(Channel_t *channel, EagleClient *client, const char *pattern)
{
	List *list;
	KeylistNode *node = keylist_get_value(channel->patterns, (void*)pattern);

	if (!node) {
		return EG_STATUS_ERR;
	}

	list = EG_KEYLIST_NODE_VALUE(node);

	list_delete_value(list, client);
	remove_keylist_channel_t(client->subscribed_patterns, channel, node);

	if (!EG_LIST_LENGTH(list)) {
		keylist_delete_node(channel->patterns, node);
	}

	if (channel->auto_delete)
	{
		if (EG_KEYLIST_LENGTH(channel->topics) == 0 &&
			EG_KEYLIST_LENGTH(channel->patterns) == 0) {
			list_delete_value(server->channels, channel);
		}
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
movq %rdx, %rsi
callq 0x8664
testq %rax, %rax
je 0xa126
movq %rax, %r14
movq 0x18(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x88db
movq 0x68(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xa03f
cmpl $0x0, 0x20(%r12)
jne 0xa0ef
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x8775
xorl %ebp, %ebp
cmpl $0x0, 0x44(%rbx)
je 0xa12b
movq 0x50(%rbx), %rax
cmpl $0x0, 0x20(%rax)
jne 0xa12b
movq 0x58(%rbx), %rax
cmpl $0x0, 0x20(%rax)
jne 0xa12b
leaq 0x817e(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %rbx, %rsi
callq 0x88db
jmp 0xa12b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/storage.c
// Function: storage_save_channels
static int storage_save_channels(FILE *fp)
{
	ListIterator iterator;
	ListNode *node;
	Channel_t *channel;

	list_rewind(server->channels, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		channel = EG_LIST_NODE_VALUE(node);

		if (!BIT_CHECK(channel->flags, EG_CHANNEL_DURABLE_FLAG))
			continue;

		if (storage_save_channel(fp, channel) != EG_STATUS_OK)
			return EG_STATUS_ERR;
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x7584(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0xadab
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x10(%rax), %r12
testb $0x4, 0x40(%r12)
je 0xad9e
movb $0x6, 0xf(%rsp)
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x2460
testq %rax, %rax
je 0xadad
movq %r12, %rdi
callq 0x2160
leal 0x1(%rax), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xaf75
cmpl $-0x1, %eax
je 0xadad
addq $0x40, %r12
movq %rbx, %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0xaf75
cmpl $-0x1, %eax
je 0xadad
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0xad3f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/storage.c
// Function: storage_save_background
int storage_save_background(const char *filename)
{
	pid_t child_pid;

	if (server->child_pid != -1)
		return EG_STATUS_ERR;

	if ((child_pid = fork()) == 0)
	{
		if (server->fd > 0)
			close(server->fd);

		if (server->sfd > 0)
			close(server->sfd);

		_exit(storage_save(filename));
	}
	else
	{
		if (child_pid == -1)
		{
			warning("Error save data in background: %s\n", strerror(errno));
			return EG_STATUS_ERR;
		}

		server->child_pid = child_pid;
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x74c9(%rip), %r14      # 0x12290
movq (%r14), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, 0x34(%rax)
jne 0xae0d
movq %rdi, %rbx
callq 0x2490
cmpl $-0x1, %eax
je 0xadf0
testl %eax, %eax
je 0xae14
movq (%r14), %rcx
movl %eax, 0x34(%rcx)
xorl %ebp, %ebp
jmp 0xae0d
callq 0x2050
movl (%rax), %edi
callq 0x2480
leaq 0x19ff(%rip), %rdi      # 0xc802
movq %rax, %rsi
xorl %eax, %eax
callq 0x4734
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq (%r14), %rax
movl 0x8(%rax), %edi
testl %edi, %edi
jle 0xae23
callq 0x21e0
movq (%r14), %rax
movl 0xc(%rax), %edi
testl %edi, %edi
jle 0xae32
callq 0x21e0
movq %rbx, %rdi
callq 0xa744
movl %eax, %edi
callq 0x2090
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/storage.c
// Function: storage_read_data
static int storage_read_data(FILE *fp, void *data, uint32_t maxlen)
{
	uint32_t comprlen;
	uint32_t length;
	void *compressed;

	if (storage_read(fp, &comprlen, sizeof(comprlen)) == -1)
		return EG_STATUS_ERR;

	if (storage_read(fp, &length, sizeof(length)) == -1)
		return EG_STATUS_ERR;

	if ((length > maxlen && !comprlen) || comprlen > maxlen)
		return EG_STATUS_ERR;

	if (comprlen)
	{
		compressed = xmalloc(length);

		if (storage_read(fp, compressed, length) == -1) {
			xfree(compressed);
			return EG_STATUS_ERR;
		}

		if (lzf_decompress(compressed, length, data, comprlen) == 0) {
			xfree(compressed);
			return EG_STATUS_ERR;
		}

		xfree(compressed);
	}
	else
	{
		if (storage_read(fp, data, length) == -1)
			return EG_STATUS_ERR;
	}

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %r15
leaq 0x4(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x20c0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xaf64
movq %rsp, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x20c0
testq %rax, %rax
je 0xaf64
movl (%rsp), %r12d
cmpl %r13d, %r12d
seta %al
movl 0x4(%rsp), %ebp
testl %ebp, %ebp
sete %cl
andb %al, %cl
cmpl %r13d, %ebp
seta %al
orb %cl, %al
jne 0xaf64
testl %ebp, %ebp
je 0xaf36
movq %r12, %rdi
callq 0x42f0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x20c0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %r12
je 0xaf5c
testq %rax, %rax
je 0xaf5c
movq %r13, %rdi
movl %r12d, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0xb8a8
movl %eax, %ebp
movq %r13, %rdi
callq 0x44fe
testl %ebp, %ebp
jne 0xaf58
jmp 0xaf64
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x20c0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %r12
je 0xaf64
testq %rax, %rax
je 0xaf64
xorl %ebx, %ebx
jmp 0xaf64
movq %r13, %rdi
callq 0x44fe
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/storage.c
// Function: storage_write_data
static int storage_write_data(FILE *fp, void *data, uint32_t length)
{
	int err;
	uint32_t comprlen = 0;

	err = storage_write_lzf_data(fp, data, length);

	if (err == -1)
		return EG_STATUS_ERR;

	if (err)
		return EG_STATUS_OK;

	if (storage_write(fp, &comprlen, sizeof(comprlen)) == -1)
		return EG_STATUS_ERR;

	if (storage_write(fp, &length, sizeof(length)) == -1)
		return EG_STATUS_ERR;

	if (storage_write(fp, data, length) == -1)
		return EG_STATUS_ERR;

	return EG_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, (%rsp)
movl $0x0, 0x8(%rsp)
movl %edx, 0xc(%rsp)
xorl %ebp, %ebp
cmpl $0x5, %edx
jb 0xb043
movl %edx, %r12d
leal -0x4(%r12), %ebp
leal -0x3(%r12), %edi
callq 0x42f0
movq %rax, %r15
movq %r14, %rdi
movl %r12d, %esi
movq %rax, %rdx
movl %ebp, %ecx
callq 0xb48c
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0xb039
leaq 0xc(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2460
testq %rax, %rax
je 0xb032
leaq 0x4(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2460
testq %rax, %rax
je 0xb032
movl 0x4(%rsp), %r12d
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x2460
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %r12
je 0xb032
movl $0x1, %ebp
testq %rax, %rax
jne 0xb03b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xb03b
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x44fe
cmpl $-0x1, %ebp
je 0xb0b8
testl %ebp, %ebp
jne 0xb0b6
leaq 0x8(%rsp), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2460
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xb0b8
movq %rsp, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2460
testq %rax, %rax
je 0xb0b8
movl (%rsp), %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rsi
sete %bpl
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x2460
testq %rax, %rax
sete %al
orb %bpl, %al
movzbl %al, %ebp
negl %ebp
jmp 0xb0b8
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/config.c
// Function: config_load
int config_load(const char *filename)
{
	char line[512];
	FILE *fp;

	fp = fopen(filename, "r");
	if (!fp)
		return EG_STATUS_ERR;

	while (fgets(line, sizeof(line), fp) != NULL)
	{
		if (parse_config_line(line) != EG_STATUS_OK)
		{
			fclose(fp);
			return EG_STATUS_ERR;
		}
	}

	fclose(fp);

	return EG_STATUS_OK; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
leaq 0x14d7(%rip), %rsi      # 0xc866
callq 0x23c0
testq %rax, %rax
je 0xb460
movq %rax, %rbx
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdx
callq 0x2220
testq %rax, %rax
je 0xb467
leaq 0x1543(%rip), %r14      # 0xc903
movq %rsp, %r15
movabsq $0x800000401, %r12      # imm = 0x800000401
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movzbl (%rsp), %eax
cmpq $0x23, %rax
ja 0xb3f9
btq %rax, %r12
jae 0xb3f9
movq %r15, %rdi
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdx
callq 0x2220
testq %rax, %rax
jne 0xb3d2
jmp 0xb467
movq %r15, %rdi
movq %r14, %rsi
callq 0x23e0
testq %rax, %rax
je 0xb435
xorl %r13d, %r13d
xorl %r12d, %r12d
testq %r12, %r12
je 0xb41b
testq %r13, %r13
je 0xb421
jmp 0xb46b
movq %rax, %r12
movq %r13, %rax
movq %rax, %r13
xorl %edi, %edi
movq %r14, %rsi
callq 0x23e0
testq %rax, %rax
jne 0xb40f
jmp 0xb43b
xorl %r12d, %r12d
xorl %r13d, %r13d
testq %r12, %r12
je 0xb470
testq %r13, %r13
je 0xb470
movq %r12, %rdi
movq %r13, %rsi
callq 0xb0c8
testl %eax, %eax
movabsq $0x800000401, %r12      # imm = 0x800000401
je 0xb3e2
jmp 0xb470
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xb478
xorl %ebp, %ebp
jmp 0xb470
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x2130
movl %ebp, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/antonblanchard[P]will-it-scale/tests/lock1.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char tmpfile[] = "/tmp/willitscale.XXXXXX";
	int fd = mkstemp(tmpfile);

	assert(fd >= 0);
	unlink(tmpfile);

	while (1) {
		struct flock lck;

		lck.l_type = F_WRLCK;
		lck.l_whence = SEEK_SET;
		lck.l_start = 0;
		lck.l_len = 1;
		assert(fcntl(fd, F_SETLKW, &lck) == 0);

		lck.l_type = F_UNLCK;
		lck.l_whence = SEEK_SET;
		lck.l_start = 0;
		lck.l_len = 1;
		assert(fcntl(fd, F_SETLKW, &lck) == 0);

		(*iterations) += 2;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movaps 0x66e(%rip), %xmm0      # 0x22e0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
movabsq $0x5858585858582e, %rax # imm = 0x5858585858582E
movq %rax, 0x10(%rdi)
callq 0x11f0
testl %eax, %eax
js 0x1d4e
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x1080
movq %rsp, %rdx
movl $0x1, (%rdx)
movq $0x0, 0x8(%rdx)
movq $0x1, 0x10(%rdx)
movl %ebp, %edi
movl $0x7, %esi
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
jne 0x1d2f
movq %rsp, %r14
movl $0x2, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x1, 0x10(%rsp)
movl %ebp, %edi
movl $0x7, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
jne 0x1d6d
addq $0x2, (%rbx)
movl $0x1, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x1, 0x10(%rsp)
movl %ebp, %edi
movl $0x7, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10d0
testl %eax, %eax
je 0x1ccf
leaq 0x58b(%rip), %rdi       # 0x22c1
leaq 0x543(%rip), %rsi       # 0x2280
leaq 0x54a(%rip), %rcx       # 0x228e
movl $0x18, %edx
callq 0x1140
leaq 0x523(%rip), %rdi       # 0x2278
leaq 0x524(%rip), %rsi       # 0x2280
leaq 0x52b(%rip), %rcx       # 0x228e
movl $0xe, %edx
callq 0x1140
leaq 0x54d(%rip), %rdi       # 0x22c1
leaq 0x505(%rip), %rsi       # 0x2280
leaq 0x50c(%rip), %rcx       # 0x228e
movl $0x1e, %edx
callq 0x1140
// File: /workspace/github_c_makefile_star2_O1/sadistech[P]nesromtool2/./src/nrt.c
// Function: nrt_prg_list_delete
nrt_prg_listitem* nrt_prg_listitem_at(nrt_prg_list* list, int index)
{
  nrt_prg_listitem *l = list->list;
  int counter = 0;

  while (l) {
    if (counter == index) {
      return l;
    }

    counter++;
    l = l->next;
  }

  return NULL;
}

// Assembly:
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x340e
leal 0x1(%rsi), %edx
movq %rcx, %rax
decl %edx
je 0x3410
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x3401
xorl %eax, %eax
testq %rax, %rax
je 0x342e
decl (%rdi)
testl %esi, %esi
je 0x3431
decl %esi
je 0x3425
movq 0x8(%rcx), %rcx
jmp 0x341b
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rcx)
retq
xorl %eax, %eax
retq
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/sadistech[P]nesromtool2/./src/tilec_main.c
// Function: parse_opts
tilec_opts* parse_opts(int argc, char **argv) {
  if (argc < 3) {
    fprintf(stderr, "Usage: %s <outfile> <infile> [ <infile> ... ]\n", argv[0]);
    exit(EXIT_FAILURE);
  }

  tilec_opts *opts = (tilec_opts*)calloc(1, sizeof(tilec_opts));

  static struct option longopts[] = {
    { "help", no_argument, NULL, 'h' },
    { "outfile", required_argument, NULL, 'o' },
    { "varfile", required_argument, NULL, 'V' },
    { NULL, 0, NULL, 0 }
  };

  int ch;

  while ((ch = getopt_long(argc, argv, "ho:V:", longopts, NULL)) != -1) {
    switch (ch) {
      case 'h':
        printf("USAGE\n");
        exit(EXIT_SUCCESS);
        break;

      case 'o':
        strncpy(opts->outfile, optarg, PATH_MAX);
        break;

      case 'V':
        strncpy(opts->varfile, optarg, PATH_MAX);
        break;

      case 0:
        break;
      default:
        fprintf(stderr, "Invalid argument: -%c\n", ch);
        exit(EXIT_FAILURE);
    }
  }

  // set up default values if they aren't already in there.
  if (opts->outfile[0] == 0) {
    strncpy(opts->outfile, DEFAULT_OUTFILE, PATH_MAX);
  }

  if (opts->varfile[0] == 0) {
    strncpy(opts->varfile, DEFAULT_VARFILE, PATH_MAX);
  }

  argc -= optind;
  argv += optind;

  opts->argc = argc;
  opts->argv = argv;

  return opts;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x2, %edi
jle 0x5db7
movl %edi, %ebp
movl $0x1, %edi
movl $0x2010, %esi           # imm = 0x2010
callq 0x21b0
movq %rax, %r14
addq $0x1000, %rax           # imm = 0x1000
movq %rax, (%rsp)
leaq 0x2bce(%rip), %r15      # 0x889f
leaq 0x6c98(%rip), %r12      # 0xc970
movq 0x62f1(%rip), %r13      # 0xbfd0
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x2130
cmpl $0x55, %eax
jle 0x5d1c
movq %r14, %rdi
cmpl $0x56, %eax
je 0x5d0c
movq (%rsp), %rdi
cmpl $0x6f, %eax
jne 0x5d98
movq (%r13), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x2070
jmp 0x5cdf
testl %eax, %eax
je 0x5cdf
cmpl $-0x1, %eax
jne 0x5db0
cmpb $0x0, 0x1000(%r14)
jne 0x5d4e
movq %r14, %rdi
addq $0x1000, %rdi           # imm = 0x1000
leaq 0x2b61(%rip), %rsi      # 0x88a5
movl $0x1000, %edx           # imm = 0x1000
callq 0x2070
cmpb $0x0, (%r14)
jne 0x5d68
leaq 0x2b53(%rip), %rsi      # 0x88ae
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
callq 0x2070
movq 0x6259(%rip), %rax      # 0xbfc8
movslq (%rax), %rax
subl %eax, %ebp
leaq (%rbx,%rax,8), %rax
movl %ebp, 0x2000(%r14)
movq %rax, 0x2008(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x68, %eax
jne 0x5db0
leaq 0x2be7(%rip), %rdi      # 0x898b
callq 0x20b0
xorl %edi, %edi
callq 0x2310
movl %eax, %edi
callq 0x2852
movq %rbx, %rdi
callq 0x2875
// File: /workspace/github_c_makefile_star2_O1/sadistech[P]nesromtool2/./src/tilec_main.c
// Function: is_in_bank
bool is_in_bank(nrt_chrbank *bank, int bank_size, nrt_tile *tile) {
  int i;
  for (i = 0; i < bank_size; i++) {
    if (memcmp(&(bank->tile[i]), tile, NRT_TILE_SIZE) == 0) {
      // they match!
      last_offset = i;
      return true;
    }
  }

  return false;
}

// Assembly:
testl %esi, %esi
setg %al
jle 0x60fd
movdqu (%rdi), %xmm0
movdqu (%rdx), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x60eb
movl %esi, %eax
addq $0x10, %rdi
leaq -0x1(%rax), %rsi
xorl %ecx, %ecx
cmpq %rcx, %rsi
je 0x60f4
movdqu (%rdi), %xmm0
movdqu (%rdx), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %r8d
addq $0x10, %rdi
incq %rcx
cmpl $0xffff, %r8d           # imm = 0xFFFF
jne 0x60bd
cmpq %rax, %rcx
setb %al
jmp 0x60ed
xorl %ecx, %ecx
movl %ecx, 0x6901(%rip)      # 0xc9f4
retq
incq %rcx
cmpq %rax, %rcx
setb %al
retq