LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xcalloc
void *xcalloc(size_t size)
{
	void *ptr = calloc(1, size + PREFIX_SIZE);

	if (!ptr) {
		fatal("Error allocate memory");
	}

#ifdef HAVE_MALLOC_SIZE
	xmalloc_update_stat_alloc(xmalloc_size(ptr));
	return ptr;
#else
	*((size_t*)ptr) = size;
	xmalloc_update_stat_alloc(size + PREFIX_SIZE);
	return (char*)ptr + PREFIX_SIZE;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
movl $0x1, %edi
callq 0x2260
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5197
leaq 0xd4fc(%rip), %rdi      # 0x1268c
movb $0x0, %al
callq 0x5ab0
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x51d4
movq -0x18(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, 0x1290d(%rip)     # 0x17ae8
je 0x520b
jmp 0x51df
leaq 0x128da(%rip), %rdi     # 0x17ac0
callq 0x24e0
movq -0x18(%rbp), %rax
addq 0x128fa(%rip), %rax     # 0x17af0
movq %rax, 0x128f3(%rip)     # 0x17af0
leaq 0x128bc(%rip), %rdi     # 0x17ac0
callq 0x2320
jmp 0x521d
movq -0x18(%rbp), %rax
addq 0x128da(%rip), %rax     # 0x17af0
movq %rax, 0x128d3(%rip)     # 0x17af0
jmp 0x521f
movq -0x10(%rbp), %rax
addq $0x8, %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xrealloc
void *xrealloc(void *ptr, size_t size)
{
#ifndef HAVE_MALLOC_SIZE
	void *realptr;
#endif
	size_t oldsize;
	void *newptr;

	if (!ptr) {
		return xmalloc(size);
	}

#ifdef HAVE_MALLOC_SIZE
	oldsize = xmalloc_size(ptr);
	newptr = realloc(ptr, size);

	if (!newptr) {
		fatal("Error allocate memory");
	}

	xmalloc_update_stat_free(oldsize);
	xmalloc_update_stat_alloc(xmalloc_size(newptr));

	return newptr;
#else
	realptr = (char*)ptr - PREFIX_SIZE;
	oldsize = *((size_t*)realptr);
	newptr = realloc(realptr, size + PREFIX_SIZE);

	if (!newptr) {
		fatal("Error allocate memory");
	}

	*((size_t*)newptr) = size;
	xmalloc_update_stat_free(oldsize);
	xmalloc_update_stat_alloc(size);

	return (char*)newptr + PREFIX_SIZE;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5259
movq -0x18(%rbp), %rdi
callq 0x5090
movq %rax, -0x8(%rbp)
jmp 0x53ab
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x2370
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x529a
leaq 0xd3f9(%rip), %rdi      # 0x1268c
movb $0x0, %al
callq 0x5ab0
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x52d3
movq -0x38(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, 0x1280e(%rip)     # 0x17ae8
je 0x530d
jmp 0x52de
leaq 0x127db(%rip), %rdi     # 0x17ac0
callq 0x24e0
movq -0x38(%rbp), %rcx
movq 0x127fb(%rip), %rax     # 0x17af0
subq %rcx, %rax
movq %rax, 0x127f1(%rip)     # 0x17af0
leaq 0x127ba(%rip), %rdi     # 0x17ac0
callq 0x2320
jmp 0x5322
movq -0x38(%rbp), %rcx
movq 0x127d8(%rip), %rax     # 0x17af0
subq %rcx, %rax
movq %rax, 0x127ce(%rip)     # 0x17af0
jmp 0x5324
jmp 0x5326
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x5354
movq -0x40(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, 0x1278d(%rip)     # 0x17ae8
je 0x538b
jmp 0x535f
leaq 0x1275a(%rip), %rdi     # 0x17ac0
callq 0x24e0
movq -0x40(%rbp), %rax
addq 0x1277a(%rip), %rax     # 0x17af0
movq %rax, 0x12773(%rip)     # 0x17af0
leaq 0x1273c(%rip), %rdi     # 0x17ac0
callq 0x2320
jmp 0x539d
movq -0x40(%rbp), %rax
addq 0x1275a(%rip), %rax     # 0x17af0
movq %rax, 0x12753(%rip)     # 0x17af0
jmp 0x539f
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xstrdup
char *xstrdup(const char *str)
{
	size_t len = strlenz(str);
	char *ptr = xmalloc(len);

	memcpy(ptr, str, len);

	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2160
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5090
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x22c0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xfree
void xfree(void *ptr)
{
#ifndef HAVE_MALLOC_SIZE
	void *realptr;
	size_t oldsize;
#endif

	if (!ptr) {
		return;
	}

#ifdef HAVE_MALLOC_SIZE
	xmalloc_update_stat_free(xmalloc_size(ptr));
	free(ptr);
#else
	realptr = (char*)ptr - PREFIX_SIZE;
	oldsize = *((size_t*)realptr);
	xmalloc_update_stat_free(oldsize + PREFIX_SIZE);
	free(realptr);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x5428
jmp 0x54cb
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x5471
movq -0x20(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, 0x12670(%rip)     # 0x17ae8
je 0x54ab
jmp 0x547c
leaq 0x1263d(%rip), %rdi     # 0x17ac0
callq 0x24e0
movq -0x20(%rbp), %rcx
movq 0x1265d(%rip), %rax     # 0x17af0
subq %rcx, %rax
movq %rax, 0x12653(%rip)     # 0x17af0
leaq 0x1261c(%rip), %rdi     # 0x17ac0
callq 0x2320
jmp 0x54c0
movq -0x20(%rbp), %rcx
movq 0x1263a(%rip), %rax     # 0x17af0
subq %rcx, %rax
movq %rax, 0x12630(%rip)     # 0x17af0
jmp 0x54c2
movq -0x10(%rbp), %rdi
callq 0x2030
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xmalloc_size
size_t xmalloc_size(void *ptr)
{
	void *realptr = (char*)ptr - PREFIX_SIZE;
	size_t size = *((size_t*)realptr);

	if (size & (sizeof(long) - 1)) {
		size += sizeof(long) - (size & (sizeof(long) - 1));
	}

	return size + PREFIX_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x5525
movq -0x18(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xmalloc_used_memory
size_t xmalloc_used_memory(void)
{
	size_t um;

	if (xmalloc_state_lock) {
#ifdef HAVE_ATOMIC
		um = __sync_add_and_fetch(&used_memory, 0);
#else
		pthread_mutex_lock(&memory_stat_mutex);
		um = used_memory;
		pthread_mutex_unlock(&memory_stat_mutex);
#endif
	} else {
		um = used_memory;
	}

	return um;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x125a9(%rip)     # 0x17ae8
je 0x5566
leaq 0x12578(%rip), %rdi     # 0x17ac0
callq 0x24e0
movq 0x1259c(%rip), %rax     # 0x17af0
movq %rax, -0x8(%rbp)
leaq 0x12561(%rip), %rdi     # 0x17ac0
callq 0x2320
jmp 0x5571
movq 0x12583(%rip), %rax     # 0x17af0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xmalloc_memory_rss
size_t xmalloc_memory_rss(void)
{
	int page = sysconf(_SC_PAGESIZE);
	size_t rss;
	char buf[4096];
	char filename[256];
	int fd, count;
	char *p, *x;

	snprintf(filename, 256, "/proc/%d/stat", getpid());
	if ((fd = open(filename, O_RDONLY)) == -1) {
		return 0;
	}

	if (read(fd, buf, 4096) <= 0) {
		close(fd);
		return 0;
	}

	close(fd);

	p = buf;
	count = 23;
	while (p && count--) {
		p = strchr(p, ' ');
		if (p) p++;
	}

	if (!p) {
		return 0;
	}

	x = strchr(p, ' ');
	if (!x) {
		return 0;
	}

	*x = '\0';

	rss = strtoll(p, NULL, 10);
	rss *= page;

	return rss;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1150, %rsp           # imm = 0x1150
movl $0x1e, %edi
callq 0x2430
movl %eax, -0xc(%rbp)
leaq -0x1120(%rbp), %rax
movq %rax, -0x1140(%rbp)
callq 0x2110
movq -0x1140(%rbp), %rdi
movl %eax, %ecx
movl $0x100, %esi            # imm = 0x100
leaq 0xd0d2(%rip), %rdx      # 0x126a2
movb $0x0, %al
callq 0x21b0
leaq -0x1120(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x23e0
movl %eax, -0x1124(%rbp)
cmpl $-0x1, %eax
jne 0x55ff
movq $0x0, -0x8(%rbp)
jmp 0x5740
movl -0x1124(%rbp), %edi
leaq -0x1020(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x2230
cmpq $0x0, %rax
jg 0x5634
movl -0x1124(%rbp), %edi
callq 0x2200
movq $0x0, -0x8(%rbp)
jmp 0x5740
movl -0x1124(%rbp), %edi
callq 0x2200
leaq -0x1020(%rbp), %rax
movq %rax, -0x1130(%rbp)
movl $0x17, -0x1128(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x1130(%rbp)
movb %al, -0x1141(%rbp)
je 0x5686
movl -0x1128(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x1128(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x1141(%rbp)
movb -0x1141(%rbp), %al
testb $0x1, %al
jne 0x5692
jmp 0x56c8
movq -0x1130(%rbp), %rdi
movl $0x20, %esi
callq 0x2190
movq %rax, -0x1130(%rbp)
cmpq $0x0, -0x1130(%rbp)
je 0x56c6
movq -0x1130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1130(%rbp)
jmp 0x5657
cmpq $0x0, -0x1130(%rbp)
jne 0x56dc
movq $0x0, -0x8(%rbp)
jmp 0x5740
movq -0x1130(%rbp), %rdi
movl $0x20, %esi
callq 0x2190
movq %rax, -0x1138(%rbp)
cmpq $0x0, -0x1138(%rbp)
jne 0x5708
movq $0x0, -0x8(%rbp)
jmp 0x5740
movq -0x1138(%rbp), %rax
movb $0x0, (%rax)
movq -0x1130(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x2290
movq %rax, -0x18(%rbp)
movslq -0xc(%rbp), %rax
imulq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1150, %rsp           # imm = 0x1150
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xcea9(%rip), %rsi      # 0x126b0
callq 0x2400
movq %rax, 0x122ed(%rip)     # 0x17b00
cmpq $0x0, 0x122e5(%rip)     # 0x17b00
jne 0x582d
leaq 0xce8e(%rip), %rdi      # 0x126b2
movb $0x0, %al
callq 0x5840
jmp 0x5837
movl $0x1, 0x122c1(%rip)     # 0x17af8
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x120(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x100, %esi            # imm = 0x100
callq 0x20d0
cmpl $0x3, -0x4(%rbp)
je 0x5993
cmpl $0x2, -0x4(%rbp)
je 0x5951
cmpl $0x1, -0x4(%rbp)
jne 0x5972
movq 0x116a0(%rip), %rax     # 0x16ff8
movq (%rax), %rdi
leaq -0x120(%rbp), %rdx
leaq 0xc6e4(%rip), %rsi      # 0x1204d
movb $0x0, %al
callq 0x22a0
jmp 0x5991
movq 0x1165f(%rip), %rax     # 0x16fd8
movq (%rax), %rdi
leaq -0x120(%rbp), %rdx
leaq 0xc6c3(%rip), %rsi      # 0x1204d
movb $0x0, %al
callq 0x22a0
jmp 0x5993
cmpl $0x0, 0x1215e(%rip)     # 0x17af8
je 0x59fa
leaq -0x20(%rbp), %rdi
callq 0x22e0
leaq -0x220(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2150
movq -0x228(%rbp), %rdi
movq %rax, %rdx
leaq -0x120(%rbp), %rcx
leaq 0xccfa(%rip), %rsi      # 0x126ce
movb $0x0, %al
callq 0x2480
leaq -0x220(%rbp), %rdi
movq 0x12117(%rip), %rsi     # 0x17b00
callq 0x21d0
movq 0x1210b(%rip), %rdi     # 0x17b00
callq 0x2340
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/utils.c
// Function: fatal
void fatal(const char *fmt,...)
{
	va_list args;

	va_start(args, fmt);
	output_message(FATAL_LEVEL, fmt, args);
	va_end(args);

	exit(EG_STATUS_ERR);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x5ae5
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
movl $0x2, %edi
callq 0x5910
leaq -0x20(%rbp), %rax
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2490
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/utils.c
// Function: make_message_tag
uint64_t make_message_tag(uint32_t msg_counter, uint32_t time)
{
	uint64_t id = 0;

	id |= time;
	id = id << 32;
	id |= msg_counter;

	return id;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movl -0x8(%rbp), %eax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xb9(%rbp)
je 0x6129
callq 0x24f0
movq (%rax), %rax
movq -0xa8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
setne %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x6135
jmp 0x6149
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x60e8
movq -0xa8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x6170
movq -0xa8(%rbp), %rdi
leaq 0xc562(%rip), %rsi      # 0x126c8
callq 0x2040
cmpl $0x0, %eax
jne 0x6180
movq $0x1, -0xb8(%rbp)
jmp 0x620a
movq -0xa8(%rbp), %rdi
leaq 0xc53c(%rip), %rsi      # 0x126ca
callq 0x2040
cmpl $0x0, %eax
jne 0x61a5
movq $0x3e8, -0xb8(%rbp) # imm = 0x3E8
jmp 0x6208
movq -0xa8(%rbp), %rdi
leaq 0xc519(%rip), %rsi      # 0x126cc
callq 0x2040
cmpl $0x0, %eax
jne 0x61ca
movq $0xf4240, -0xb8(%rbp) # imm = 0xF4240
jmp 0x6206
movq -0xa8(%rbp), %rdi
leaq 0xc09d(%rip), %rsi      # 0x12275
callq 0x2040
cmpl $0x0, %eax
jne 0x61ef
movq $0x3b9aca00, -0xb8(%rbp) # imm = 0x3B9ACA00
jmp 0x6204
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq $0x1, -0xb8(%rbp)
jmp 0x6206
jmp 0x6208
jmp 0x620a
movq -0xa8(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
cmpq $0x80, %rax
jb 0x6246
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x8(%rbp)
jmp 0x628d
leaq -0xa0(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0xac(%rbp), %eax
movl %eax, %edx
callq 0x22c0
movl -0xac(%rbp), %eax
movb $0x0, -0xa0(%rbp,%rax)
leaq -0xa0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x2290
imulq -0xb8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x62fb
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x62f9
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x2c(%rbp)
jmp 0x62fb
jmp 0x62c7
cmpl $0x0, -0x2c(%rbp)
jne 0x630d
movl $0x0, -0x4(%rbp)
jmp 0x63ab
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x63a5
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
orl $0x20, %eax
movzbl %al, %eax
cmpl $0x61, %eax
jl 0x634d
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
orl $0x20, %eax
movzbl %al, %eax
cmpl $0x7a, %eax
jle 0x6392
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x6365
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x6392
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
je 0x6392
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x6392
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0x6392
movl $0x0, -0x4(%rbp)
jmp 0x63ab
jmp 0x6394
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6315
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x660b
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x6609
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x2c(%rbp)
jmp 0x660b
jmp 0x65d7
cmpl $0x0, -0x2c(%rbp)
jne 0x661d
movl $0x0, -0x4(%rbp)
jmp 0x66ff
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x66f9
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
orl $0x20, %eax
movzbl %al, %eax
cmpl $0x61, %eax
jl 0x6665
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
orl $0x20, %eax
movzbl %al, %eax
cmpl $0x7a, %eax
jle 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x667d
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
je 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3f, %eax
je 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
je 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
je 0x66e6
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
je 0x66e6
movl $0x0, -0x4(%rbp)
jmp 0x66ff
jmp 0x66e8
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6625
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x18, %edi
callq 0x5090
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x10(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x18, %edi
callq 0x5090
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5090
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x10(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x22c0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10(%rax)
ja 0x6841
movq -0x8(%rbp), %rdi
callq 0x67d0
jmp 0x684e
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x48, 0x20(%rax)
jae 0x68b8
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x6975
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x20, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0x68ea
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x20, %rdi
movl $0x20, %esi
callq 0x62a0
cmpl $0x0, %eax
jne 0x6902
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0x6975
leaq 0x109a7(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
addq $0x20, %rdx
callq 0xcb40
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x694f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0x6975
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x69d5
movl $0x8, %edi
callq 0x5090
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %eax
movb %al, %dl
movl -0x10(%rbp), %eax
xorl %ecx, %ecx
movzbl %dl, %esi
movzbl %al, %edx
callq 0x6c70
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0x6cb0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: ping_command_handler
void ping_command_handler(EagleClient *client)
{
	ProtocolRequestPing *req = (ProtocolRequestPing*)client->request;

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x8, 0x20(%rax)
jae 0x6a15
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x6a2b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: set_response_header
static inline void set_response_header(ProtocolResponseHeader *header, uint8_t cmd, uint8_t status, uint32_t bodylen)
{
	header->magic = EG_PROTOCOL_RES;
	header->cmd = cmd;
	header->status = status;
	header->bodylen = bodylen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movb %al, -0xa(%rbp)
movl %ecx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movw $0x80, (%rax)
movb -0x9(%rbp), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x2(%rax)
movb -0xa(%rbp), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x6710
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0xba60
cmpl $0x0, %eax
je 0x6ced
movq -0x20(%rbp), %rdi
callq 0x67d0
jmp 0x6cfe
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xc170
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x9, 0x20(%rax)
jae 0x6d48
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x6dfb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0x6d75
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0x6dfb
movq -0x10(%rbp), %rax
cmpb $0x0, 0x8(%rax)
je 0x6db2
leaq 0x1052a(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x1c0(%rax), %rdi
callq 0xf5d0
cmpl $0x0, %eax
je 0x6db0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x2, %edx
callq 0x6980
jmp 0x6de5
leaq 0x104f7(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x1c0(%rax), %rdi
callq 0xf150
cmpl $0x0, %eax
je 0x6de3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x2, %edx
callq 0x6980
jmp 0x6de5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0xc, 0x20(%rax)
jae 0x6e48
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x6ee0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0x6e72
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0x6ee0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x6e88
callq 0x6ef0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x6e9e
callq 0x6f70
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andq $0x4, %rax
cmpq $0x0, %rax
je 0x6eb4
callq 0x6fd0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andq $0x8, %rax
cmpq $0x0, %rax
je 0x6eca
callq 0x7030
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: delete_users
static void delete_users(void)
{
	ListIterator iterator;
	ListNode *node;
	EagleUser *user;

	list_rewind(server->users, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		user = EG_LIST_NODE_VALUE(node);

		if (BIT_CHECK(user->perm, EG_USER_NOT_CHANGE_PERM)) {
			continue;
		}

		list_delete_node(server->users, node);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x103b1(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0xc520
leaq -0x10(%rbp), %rdi
callq 0xc450
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x6f61
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x6f45
jmp 0x6f12
leaq 0x10364(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xc320
jmp 0x6f12
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: delete_queues
static void delete_queues(void)
{
	ListIterator iterator;
	ListNode *node;

	list_rewind(server->queues, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		list_delete_node(server->queues, node);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x10331(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x170(%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0xc520
leaq -0x10(%rbp), %rdi
callq 0xc450
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x6fc1
leaq 0x10304(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x170(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xc320
jmp 0x6f92
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: delete_routes
static void delete_routes(void)
{
	ListIterator iterator;
	ListNode *node;

	list_rewind(server->routes, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		list_delete_node(server->routes, node);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x102d1(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x178(%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0xc520
leaq -0x10(%rbp), %rdi
callq 0xc450
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x7021
leaq 0x102a4(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x178(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xc320
jmp 0x6ff2
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: delete_channels
static void delete_channels(void)
{
	ListIterator iterator;
	ListNode *node;

	list_rewind(server->channels, &iterator);
	while ((node = list_next_node(&iterator)) != NULL)
	{
		list_delete_node(server->channels, node);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x10271(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0xc520
leaq -0x10(%rbp), %rdi
callq 0xc450
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x7081
leaq 0x10244(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x180(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xc320
jmp 0x7052
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/handlers.c
// Function: disconnect_command_handler
void disconnect_command_handler(EagleClient *client)
{
	ProtocolRequestDisconnect *req = (ProtocolRequestDisconnect*)client->request;

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

	free_client(client);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x8, 0x20(%rax)
jae 0x70c5
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x70ce
movq -0x8(%rbp), %rdi
callq 0x70e0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5410
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x5410
movq -0x8(%rbp), %rdi
callq 0xb750
movq -0x8(%rbp), %rdi
callq 0xb7f0
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0xc040
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xc040
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0xc040
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0xbcc0
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0xbcc0
leaq 0x10150(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %esi
movl $0x1, %edx
callq 0x3e10
leaq 0x10133(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %esi
movl $0x2, %edx
callq 0x3e10
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x2200
leaq 0x1010b(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x160(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0xc220
movq -0x8(%rbp), %rdi
callq 0x5410
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x50, 0x20(%rax)
jae 0x7208
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x7317
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0x7235
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0x7317
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x20, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0x7267
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x20, %rdi
movl $0x20, %esi
callq 0x62a0
cmpl $0x0, %eax
jne 0x7282
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0x7317
leaq 0x10027(%rip), %rax     # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xcb40
cmpq $0x0, %rax
je 0x72c2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x2, %edx
callq 0x6980
jmp 0x7317
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x20, %rsi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdx
callq 0xca80
movq %rax, -0x18(%rbp)
leaq 0xffc2(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xc170
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x48, 0x20(%rax)
jae 0x7508
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x7648
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0x7535
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0x7648
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x20, %esi
callq 0x63b0
cmpl $0x0, %eax
je 0x7567
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
addq $0x20, %rdi
movl $0x20, %esi
callq 0x63b0
cmpl $0x0, %eax
jne 0x7582
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0x7648
leaq 0xfd27(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xcb40
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x75db
leaq 0xfcfa(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x20, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xcb40
cmpq $0x0, %rax
je 0x75f3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0x7648
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x761d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x2, %edx
callq 0x6980
jmp 0x7648
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x20, %rsi
callq 0xcbf0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x30, 0x20(%rax)
jae 0x7688
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x6980
jmp 0x777d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
andq $0x20, %rax
cmpq $0x0, %rax
jne 0x76b5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x5, %edx
callq 0x6980
jmp 0x777d
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x20, %esi
callq 0x63b0
cmpl $0x0, %eax
jne 0x76e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x7, %edx
callq 0x6980
jmp 0x777d
leaq 0xfbc2(%rip), %rax      # 0x172b0
movq (%rax), %rax
movq 0x168(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xcb40
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x772c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x9, %edx
callq 0x6980
jmp 0x777d
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x7756
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x2, %edx
callq 0x6980
jmp 0x777d
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0xcc40
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %esi
movl $0x1, %edx
callq 0x6980
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)