LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/eagle.c
// Function: init_storage
void init_storage()
{
	if (access(server->storage, F_OK) == -1)
	{
		if (storage_save(server->storage) != EG_STATUS_OK) {
			warning("Error init storage %s\n", server->storage);
		}
	}

	if (storage_load(server->storage) != EG_STATUS_OK) {
		warning("Error loading data from %s", server->storage);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x14395(%rip), %rax     # 0x172b0
movq 0x1c0(%rax), %rdi
xorl %esi, %esi
callq 0x23f0
cmpl $-0x1, %eax
jne 0x2f64
movq 0x1437b(%rip), %rax     # 0x172b0
movq 0x1c0(%rax), %rdi
callq 0xf150
cmpl $0x0, %eax
je 0x2f62
movq 0x14363(%rip), %rax     # 0x172b0
movq 0x1c0(%rax), %rsi
leaq 0xf22f(%rip), %rdi      # 0x1218a
movb $0x0, %al
callq 0x5840
jmp 0x2f64
movq 0x14345(%rip), %rax     # 0x172b0
movq 0x1c0(%rax), %rdi
callq 0xeb40
cmpl $0x0, %eax
je 0x2f98
movq 0x1432d(%rip), %rax     # 0x172b0
movq 0x1c0(%rax), %rsi
leaq 0xf210(%rip), %rdi      # 0x121a1
movb $0x0, %al
callq 0x5840
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/eagle.c
// Function: destroy_server
void destroy_server()
{
	if (server->child_pid != -1)
	{
		kill(server->child_pid, SIGKILL);
		remove_temp_file(server->child_pid);
	}

	if (server->fd > 0) {
		close(server->fd);
	}

	if (server->sfd > 0) {
		close(server->sfd);
	}

	if (server->pidfile) {
		unlink(server->pidfile);
	}

	if (server->unix_socket) {
		unlink(server->unix_socket);
	}

	disable_log();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x140a5(%rip), %rax     # 0x172b0
cmpl $-0x1, 0x34(%rax)
je 0x3234
movq 0x14098(%rip), %rax     # 0x172b0
movl 0x34(%rax), %edi
movl $0x9, %esi
callq 0x22d0
movq 0x14084(%rip), %rax     # 0x172b0
movl 0x34(%rax), %edi
callq 0xf6b0
movq 0x14075(%rip), %rax     # 0x172b0
cmpl $0x0, 0x8(%rax)
jle 0x3250
movq 0x14068(%rip), %rax     # 0x172b0
movl 0x8(%rax), %edi
callq 0x2200
movq 0x14059(%rip), %rax     # 0x172b0
cmpl $0x0, 0xc(%rax)
jle 0x326c
movq 0x1404c(%rip), %rax     # 0x172b0
movl 0xc(%rax), %edi
callq 0x2200
movq 0x1403d(%rip), %rax     # 0x172b0
cmpq $0x0, 0x1c8(%rax)
je 0x3290
movq 0x1402c(%rip), %rax     # 0x172b0
movq 0x1c8(%rax), %rdi
callq 0x2060
movq 0x14019(%rip), %rax     # 0x172b0
cmpq $0x0, 0x28(%rax)
je 0x32ae
movq 0x1400b(%rip), %rax     # 0x172b0
movq 0x28(%rax), %rdi
callq 0x2060
movb $0x0, %al
callq 0x58e0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/eagle.c
// Function: init_config
void init_config(void)
{
	if (access(server->config, F_OK) != -1)
	{
		if (config_load(server->config) != EG_STATUS_OK)
		{
			fatal("Error load config file %s", server->config);
		}
	}
	else
	{
		warning("Config file %s don't exist", server->config);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x13fe5(%rip), %rax     # 0x172b0
movq 0x1d8(%rax), %rdi
xorl %esi, %esi
callq 0x23f0
cmpl $-0x1, %eax
je 0x3314
movq 0x13fcb(%rip), %rax     # 0x172b0
movq 0x1d8(%rax), %rdi
callq 0x10760
cmpl $0x0, %eax
je 0x3312
movq 0x13fb3(%rip), %rax     # 0x172b0
movq 0x1d8(%rax), %rsi
leaq 0xef0f(%rip), %rdi      # 0x1221a
movb $0x0, %al
callq 0x5ab0
jmp 0x3330
movq 0x13f95(%rip), %rax     # 0x172b0
movq 0x1d8(%rax), %rsi
leaq 0xef0b(%rip), %rdi      # 0x12234
movb $0x0, %al
callq 0x5840
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/eagle.c
// Function: destroy_server_config
void destroy_server_config(void)
{
	xfree(server->addr);
	xfree(server->name);
	xfree(server->password);
	xfree(server->storage);
	xfree(server->logfile);

	if (server->unix_socket)
		xfree(server->unix_socket);

	if (server->pidfile)
		xfree(server->pidfile);

	list_release(server->clients);
	list_release(server->users);
	list_release(server->queues);
	list_release(server->routes);
	list_release(server->channels);

	xfree(server);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x13c65(%rip), %rax     # 0x172b0
movq 0x18(%rax), %rdi
callq 0x5410
movq 0x13c55(%rip), %rax     # 0x172b0
movq 0x38(%rax), %rdi
callq 0x5410
movq 0x13c45(%rip), %rax     # 0x172b0
movq 0x40(%rax), %rdi
callq 0x5410
movq 0x13c35(%rip), %rax     # 0x172b0
movq 0x1c0(%rax), %rdi
callq 0x5410
movq 0x13c22(%rip), %rax     # 0x172b0
movq 0x1d0(%rax), %rdi
callq 0x5410
movq 0x13c0f(%rip), %rax     # 0x172b0
cmpq $0x0, 0x28(%rax)
je 0x36b8
movq 0x13c01(%rip), %rax     # 0x172b0
movq 0x28(%rax), %rdi
callq 0x5410
movq 0x13bf1(%rip), %rax     # 0x172b0
cmpq $0x0, 0x1c8(%rax)
je 0x36dc
movq 0x13be0(%rip), %rax     # 0x172b0
movq 0x1c8(%rax), %rdi
callq 0x5410
movq 0x13bcd(%rip), %rax     # 0x172b0
movq 0x160(%rax), %rdi
callq 0xc040
movq 0x13bba(%rip), %rax     # 0x172b0
movq 0x168(%rax), %rdi
callq 0xc040
movq 0x13ba7(%rip), %rax     # 0x172b0
movq 0x170(%rax), %rdi
callq 0xc040
movq 0x13b94(%rip), %rax     # 0x172b0
movq 0x178(%rax), %rdi
callq 0xc040
movq 0x13b81(%rip), %rax     # 0x172b0
movq 0x180(%rax), %rdi
callq 0xc040
movq 0x13b6e(%rip), %rdi     # 0x172b0
callq 0x5410
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/eagle.c
// Function: show_logo
void show_logo(void)
{
	printf(ascii_logo,
		EAGLE_VERSION,
		server->addr,
		server->port,
		get_event_api_name());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x13b39(%rip), %rax     # 0x17298
movq %rax, -0x18(%rbp)
movq 0x13b46(%rip), %rax     # 0x172b0
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq 0x13b37(%rip), %rax     # 0x172b0
movl 0x20(%rax), %eax
movl %eax, -0x4(%rbp)
callq 0x49b0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl -0x4(%rbp), %ecx
movq %rax, %r8
leaq 0xeaeb(%rip), %rsi      # 0x12284
movb $0x0, %al
callq 0x21a0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/eagle.c
// Function: parse_args
void parse_args(int argc, char *argv[])
{
	int position = 1;

	if (argc >= 2)
	{
		if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
			usage();
			exit(0);
		} else {
			server->config = argv[1];
			position = 2;
			init_config();
		}
	}

	for (; position < argc; position += 2)
	{
		if (position == argc - 1)
			fatal("Error parse command line. Key %s must have value", argv[position]);

		if (strncmp(argv[position], "--", 2))
			fatal("Error parse command line. Use prefix \'--\' for key");

		if (config_parse_key_value(argv[position] + 2, argv[position + 1]) != EG_STATUS_OK)
			fatal("Error parse command line");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
cmpl $0x2, -0x4(%rbp)
jl 0x38ae
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xed17(%rip), %rsi      # 0x12572
callq 0x2270
cmpl $0x0, %eax
je 0x387e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xed01(%rip), %rsi      # 0x12575
callq 0x2270
cmpl $0x0, %eax
jne 0x388a
callq 0x37b0
xorl %edi, %edi
callq 0x2490
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq 0x13a17(%rip), %rax     # 0x172b0
movq %rcx, 0x1d8(%rax)
movl $0x2, -0x14(%rbp)
callq 0x32c0
jmp 0x38ae
jmp 0x38b0
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x395c
movl -0x14(%rbp), %eax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x38e3
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xeca0(%rip), %rdi      # 0x1257c
movb $0x0, %al
callq 0x5ab0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xecb7(%rip), %rsi      # 0x125ad
movl $0x2, %edx
callq 0x2080
cmpl $0x0, %eax
je 0x3913
leaq 0xeca4(%rip), %rdi      # 0x125b0
movb $0x0, %al
callq 0x5ab0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x103e0
cmpl $0x0, %eax
je 0x394c
leaq 0xec9d(%rip), %rdi      # 0x125e2
movb $0x0, %al
callq 0x5ab0
jmp 0x394e
movl -0x14(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x14(%rbp)
jmp 0x38b0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/eagle.c
// Function: main
int main(int argc, char *argv[])
{
	setup_signals();
	xmalloc_state_lock_on();

	init_commands();
	init_server_config();

	parse_args(argc, argv);

	show_logo();

	linux_overcommit_memory_warning();

	init_server();
	init_admin();
	init_storage();

	wlog("Server started (version: %s)", EAGLE_VERSION);

	start_main_loop(server->loop);

	delete_time_event(server->loop, server->ufd);
	delete_event_loop(server->loop);

	destroy_server();
	destroy_server_config();

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2880
callq 0x5580
callq 0x2940
callq 0x3340
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x3830
callq 0x3750
callq 0x2830
callq 0x2fa0
callq 0x2ec0
callq 0x2f10
leaq 0xec35(%rip), %rdi      # 0x125fb
leaq 0xe8b7(%rip), %rsi      # 0x12284
movb $0x0, %al
callq 0x5b50
movq 0x138d5(%rip), %rax     # 0x172b0
movq (%rax), %rdi
callq 0x4930
movq 0x138c6(%rip), %rax     # 0x172b0
movq (%rax), %rdi
movq 0x138bc(%rip), %rax     # 0x172b0
movq 0x10(%rax), %rsi
callq 0x4150
movq 0x138ac(%rip), %rax     # 0x172b0
movq (%rax), %rdi
callq 0x3bc0
callq 0x3200
callq 0x3640
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: create_event_loop
EventLoop *create_event_loop(int size)
{
	EventLoop *loop;
	int i;

	loop = (EventLoop*)xmalloc(sizeof(*loop));

	loop->events = (FileEvent*)xmalloc(sizeof(FileEvent) * size);
	loop->fired = (FiredEvent*)xmalloc(sizeof(FiredEvent) * size);

	loop->maxfd = -1;
	loop->size = size;
	loop->time_event_id = 0;
	loop->time_event = NULL;
	loop->stop = 0;
	loop->before_sleep_handler = NULL;

	if (event_api_init(loop) == -1) {
		xfree(loop->events);
		xfree(loop->fired);
		xfree(loop);
		return NULL;
	}

	for (i = 0; i < size; i++) {
		loop->events[i].mask = EG_EVENT_NONE;
	}

	return loop;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl $0x40, %edi
callq 0x5090
movq %rax, -0x18(%rbp)
movslq -0xc(%rbp), %rdi
shlq $0x5, %rdi
callq 0x5090
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movslq -0xc(%rbp), %rdi
shlq $0x3, %rdi
callq 0x5090
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x18(%rbp), %rdi
callq 0x3b30
cmpl $-0x1, %eax
jne 0x3ae7
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5410
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x5410
movq -0x18(%rbp), %rdi
callq 0x5410
movq $0x0, -0x8(%rbp)
jmp 0x3b22
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x3b1a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3aee
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/./event_epoll.c
// Function: event_api_init
static int event_api_init(EventLoop *loop)
{
	ApiData *data = (ApiData*)xmalloc(sizeof(*data));

	data->events = (struct epoll_event*)xmalloc(sizeof(struct epoll_event) * loop->size);

	data->epfd = epoll_create(1024);
	if (data->epfd == -1) {
		xfree(data->events);
		xfree(data);
		return -1;
	}

	loop->api_data = data;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x10, %edi
callq 0x5090
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rax
imulq $0xc, %rax, %rdi
callq 0x5090
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x400, %edi            # imm = 0x400
callq 0x2470
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x3ba0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5410
movq -0x18(%rbp), %rdi
callq 0x5410
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3bb3
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: delete_event_loop
void delete_event_loop(EventLoop *loop)
{
	event_api_free(loop);
	xfree(loop->events);
	xfree(loop->fired);
	xfree(loop);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3c00
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5410
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x5410
movq -0x8(%rbp), %rdi
callq 0x5410
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/./event_epoll.c
// Function: event_api_free
static void event_api_free(EventLoop *loop)
{
	ApiData *data = (ApiData*)loop->api_data;

	close(data->epfd);
	xfree(data->events);
	xfree(data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x2200
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5410
movq -0x10(%rbp), %rdi
callq 0x5410
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: create_file_event
int create_file_event(EventLoop *loop, int fd, int mask, file_handler *handler, void *data)
{
	FileEvent *file_event;

	if (fd >= loop->size) {
		return EG_EVENT_ERR;
	}

	file_event = &loop->events[fd];

	if (event_api_add(loop, fd, mask) == -1) {
		return EG_EVENT_ERR;
	}

	file_event->mask |= mask;

	if (mask & EG_EVENT_READABLE) {
		file_event->read_handler = handler;
	}

	if (mask & EG_EVENT_WRITABLE) {
		file_event->write_handler = handler;
	}

	file_event->data = data;

	if (fd > loop->maxfd) {
		loop->maxfd = fd;
	}

	return EG_EVENT_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x3c92
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3d26
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x3d30
cmpl $-0x1, %eax
jne 0x3cc6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3d26
movl -0x18(%rbp), %ecx
movq -0x30(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3ce8
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3cff
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x3d1f
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/./event_epoll.c
// Function: event_api_add
static int event_api_add(EventLoop *loop, int fd, int mask)
{
	ApiData *data = (ApiData*)loop->api_data;
	struct epoll_event epoll_ev;
	int op = loop->events[fd].mask == EG_EVENT_NONE ? EPOLL_CTL_ADD : EPOLL_CTL_MOD;

	epoll_ev.events = 0;
	mask |= loop->events[fd].mask;

	if (mask & EG_EVENT_READABLE) {
		epoll_ev.events |= EPOLLIN;
	}

	if (mask & EG_EVENT_WRITABLE) {
		epoll_ev.events |= EPOLLOUT;
	}

	epoll_ev.data.u64 = 0;
	epoll_ev.data.fd = fd;

	if (epoll_ctl(data->epfd, op, fd, &epoll_ev) == -1) {
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %edx
movl $0x3, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3dac
movl -0x2c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3dc0
movl -0x2c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x2c(%rbp)
movq $0x0, -0x28(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %edi
movl -0x30(%rbp), %esi
movl -0x14(%rbp), %edx
leaq -0x2c(%rbp), %rcx
callq 0x2220
cmpl $-0x1, %eax
jne 0x3df1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3df8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: delete_file_event
void delete_file_event(EventLoop *loop, int fd, int mask)
{
	FileEvent *file_event;
	int i;

	if (fd >= loop->size) {
		return;
	}

	file_event = &loop->events[fd];

	if (file_event->mask == EG_EVENT_NONE) {
		return;
	}

	file_event->mask = file_event->mask & (~mask);

	if (fd == loop->maxfd && file_event->mask == EG_EVENT_NONE) {
		for (i = loop->maxfd - 1; i >= 0; i--) {
			if (loop->events[i].mask != EG_EVENT_NONE) {
				break;
			}
		}
		loop->maxfd = i;
	}

	event_api_delete(loop, fd, mask);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x3e33
jmp 0x3ece
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x3e55
jmp 0x3ece
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movl -0x10(%rbp), %eax
xorl $-0x1, %eax
andl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x3ebf
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x3ebf
movq -0x8(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x3eb6
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0x3ea9
jmp 0x3eb6
jmp 0x3eab
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3e89
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x3ee0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/./event_epoll.c
// Function: event_api_delete
static void event_api_delete(EventLoop *loop, int fd, int mask)
{
	ApiData *data = (ApiData*)loop->api_data;
	struct epoll_event epoll_ev;
	int nmask = loop->events[fd].mask & (~mask);

	epoll_ev.events = 0;

	if (nmask & EG_EVENT_READABLE) {
		epoll_ev.events |= EPOLLIN;
	}

	if (nmask & EG_EVENT_WRITABLE) {
		epoll_ev.events |= EPOLLOUT;
	}

	epoll_ev.data.u64 = 0;
	epoll_ev.data.fd = fd;

	if (nmask != EG_EVENT_NONE) {
		epoll_ctl(data->epfd, EPOLL_CTL_MOD, fd, &epoll_ev);
	} else {
		epoll_ctl(data->epfd, EPOLL_CTL_DEL, fd, &epoll_ev);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl -0x10(%rbp), %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x28(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3f39
movl -0x24(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3f4d
movl -0x24(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x24(%rbp)
movq $0x0, -0x20(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x3f7a
movq -0x18(%rbp), %rax
movl (%rax), %edi
movl -0xc(%rbp), %edx
movl $0x3, %esi
leaq -0x24(%rbp), %rcx
callq 0x2220
jmp 0x3f91
movq -0x18(%rbp), %rax
movl (%rax), %edi
movl -0xc(%rbp), %edx
movl $0x2, %esi
leaq -0x24(%rbp), %rcx
callq 0x2220
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: get_file_events
int get_file_events(EventLoop *loop, int fd)
{
	FileEvent *file_event;

	if (fd >= loop->size) {
		return 0;
	}

	file_event = &loop->events[fd];

	return file_event->mask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x3fc0
movl $0x0, -0x4(%rbp)
jmp 0x3fe0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: create_time_event
long long create_time_event(EventLoop *loop, long long milliseconds, time_handler *time_handler,
	finalizer_handler *finalizer_handler, void *data)
{
	TimeEvent *time_event = (TimeEvent*)xmalloc(sizeof(*time_event));
	long long id = loop->time_event_id++;

	time_event->id = id;

	add_milliseconds_to_now(milliseconds, &time_event->sec, &time_event->ms);

	time_event->time_handler = time_handler;
	time_event->finalizer_handler = finalizer_handler;
	time_event->data = data;
	time_event->next = loop->time_event;

	loop->time_event = time_event;

	return id;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x38, %edi
callq 0x5090
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x8, %rsi
movq -0x30(%rbp), %rdx
addq $0x10, %rdx
callq 0x40a0
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: delete_time_event
int delete_time_event(EventLoop *loop, long long id)
{
	TimeEvent *time_event = loop->time_event, *prev = NULL;

	while (time_event)
	{
		if (time_event->id == id)
		{
			if (prev == NULL) {
				loop->time_event = time_event->next;
			} else {
				prev->next = time_event->next;
			}

			if (time_event->finalizer_handler) {
				time_event->finalizer_handler(loop, time_event->data);
			}

			xfree(time_event);
			return EG_EVENT_OK;
		}

		prev = time_event;
		time_event = time_event->next;
	}

	return EG_EVENT_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x4201
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x41e8
cmpq $0x0, -0x28(%rbp)
jne 0x41a5
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x41b5
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x41d6
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq 0x28(%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rdi
callq 0x5410
movl $0x0, -0x4(%rbp)
jmp 0x4208
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x4174
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: search_nearest_timer
static TimeEvent *search_nearest_timer(EventLoop *loop)
{
	TimeEvent *time_event = loop->time_event;
	TimeEvent *nearest = NULL;

	while (time_event)
	{
		if (!nearest || time_event->sec < nearest->sec ||
			(time_event->sec == nearest->sec && time_event->ms < nearest->ms)) {
			nearest = time_event;
		}

		time_event = time_event->next;
	}

	return nearest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x4546
cmpq $0x0, -0x18(%rbp)
je 0x4530
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x4530
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x4538
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x4538
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x44ec
movq -0x18(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/./event_epoll.c
// Function: event_api_poll
static int event_api_poll(EventLoop *loop, struct timeval *tvp)
{
	ApiData *data = (ApiData*)loop->api_data;
	struct epoll_event *epoll_ev;
	int retval, i, mask, events = 0;

	retval = epoll_wait(data->epfd, data->events, loop->size,
		tvp ? (tvp->tv_sec * 1000 + tvp->tv_usec / 1000) : -1);

	if (retval > 0)
	{
		events = retval;
		for (i = 0; i < events; i++)
		{
			mask = 0;
			epoll_ev = data->events + i;

			if (epoll_ev->events & EPOLLIN) {
				mask |= EG_EVENT_READABLE;
			}

			if (epoll_ev->events & EPOLLOUT) {
				mask |= EG_EVENT_WRITABLE;
			}

			if (epoll_ev->events & EPOLLERR) {
				mask |= EG_EVENT_WRITABLE;
			}

			if (epoll_ev->events & EPOLLHUP) {
				mask |= EG_EVENT_WRITABLE;
			}

			loop->fired[i].fd = epoll_ev->data.fd;
			loop->fired[i].mask = mask;
		}
	}

	return events;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x461a
movq -0x10(%rbp), %rax
imulq $0x3e8, (%rax), %rax    # imm = 0x3E8
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rcx
movq -0x58(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x4627
movq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x4627
movl -0x34(%rbp), %edx
movq -0x40(%rbp), %rsi
movl -0x44(%rbp), %edi
movq -0x50(%rbp), %rax
movl %eax, %ecx
callq 0x2390
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x4715
movl -0x24(%rbp), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x4713
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4697
movl -0x2c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x46ae
movl -0x2c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x46c5
movl -0x2c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x46dc
movl -0x2c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,8)
movl -0x2c(%rbp), %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x28(%rbp), %rcx
movl %edx, 0x4(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x4656
jmp 0x4715
movl -0x30(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: process_time_events
static int process_time_events(EventLoop *loop)
{
	int processed = 0;
	TimeEvent *time_event = loop->time_event;
	long long max_id = loop->time_event_id - 1;
	long sec, ms;
	long long id;
	int retval;

	while (time_event)
	{
		if (time_event->id > max_id) {
			time_event = time_event->next;
			continue;
		}

		get_time(&sec, &ms);

		if (sec > time_event->sec || (sec == time_event->sec && ms >= time_event->ms))
		{
			id = time_event->id;
			retval = time_event->time_handler(loop, id, time_event->data);
			processed++;

			if (retval != -1) {
				add_milliseconds_to_now(retval, &time_event->sec, &time_event->ms);
			} else {
				delete_time_event(loop, id);
			}

			time_event = loop->time_event;
		} else {
			time_event = time_event->next;
		}
	}

	return processed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x482a
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq -0x20(%rbp), %rax
jle 0x4775
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x474f
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4550
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jg 0x47ac
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x4819
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0x4819
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rdx
callq *%rax
movl %eax, -0x3c(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0x3c(%rbp)
je 0x47fe
movslq -0x3c(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
callq 0x40a0
jmp 0x480b
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x4150
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x4825
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x474f
movl -0xc(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: wait
int wait(int fd, int mask, long long milliseconds)
{
	struct pollfd pfd;
	int retmask = 0, retval;

	memset(&pfd, 0, sizeof(pfd));
	pfd.fd = fd;

	if (mask & EG_EVENT_READABLE)
		pfd.events |= POLLIN;

	if (mask & EG_EVENT_WRITABLE)
		pfd.events |= POLLOUT;

	if ((retval = poll(&pfd, 1, milliseconds)) == 1)
	{
		if (pfd.revents & POLLIN)
			retmask |= EG_EVENT_READABLE;

		if (pfd.revents & POLLOUT)
			retmask |= EG_EVENT_WRITABLE;

		if (pfd.revents & POLLERR)
			retmask |= EG_EVENT_WRITABLE;

		if (pfd.revents & POLLHUP)
			retmask |= EG_EVENT_WRITABLE;

		return retmask;
	} else {
		return retval;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x21f0
movl -0x8(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4885
movswl -0x1c(%rbp), %eax
orl $0x1, %eax
movw %ax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x489b
movswl -0x1c(%rbp), %eax
orl $0x4, %eax
movw %ax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x23a0
movl %eax, -0x28(%rbp)
cmpl $0x1, %eax
jne 0x4913
movswl -0x1a(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x48cc
movl -0x24(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x24(%rbp)
movswl -0x1a(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x48e1
movl -0x24(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x24(%rbp)
movswl -0x1a(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x48f6
movl -0x24(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x24(%rbp)
movswl -0x1a(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x490b
movl -0x24(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4919
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/event.c
// Function: start_main_loop
void start_main_loop(EventLoop *loop)
{
	loop->stop = 0;

	while (!loop->stop)
	{
		if (loop->before_sleep_handler != NULL)
			loop->before_sleep_handler(loop);

		process_events(loop, EG_EVENTS_ALL);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x28(%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x495a
jmp 0x4983
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x4973
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x4220
jmp 0x4947
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_set_nonblock
int net_set_nonblock(char *err, int fd)
{
	int flags;

	if ((flags = fcntl(fd, F_GETFL)) == -1) {
		net_set_error(err, "fcntl: %s", strerror(errno));
		return EG_NET_OK;
	}

	if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
		net_set_error(err, "fcntl: %s", strerror(errno));
        return EG_NET_ERR;
	}

	return EG_NET_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0x20f0
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
jne 0x4a28
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x20(%rbp), %rdi
movq %rax, %rdx
leaq 0xdc06(%rip), %rsi      # 0x1261e
movb $0x0, %al
callq 0x4a90
movl $0x0, -0x4(%rbp)
jmp 0x4a7e
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x20f0
cmpl $-0x1, %eax
jne 0x4a77
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0xdbb7(%rip), %rsi      # 0x1261e
movb $0x0, %al
callq 0x4a90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4a7e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_tcp_nodelay
int net_tcp_nodelay(char *err, int fd)
{
	int yes = 1;

	if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &yes, sizeof(yes)) == -1) {
		net_set_error(err, "setsockopt: %s", strerror(errno));
		return EG_NET_ERR;
	}

	return EG_NET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x14(%rbp), %edi
movl $0x6, %esi
movl $0x1, %edx
leaq -0x18(%rbp), %rcx
movl $0x4, %r8d
callq 0x20e0
cmpl $-0x1, %eax
jne 0x4ba9
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x20(%rbp), %rdi
movq %rax, %rdx
leaq 0xda8f(%rip), %rsi      # 0x12628
movb $0x0, %al
callq 0x4a90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4bb0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_tcp_server
int net_tcp_server(char *err, const char *addr, int port)
{
	int sock;
	struct sockaddr_in sa;

	if ((sock = net_create_socket(err, AF_INET)) == EG_NET_ERR) {
		return EG_NET_ERR;
	}

	memset(&sa, 0, sizeof(sa));

	sa.sin_family = AF_INET;
	sa.sin_port = htons(port);
	sa.sin_addr.s_addr = htonl(INADDR_ANY);

	if (addr && inet_aton(addr, &sa.sin_addr) == 0) {
		net_set_error(err, "Invalid bind address");
		close(sock);
		return EG_NET_ERR;
	}

	if (net_listen(err, sock, (struct sockaddr*)&sa, sizeof(sa)) == EG_NET_ERR) {
		return EG_NET_ERR;
	}

	return sock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x4ca0
movl %eax, -0x20(%rbp)
cmpl $-0x1, %eax
jne 0x4bf5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4c8d
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x21f0
movw $0x2, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movzwl %ax, %edi
callq 0x2170
movw %ax, -0x2e(%rbp)
xorl %edi, %edi
callq 0x21e0
movl %eax, -0x2c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4c64
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
addq $0x4, %rsi
callq 0x2300
cmpl $0x0, %eax
jne 0x4c64
movq -0x10(%rbp), %rdi
leaq 0xd9eb(%rip), %rsi      # 0x12637
movb $0x0, %al
callq 0x4a90
movl -0x20(%rbp), %edi
callq 0x2200
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4c8d
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
leaq -0x30(%rbp), %rdx
movl $0x10, %ecx
callq 0x4d70
cmpl $-0x1, %eax
jne 0x4c87
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4c8d
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_create_socket
static int net_create_socket(char *err, int domain)
{
	int sock, on = 1;

	if ((sock = socket(domain, SOCK_STREAM, 0)) == -1) {
		net_set_error(err, "socket: %s", strerror(errno));
		return EG_NET_ERR;
	}

	if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1) {
		net_set_error(err, "setsockopt: %s", strerror(errno));
		return EG_NET_ERR;
	}

	return sock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x14(%rbp), %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2500
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
jne 0x4cff
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0xd95d(%rip), %rsi      # 0x1264c
movb $0x0, %al
callq 0x4a90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4d58
movl -0x18(%rbp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x1c(%rbp), %rcx
movl $0x4, %r8d
callq 0x20e0
cmpl $-0x1, %eax
jne 0x4d52
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0xd8e6(%rip), %rsi      # 0x12628
movb $0x0, %al
callq 0x4a90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4d58
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_listen
static int net_listen(char *err, int sock, struct sockaddr *sa, socklen_t len)
{
	if (bind(sock, sa, len) == -1) {
		net_set_error(err, "bind: %s", strerror(errno));
		warning("bind socket error:\n%s", err);
		close(sock);
		return EG_NET_ERR;
	}

	if (listen(sock, 511) == -1) { /* 511 is optimal backlog value for most OS */
		net_set_error(err, "listen: %s", strerror(errno));
		close(sock);
		return EG_NET_ERR;
	}

	return EG_NET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl -0x14(%rbp), %edi
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rsi
callq 0x23c0
cmpl $-0x1, %eax
jne 0x4dee
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0xd893(%rip), %rsi      # 0x12657
movb $0x0, %al
callq 0x4a90
movq -0x10(%rbp), %rsi
leaq 0xd88a(%rip), %rdi      # 0x12660
movb $0x0, %al
callq 0x5840
movl -0x14(%rbp), %edi
callq 0x2200
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4e41
movl -0x14(%rbp), %edi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x2350
cmpl $-0x1, %eax
jne 0x4e3a
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0xd854(%rip), %rsi      # 0x12676
movb $0x0, %al
callq 0x4a90
movl -0x14(%rbp), %edi
callq 0x2200
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4e41
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_unix_server
int net_unix_server(char *err, const char *path, mode_t perm)
{
	int sock;
	struct sockaddr_un sa;

	if ((sock = net_create_socket(err, AF_LOCAL)) == EG_NET_ERR) {
		return EG_NET_ERR;
	}

	memset(&sa, 0, sizeof(sa));
	sa.sun_family = AF_LOCAL;

	strncpy(sa.sun_path, path, sizeof(sa.sun_path) - 1);

	if (net_listen(err, sock, (struct sockaddr*)&sa, sizeof(sa)) == EG_NET_ERR) {
		return EG_NET_ERR;
	}

	if (perm) {
		chmod(sa.sun_path, perm);
	}

	return sock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4ca0
movl %eax, -0x20(%rbp)
cmpl $-0x1, %eax
jne 0x4e85
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4eff
leaq -0x8e(%rbp), %rdi
xorl %esi, %esi
movl $0x6e, %edx
callq 0x21f0
movw $0x1, -0x8e(%rbp)
leaq -0x8e(%rbp), %rdi
addq $0x2, %rdi
movq -0x18(%rbp), %rsi
movl $0x6b, %edx
callq 0x2070
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
leaq -0x8e(%rbp), %rdx
movl $0x6e, %ecx
callq 0x4d70
cmpl $-0x1, %eax
jne 0x4ee0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4eff
cmpl $0x0, -0x1c(%rbp)
je 0x4ef9
leaq -0x8e(%rbp), %rdi
addq $0x2, %rdi
movl -0x1c(%rbp), %esi
callq 0x23b0
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_tcp_accept
int net_tcp_accept(char *err, int sock, char *ip, int *port)
{
	int fd;
	struct sockaddr_in sa;
	socklen_t sa_len = sizeof(sa);

	if ((fd = net_generic_accept(err, sock, (struct sockaddr*)&sa, &sa_len)) == EG_NET_ERR) {
		return EG_NET_ERR;
	}

	if (ip) {
		strcpy(ip, inet_ntoa(sa.sin_addr));
	}

	if (port) {
		*port = ntohs(sa.sin_port);
	}

	return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x10, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x3c(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x4fa0
movl %eax, -0x2c(%rbp)
cmpl $-0x1, %eax
jne 0x4f53
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f95
cmpq $0x0, -0x20(%rbp)
je 0x4f76
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x38(%rbp), %edi
callq 0x2120
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x20a0
cmpq $0x0, -0x28(%rbp)
je 0x4f8f
movzwl -0x3a(%rbp), %edi
callq 0x2380
movzwl %ax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_generic_accept
static int net_generic_accept(char *err, int sock, struct sockaddr *sa, socklen_t *len)
{
	int fd;

	while (1)
	{
		fd = accept(sock, sa, len);
		if (fd == -1)
		{
			if (errno == EINTR) {
				continue;
			} else {
				net_set_error(err, "accept: %s", strerror(errno));
				return EG_NET_ERR;
			}
		}
		break;
	}

	return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl -0x14(%rbp), %edi
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rsi
callq 0x2450
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0x5016
callq 0x2050
cmpl $0x4, (%rax)
jne 0x4fe4
jmp 0x4fb7
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x24c0
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0xd67b(%rip), %rsi      # 0x12681
movb $0x0, %al
callq 0x4a90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x501e
jmp 0x5018
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/network.c
// Function: net_unix_accept
int net_unix_accept(char *err, int sock)
{
	int fd;
	struct sockaddr_un sa;
	socklen_t salen = sizeof(sa);

	if ((fd = net_generic_accept(err, sock, (struct sockaddr*)&sa, &salen)) == EG_NET_ERR) {
		return EG_NET_ERR;
	}

	return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x6e, -0x8c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x86(%rbp), %rdx
leaq -0x8c(%rbp), %rcx
callq 0x4fa0
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
jne 0x5077
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x507d
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/yakushstanislav[P]EagleMQ/src/xmalloc.c
// Function: xmalloc
void *xmalloc(size_t size)
{
	void *ptr = malloc(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), %rdi
addq $0x8, %rdi
callq 0x2330
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x50c2
leaq 0xd5d1(%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 0x50ff
movq -0x18(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, 0x129e2(%rip)     # 0x17ae8
je 0x5136
jmp 0x510a
leaq 0x129af(%rip), %rdi     # 0x17ac0
callq 0x24e0
movq -0x18(%rbp), %rax
addq 0x129cf(%rip), %rax     # 0x17af0
movq %rax, 0x129c8(%rip)     # 0x17af0
leaq 0x12991(%rip), %rdi     # 0x17ac0
callq 0x2320
jmp 0x5148
movq -0x18(%rbp), %rax
addq 0x129af(%rip), %rax     # 0x17af0
movq %rax, 0x129a8(%rip)     # 0x17af0
jmp 0x514a
movq -0x10(%rbp), %rax
addq $0x8, %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)