LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x7fc4(%rip), %rsi      # 0xc6cc
callq 0x23c0
movq %rax, 0xe3cc(%rip)      # 0x12ae0
testq %rax, %rax
je 0x4725
movl $0x1, 0xe3b5(%rip)      # 0x12ad8
popq %rax
retq
leaq 0x7fa2(%rip), %rdi      # 0xc6ce
xorl %eax, %eax
popq %rcx
jmp 0x4734
// File: /workspace/github_c_makefile_star2_O1/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 0x20d0
cmpl $0x3, %ebx
je 0x4833
decl %ebx
cmpl $0x1, %ebx
jbe 0x4896
movq 0xd7bb(%rip), %rax      # 0x11fd8
movq (%rax), %rdi
leaq 0x7842(%rip), %rsi      # 0xc069
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2270
cmpl $0x0, 0xe29e(%rip)      # 0x12ad8
je 0x488d
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x22b0
movq %rbx, %rdi
callq 0x2150
leaq 0x7e92(%rip), %rsi      # 0xc6ea
leaq 0x110(%rsp), %rbx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2440
movq 0xe267(%rip), %rsi      # 0x12ae0
movq %rbx, %rdi
callq 0x21c0
movq 0xe258(%rip), %rdi      # 0x12ae0
callq 0x2310
addq $0x210, %rsp            # imm = 0x210
popq %rbx
retq
movq 0xd75b(%rip), %rax      # 0x11ff8
jmp 0x481d
// File: /workspace/github_c_makefile_star2_O1/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)
movsbq (%rdi), %r15
movl $0x1, %r12d
testq %r15, %r15
sete %bpl
je 0x4df3
callq 0x24b0
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r15,2)
movq %rbx, %r15
je 0x4d95
leaq 0x1(%rbx), %r15
movsbq (%r15), %rcx
testq %rcx, %rcx
sete %bpl
je 0x4df6
incq %r15
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x4d7b
decq %r15
testb %bpl, %bpl
jne 0x4df6
leaq 0x7943(%rip), %rsi      # 0xc6e4
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x4df6
leaq 0x7932(%rip), %rsi      # 0xc6e6
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x4e4e
leaq 0x791d(%rip), %rsi      # 0xc6e8
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x4e56
leaq 0x74b3(%rip), %rsi      # 0xc291
movq %r15, %rdi
callq 0x2040
testl %eax, %eax
je 0x4e5e
movl $0x1, (%r14)
jmp 0x4df6
movq %rbx, %r15
subl %ebx, %r15d
cmpl $0x80, %r15d
jb 0x4e15
movl $0x1, (%r14)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
jmp 0x4e3e
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2290
movb $0x0, (%rsp,%r15)
movq %r14, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2260
imulq %r12, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x3e8, %r12d           # imm = 0x3E8
jmp 0x4df6
movl $0xf4240, %r12d         # imm = 0xF4240
jmp 0x4df6
movl $0x3b9aca00, %r12d      # imm = 0x3B9ACA00
jmp 0x4df6
// File: /workspace/github_c_makefile_star2_O1/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 %ecx, %ecx
xorl %eax, %eax
leaq (%rdi,%rax), %rdx
cmpq %rsi, %rdx
jae 0x4e86
leaq 0x1(%rax), %rdx
cmpb $0x0, 0x1(%rdi,%rax)
movq %rdx, %rax
jne 0x4e6d
movl %edx, %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0x4ed7
jle 0x4ed5
movslq %ecx, %rdx
addq %rdi, %rdx
movabsq $0x4000000000003, %rsi  # imm = 0x4000000000003
movzbl (%rdi), %r8d
leal -0x30(%r8), %r9d
cmpb $0xa, %r9b
jb 0x4ecd
movl %r8d, %r9d
orb $0x20, %r9b
addb $-0x61, %r9b
cmpb $0x1a, %r9b
jb 0x4ecd
addl $-0x2d, %r8d
cmpl $0x32, %r8d
ja 0x4ed7
btq %r8, %rsi
jae 0x4ed7
incq %rdi
cmpq %rdx, %rdi
jb 0x4e9e
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %ecx, %ecx
xorl %eax, %eax
leaq (%rdi,%rax), %rdx
cmpq %rsi, %rdx
jae 0x4ef8
leaq 0x1(%rax), %rdx
cmpb $0x0, 0x1(%rdi,%rax)
movq %rdx, %rax
jne 0x4edf
movl %edx, %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0x4fc4
movzbl (%rdi), %esi
movl %esi, %edx
orb $0x20, %dl
addb $-0x61, %dl
cmpb $0x1a, %dl
jb 0x4f20
cmpl $0x5f, %esi
je 0x4f20
cmpl $0x2e, %esi
jne 0x4fc4
cmpl $0x3, %ecx
jl 0x4fc5
movslq %ecx, %rdx
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 0x4f64
cmpl $0x5f, %r8d
jne 0x4fb9
testl %r9d, %r9d
jne 0x4fc4
leal -0x30(%r8), %r9d
cmpb $0xa, %r9b
jb 0x4f96
movl %r8d, %r9d
orb $0x20, %r9b
addb $-0x61, %r9b
cmpb $0x1a, %r9b
jb 0x4f96
addl $-0x2d, %r8d
cmpl $0x32, %r8d
ja 0x4fc4
btq %r8, %rsi
jb 0x4fa9
jmp 0x4fc4
xorl %r9d, %r9d
addl $-0x2d, %r8d
cmpl $0x32, %r8d
ja 0x4faf
btq %r8, %rsi
jae 0x4faf
movl $0x1, %r9d
incq %rdi
cmpq %rdx, %rdi
jb 0x4f54
jmp 0x4fc5
testl %r9d, %r9d
je 0x4f69
cmpb $0x2e, %r8b
jne 0x4f69
retq
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %ecx, %ecx
xorl %eax, %eax
leaq (%rdi,%rax), %rdx
cmpq %rsi, %rdx
jae 0x4fe8
leaq 0x1(%rax), %rdx
cmpb $0x0, 0x1(%rdi,%rax)
movq %rdx, %rax
jne 0x4fcf
movl %edx, %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0x5039
jle 0x5037
movslq %ecx, %rdx
addq %rdi, %rdx
movabsq $0x2e000000200019, %rsi # imm = 0x2E000000200019
movzbl (%rdi), %r8d
leal -0x30(%r8), %r9d
cmpb $0xa, %r9b
jb 0x502f
movl %r8d, %r9d
orb $0x20, %r9b
addb $-0x61, %r9b
cmpb $0x1a, %r9b
jb 0x502f
addl $-0x2a, %r8d
cmpl $0x35, %r8d
ja 0x5039
btq %r8, %rsi
jae 0x5039
incq %rdi
cmpq %rdx, %rdi
jb 0x5000
movl %ecx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x42f0
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_O1/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 0x42f0
movq %rax, %r15
movq %rbx, %rdi
callq 0x42f0
movq %rax, (%r15)
movq %rbx, 0x8(%r15)
movl $0x1, 0x10(%r15)
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2290
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x50e2
movq (%rbx), %rdi
callq 0x44fe
movq %rbx, %rdi
popq %rbx
jmp 0x44fe
decl %eax
movl %eax, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x510e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5185
movq 0x10(%rbx), %r12
leaq 0x8(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5177
leaq 0x28(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x4e66
testl %eax, %eax
je 0x5177
leaq 0xd14b(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8d02
testq %rax, %rax
je 0x5192
movq 0x40(%rax), %rax
movq %rax, 0x8(%rbx)
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5185
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x5185
// File: /workspace/github_c_makefile_star2_O1/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 0x51a9
retq
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl $0x8, %edi
callq 0x42f0
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 0x5396
// File: /workspace/github_c_makefile_star2_O1/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 0x503c
movq %rax, %r14
movq %rbx, %rdi
callq 0x84aa
testl %eax, %eax
je 0x53c9
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x50ac
movq 0x48(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8886
// File: /workspace/github_c_makefile_star2_O1/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 0x53f6
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5456
movq 0x10(%rbx), %r14
testb $0x20, 0x8(%rbx)
jne 0x540f
movzbl 0x2(%r14), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5456
cmpb $0x0, 0x8(%r14)
leaq 0xce75(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x1c0(%rax), %rdi
je 0x542e
callq 0xadbc
jmp 0x5433
callq 0xa744
testl %eax, %eax
je 0x5449
movzbl 0x2(%r14), %esi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x51a2
movzbl 0x2(%r14), %esi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/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 0x5483
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x549a
movq 0x10(%rbx), %r15
testb $0x20, 0x8(%rbx)
jne 0x54aa
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
testb $0x1, 0x8(%r15)
je 0x550c
leaq 0xcdd8(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x168(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x550c
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %rcx
testb $0x40, 0x40(%rcx)
jne 0x54ff
movq (%r12), %rcx
movq 0x168(%rcx), %rdi
movq %rax, %rsi
callq 0x897a
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x54e2
testb $0x2, 0x8(%r15)
je 0x5564
leaq 0xcd76(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x170(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x5564
leaq 0x8(%rsp), %r14
movq (%r12), %rcx
movq 0x170(%rcx), %rdi
movq %rax, %rsi
callq 0x897a
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x5544
testb $0x4, 0x8(%r15)
je 0x55bc
leaq 0xcd1e(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x178(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x55bc
leaq 0x8(%rsp), %r14
movq (%r12), %rcx
movq 0x178(%rcx), %rdi
movq %rax, %rsi
callq 0x897a
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x559c
testb $0x8, 0x8(%r15)
je 0x5614
leaq 0xccc6(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x180(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x5614
leaq 0x8(%rsp), %r14
movq (%r12), %rcx
movq 0x180(%rcx), %rdi
movq %rax, %rsi
callq 0x897a
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x55f4
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x51a2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x44fe
movq 0x30(%rbx), %rdi
callq 0x44fe
movq 0x58(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x56a5
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x9432
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x568c
movq 0x50(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x56ec
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x93db
movq %r15, %rdi
callq 0x95ae
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x56c8
movq 0x60(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x86b7
movq %r14, %rdi
callq 0x86be
testq %rax, %rax
je 0x574f
leaq 0x8(%rsp), %r14
movq %rsp, %r15
movq 0x10(%rax), %r12
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x5742
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9fa4
jmp 0x5720
movq %r15, %rdi
callq 0x86be
testq %rax, %rax
jne 0x5710
movq 0x68(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x86b7
movq %r14, %rdi
callq 0x86be
testq %rax, %rax
je 0x57b2
leaq 0x8(%rsp), %r14
movq %rsp, %r15
movq 0x10(%rax), %r12
movq 0x18(%rax), %rdi
movq %r14, %rsi
callq 0x8a40
movq %r14, %rdi
callq 0x89ff
testq %rax, %rax
je 0x57a5
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa09b
jmp 0x5783
movq %r15, %rdi
callq 0x86be
testq %rax, %rax
jne 0x5773
movq 0x48(%rbx), %rdi
callq 0x87ea
movq 0x50(%rbx), %rdi
callq 0x87ea
movq 0x58(%rbx), %rdi
callq 0x87ea
movq 0x60(%rbx), %rdi
callq 0x8616
movq 0x68(%rbx), %rdi
callq 0x8616
leaq 0xcaaa(%rip), %r14      # 0x12290
movq (%r14), %rax
movq (%rax), %rdi
movl (%rbx), %esi
movl $0x1, %edx
callq 0x37d7
movq (%r14), %rax
movq (%rax), %rdi
movl (%rbx), %esi
movl $0x2, %edx
callq 0x37d7
movl (%rbx), %edi
callq 0x21e0
movq (%r14), %rax
movq 0x160(%rax), %rdi
movq %rbx, %rsi
callq 0x88db
movq %rbx, %rdi
callq 0x44fe
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/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 0x5859
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x58de
movq 0x10(%rbx), %r12
testb $0x20, 0x8(%rbx)
jne 0x5873
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x58de
leaq 0x8(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x58d0
leaq 0x28(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x4e66
testl %eax, %eax
je 0x58d0
leaq 0xc9ea(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x8d02
testq %rax, %rax
je 0x58ec
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x58de
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x51a2
movq 0x48(%r12), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x8c98
movq (%r13), %rcx
movq 0x168(%rcx), %rdi
movq %rax, %rsi
callq 0x8886
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x58de
// File: /workspace/github_c_makefile_star2_O1/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 0x593d
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5954
movq 0x10(%rdi), %rax
testb $0x20, 0x8(%rdi)
movzbl 0x2(%rax), %r12d
jne 0x5967
movl %r12d, %esi
movl $0x5, %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x51a2
movq %rdi, 0x10(%rsp)
leaq 0xc91d(%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 0x4376
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 0x8a40
movq %r12, %rdi
callq 0x89ff
testq %rax, %rax
je 0x5a3c
movl $0x8, %ebx
leaq 0x18(%rsp), %r12
movq 0x10(%rax), %r13
movslq %ebx, %rbx
leaq (%r15,%rbx), %rbp
movq %r13, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2290
leaq (%r15,%rbx), %rbp
addq $0x20, %rbp
leaq 0x20(%r13), %r14
movq %r14, %rdi
callq 0x2160
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2290
movq 0x40(%r13), %rax
movq %rax, 0x40(%r15,%rbx)
addq $0x48, %rbx
movq %r12, %rdi
callq 0x89ff
testq %rax, %rax
jne 0x59dd
movq 0x8(%rsp), %rdx
addl $0x8, %edx
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x5396
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5a82
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5b27
movq 0x10(%rbx), %r12
testb $0x20, 0x8(%rbx)
jne 0x5a9f
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5b27
leaq 0x8(%r12), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5b19
leaq 0x28(%r12), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5b19
leaq 0xc7be(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x168(%rax), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x8d02
testq %rax, %rax
je 0x5b09
movq %rax, %r15
movq (%r13), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x8d02
testq %rax, %rax
je 0x5b35
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x5b27
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x51a2
testb $0x40, 0x40(%r15)
jne 0x5b57
movq %r15, %rdi
movq %r14, %rsi
callq 0x8d7a
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5b27
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x5b27
// File: /workspace/github_c_makefile_star2_O1/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 0x5b85
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5c22
movq 0x10(%rbx), %r15
testb $0x20, 0x8(%rbx)
jne 0x5ba1
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5c22
leaq 0x8(%r15), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5bf7
leaq 0xc6d3(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x8d02
testq %rax, %rax
je 0x5c06
testb $0x40, 0x40(%rax)
jne 0x5c15
movq 0x28(%r15), %rsi
movq %rax, %rdi
callq 0x8da2
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5c22
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x5c22
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x5c22
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/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 0x5c4d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5cf7
movq 0x10(%rbx), %r15
testb $0x20, 0x8(%rbx)
jne 0x5c69
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5cf7
leaq 0x8(%r15), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5ccc
leaq 0xc60b(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x168(%rax), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x8d02
testq %rax, %rax
je 0x5cdb
testb $0x40, 0x40(%rax)
jne 0x5cea
movq (%r12), %rcx
movq 0x168(%rcx), %rdi
movq %rax, %rsi
callq 0x88db
movzbl 0x2(%r15), %esi
cmpl $-0x1, %eax
je 0x5cef
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5cf7
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x5cf7
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x5cf7
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_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 0x5d28
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5dde
movq 0x10(%rbx), %r15
testl $0x100021, 0x8(%rbx)    # imm = 0x100021
je 0x5d7c
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5dd1
leaq 0xc53b(%rip), %r12      # 0x12290
movq (%r12), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x5d8b
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
jmp 0x5dde
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5dde
movl 0x48(%r15), %esi
testl %esi, %esi
je 0x5dd1
movl 0x4c(%r15), %edx
testl %edx, %edx
js 0x5dd1
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmovel %eax, %edx
movl 0x50(%r15), %ecx
movq %r14, %rdi
callq 0x8e0c
movq (%r12), %rcx
movq 0x170(%rcx), %rdi
movq %rax, %rsi
callq 0x8886
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5dde
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x5e0f
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5ead
movq 0x10(%rbx), %r12
testl $0x200021, 0x8(%rbx)    # imm = 0x200021
je 0x5e7f
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5e8f
leaq 0xc457(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x5e9f
movq %rax, %r15
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
jne 0x5e6f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x93b2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x5ead
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5ead
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x5ead
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_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 0x5ede
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x5f88
movq 0x10(%rbx), %r12
testl $0x400021, 0x8(%rbx)    # imm = 0x400021
je 0x5f6a
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x5f7a
movl $0xc, %edi
callq 0x4376
movq %rax, %r15
movb 0x2(%r12), %al
movw $0x80, (%r15)
movb %al, 0x2(%r15)
movb $0x1, 0x3(%r15)
movl $0x4, 0x4(%r15)
leaq 0xc35f(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x9316
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl $0xc, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5396
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x5f88
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: 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 0x6141
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x61d2
movq 0x10(%rbx), %r12
testl $0x1000021, 0x8(%rbx)   # imm = 0x1000021
je 0x61c4
leaq 0x8(%r12), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x61b4
leaq 0x48(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x61b4
leaq 0xc10f(%rip), %r13      # 0x12290
movq (%r13), %rax
movq 0x170(%rax), %rdi
movq %r15, %rsi
callq 0x9316
testq %rax, %rax
je 0x61e0
movq %rax, %r15
movq (%r13), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x61f0
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x61d2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x51a2
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
jmp 0x61d2
movq %r15, %rdi
movq %r14, %rsi
callq 0x935f
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x61d2
// File: /workspace/github_c_makefile_star2_O1/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 0x622c
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x62f6
movq 0x10(%rbx), %r12
testl $0x2000021, 0x8(%rbx)   # imm = 0x2000021
je 0x62c8
leaq 0x8(%r12), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x62d8
leaq 0xc032(%rip), %rax      # 0x12290
movq (%rax), %rax
movq 0x170(%rax), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x62e8
movq %rax, %r14
movl $0xc, %edi
callq 0x42f0
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 0x93a1
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 0x5396
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x62f6
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x7, %edx
jmp 0x62f6
movzbl 0x2(%r12), %esi
movq %rbx, %rdi
movl $0x9, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x51a2
// File: /workspace/github_c_makefile_star2_O1/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: queue_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 0x6324
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x6385
movq 0x10(%rbx), %r15
testl $0x4000021, 0x8(%rbx)   # imm = 0x4000021
je 0x6369
leaq 0x8(%r15), %r14
movl $0x40, %esi
movq %r14, %rdi
callq 0x4ed8
testl %eax, %eax
je 0x6378
leaq 0xbf43(%rip), %r12      # 0x12290
movq (%r12), %rax
cmpl $0x0, 0x1b0(%rax)
je 0x6392
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x6, %edx
jmp 0x6385
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x5, %edx
jmp 0x6385
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x7, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x51a2
movq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x9316
testq %rax, %rax
je 0x63c9
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 0x63d8
movq (%r12), %rax
addl 0x190(%rax), %ebp
jmp 0x63da
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
movl $0x8, %edx
jmp 0x6385
xorl %ebp, %ebp
callq 0x5066
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x90d2
movzbl 0x2(%r15), %esi
movq %rbx, %rdi
cmpl $-0x1, %eax
je 0x6400
movl $0x1, %edx
jmp 0x6385
movl $0x2, %edx
jmp 0x6385