LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_get_command_handler
void queue_get_command_handler(EagleClient *client)
{
	ProtocolRequestQueueGet *req = (ProtocolRequestQueueGet*)client->request;
	ProtocolResponseHeader res;
	Queue_t *queue_t;
	Message *msg;
	char *buffer;

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

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

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

	queue_t = find_queue_t(client->declared_queues, req->body.name);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_DECLARED);
		return;
	}

	msg = get_message_queue_t(queue_t);
	if (!msg) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NO_DATA);
		return;
	}

	set_response_header(&res, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS, EG_MESSAGE_SIZE(msg) + sizeof(uint64_t));

	buffer = (char*)xmalloc(sizeof(res) + sizeof(uint64_t));

	memcpy(buffer, &res, sizeof(res));
	memcpy(buffer + sizeof(res), &msg->tag, sizeof(uint64_t));

	add_response(client, buffer, sizeof(res) + sizeof(uint64_t));
	add_object_response(client, EG_MESSAGE_OBJECT(msg));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x68cf
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x69b6
movq 0x10(%rbx), %r15
testl $0x8000021, 0x8(%rbx)   # imm = 0x8000021
je 0x697e
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x698d
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x699c
movq %rax, %rdi
callq 0x9742
movzbl 0x2(%r15), %r15d
testq %rax, %rax
je 0x69ab
movq %rax, %r14
movq (%rax), %rax
movq 0x8(%rax), %r12
movl $0x10, %edi
callq 0x4770
shlq $0x20, %r12
shll $0x10, %r15d
orq %r12, %r15
movabsq $0x801000080, %rcx      # imm = 0x801000080
addq %r15, %rcx
movq %rcx, (%rax)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x10, %edx
callq 0x5836
movq (%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x69c6
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x69b6
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x69b6
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x69b6
movq %rbx, %rdi
movl %r15d, %esi
movl $0xa, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: add_object_response
static void add_object_response(EagleClient *client, Object *object)
{
	increment_references_count(object);

	if (set_write_event(client) != EG_STATUS_OK) {
		decrement_references_count(object);
		return;
	}

	list_add_value_tail(client->responses, object);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x5561
movq %r14, %rdi
callq 0x8943
testl %eax, %eax
je 0x69f3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5565
movq 0x48(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8d1a
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_pop_command_handler
void queue_pop_command_handler(EagleClient *client)
{
	ProtocolRequestQueuePop *req = (ProtocolRequestQueuePop*)client->request;
	ProtocolResponseHeader res;
	Queue_t *queue_t;
	Message *msg;
	char *buffer;

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

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

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

	queue_t = find_queue_t(client->declared_queues, req->body.name);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_DECLARED);
		return;
	}

	msg = get_message_queue_t(queue_t);
	if (!msg) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NO_DATA);
		return;
	}

	set_response_header(&res, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS, EG_MESSAGE_SIZE(msg) + sizeof(uint64_t));

	buffer = (char*)xmalloc(sizeof(res) + sizeof(uint64_t));

	memcpy(buffer, &res, sizeof(res));
	memcpy(buffer + sizeof(res), &msg->tag, sizeof(uint64_t));

	add_response(client, buffer, sizeof(res) + sizeof(uint64_t));
	add_object_response(client, EG_MESSAGE_OBJECT(msg));

	pop_message_queue_t(queue_t, req->body.timeout);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x4b, 0x20(%rdi)
