LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/utils.c
// Function: enable_log
void enable_log(const char *logfile)
{
	fd = fopen(logfile, "a");

	if (fd == NULL) {
		warning("Error create log file");
		return;
	}

	log_init = 1;
}

// Assembly:
pushq %rax
leaq 0x7b6c(%rip), %rsi      # 0xc708
callq 0x23b0
movq %rax, 0xdf38(%rip)      # 0x12ae0
testq %rax, %rax
je 0x4bb9
movl $0x1, 0xdf21(%rip)      # 0x12ad8
popq %rax
retq
leaq 0x7b4a(%rip), %rdi      # 0xc70a
xorl %eax, %eax
popq %rcx
jmp 0x4bc8
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/utils.c
// Function: output_message
static void output_message(int level, const char *fmt, va_list args)
{
	time_t now_time;
	char msg[MESSAGE_BUFFER_SIZE];
	char log[MESSAGE_BUFFER_SIZE];

	vsnprintf(msg, sizeof(msg), fmt, args);

	if (level != LOG_ONLY_LEVEL)
	{
		if (level == FATAL_LEVEL || level == WARNING_LEVEL) {
			fprintf(stderr, "%s\n", msg);
		} else {
			fprintf(stdout, "%s\n", msg);
		}
	}

	if (log_init) {
		time(&now_time);
		sprintf(log, "%s%s\n", ctime(&now_time), msg);
		fputs(log, fd);
		fflush(fd);
	}
}

