LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x642b
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6512
movq 0x10(%rbx), %r15
testl $0x8000021, 0x8(%rbx)   # imm = 0x8000021
je 0x64da
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x64e9
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x64f8
movq %rax, %rdi
callq 0x92aa
movzbl 0x2(%r15), %r15d
testq %rax, %rax
je 0x6507
movq %rax, %r14
movq (%rax), %rax
movq 0x8(%rax), %r12
movl $0x10, %edi
callq 0x42f0
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 0x5396
movq (%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6522
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6512
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6512
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6512
movq %rbx, %rdi
movl %r15d, %esi
movl $0xa, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x50c1
movq %r14, %rdi
callq 0x84aa
testl %eax, %eax
je 0x654f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x50c5
movq 0x48(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8886
// File: /workspace/github_c_makefile_star2_O1/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 0x6586
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6682
movq 0x10(%rbx), %r13
testl $0x10000021, 0x8(%rbx)  # imm = 0x10000021
je 0x664a
leaq 0x8(%r13), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6659
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x6668
movq %rax, %r14
movq %rax, %rdi
callq 0x92aa
movzbl 0x2(%r13), %r12d
testq %rax, %rax
je 0x6677
movq %rax, %r15
movq (%rax), %rax
movq 0x8(%rax), %rbp
movl $0x10, %edi
callq 0x42f0
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 0x5396
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x6522
movl 0x48(%r13), %esi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x924e
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6682
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6682
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6682
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 0x51a2
// File: /workspace/github_c_makefile_star2_O1/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 0x66b3
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6737
movq 0x10(%rbx), %r15
testl $0x20000021, 0x8(%rbx)  # imm = 0x20000021
je 0x6705
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6714
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x6723
movq 0x48(%r15), %rsi
movq %rax, %rdi
callq 0x92b3
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
testl %eax, %eax
je 0x6732
movl $0xa, %edx
jmp 0x6737
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6737
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6737
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6737
movl $0x1, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/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 0x6762
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6808
movq 0x10(%rbx), %r12
testl $0x40000021, 0x8(%rbx)  # imm = 0x40000021
je 0x67ba
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x67ca
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x67da
movq %rax, %r15
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x67ea
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x6808
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6808
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6808
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6808
movl 0x48(%r12), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9404
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_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 0x6839
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x68da
movq 0x10(%rbx), %r12
testl $0x80000021, 0x8(%rbx)  # imm = 0x80000021
je 0x689c
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x68ac
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x68bc
movq %rax, %r15
movq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x68cc
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9432
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x68da
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x68da
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x68da
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x68da
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_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 0x6905
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6981
movq 0x10(%rbx), %r15
movabsq $0x100000021, %rax      # imm = 0x100000021
testq %rax, 0x8(%rbx)
je 0x6956
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6965
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x6974
movq %rax, %rdi
callq 0x93a9
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x6981
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6981
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6981
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/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 0x69ac
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6a4d
movq 0x10(%rbx), %r15
movabsq $0x200000021, %rax      # imm = 0x200000021
testq %rax, 0x8(%rbx)
je 0x6a1b
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6a2a
leaq 0xb8b4(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x6a39
movq (%r12), %rcx
movq 0x170(%rcx), %rdi
movq %rax, %rsi
callq 0x88db
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x6a48
movl $0x1, %edx
jmp 0x6a4d
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6a4d
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6a4d
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x6a4d
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x6a7e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6b1f
movq 0x10(%rbx), %r15
movabsq $0x400000022, %rax      # imm = 0x400000022
testq %rax, 0x8(%rbx)
je 0x6ad5
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6ae4
leaq 0xb7e2(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9a0f
testq %rax, %rax
je 0x6af3
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x6b1f
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6b1f
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6b1f
movl 0x48(%r15), %esi
movq %r14, %rdi
callq 0x9700
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x8886
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x6b50
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6c01
movq 0x10(%rbx), %r12
movabsq $0x800000022, %rax      # imm = 0x800000022
testq %rax, 0x8(%rbx)
je 0x6be3
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6bf3
movl $0xc, %edi
callq 0x4376
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xb6e6(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9a0f
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 0x5396
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6c01
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x6c32
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6d3c
movq 0x10(%rdi), %rax
movabsq $0x1000000022, %rcx     # imm = 0x1000000022
movzbl 0x2(%rax), %r12d
testq %rcx, 0x8(%rdi)
je 0x6d34
movq %rdi, 0x10(%rsp)
leaq 0xb635(%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 0x4376
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 0x8a40
movq %r12, %rdi
callq 0x89ff
testq %rax, %rax
je 0x6d10
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 0x2160
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2290
movl 0x40(%r13), %eax
movl %eax, 0x40(%r15,%r12)
movslq %r14d, %r14
movl %ebx, (%r15,%r14)
leaq 0x18(%rsp), %rdi
callq 0x89ff
addl $0x48, %r14d
testq %rax, %rax
jne 0x6cc0
movq 0x8(%rsp), %rdx
addl $0x8, %edx
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5396
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 0x51a2
// File: /workspace/github_c_makefile_star2_O1/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 0x6f49
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6fe1
movq 0x10(%rbx), %r12
movabsq $0x4000000022, %rax     # imm = 0x4000000022
testq %rax, 0x8(%rbx)
je 0x6fd3
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6fc3
leaq 0x48(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6fc3
leaq 0xb300(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9a0f
testq %rax, %rax
je 0x6fef
movq %rax, %r15
movq (%r13), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9a0f
testq %rax, %rax
je 0x6fff
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6fe1
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x6fe1
movq %r15, %rdi
movq %r14, %rsi
callq 0x9a58
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x6fe1
// File: /workspace/github_c_makefile_star2_O1/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 0x7041
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7112
movq 0x10(%rbx), %r13
movabsq $0x8000000022, %rax     # imm = 0x8000000022
testq %rax, 0x8(%rbx)
je 0x7105
leaq 0x8(%r13), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x70f6
leaq 0x48(%r13), %r12
movl $0x40, %esi
movq %r12, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x70f6
leaq 0x88(%r13), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4e66
testl %eax, %eax
je 0x70f6
leaq 0xb1ea(%rip), %rbp      # 0x12290
movq (%rbp), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9a0f
testq %rax, %rax
je 0x7125
movq %rax, %r15
movq (%rbp), %rax
movq 0x170(%rax), %rdi
movq %r12, %rsi
callq 0x9316
testq %rax, %rax
je 0x7125
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x98e6
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7112
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7112
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 0x51a2
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7112
// File: /workspace/github_c_makefile_star2_O1/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 0x715b
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7231
movq 0x10(%rbx), %r13
movabsq $0x10000000022, %rax    # imm = 0x10000000022
testq %rax, 0x8(%rbx)
je 0x7224
leaq 0x8(%r13), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7215
leaq 0x48(%r13), %r12
movl $0x40, %esi
movq %r12, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7215
leaq 0x88(%r13), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4e66
testl %eax, %eax
je 0x7215
leaq 0xb0d0(%rip), %rbp      # 0x12290
movq (%rbp), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9a0f
testq %rax, %rax
je 0x7244
movq %rax, %r15
movq (%rbp), %rax
movq 0x170(%rax), %rdi
movq %r12, %rsi
callq 0x9316
testq %rax, %rax
je 0x7244
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x9974
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x7253
movl $0x1, %edx
jmp 0x7231
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7231
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 0x51a2
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7231
movl $0x2, %edx
jmp 0x7231
// File: /workspace/github_c_makefile_star2_O1/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 0x727e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7300
movq 0x10(%rbx), %r12
movabsq $0x20000000022, %rax    # imm = 0x20000000022
testq %rax, 0x8(%rbx)
je 0x72f2
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x72e2
leaq 0x48(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4e66
testl %eax, %eax
je 0x72e2
leaq 0xafcb(%rip), %r13      # 0x12290
movq (%r13), %rax
cmpl $0x0, 0x1b0(%rax)
je 0x7313
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x6, %edx
jmp 0x7300
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7300
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 0x51a2
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x9a0f
testq %rax, %rax
je 0x734d
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 0x735d
movq (%r13), %rax
addl 0x190(%rax), %ebp
jmp 0x735f
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7300
xorl %ebp, %ebp
callq 0x5066
movl $0x0, 0x10(%rax)
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0x9826
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
testl %eax, %eax
je 0x7392
movl $0x2, %edx
jmp 0x7300
movl $0x1, %edx
jmp 0x7300
// File: /workspace/github_c_makefile_star2_O1/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 0x73bd
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x745e
movq 0x10(%rbx), %r15
movabsq $0x40000000022, %rax    # imm = 0x40000000022
testq %rax, 0x8(%rbx)
je 0x742c
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x743b
leaq 0xaea3(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x9a0f
testq %rax, %rax
je 0x744a
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x88db
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x7459
movl $0x1, %edx
jmp 0x745e
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x745e
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x745e
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x745e
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x748f
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7530
movq 0x10(%rbx), %r15
movabsq $0x80000000024, %rax    # imm = 0x80000000024
testq %rax, 0x8(%rbx)
je 0x74e6
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x74f5
leaq 0xadd1(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7504
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x7530
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x7530
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7530
movl 0x48(%r15), %esi
movq %r14, %rdi
callq 0x9ac8
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x8886
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x7561
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7612
movq 0x10(%rbx), %r12
movabsq $0x100000000024, %rax   # imm = 0x100000000024
testq %rax, 0x8(%rbx)
je 0x75f4
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7604
movl $0xc, %edi
callq 0x4376
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xacd5(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
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 0x5396
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x7612
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x779b
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7833
movq 0x10(%rbx), %r12
movabsq $0x400000000024, %rax   # imm = 0x400000000024
testq %rax, 0x8(%rbx)
je 0x7825
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7815
leaq 0x48(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7815
leaq 0xaaae(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x180(%rax), %rdi
movq %r15, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7841
movq %rax, %r15
movq (%r13), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7851
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7833
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7833
movq %r15, %rdi
movq %r14, %rsi
callq 0x9ddb
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7833
// File: /workspace/github_c_makefile_star2_O1/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 0x788e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x794a
movq 0x10(%rbx), %r13
movabsq $0x800000000024, %rax   # imm = 0x800000000024
testq %rax, 0x8(%rbx)
je 0x793d
leaq 0x8(%r13), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x792e
leaq 0x48(%r13), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4e66
testl %eax, %eax
je 0x792e
leaq 0xa9b9(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r15, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7958
movq %rax, %r15
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x68, %rdi
addq $-0x68, %rsi
callq 0x5066
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x9c71
movq %r12, %rdi
callq 0x50c5
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x794a
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x794a
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r13), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x794a
// File: /workspace/github_c_makefile_star2_O1/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 0x7988
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x7a22
movq 0x10(%rbx), %r12
movabsq $0x1000000000024, %rax  # imm = 0x1000000000024
testq %rax, 0x8(%rbx)
je 0x7a14
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x7a04
leaq 0x48(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x4e66
testl %eax, %eax
je 0x7a04
leaq 0xa8c1(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x9d92
testq %rax, %rax
je 0x7a32
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x9e03
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x7a22
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x7a22
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x7a22