ja 0x6a2a
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6b26
movq 0x10(%rbx), %r13
testl $0x10000021, 0x8(%rbx)  # imm = 0x10000021
je 0x6aee
leaq 0x8(%r13), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6afd
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6b0c
movq %rax, %r14
movq %rax, %rdi
callq 0x9742
movzbl 0x2(%r13), %r12d
testq %rax, %rax
je 0x6b1b
movq %rax, %r15
movq (%rax), %rax
movq 0x8(%rax), %rbp
movl $0x10, %edi
callq 0x4770
shlq $0x20, %rbp
shll $0x10, %r12d
orq %rbp, %r12
movabsq $0x801000080, %rcx      # imm = 0x801000080
addq %r12, %rcx
movq %rcx, (%rax)
movq 0x8(%r15), %rcx
movq %rcx, 0x8(%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x10, %edx
callq 0x5836
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x69c6
movl 0x48(%r13), %esi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x96e6
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6b26
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6b26
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6b26
movq %rbx, %rdi
movl %r12d, %esi
movl $0xa, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_confirm_command_handler
void queue_confirm_command_handler(EagleClient *client)
{
	ProtocolRequestQueueConfirm *req = (ProtocolRequestQueueConfirm*)client->request;
	Queue_t *queue_t;

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

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

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

	queue_t = find_queue_t(client->declared_queues, req->body.name);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_DECLARED);
		return;
	}

	if (confirm_message_queue_t(queue_t, req->body.tag) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NO_DATA);
		return;
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x4f, 0x20(%rdi)
ja 0x6b57
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6bdb
movq 0x10(%rbx), %r15
testl $0x20000021, 0x8(%rbx)  # imm = 0x20000021
je 0x6ba9
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6bb8
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6bc7
movq 0x48(%r15), %rsi
movq %rax, %rdi
callq 0x974b
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
testl %eax, %eax
je 0x6bd6
movl $0xa, %edx
jmp 0x6bdb
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6bdb
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6bdb
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6bdb
movl $0x1, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_subscribe_command_handler
void queue_subscribe_command_handler(EagleClient *client)
{
	ProtocolRequestQueueSubscribe *req = (ProtocolRequestQueueSubscribe*)client->request;
	Queue_t *queue_t;

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

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

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

	queue_t = find_queue_t(client->declared_queues, req->body.name);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_DECLARED);
		return;
	}

	if (find_queue_t(client->subscribed_queues, req->body.name)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	subscribe_client_queue_t(queue_t, client, req->body.flags);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x4b, 0x20(%rdi)
ja 0x6c06
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6cac
movq 0x10(%rbx), %r12
testl $0x40000021, 0x8(%rbx)  # imm = 0x40000021
je 0x6c5e
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6c6e
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6c7e
movq %rax, %r15
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6c8e
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x6cac
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6cac
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6cac
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6cac
movl 0x48(%r12), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x989c
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_unsubscribe_command_handler
void queue_unsubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestQueueUnsubscribe *req = (ProtocolRequestQueueUnsubscribe*)client->request;
	Queue_t *queue_t;

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

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

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

	queue_t = find_queue_t(client->declared_queues, req->body.name);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_DECLARED);
		return;
	}

	if (!find_queue_t(client->subscribed_queues, req->body.name)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	unsubscribe_client_queue_t(queue_t, client);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x6cdd
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6d7e
movq 0x10(%rbx), %r12
testl $0x80000021, 0x8(%rbx)  # imm = 0x80000021
je 0x6d40
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6d50
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6d60
movq %rax, %r15
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6d70
movq %r15, %rdi
movq %rbx, %rsi
callq 0x98ca
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x6d7e
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6d7e
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6d7e
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6d7e
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_purge_command_handler
void queue_purge_command_handler(EagleClient *client)
{
	ProtocolRequestQueuePurge *req = (ProtocolRequestQueuePurge*)client->request;
	Queue_t *queue_t;

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

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

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

	queue_t = find_queue_t(client->declared_queues, req->body.name);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_DECLARED);
		return;
	}

	purge_queue_t(queue_t);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x6da9
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6e25
movq 0x10(%rbx), %r15
movabsq $0x100000021, %rax      # imm = 0x100000021
testq %rax, 0x8(%rbx)
je 0x6dfa
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6e09
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6e18
movq %rax, %rdi
callq 0x9841
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x6e25
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6e25
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6e25
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_delete_command_handler
void queue_delete_command_handler(EagleClient *client)
{
	ProtocolRequestQueueDelete *req = (ProtocolRequestQueueDelete*)client->request;
	Queue_t *queue_t;

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

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

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

	queue_t = find_queue_t(server->queues, req->body.name);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x6e50
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6ef1
movq 0x10(%rbx), %r15
movabsq $0x200000021, %rax      # imm = 0x200000021
testq %rax, 0x8(%rbx)
je 0x6ebf
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6ece
leaq 0xb410(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6edd
movq (%r12), %rcx
movq 0x170(%rcx), %rdi
movq %rax, %rsi
callq 0x8d73
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x6eec
movl $0x1, %edx
jmp 0x6ef1
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6ef1
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6ef1
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x6ef1
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_create_command_handler
void route_create_command_handler(EagleClient *client)
{
	ProtocolRequestRouteCreate *req = (ProtocolRequestRouteCreate*)client->request;
	Route_t *route;

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

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

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

	if (find_route_t(server->routes, req->body.name)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	route = create_route_t(req->body.name, req->body.flags);

	list_add_value_tail(server->routes, route);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x4b, 0x20(%rdi)
ja 0x6f22
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6fc3
movq 0x10(%rbx), %r15
movabsq $0x400000022, %rax      # imm = 0x400000022
testq %rax, 0x8(%rbx)
je 0x6f79
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6f88
leaq 0xb33e(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9e9e
testq %rax, %rax
je 0x6f97
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x6fc3
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6fc3
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6fc3
movl 0x48(%r15), %esi
movq %r14, %rdi
callq 0x9b98
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x8d1a
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_exist_command_handler
void route_exist_command_handler(EagleClient *client)
{
	ProtocolRequestRouteExist *req = (ProtocolRequestRouteExist*)client->request;
	ProtocolResponseRouteExist *res;

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

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

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

	res = (ProtocolResponseRouteExist*)xcalloc(sizeof(*res));

	set_response_header(&res->header, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS, sizeof(res->body));

	if (find_route_t(server->routes, req->body.name)) {
		res->body.status = 1;
	} else {
		res->body.status = 0;
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x6ff4
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x70a5
movq 0x10(%rbx), %r12
movabsq $0x800000022, %rax      # imm = 0x800000022
testq %rax, 0x8(%rbx)
je 0x7087
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x7097
movl $0xc, %edi
callq 0x47f6
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xb242(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9e9e
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl $0xc, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5836
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x70a5
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_list_command_handler
void route_list_command_handler(EagleClient *client)
{
	ProtocolRequestRouteList *req = (ProtocolRequestRouteList*)client->request;
	ProtocolResponseHeader res;
	ListIterator iterator;
	ListNode *node;
	Route_t *route;
	char *list;
	uint32_t keys;
	int i;

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

	if (!BIT_CHECK(client->perm, EG_USER_ADMIN_PERM) && !BIT_CHECK(client->perm, EG_USER_ROUTE_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_ROUTE_LIST_PERM)) {
		add_status_response(client, req->cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	set_response_header(&res, req->cmd, EG_PROTOCOL_STATUS_SUCCESS,
		EG_LIST_LENGTH(server->routes) * (64 + (sizeof(uint32_t) * 2)));

	list = (char*)xcalloc(sizeof(res) + res.bodylen);

	memcpy(list, &res, sizeof(res));

	i = sizeof(res);
	list_rewind(server->routes, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		route = EG_LIST_NODE_VALUE(node);

		keys = EG_KEYLIST_LENGTH(route->keys);

		memcpy(list + i, route->name, strlenz(route->name));
		i += 64;
		memcpy(list + i, &route->flags, sizeof(uint32_t));
		i += sizeof(uint32_t);
		memcpy(list + i, &keys, sizeof(uint32_t));
		i += sizeof(uint32_t);
	}

	add_response(client, list, sizeof(res) + res.bodylen);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpq $0x7, 0x20(%rdi)
ja 0x70d6
xorl %esi, %esi
movl $0x3, %edx
jmp 0x71e0
movq 0x10(%rdi), %rax
movabsq $0x1000000022, %rcx     # imm = 0x1000000022
movzbl 0x2(%rax), %r12d
testq %rcx, 0x8(%rdi)
je 0x71d8
movq %rdi, 0x10(%rsp)
leaq 0xb191(%rip), %r14      # 0x12290
movq (%r14), %rax
movq 0x178(%rax), %rax
movl 0x20(%rax), %eax
shll $0x3, %eax
leal (%rax,%rax,8), %ebx
leaq 0x8(%rbx), %rdi
callq 0x47f6
movq %rax, %r15
movq %rbx, 0x8(%rsp)
movq %rbx, %rax
shlq $0x20, %rax
shll $0x10, %r12d
addq %r12, %rax
addq $0x1000080, %rax        # imm = 0x1000080
movq %rax, (%r15)
movq (%r14), %rax
movq 0x178(%rax), %rdi
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0x8ed9
movq %r12, %rdi
callq 0x8e98
testq %rax, %rax
je 0x71b4
movl $0x4c, %r14d
leal -0x44(%r14), %ecx
movq 0x10(%rax), %r13
movq 0x50(%r13), %rax
movl 0x20(%rax), %ebx
movslq %ecx, %r12
leaq (%r15,%r12), %rbp
movq %r13, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2280
movl 0x40(%r13), %eax
movl %eax, 0x40(%r15,%r12)
movslq %r14d, %r14
movl %ebx, (%r15,%r14)
leaq 0x18(%rsp), %rdi
callq 0x8e98
addl $0x48, %r14d
testq %rax, %rax
jne 0x7164
movq 0x8(%rsp), %rdx
addl $0x8, %edx
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5836
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, %esi
movl $0x5, %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_rename_command_handler
void route_rename_command_handler(EagleClient *client)
{
	ProtocolRequestRouteRename *req = (ProtocolRequestRouteRename*)client->request;
	Route_t *route;

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

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

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

	route = find_route_t(server->routes, req->body.from);
	if (!route) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (find_route_t(server->routes, req->body.to)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	rename_route_t(route, req->body.to);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpq $0x87, 0x20(%rdi)
ja 0x73ed
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7485
movq 0x10(%rbx), %r12
movabsq $0x4000000022, %rax     # imm = 0x4000000022
testq %rax, 0x8(%rbx)
je 0x7477
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x7467
leaq 0x48(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x7467
leaq 0xae5c(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9e9e
testq %rax, %rax
je 0x7493
movq %rax, %r15
movq (%r13), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9e9e
testq %rax, %rax
je 0x74a3
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7485
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7485
movq %r15, %rdi
movq %r14, %rsi
callq 0x9ee7
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7485
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_bind_command_handler
void route_bind_command_handler(EagleClient *client)
{
	ProtocolRequestRouteBind *req = (ProtocolRequestRouteBind*)client->request;
	Route_t *route;
	Queue_t *queue_t;

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

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

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

	route = find_route_t(server->routes, req->body.name);
	if (!route) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	queue_t = find_queue_t(server->queues, req->body.queue);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	bind_route_t(route, queue_t, req->body.key);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0xa7, 0x20(%rdi)
ja 0x74e5
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x75b6
movq 0x10(%rbx), %r13
movabsq $0x8000000022, %rax     # imm = 0x8000000022
testq %rax, 0x8(%rbx)
je 0x75a9
leaq 0x8(%r13), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x759a
leaq 0x48(%r13), %r12
movl $0x40, %esi
movq %r12, %rdi
callq 0x5351
testl %eax, %eax
je 0x759a
leaq 0x88(%r13), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x52ce
testl %eax, %eax
je 0x759a
leaq 0xad46(%rip), %rbp      # 0x12290
movq (%rbp), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9e9e
testq %rax, %rax
je 0x75c9
movq %rax, %r15
movq (%rbp), %rax
movq 0x170(%rax), %rdi
movq %r12, %rsi
callq 0x97ae
testq %rax, %rax
je 0x75c9
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x9d7e
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x75b6
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x75b6
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5642
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x75b6
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_unbind_command_handler
void route_unbind_command_handler(EagleClient *client)
{
	ProtocolRequestRouteUnbind *req = (ProtocolRequestRouteUnbind*)client->request;
	Route_t *route;
	Queue_t *queue_t;

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

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

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

	route = find_route_t(server->routes, req->body.name);
	if (!route) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	queue_t = find_queue_t(server->queues, req->body.queue);
	if (!queue_t) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (unbind_route_t(route, queue_t, req->body.key) == EG_STATUS_ERR) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0xa7, 0x20(%rdi)
ja 0x75ff
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x76d5
movq 0x10(%rbx), %r13
movabsq $0x10000000022, %rax    # imm = 0x10000000022
testq %rax, 0x8(%rbx)
je 0x76c8
leaq 0x8(%r13), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x76b9
leaq 0x48(%r13), %r12
movl $0x40, %esi
movq %r12, %rdi
callq 0x5351
testl %eax, %eax
je 0x76b9
leaq 0x88(%r13), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x52ce
testl %eax, %eax
je 0x76b9
leaq 0xac2c(%rip), %rbp      # 0x12290
movq (%rbp), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9e9e
testq %rax, %rax
je 0x76e8
movq %rax, %r15
movq (%rbp), %rax
movq 0x170(%rax), %rdi
movq %r12, %rsi
callq 0x97ae
testq %rax, %rax
je 0x76e8
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x9e03
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x76f7
movl $0x1, %edx
jmp 0x76d5
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x76d5
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5642
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x76d5
movl $0x2, %edx
jmp 0x76d5
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_push_command_handler
void route_push_command_handler(EagleClient *client)
{
	ProtocolRequestRoutePush *req = (ProtocolRequestRoutePush*)client->request;
	Route_t *route;
	Object *msg;
	char *msg_data;
	uint32_t expire;
	size_t msg_size;

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

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

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

	if (server->nomemory) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_MEMORY);
		return;
	}

	route = find_route_t(server->routes, req->body.name);
	if (!route) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	msg_data = client->request + sizeof(*req) + sizeof(uint32_t);
	msg_size = client->pos - (sizeof(*req) + sizeof(uint32_t));
	expire = *((uint32_t*)(client->request + sizeof(*req)));

	if (expire) {
		expire += server->now_timems;
	}

	msg = create_dup_object(msg_data, msg_size);
	EG_OBJECT_RESET_REFCOUNT(msg);

	if (push_message_route_t(route, req->body.key, msg, expire) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x6c, 0x20(%rdi)
ja 0x7722
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x77a4
movq 0x10(%rbx), %r12
movabsq $0x20000000022, %rax    # imm = 0x20000000022
testq %rax, 0x8(%rbx)
je 0x7796
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x7786
leaq 0x48(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x52ce
testl %eax, %eax
je 0x7786
leaq 0xab27(%rip), %r13      # 0x12290
movq (%r13), %rax
cmpl $0x0, 0x1b0(%rax)
je 0x77b7
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x6, %edx
jmp 0x77a4
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x77a4
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5642
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9e9e
testq %rax, %rax
je 0x77f1
movq %rax, %r15
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $-0x6c, %rsi
movl 0x68(%rdi), %ebp
addq $0x6c, %rdi
testl %ebp, %ebp
je 0x7801
movq (%r13), %rax
addl 0x190(%rax), %ebp
jmp 0x7803
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x77a4
xorl %ebp, %ebp
callq 0x5506
movl $0x0, 0x10(%rax)
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0x9cbe
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
testl %eax, %eax
je 0x7836
movl $0x2, %edx
jmp 0x77a4
movl $0x1, %edx
jmp 0x77a4
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: route_delete_command_handler
void route_delete_command_handler(EagleClient *client)
{
	ProtocolRequestRouteDelete *req = (ProtocolRequestRouteDelete*)client->request;
	Route_t *route;

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

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

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

	route = find_route_t(server->routes, req->body.name);
	if (!route) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x7861
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7902
movq 0x10(%rbx), %r15
movabsq $0x40000000022, %rax    # imm = 0x40000000022
testq %rax, 0x8(%rbx)
je 0x78d0
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x78df
leaq 0xa9ff(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9e9e
testq %rax, %rax
je 0x78ee
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x8d73
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x78fd
movl $0x1, %edx
jmp 0x7902
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x7902
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7902
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7902
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_create_command_handler
void channel_create_command_handler(EagleClient *client)
{
	ProtocolRequestChannelCreate *req = (ProtocolRequestChannelCreate*)client->request;
	Channel_t *channel;

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

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

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

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

	channel = create_channel_t(req->body.name, req->body.flags);

	list_add_value_tail(server->channels, channel);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x4b, 0x20(%rdi)
ja 0x7933
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x79d4
movq 0x10(%rbx), %r15
movabsq $0x80000000024, %rax    # imm = 0x80000000024
testq %rax, 0x8(%rbx)
je 0x798a
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x7999
leaq 0xa92d(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
testq %rax, %rax
je 0x79a8
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x79d4
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x79d4
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x79d4
movl 0x48(%r15), %esi
movq %r14, %rdi
callq 0x9f58
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x8d1a
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_exist_command_handler
void channel_exist_command_handler(EagleClient *client)
{
	ProtocolRequestChannelExist *req = (ProtocolRequestChannelExist*)client->request;
	ProtocolResponseChannelExist *res;

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

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

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

	res = (ProtocolResponseChannelExist*)xcalloc(sizeof(*res));

	set_response_header(&res->header, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS, sizeof(res->body));

	if (find_channel_t(server->channels, req->body.name)) {
		res->body.status = 1;
	} else {
		res->body.status = 0;
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x7a05
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7ab6
movq 0x10(%rbx), %r12
movabsq $0x100000000024, %rax   # imm = 0x100000000024
testq %rax, 0x8(%rbx)
je 0x7a98
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x7aa8
movl $0xc, %edi
callq 0x47f6
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xa831(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl $0xc, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5836
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x7ab6
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_rename_command_handler
void channel_rename_command_handler(EagleClient *client)
{
	ProtocolRequestChannelRename *req = (ProtocolRequestChannelRename*)client->request;
	Channel_t *channel;

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

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

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

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

	if (find_channel_t(server->channels, req->body.to)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	rename_channel_t(channel, req->body.to);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpq $0x87, 0x20(%rdi)
ja 0x7c3f
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7cd7
movq 0x10(%rbx), %r12
movabsq $0x400000000024, %rax   # imm = 0x400000000024
testq %rax, 0x8(%rbx)
je 0x7cc9
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x7cb9
leaq 0x48(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x7cb9
leaq 0xa60a(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x180(%rax), %rdi
movq %r15, %rsi
callq 0xa222
testq %rax, %rax
je 0x7ce5
movq %rax, %r15
movq (%r13), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
testq %rax, %rax
je 0x7cf5
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7cd7
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7cd7
movq %r15, %rdi
movq %r14, %rsi
callq 0xa26b
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7cd7
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_publish_command_handler
void channel_publish_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPublish *req = (ProtocolRequestChannelPublish*)client->request;
	Channel_t *channel;
	Object *msg;

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

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

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

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

	msg = create_dup_object(client->request + sizeof(*req), client->pos - sizeof(*req));

	publish_message_channel_t(channel, req->body.topic, msg);

	decrement_references_count(msg);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpq $0x68, 0x20(%rdi)
ja 0x7d32
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7dee
movq 0x10(%rbx), %r13
movabsq $0x800000000024, %rax   # imm = 0x800000000024
testq %rax, 0x8(%rbx)
je 0x7de1
leaq 0x8(%r13), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x7dd2
leaq 0x48(%r13), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x52ce
testl %eax, %eax
je 0x7dd2
leaq 0xa515(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r15, %rsi
callq 0xa222
testq %rax, %rax
je 0x7dfc
movq %rax, %r15
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x68, %rdi
addq $-0x68, %rsi
callq 0x5506
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xa101
movq %r12, %rdi
callq 0x5565
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7dee
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7dee
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7dee
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_subscribe_command_handler
void channel_subscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelSubscribe *req = (ProtocolRequestChannelSubscribe*)client->request;
	Channel_t *channel;

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

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

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

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

	subscribe_channel_t(channel, client, req->body.topic);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x67, 0x20(%rdi)
ja 0x7e2c
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7ec6
movq 0x10(%rbx), %r12
movabsq $0x1000000000024, %rax  # imm = 0x1000000000024
testq %rax, 0x8(%rbx)
je 0x7eb8
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x7ea8
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x52ce
testl %eax, %eax
je 0x7ea8
leaq 0xa41d(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0xa222
testq %rax, %rax
je 0x7ed6
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xa293
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7ec6
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7ec6
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7ec6