LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x64b5
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x653d
movq 0x10(%rbx), %r15
movabsq $0x200000021, %rax      # imm = 0x200000021
testq %rax, 0x8(%rbx)
je 0x651c
leaq 0x8(%r15), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6525
leaq 0xbdad(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x8a49
testq %rax, %rax
je 0x652e
movq (%r12), %rcx
movq 0x170(%rcx), %rdi
movq %rax, %rsi
callq 0x80e7
movzbl 0x2(%r15), %esi
cmpl $-0x1, %eax
je 0x6537
pushq $0x1
jmp 0x6539
movzbl 0x2(%r15), %esi
pushq $0x5
jmp 0x6539
movzbl 0x2(%r15), %esi
pushq $0x7
jmp 0x6539
movzbl 0x2(%r15), %esi
pushq $0x9
jmp 0x6539
pushq $0x2
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/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 0x656c
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x65f7
movq 0x10(%rbx), %r15
movabsq $0x400000022, %rax      # imm = 0x400000022
testq %rax, 0x8(%rbx)
je 0x65bb
leaq 0x8(%r15), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x65c4
leaq 0xbcf6(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x90e2
testq %rax, %rax
je 0x65cd
movzbl 0x2(%r15), %esi
pushq $0x2
jmp 0x65f3
movzbl 0x2(%r15), %esi
pushq $0x5
jmp 0x65f3
movzbl 0x2(%r15), %esi
pushq $0x7
jmp 0x65f3
movl 0x48(%r15), %esi
movq %r14, %rdi
callq 0x8e04
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x8096
movzbl 0x2(%r15), %esi
pushq $0x1
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/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 0x6626
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x66c9
movq 0x10(%rbx), %r12
movabsq $0x800000022, %rax      # imm = 0x800000022
testq %rax, 0x8(%rbx)
je 0x66b3
leaq 0x8(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x66bd
pushq $0xc
popq %rdi
callq 0x417e
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xbc14(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x90e2
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x8(%r15)
pushq $0xc
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x512c
movzbl 0x2(%r12), %esi
pushq $0x5
jmp 0x66c5
movzbl 0x2(%r12), %esi
pushq $0x7
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/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 0x66f8
pushq $0x3
popq %rdx
xorl %esi, %esi
jmp 0x67eb
movq 0x10(%rdi), %rax
movabsq $0x1000000022, %rcx     # imm = 0x1000000022
movzbl 0x2(%rax), %r12d
testq %rcx, 0x8(%rdi)
je 0x67e5
movq %rdi, 0x10(%rsp)
leaq 0xbb6f(%rip), %r14      # 0x12290
movq (%r14), %rax
movq 0x178(%rax), %rax
imull $0x48, 0x20(%rax), %ebx
leaq 0x8(%rbx), %rdi
callq 0x417e
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), %rsi
callq 0x8226
pushq $0x4c
popq %r14
leaq 0x18(%rsp), %rdi
callq 0x81e5
testq %rax, %rax
je 0x67c1
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)
addl $0x48, %r14d
jmp 0x676f
movq 0x8(%rsp), %rdx
addl $0x8, %edx
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x512c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x5
popq %rdx
movl %r12d, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/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 0x69c5
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x6a51
movq 0x10(%rbx), %r12
movabsq $0x4000000022, %rax     # imm = 0x4000000022
testq %rax, 0x8(%rbx)
je 0x6a45
leaq 0x8(%r12), %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6a3b
leaq 0x48(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6a3b
leaq 0xb888(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x90e2
testq %rax, %rax
je 0x6a5f
movq %rax, %r15
movq (%r13), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x90e2
testq %rax, %rax
je 0x6a69
movzbl 0x2(%r12), %esi
pushq $0x7
jmp 0x6a4d
movzbl 0x2(%r12), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x9
jmp 0x6a4d
movq %r15, %rdi
movq %r14, %rsi
callq 0x912b
movzbl 0x2(%r12), %esi
pushq $0x1
jmp 0x6a4d
// File: /workspace/github_c_makefile_star2_O2/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 0x6aa3
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x6b5c
movq 0x10(%rbx), %r13
movabsq $0x8000000022, %rax     # imm = 0x8000000022
testq %rax, 0x8(%rbx)
je 0x6b51
leaq 0x8(%r13), %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6b48
leaq 0x48(%r13), %r12
pushq $0x40
popq %rsi
movq %r12, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6b48
leaq 0x88(%r13), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x4c1e
testl %eax, %eax
je 0x6b48
leaq 0xb792(%rip), %rbp      # 0x12290
movq (%rbp), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x90e2
testq %rax, %rax
je 0x6b6f
movq %rax, %r15
movq (%rbp), %rax
movq 0x170(%rax), %rdi
movq %r12, %rsi
callq 0x8a49
testq %rax, %rax
je 0x6b6f
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x8fc4
movzbl 0x2(%r13), %esi
pushq $0x1
jmp 0x6b58
movzbl 0x2(%r13), %esi
pushq $0x7
jmp 0x6b58
movzbl 0x2(%r13), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4f56
movzbl 0x2(%r13), %esi
pushq $0x9
jmp 0x6b58
// File: /workspace/github_c_makefile_star2_O2/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 0x6b9d
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x6c5b
movq 0x10(%rbx), %r13
movabsq $0x10000000022, %rax    # imm = 0x10000000022
testq %rax, 0x8(%rbx)
je 0x6c50
leaq 0x8(%r13), %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6c47
leaq 0x48(%r13), %r12
pushq $0x40
popq %rsi
movq %r12, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6c47
leaq 0x88(%r13), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x4c1e
testl %eax, %eax
je 0x6c47
leaq 0xb698(%rip), %rbp      # 0x12290
movq (%rbp), %rax
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x90e2
testq %rax, %rax
je 0x6c6e
movq %rax, %r15
movq (%rbp), %rax
movq 0x170(%rax), %rdi
movq %r12, %rsi
callq 0x8a49
testq %rax, %rax
je 0x6c6e
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x9049
movzbl 0x2(%r13), %esi
cmpl $-0x1, %eax
je 0x6c77
pushq $0x1
jmp 0x6c57
movzbl 0x2(%r13), %esi
pushq $0x7
jmp 0x6c57
movzbl 0x2(%r13), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4f56
movzbl 0x2(%r13), %esi
pushq $0x9
jmp 0x6c57
pushq $0x2
jmp 0x6c57
// File: /workspace/github_c_makefile_star2_O2/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 0x6c9a
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x6d0a
movq 0x10(%rbx), %r12
movabsq $0x20000000022, %rax    # imm = 0x20000000022
testq %rax, 0x8(%rbx)
je 0x6cfe
leaq 0x8(%r12), %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6cf4
leaq 0x48(%r12), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x4c1e
testl %eax, %eax
je 0x6cf4
leaq 0xb5b3(%rip), %r13      # 0x12290
movq (%r13), %rax
cmpl $0x0, 0x1b0(%rax)
je 0x6d1d
movzbl 0x2(%r12), %esi
pushq $0x6
jmp 0x6d06
movzbl 0x2(%r12), %esi
pushq $0x7
jmp 0x6d06
movzbl 0x2(%r12), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4f56
movq 0x178(%rax), %rdi
movq %r15, %rsi
callq 0x90e2
testq %rax, %rax
je 0x6d57
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 0x6d61
movq (%r13), %rax
addl 0x190(%rax), %ebp
jmp 0x6d63
movzbl 0x2(%r12), %esi
pushq $0x9
jmp 0x6d06
xorl %ebp, %ebp
callq 0x4e44
andl $0x0, 0x10(%rax)
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0x8f15
movzbl 0x2(%r12), %esi
testl %eax, %eax
je 0x6d8d
pushq $0x2
jmp 0x6d06
pushq $0x1
jmp 0x6d06
// File: /workspace/github_c_makefile_star2_O2/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 0x6db3
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x6e3b
movq 0x10(%rbx), %r15
movabsq $0x40000000022, %rax    # imm = 0x40000000022
testq %rax, 0x8(%rbx)
je 0x6e1a
leaq 0x8(%r15), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6e23
leaq 0xb4af(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
movq %r14, %rsi
callq 0x90e2
testq %rax, %rax
je 0x6e2c
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x80e7
movzbl 0x2(%r15), %esi
cmpl $-0x1, %eax
je 0x6e35
pushq $0x1
jmp 0x6e37
movzbl 0x2(%r15), %esi
pushq $0x5
jmp 0x6e37
movzbl 0x2(%r15), %esi
pushq $0x7
jmp 0x6e37
movzbl 0x2(%r15), %esi
pushq $0x9
jmp 0x6e37
pushq $0x2
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/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 0x6e6a
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x6ef5
movq 0x10(%rbx), %r15
movabsq $0x80000000024, %rax    # imm = 0x80000000024
testq %rax, 0x8(%rbx)
je 0x6eb9
leaq 0x8(%r15), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6ec2
leaq 0xb3f8(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
testq %rax, %rax
je 0x6ecb
movzbl 0x2(%r15), %esi
pushq $0x2
jmp 0x6ef1
movzbl 0x2(%r15), %esi
pushq $0x5
jmp 0x6ef1
movzbl 0x2(%r15), %esi
pushq $0x7
jmp 0x6ef1
movl 0x48(%r15), %esi
movq %r14, %rdi
callq 0x918c
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x8096
movzbl 0x2(%r15), %esi
pushq $0x1
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/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 0x6f24
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x6fc7
movq 0x10(%rbx), %r12
movabsq $0x100000000024, %rax   # imm = 0x100000000024
testq %rax, 0x8(%rbx)
je 0x6fb1
leaq 0x8(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x6fbb
pushq $0xc
popq %rdi
callq 0x417e
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xb316(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x8(%r15)
pushq $0xc
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x512c
movzbl 0x2(%r12), %esi
pushq $0x5
jmp 0x6fc3
movzbl 0x2(%r12), %esi
pushq $0x7
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_list_command_handler
void channel_list_command_handler(EagleClient *client)
{
	ProtocolRequestChannelList *req = (ProtocolRequestChannelList*)client->request;
	ProtocolResponseHeader res;
	ListIterator iterator;
	ListNode *node;
	Channel_t *channel;
	char *list;
	uint32_t topics;
	uint32_t patterns;
	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_CHANNEL_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_CHANNEL_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->channels) * (64 + (sizeof(uint32_t) * 3)));

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

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

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

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

		memcpy(list + i, channel->name, strlenz(channel->name));
		i += 64;
		memcpy(list + i, &channel->flags, sizeof(uint32_t));
		i += sizeof(uint32_t);
		memcpy(list + i, &topics, sizeof(uint32_t));
		i += sizeof(uint32_t);
		memcpy(list + i, &patterns, 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 0x6ff6
pushq $0x3
popq %rdx
xorl %esi, %esi
jmp 0x7102
movq 0x10(%rdi), %rax
movabsq $0x200000000024, %rcx   # imm = 0x200000000024
movzbl 0x2(%rax), %r12d
testq %rcx, 0x8(%rdi)
je 0x70fc
movq %rdi, 0x10(%rsp)
leaq 0xb271(%rip), %r14      # 0x12290
movq (%r14), %rax
movq 0x180(%rax), %rax
imull $0x4c, 0x20(%rax), %ebx
leaq 0x8(%rbx), %rdi
callq 0x417e
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 0x180(%rax), %rdi
leaq 0x18(%rsp), %rsi
callq 0x8226
pushq $0x50
popq %r14
leaq 0x18(%rsp), %rdi
callq 0x81e5
testq %rax, %rax
je 0x70d8
leal -0x48(%r14), %ecx
movq 0x10(%rax), %r13
movq 0x50(%r13), %rax
movq 0x58(%r13), %rdx
movl 0x20(%rax), %ebx
movl 0x20(%rdx), %eax
movl %eax, 0x4(%rsp)
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)
leal -0x4(%r14), %eax
cltq
movl %ebx, (%r15,%rax)
movslq %r14d, %r14
movl 0x4(%rsp), %eax
movl %eax, (%r15,%r14)
addl $0x4c, %r14d
jmp 0x706d
movq 0x8(%rsp), %rdx
addl $0x8, %edx
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x512c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x5
popq %rdx
movl %r12d, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/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 0x7138
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x71c4
movq 0x10(%rbx), %r12
movabsq $0x400000000024, %rax   # imm = 0x400000000024
testq %rax, 0x8(%rbx)
je 0x71b8
leaq 0x8(%r12), %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x71ae
leaq 0x48(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x71ae
leaq 0xb115(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x180(%rax), %rdi
movq %r15, %rsi
callq 0x940f
testq %rax, %rax
je 0x71d2
movq %rax, %r15
movq (%r13), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
testq %rax, %rax
je 0x71dc
movzbl 0x2(%r12), %esi
pushq $0x7
jmp 0x71c0
movzbl 0x2(%r12), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x9
jmp 0x71c0
movq %r15, %rdi
movq %r14, %rsi
callq 0x9458
movzbl 0x2(%r12), %esi
pushq $0x1
jmp 0x71c0
// File: /workspace/github_c_makefile_star2_O2/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 0x7211
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x72bb
movq 0x10(%rbx), %r13
movabsq $0x800000000024, %rax   # imm = 0x800000000024
testq %rax, 0x8(%rbx)
je 0x72b0
leaq 0x8(%r13), %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x72a7
leaq 0x48(%r13), %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x4c1e
testl %eax, %eax
je 0x72a7
leaq 0xb03a(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r15, %rsi
callq 0x940f
testq %rax, %rax
je 0x72c9
movq %rax, %r15
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x68, %rdi
addq $-0x68, %rsi
callq 0x4e44
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x930c
movq %r12, %rdi
callq 0x4ea1
movzbl 0x2(%r13), %esi
pushq $0x1
jmp 0x72b7
movzbl 0x2(%r13), %esi
pushq $0x7
jmp 0x72b7
movzbl 0x2(%r13), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4f56
movzbl 0x2(%r13), %esi
pushq $0x9
jmp 0x72b7
// File: /workspace/github_c_makefile_star2_O2/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 0x72f1
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x7379
movq 0x10(%rbx), %r12
movabsq $0x1000000000024, %rax  # imm = 0x1000000000024
testq %rax, 0x8(%rbx)
je 0x736d
leaq 0x8(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x7363
leaq 0x48(%r12), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x4c1e
testl %eax, %eax
je 0x7363
leaq 0xaf5c(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
testq %rax, %rax
je 0x7389
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x9480
movzbl 0x2(%r12), %esi
pushq $0x1
jmp 0x7375
movzbl 0x2(%r12), %esi
pushq $0x7
jmp 0x7375
movzbl 0x2(%r12), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x9
jmp 0x7375
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_psubscribe_command_handler
void channel_psubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPatternSubscribe *req = (ProtocolRequestChannelPatternSubscribe*)client->request;
	Channel_t *channel;

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

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

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

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

	psubscribe_channel_t(channel, client, req->body.pattern);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x67, 0x20(%rdi)
ja 0x73b2
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x743a
movq 0x10(%rbx), %r12
movabsq $0x2000000000024, %rax  # imm = 0x2000000000024
testq %rax, 0x8(%rbx)
je 0x742e
leaq 0x8(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x7424
leaq 0x48(%r12), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x4d9c
testl %eax, %eax
je 0x7424
leaq 0xae9b(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
testq %rax, %rax
je 0x744a
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x9575
movzbl 0x2(%r12), %esi
pushq $0x1
jmp 0x7436
movzbl 0x2(%r12), %esi
pushq $0x7
jmp 0x7436
movzbl 0x2(%r12), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x9
jmp 0x7436
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_unsubscribe_command_handler
void channel_unsubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelUnsubscribe *req = (ProtocolRequestChannelUnsubscribe*)client->request;
	Channel_t *channel;

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

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

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

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

	if (unsubscribe_channel_t(channel, client, req->body.topic) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x67, 0x20(%rdi)
ja 0x7473
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x7510
movq 0x10(%rbx), %r12
movabsq $0x4000000000024, %rax  # imm = 0x4000000000024
testq %rax, 0x8(%rbx)
je 0x7504
leaq 0x8(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x74fa
leaq 0x48(%r12), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x4c1e
testl %eax, %eax
je 0x74fa
leaq 0xadda(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
testq %rax, %rax
je 0x7520
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x9606
testl %eax, %eax
je 0x74f0
movzbl 0x2(%r12), %esi
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x1
jmp 0x750c
movzbl 0x2(%r12), %esi
pushq $0x7
jmp 0x750c
movzbl 0x2(%r12), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x9
jmp 0x750c
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_punsubscribe_command_handler
void channel_punsubscribe_command_handler(EagleClient *client)
{
	ProtocolRequestChannelPatternUnsubscribe *req = (ProtocolRequestChannelPatternUnsubscribe*)client->request;
	Channel_t *channel;

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

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

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

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

	if (punsubscribe_channel_t(channel, client, req->body.pattern) != EG_STATUS_OK) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x67, 0x20(%rdi)
ja 0x7549
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x75e6
movq 0x10(%rbx), %r12
movabsq $0x8000000000024, %rax  # imm = 0x8000000000024
testq %rax, 0x8(%rbx)
je 0x75da
leaq 0x8(%r12), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x75d0
leaq 0x48(%r12), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x4d9c
testl %eax, %eax
je 0x75d0
leaq 0xad04(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
testq %rax, %rax
je 0x75f6
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x96fb
testl %eax, %eax
je 0x75c6
movzbl 0x2(%r12), %esi
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x1
jmp 0x75e2
movzbl 0x2(%r12), %esi
pushq $0x7
jmp 0x75e2
movzbl 0x2(%r12), %esi
pushq $0x5
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
movzbl 0x2(%r12), %esi
pushq $0x9
jmp 0x75e2
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_delete_command_handler
void channel_delete_command_handler(EagleClient *client)
{
	ProtocolRequestChannelDelete *req = (ProtocolRequestChannelDelete*)client->request;
	Channel_t *channel;

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

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

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

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x47, 0x20(%rdi)
ja 0x761f
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x76a7
movq 0x10(%rbx), %r15
movabsq $0x10000000000024, %rax # imm = 0x10000000000024
testq %rax, 0x8(%rbx)
je 0x7686
leaq 0x8(%r15), %r14
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x4c9e
testl %eax, %eax
je 0x768f
leaq 0xac43(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
movq %r14, %rsi
callq 0x940f
testq %rax, %rax
je 0x7698
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x80e7
movzbl 0x2(%r15), %esi
cmpl $-0x1, %eax
je 0x76a1
pushq $0x1
jmp 0x76a3
movzbl 0x2(%r15), %esi
pushq $0x5
jmp 0x76a3
movzbl 0x2(%r15), %esi
pushq $0x7
jmp 0x76a3
movzbl 0x2(%r15), %esi
pushq $0x9
jmp 0x76a3
pushq $0x2
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4f56
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_client_event_notify
void queue_client_event_notify(EagleClient *client, Queue_t *queue_t)
{
	ProtocolEventQueueNotify *event = (ProtocolEventQueueNotify*)xcalloc(sizeof(*event));

	set_event_header(&event->header, EG_PROTOCOL_CMD_QUEUE_SUBSCRIBE, EG_PROTOCOL_EVENT_NOTIFY, sizeof(event->body));

	memcpy(event->body.name, queue_t->name, strlenz(queue_t->name));

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x48
popq %rdi
callq 0x417e
movq %rax, %r15
movabsq $0x40012d0090, %rax     # imm = 0x40012D0090
movq %rax, (%r15)
leaq 0x8(%r15), %r12
movq %rbx, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2280
pushq $0x48
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x512c
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_client_event_message
void queue_client_event_message(EagleClient *client, Queue_t *queue_t, Message *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_QUEUE_SUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 64 + EG_MESSAGE_SIZE(msg));

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

	memcpy(buffer, &header, sizeof(header));
	memcpy(buffer + sizeof(header), queue_t->name, strlenz(queue_t->name));

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdx), %rax
movq 0x8(%rax), %r13
pushq $0x48
popq %rdi
callq 0x417e
movq %rax, %r12
shlq $0x20, %r13
movabsq $0x40022d0090, %rax     # imm = 0x40022D0090
addq %r13, %rax
movq %rax, (%r12)
leaq 0x8(%r12), %r13
movq %r15, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2280
pushq $0x48
popq %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x512c
movq (%rbx), %rsi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x60b7
// File: /workspace/github_c_makefile_star2_O2/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: channel_client_event_message
void channel_client_event_message(EagleClient *client, Channel_t *channel, const char *topic, Object *msg)
{
	ProtocolEventHeader header;
	char *buffer;

	set_event_header(&header, EG_PROTOCOL_CMD_CHANNEL_SUBSCRIBE, EG_PROTOCOL_EVENT_MESSAGE, 96 + EG_OBJECT_SIZE(msg));

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
movq 0x8(%rcx), %rbp
pushq $0x68
popq %rdi
callq 0x417e
movq %rax, %r12
shlq $0x20, %rbp
movabsq $0x60023f0090, %rax     # imm = 0x60023F0090
addq %rbp, %rax
movq %rax, (%r12)
leaq 0x8(%r12), %rbp
movq %r13, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2280
leaq 0x48(%r12), %r13
movq %r15, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2280
pushq $0x68
popq %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x512c
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x60b7