// Assembly:
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %rcx
movq %rsi, %rdx
movl %edi, %ebx
leaq 0x10(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x20c0
cmpl $0x3, %ebx
je 0x4cc7
decl %ebx
cmpl $0x1, %ebx
jbe 0x4d2a
movq 0xd327(%rip), %rax      # 0x11fd8
movq (%rax), %rdi
leaq 0x73ae(%rip), %rsi      # 0xc069
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2260
cmpl $0x0, 0xde0a(%rip)      # 0x12ad8
je 0x4d21
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x2140
leaq 0x7a3a(%rip), %rsi      # 0xc726
leaq 0x110(%rsp), %rbx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2430
movq 0xddd3(%rip), %rsi      # 0x12ae0
movq %rbx, %rdi
callq 0x21b0
movq 0xddc4(%rip), %rdi      # 0x12ae0
callq 0x2300
addq $0x210, %rsp            # imm = 0x210
popq %rbx
retq
movq 0xd2c7(%rip), %rax      # 0x11ff8
jmp 0x4cb1
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/utils.c
// Function: memtoll
long long memtoll(const char *value, int *err)
{
	char buffer[128];
	const char *ptr;
	unsigned int digits;
	long mul;

	*err = 0;

	ptr = value;
	while (*ptr && isdigit(*ptr)) {
		ptr++;
	}

	if (*ptr == '\0' || !strcasecmp(ptr, "b")) {
		mul = 1;
	} else if (!strcasecmp(ptr, "k")) {
		mul = 1000;
	} else if (!strcasecmp(ptr, "m")) {
		mul = 1000 * 1000;
	} else if (!strcasecmp(ptr, "g")) {
		mul = 1000L * 1000 * 1000;
	} else {
		*err = 1;
		mul = 1;
	}

	digits = ptr - value;
	if (digits >= sizeof(buffer)) {
		*err = 1;
		return LLONG_MAX;
	}

	memcpy(buffer, value, digits);
	buffer[digits] = '\0';

	return strtoll(buffer, NULL, 10) * mul;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x0, (%rsi)
movb (%rdi), %bpl
movl $0x1, %r12d
testb %bpl, %bpl
je 0x5206
callq 0x24a0
movq (%rax), %rax
movq %rbx, %r15
movsbq %bpl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x520b
movb 0x1(%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x51ed
jmp 0x5276
movq %rbx, %r15
jmp 0x5276
leaq 0x750e(%rip), %rsi      # 0xc720
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x5276
leaq 0x74fd(%rip), %rsi      # 0xc722
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x5260
leaq 0x74ec(%rip), %rsi      # 0xc724
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x5268
leaq 0x7046(%rip), %rsi      # 0xc291
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x5270
movl $0x1, (%r14)
jmp 0x5276
movl $0x3e8, %r12d           # imm = 0x3E8
jmp 0x5276
movl $0xf4240, %r12d         # imm = 0xF4240
jmp 0x5276
movl $0x3b9aca00, %r12d      # imm = 0x3B9ACA00
subl %ebx, %r15d
cmpl $0x80, %r15d
jb 0x5295
movl $0x1, (%r14)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
jmp 0x52be
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2280
movb $0x0, (%rsp,%r15)
movq %r14, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2250
imulq %r12, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/utils.c
// Function: check_input_buffer1
int check_input_buffer1(char *buffer, size_t size)
{
	char *ptr = buffer, *end_ptr = buffer + size;
	int length = 0;

	while (ptr < end_ptr) {
		if (*++ptr == '\0') {
			length = ptr - buffer;
			break;
		}
	}

	if (!length) {
		return 0;
	}

	for (ptr = buffer; ptr < (buffer + length); ptr++)
	{
		if (!IS_ALPHANUM(*ptr) && !IS_EXTRA1(*ptr)) {
			return 0;
		}
	}

	return length;
}

// Assembly:
addq %rdi, %rsi
xorl %eax, %eax
movabsq $0x100000000, %r8       # imm = 0x100000000
xorl %r9d, %r9d
xorl %ecx, %ecx
leaq (%rdi,%r9), %rdx
cmpq %rsi, %rdx
jae 0x5350
addq %r8, %rcx
leaq 0x1(%r9), %rdx
cmpb $0x0, 0x1(%rdi,%r9)
movq %rdx, %r9
jne 0x52e2
testl %edx, %edx
je 0x5350
sarq $0x20, %rcx
testq %rcx, %rcx
jle 0x534e
addq %rdi, %rcx
movabsq $0x4000000000003, %rsi  # imm = 0x4000000000003
movzbl (%rdi), %r8d
leal -0x30(%r8), %r9d
cmpb $0xa, %r9b
jb 0x5346
movl %r8d, %r9d
orb $0x20, %r9b
addb $-0x61, %r9b
cmpb $0x1a, %r9b
jb 0x5346
addl $-0x2d, %r8d
cmpl $0x32, %r8d
ja 0x5350
btq %r8, %rsi
jae 0x5350
incq %rdi
cmpq %rcx, %rdi
jb 0x5317
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/utils.c
// Function: check_input_buffer2
int check_input_buffer2(char *buffer, size_t size)
{
	char *ptr = buffer, *end_ptr = buffer + size;
	int length = 0;
	int extra = 0;

	while (ptr < end_ptr) {
		if (*++ptr == '\0') {
			length = ptr - buffer;
			break;
		}
	}

	if (!length) {
		return 0;
	}

	if (!IS_ALPHA(*buffer) && *buffer != '_' && *buffer != '.') {
		return 0;
	}

	if (*buffer == '_' || *buffer == '.') {
		extra = 1;
	}

	for (ptr = buffer + 1; ptr < (buffer + length - 1); ptr++)
	{
		if (IS_EXTRA1(*ptr) && extra) {
			return 0;
		}

		if (!IS_ALPHANUM(*ptr) && !IS_EXTRA1(*ptr)) {
			return 0;
		}

		extra = 0;
		if (IS_EXTRA1(*ptr)) {
			extra = 1;
		}
	}

	return length;
}

// Assembly:
addq %rdi, %rsi
xorl %eax, %eax
movabsq $0x100000000, %r8       # imm = 0x100000000
xorl %r9d, %r9d
xorl %edx, %edx
leaq (%rdi,%r9), %rcx
cmpq %rsi, %rcx
jae 0x5454
addq %r8, %rdx
leaq 0x1(%r9), %rcx
cmpb $0x0, 0x1(%rdi,%r9)
movq %rcx, %r9
jne 0x5365
testl %ecx, %ecx
je 0x5454
movzbl (%rdi), %esi
movl %esi, %r8d
orb $0x20, %r8b
addb $-0x61, %r8b
cmpb $0x1a, %r8b
jb 0x53ae
cmpl $0x5f, %esi
je 0x53ae
cmpl $0x2e, %esi
jne 0x5454
sarq $0x20, %rdx
cmpq $0x2, %rdx
jle 0x5455
addq %rdi, %rdx
decq %rdx
incq %rdi
cmpl $0x5f, %esi
sete %r8b
cmpl $0x2e, %esi
sete %sil
orb %r8b, %sil
movzbl %sil, %r9d
movabsq $0x4000000000003, %rsi  # imm = 0x4000000000003
movzbl (%rdi), %r8d
cmpl $0x2d, %r8d
je 0x53f4
cmpl $0x5f, %r8d
jne 0x5449
testl %r9d, %r9d
jne 0x5454
leal -0x30(%r8), %r9d
cmpb $0xa, %r9b
jb 0x5426
movl %r8d, %r9d
orb $0x20, %r9b
addb $-0x61, %r9b
cmpb $0x1a, %r9b
jb 0x5426
addl $-0x2d, %r8d
cmpl $0x32, %r8d
ja 0x5454
btq %r8, %rsi
jb 0x5439
jmp 0x5454
xorl %r9d, %r9d
addl $-0x2d, %r8d
cmpl $0x32, %r8d
ja 0x543f
btq %r8, %rsi
jae 0x543f
movl $0x1, %r9d
incq %rdi
cmpq %rdx, %rdi
jb 0x53e4
jmp 0x5455
testl %r9d, %r9d
je 0x53f9
cmpb $0x2e, %r8b
jne 0x53f9
retq
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/utils.c
// Function: check_input_buffer3
int check_input_buffer3(char *buffer, size_t size)
{
	char *ptr = buffer, *end_ptr = buffer + size;
	int length = 0;

	while (ptr < end_ptr) {
		if (*++ptr == '\0') {
			length = ptr - buffer;
			break;
		}
	}

	if (!length) {
		return 0;
	}

	for (ptr = buffer; ptr < (buffer + length); ptr++)
	{
		if (!IS_ALPHANUM(*ptr) && !IS_EXTRA3(*ptr)) {
			return 0;
		}
	}

	return length;
}

// Assembly:
addq %rdi, %rsi
xorl %eax, %eax
movabsq $0x100000000, %r8       # imm = 0x100000000
xorl %r9d, %r9d
xorl %ecx, %ecx
leaq (%rdi,%r9), %rdx
cmpq %rsi, %rdx
jae 0x54da
addq %r8, %rcx
leaq 0x1(%r9), %rdx
cmpb $0x0, 0x1(%rdi,%r9)
movq %rdx, %r9
jne 0x546c
testl %edx, %edx
je 0x54da
sarq $0x20, %rcx
testq %rcx, %rcx
jle 0x54d8
addq %rdi, %rcx
movabsq $0x2e000000200019, %rsi # imm = 0x2E000000200019
movzbl (%rdi), %r8d
leal -0x30(%r8), %r9d
cmpb $0xa, %r9b
jb 0x54d0
movl %r8d, %r9d
orb $0x20, %r9b
addb $-0x61, %r9b
cmpb $0x1a, %r9b
jb 0x54d0
addl $-0x2a, %r8d
cmpl $0x35, %r8d
ja 0x54da
btq %r8, %rsi
jae 0x54da
incq %rdi
cmpq %rcx, %rdi
jb 0x54a1
movl %edx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/object.c
// Function: create_object
Object *create_object(void *ptr, size_t size)
{
	Object *object = (Object*)xmalloc(sizeof(*object));

	object->data = ptr;
	object->size = size;
	object->refcount = 1;

	return object;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x4770
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
movl $0x1, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/object.c
// Function: create_dup_object
Object *create_dup_object(void *ptr, size_t size)
{
	Object *object = (Object*)xmalloc(sizeof(*object));

	object->data = xmalloc(size);
	object->size = size;
	object->refcount = 1;

	memcpy(object->data, ptr, size);

	return object;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x4770
movq %rax, %r15
movq %rbx, %rdi
callq 0x4770
movq %rax, (%r15)
movq %rbx, 0x8(%r15)
movl $0x1, 0x10(%r15)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2280
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/object.c
// Function: decrement_references_count
void decrement_references_count(Object *object)
{
	if (object->refcount <= 1) {
		release_object(object);
	} else {
		object->refcount--;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %eax
cmpl $0x1, %eax
ja 0x5582
movq (%rbx), %rdi
callq 0x4997
movq %rbx, %rdi
popq %rbx
jmp 0x4997
decl %eax
movl %eax, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: auth_command_handler
void auth_command_handler(EagleClient *client)
{
	ProtocolRequestAuth *req = (ProtocolRequestAuth*)client->request;
	EagleUser *user;

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

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

	user = find_user(server->users, req->body.name, req->body.password);
	if (!user) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	client->perm = user->perm;

	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 0x55ae
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5625
movq 0x10(%rbx), %r12
leaq 0x8(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x5617
leaq 0x28(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x52ce
testl %eax, %eax
je 0x5617
leaq 0xccab(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x919a
testq %rax, %rax
je 0x5632
movq 0x40(%rax), %rax
movq %rax, 0x8(%rbx)
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5625
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x5625
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: add_status_response
static void add_status_response(EagleClient *client, int cmd, int status)
{
	ProtocolResponseHeader *res;

	if (!client->noack)
	{
		res = (ProtocolResponseHeader*)xmalloc(sizeof(*res));

		set_response_header(res, cmd, status, 0);

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

// Assembly:
cmpl $0x0, 0x28(%rdi)
je 0x5649
retq
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl $0x8, %edi
callq 0x4770
movw $0x80, (%rax)
movb %r14b, 0x2(%rax)
movb %bpl, 0x3(%rax)
movl $0x0, 0x4(%rax)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x8, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x5836
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: add_response
static void add_response(EagleClient *client, void *data, int size)
{
	Object *object = create_object(data, size);

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

	list_add_value_tail(client->responses, object);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movslq %edx, %rsi
movq %rax, %rdi
callq 0x54dc
movq %rax, %r14
movq %rbx, %rdi
callq 0x8943
testl %eax, %eax
je 0x5869
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x554c
movq 0x48(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8d1a
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: save_command_handler
void save_command_handler(EagleClient *client)
{
	ProtocolRequestSave *req = (ProtocolRequestSave*)client->request;

	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)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (req->body.async)
	{
		if (storage_save_background(server->storage) != EG_STATUS_OK) {
			add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		}
	}
	else
	{
		if (storage_save(server->storage) != EG_STATUS_OK) {
			add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		}
	}

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x8, 0x20(%rdi)
ja 0x5896
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x58f6
movq 0x10(%rbx), %r14
testb $0x20, 0x8(%rbx)
jne 0x58af
movzbl 0x2(%r14), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x58f6
cmpb $0x0, 0x8(%r14)
leaq 0xc9d5(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x1c0(%rax), %rdi
je 0x58ce
callq 0xb1fa
jmp 0x58d3
callq 0xab82
testl %eax, %eax
je 0x58e9
movzbl 0x2(%r14), %esi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x5642
movzbl 0x2(%r14), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: flush_command_handler
void flush_command_handler(EagleClient *client)
{
	ProtocolRequestFlush *req = (ProtocolRequestFlush*)client->request;

	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)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	if (BIT_CHECK(req->body.flags, EG_FLUSH_USER_FLAG)) {
		delete_users();
	}

	if (BIT_CHECK(req->body.flags, EG_FLUSH_QUEUE_FLAG)) {
		delete_queues();
	}

	if (BIT_CHECK(req->body.flags, EG_FLUSH_ROUTE_FLAG)) {
		delete_routes();
	}

	if (BIT_CHECK(req->body.flags, EG_FLUSH_CHANNEL_FLAG)) {
		delete_channels();
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpq $0xb, 0x20(%rdi)
ja 0x5923
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x593a
movq 0x10(%rbx), %r15
testb $0x20, 0x8(%rbx)
jne 0x594a
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
movl 0x8(%r15), %eax
testb $0x1, %al
je 0x59b1
leaq 0xc937(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x168(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x59ad
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %rcx
testb $0x40, 0x40(%rcx)
jne 0x59a0
movq (%r12), %rcx
movq 0x168(%rcx), %rdi
movq %rax, %rsi
callq 0x8e17
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x5983
movl 0x8(%r15), %eax
testb $0x2, %al
je 0x5a0a
leaq 0xc8d4(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x170(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5a06
leaq 0x8(%rsp), %r14
movq (%r12), %rcx
movq 0x170(%rcx), %rdi
movq %rax, %rsi
callq 0x8e17
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x59e6
movl 0x8(%r15), %eax
testb $0x4, %al
je 0x5a63
leaq 0xc87b(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5a5f
leaq 0x8(%rsp), %r14
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x8e17
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x5a3f
movl 0x8(%r15), %eax
testb $0x8, %al
je 0x5ab8
leaq 0xc822(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5ab8
leaq 0x8(%rsp), %r14
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x8e17
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x5a98
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x5642
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: free_client
void free_client(EagleClient *client)
{
	xfree(client->request);
	xfree(client->buffer);

	eject_queue_client(client);
	eject_channel_client(client);

	list_release(client->responses);
	list_release(client->declared_queues);
	list_release(client->subscribed_queues);
	keylist_release(client->subscribed_topics);
	keylist_release(client->subscribed_patterns);

	delete_file_event(server->loop, client->fd, EG_EVENT_READABLE);
	delete_file_event(server->loop, client->fd, EG_EVENT_WRITABLE);

	close(client->fd);

	list_delete_value(server->clients, client);

	xfree(client);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x4997
movq 0x30(%rbx), %rdi
callq 0x4997
movq 0x58(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5b49
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x98ca
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x5b30
movq 0x50(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5b90
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x9873
movq %r15, %rdi
callq 0x9a46
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x5b6c
movq 0x60(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8b54
movq %r14, %rdi
callq 0x8b5b
testq %rax, %rax
je 0x5bf3
leaq 0x8(%rsp), %r14
movq %rsp, %r15
movq 0x10(%rax), %r12
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5be6
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa419
jmp 0x5bc4
movq %r15, %rdi
callq 0x8b5b
testq %rax, %rax
jne 0x5bb4
movq 0x68(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x8b54
movq %r14, %rdi
callq 0x8b5b
testq %rax, %rax
je 0x5c56
leaq 0x8(%rsp), %r14
movq %rsp, %r15
movq 0x10(%rax), %r12
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0x8ed9
movq %r14, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5c49
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa510
jmp 0x5c27
movq %r15, %rdi
callq 0x8b5b
testq %rax, %rax
jne 0x5c17
movq 0x48(%rbx), %rdi
callq 0x8c7e
movq 0x50(%rbx), %rdi
callq 0x8c7e
movq 0x58(%rbx), %rdi
callq 0x8c7e
movq 0x60(%rbx), %rdi
callq 0x8ab6
movq 0x68(%rbx), %rdi
callq 0x8ab6
leaq 0xc606(%rip), %r14      # 0x12290
movq (%r14), %rax
movq (%rax), %rdi
movl (%rbx), %esi
movl $0x1, %edx
callq 0x3cd4
movq (%r14), %rax
movq (%rax), %rdi
movl (%rbx), %esi
movl $0x2, %edx
callq 0x3cd4
movl (%rbx), %edi
callq 0x21d0
movq (%r14), %rax
movq 0x160(%rax), %rdi
movq %rbx, %rsi
callq 0x8d73
movq %rbx, %rdi
callq 0x4997
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: user_create_command_handler
void user_create_command_handler(EagleClient *client)
{
	ProtocolRequestUserCreate *req = (ProtocolRequestUserCreate*)client->request;
	EagleUser *user;

	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)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

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

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

	user = create_user(req->body.name, req->body.password, req->body.perm);
	list_add_value_tail(server->users, user);

	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 $0x4f, 0x20(%rdi)
ja 0x5cfd
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5d82
movq 0x10(%rbx), %r12
testb $0x20, 0x8(%rbx)
jne 0x5d17
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5d82
leaq 0x8(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x5d74
leaq 0x28(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x52ce
testl %eax, %eax
je 0x5d74
leaq 0xc546(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x919a
testq %rax, %rax
je 0x5d90
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x5d82
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5642
movq 0x48(%r12), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x9130
movq (%r13), %rcx
movq 0x168(%rcx), %rdi
movq %rax, %rsi
callq 0x8d1a
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5d82
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: user_list_command_handler
void user_list_command_handler(EagleClient *client)
{
	ProtocolRequestUserList *req = (ProtocolRequestUserList*)client->request;
	ProtocolResponseHeader res;
	EagleUser *user;
	ListIterator iterator;
	ListNode *node;
	char *list;
	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)) {
		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->users) * (64 + sizeof(uint64_t)));

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

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

	i = sizeof(res);
	list_rewind(server->users, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		user = EG_LIST_NODE_VALUE(node);
		memcpy(list + i, user->name, strlenz(user->name));
		memcpy(list + i + 32, user->password, strlenz(user->password));
		memcpy(list + i + 64, &user->perm, sizeof(uint64_t));
		i += 64 + sizeof(uint64_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 0x5de1
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5df8
movq 0x10(%rdi), %rax
testb $0x20, 0x8(%rdi)
movzbl 0x2(%rax), %r12d
jne 0x5e0b
movl %r12d, %esi
movl $0x5, %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5642
movq %rdi, 0x10(%rsp)
leaq 0xc479(%rip), %rbx      # 0x12290
movq (%rbx), %rax
movq 0x168(%rax), %rax
movl 0x20(%rax), %eax
shll $0x3, %eax
leal (%rax,%rax,8), %r14d
leaq 0x8(%r14), %rdi
callq 0x47f6
movq %rax, %r15
movq %r14, 0x8(%rsp)
movq %r14, %rax
shlq $0x20, %rax
shll $0x10, %r12d
addq %r12, %rax
addq $0x1000080, %rax        # imm = 0x1000080
movq %rax, (%r15)
movq (%rbx), %rax
movq 0x168(%rax), %rdi
leaq 0x18(%rsp), %r12
movq %r12, %rsi
callq 0x8ed9
movq %r12, %rdi
callq 0x8e98
testq %rax, %rax
je 0x5ee0
movl $0x8, %ebx
leaq 0x18(%rsp), %r12
movq 0x10(%rax), %r13
movslq %ebx, %rbx
leaq (%r15,%rbx), %rbp
movq %r13, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2280
leaq (%r15,%rbx), %rbp
addq $0x20, %rbp
leaq 0x20(%r13), %r14
movq %r14, %rdi
callq 0x2150
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2280
movq 0x40(%r13), %rax
movq %rax, 0x40(%r15,%rbx)
addq $0x48, %rbx
movq %r12, %rdi
callq 0x8e98
testq %rax, %rax
jne 0x5e81
movq 0x8(%rsp), %rdx
addl $0x8, %edx
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5836
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: user_rename_command_handler
void user_rename_command_handler(EagleClient *client)
{
	ProtocolRequestUserRename *req = (ProtocolRequestUserRename*)client->request;
	EagleUser *user;

	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)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

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

	user = find_user(server->users, req->body.from, NULL);
	if (!user || find_user(server->users, req->body.to, NULL)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (BIT_CHECK(user->perm, EG_USER_NOT_CHANGE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	rename_user(user, 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 $0x47, 0x20(%rdi)
ja 0x5f26
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5fcb
movq 0x10(%rbx), %r12
testb $0x20, 0x8(%rbx)
jne 0x5f43
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5fcb
leaq 0x8(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x5fbd
leaq 0x28(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x5fbd
leaq 0xc31a(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x168(%rax), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x919a
testq %rax, %rax
je 0x5fad
movq %rax, %r15
movq (%r13), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x919a
testq %rax, %rax
je 0x5fd9
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x5fcb
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5642
testb $0x40, 0x40(%r15)
jne 0x5ffb
movq %r15, %rdi
movq %r14, %rsi
callq 0x9212
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5fcb
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x5fcb
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: user_set_perm_command_handler
void user_set_perm_command_handler(EagleClient *client)
{
	ProtocolRequestUserSetPerm *req = (ProtocolRequestUserSetPerm*)client->request;
	EagleUser *user;

	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)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

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

	user = find_user(server->users, req->body.name, NULL);
	if (!user) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (BIT_CHECK(user->perm, EG_USER_NOT_CHANGE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	set_user_perm(user, req->body.perm);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x2f, 0x20(%rdi)
ja 0x6029
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x60c6
movq 0x10(%rbx), %r15
testb $0x20, 0x8(%rbx)
jne 0x6045
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x60c6
leaq 0x8(%r15), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x609b
leaq 0xc22f(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x919a
testq %rax, %rax
je 0x60aa
testb $0x40, 0x40(%rax)
jne 0x60b9
movq 0x28(%r15), %rsi
movq %rax, %rdi
callq 0x923a
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x60c6
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x60c6
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x60c6
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: user_delete_command_handler
void user_delete_command_handler(EagleClient *client)
{
	ProtocolRequestUserDelete *req = (ProtocolRequestUserDelete*)client->request;
	EagleUser *user;

	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)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

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

	user = find_user(server->users, req->body.name, NULL);
	if (!user) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_NOT_FOUND);
		return;
	}

	if (BIT_CHECK(user->perm, EG_USER_NOT_CHANGE_PERM)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	if (list_delete_value(server->users, user) == 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 $0x27, 0x20(%rdi)
ja 0x60f1
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x619b
movq 0x10(%rbx), %r15
testb $0x20, 0x8(%rbx)
jne 0x610d
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x619b
leaq 0x8(%r15), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6170
leaq 0xc167(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x919a
testq %rax, %rax
je 0x617f
testb $0x40, 0x40(%rax)
jne 0x618e
movq (%r12), %rcx
movq 0x168(%rcx), %rdi
movq %rax, %rsi
callq 0x8d73
movzbl 0x2(%r15), %esi
cmpl $-0x1, %eax
je 0x6193
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x619b
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x619b
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x619b
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_create_command_handler
void queue_create_command_handler(EagleClient *client)
{
	ProtocolRequestQueueCreate *req = (ProtocolRequestQueueCreate*)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_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_queue_t(server->queues, req->body.name)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

	if (!req->body.max_msg || req->body.max_msg_size > EG_MAX_MSG_SIZE) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

	queue_t = create_queue_t(req->body.name, req->body.max_msg,
		((req->body.max_msg_size == 0) ? EG_MAX_MSG_SIZE : req->body.max_msg_size), req->body.flags);

	list_add_value_tail(server->queues, queue_t);

	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 $0x53, 0x20(%rdi)
ja 0x61cc
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6282
movq 0x10(%rbx), %r15
testl $0x100021, 0x8(%rbx)    # imm = 0x100021
je 0x6220
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6275
leaq 0xc097(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x622f
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x6282
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6282
movl 0x48(%r15), %esi
testl %esi, %esi
je 0x6275
movl 0x4c(%r15), %edx
testl %edx, %edx
js 0x6275
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmovel %eax, %edx
movl 0x50(%r15), %ecx
movq %r14, %rdi
callq 0x92a4
movq (%r12), %rcx
movq 0x170(%rcx), %rdi
movq %rax, %rsi
callq 0x8d1a
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x6282
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_declare_command_handler
void queue_declare_command_handler(EagleClient *client)
{
	ProtocolRequestQueueDeclare *req = (ProtocolRequestQueueDeclare*)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_DECLARE_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 (find_queue_t(client->declared_queues, req->body.name)) {
		add_status_response(client, req->header.cmd, EG_PROTOCOL_STATUS_SUCCESS);
		return;
	}

	declare_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 0x62b3
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6351
movq 0x10(%rbx), %r12
testl $0x200021, 0x8(%rbx)    # imm = 0x200021
je 0x6323
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6333
leaq 0xbfb3(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6343
movq %rax, %r15
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
jne 0x6313
movq %r15, %rdi
movq %rbx, %rsi
callq 0x984a
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x6351
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6351
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6351
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_exist_command_handler
void queue_exist_command_handler(EagleClient *client)
{
	ProtocolRequestQueueExist *req = (ProtocolRequestQueueExist*)client->request;
	ProtocolResponseQueueExist *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_QUEUE_PERM)
		&& !BIT_CHECK(client->perm, EG_USER_QUEUE_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 = (ProtocolResponseQueueExist*)xcalloc(sizeof(*res));

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

	if (find_queue_t(server->queues, 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 0x6382
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x642c
movq 0x10(%rbx), %r12
testl $0x400021, 0x8(%rbx)    # imm = 0x400021
je 0x640e
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x641e
movl $0xc, %edi
callq 0x47f6
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xbebb(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x97ae
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl $0xc, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5836
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x642c
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_rename_command_handler
void queue_rename_command_handler(EagleClient *client)
{
	ProtocolRequestQueueRename *req = (ProtocolRequestQueueRename*)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_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;
	}

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

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

	rename_queue_t(queue_t, 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 0x65e5
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6676
movq 0x10(%rbx), %r12
testl $0x1000021, 0x8(%rbx)   # imm = 0x1000021
je 0x6668
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x5351
testl %eax, %eax
je 0x6658
leaq 0x48(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x6658
leaq 0xbc6b(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x170(%rax), %rdi
movq %r15, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6684
movq %rax, %r15
movq (%r13), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x6694
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x6676
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5642
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x6676
movq %r15, %rdi
movq %r14, %rsi
callq 0x97f7
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x6676
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_size_command_handler
void queue_size_command_handler(EagleClient *client)
{
	ProtocolRequestQueueSize *req = (ProtocolRequestQueueSize*)client->request;
	ProtocolResponseQueueSize *res;
	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_SIZE_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;
	}

	res = (ProtocolResponseQueueSize*)xmalloc(sizeof(*res));

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

	res->body.size = get_size_queue_t(queue_t);

	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 0x66d0
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x679a
movq 0x10(%rbx), %r12
testl $0x2000021, 0x8(%rbx)   # imm = 0x2000021
je 0x676c
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x677c
leaq 0xbb8e(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x678c
movq %rax, %r14
movl $0xc, %edi
callq 0x4770
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
movq %r14, %rdi
callq 0x9839
movl %eax, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl $0xc, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5836
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x679a
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x679a
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5642
// File: /workspace/github_c_makefile_star2_O3/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_push_command_handler
void queue_push_command_handler(EagleClient *client)
{
	ProtocolRequestHeader *req = (ProtocolRequestHeader*)client->request;
	Queue_t *queue_t;
	Object *msg;
	char *queue_name, *msg_data;
	uint32_t expire;
	size_t msg_size;

	if (client->pos < (sizeof(*req) + 69)) {
		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_PUSH_PERM)) {
		add_status_response(client, req->cmd, EG_PROTOCOL_STATUS_ERROR_ACCESS);
		return;
	}

	queue_name = client->request + sizeof(*req);

	if (!check_input_buffer2(queue_name, 64)) {
		add_status_response(client, req->cmd, EG_PROTOCOL_STATUS_ERROR_VALUE);
		return;
	}

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

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

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

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

	msg = create_dup_object(msg_data, msg_size);

	if (push_message_queue_t(queue_t, msg, expire) == EG_STATUS_ERR) {
		add_status_response(client, req->cmd, EG_PROTOCOL_STATUS_ERROR);
		return;
	}

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpq $0x4c, 0x20(%rdi)
ja 0x67c8
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6829
movq 0x10(%rbx), %r15
testl $0x4000021, 0x8(%rbx)   # imm = 0x4000021
je 0x680d
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x5351
testl %eax, %eax
je 0x681c
leaq 0xba9f(%rip), %r12      # 0x12290
movq (%r12), %rax
cmpl $0x0, 0x1b0(%rax)
je 0x6836
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x6, %edx
jmp 0x6829
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6829
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5642
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x97ae
testq %rax, %rax
je 0x686d
movq %rax, %r14
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $-0x4c, %rsi
movl 0x48(%rdi), %ebp
addq $0x4c, %rdi
testl %ebp, %ebp
je 0x687c
movq (%r12), %rax
addl 0x190(%rax), %ebp
jmp 0x687e
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6829
xorl %ebp, %ebp
callq 0x5506
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x956a
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x68a4
movl $0x1, %edx
jmp 0x6829
movl $0x2, %edx
jmp 0x6829