LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/listview.c
// Function: change_cb
static void change_cb(enum model_change change, size_t newindex, size_t oldindex, void *data)
{
	struct listview *view = data;
	unsigned int rowcount = getmaxy(view->window);

	switch(change) {
	case MODEL_ADD:
		if(newindex <= view->index)
			listview_setindex_internal(view, view->index + 1, 1, true);
		else if(newindex < view->first + rowcount)
			view->needs_refresh = true;
		break;
	case MODEL_REMOVE:
		if(oldindex < view->index)
			listview_setindex_internal(view, view->index - 1, -1, true);
		else if(oldindex < view->first + rowcount)
			listview_setindex_internal(view, view->index, 0, true);
		break;
	case MODEL_CHANGE:
		if(newindex == oldindex) {
			if(newindex >= view->first && newindex < view->first + rowcount)
				view->needs_refresh = true;
		} else if(oldindex == view->index) {
			listview_setindex_internal(view, newindex, 0, false);
		} else {
			change_cb(MODEL_ADD, newindex, oldindex, data);
			change_cb(MODEL_REMOVE, newindex, oldindex, data);
		}
		break;
	case MODEL_RELOAD:
		view->first = 0;
		view->index = 0;
		view->needs_refresh = true;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
leaq 0x17fd(%rip), %r12      # 0x94cc
pushq $0x1
popq %rbp
movq (%rbx), %rax
testq %rax, %rax
je 0x7ce2
movswl 0x4(%rax), %eax
incl %eax
jmp 0x7ce7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x3, %edi
ja 0x7d5f
movl %edi, %ecx
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
cmpq %r15, %r14
je 0x7d4a
cmpq %r15, 0x18(%rbx)
je 0x7d68
xorl %edi, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x7cb7
movl %ebp, %edi
jmp 0x7cd2
movq 0x18(%rbx), %rsi
cmpq %r15, %rsi
jbe 0x7d74
decq %rsi
pushq $-0x1
popq %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
jmp 0x7d92
movq 0x18(%rbx), %rsi
cmpq %r14, %rsi
jae 0x7d87
addq 0x10(%rbx), %rax
cmpq %r14, %rax
ja 0x7d5b
jmp 0x7d5f
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
jmp 0x7d5b
movq 0x10(%rbx), %rcx
cmpq %r14, %rcx
ja 0x7d5f
addq %rax, %rcx
cmpq %r14, %rcx
jbe 0x7d5f
movb $0x1, 0x20(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x7d92
addq 0x10(%rbx), %rax
cmpq %r15, %rax
jbe 0x7d5f
pushq $0x1
popq %rcx
movq %rbx, %rdi
xorl %edx, %edx
jmp 0x7d92
incq %rsi
pushq $0x1
popq %rcx
movq %rbx, %rdi
movl %ecx, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7acf
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_add_component
bool path_add_component(struct path *path, const char *component)
{
	while(strlen(path->path) + strlen(component) + 2 > path->allocated_size)
		if(!path_make_room(path, 0))
			return false;

	strcat(path->path, "/");
	strcat(path->path, component);

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%r14), %r15
movq %r15, %rdi
callq 0x3230
movq %rax, %r12
movq %rbx, %rdi
callq 0x3230
addq %rax, %r12
addq $0x2, %r12
movq 0x8(%r14), %r13
cmpq %r13, %r12
jbe 0x7e1f
movq %r14, %rdi
xorl %esi, %esi
callq 0x7e49
testb %al, %al
jne 0x7de9
jmp 0x7e39
movq %r15, %rdi
callq 0x3230
movw $0x2f, (%r15,%rax)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3670
cmpq %r13, %r12
setbe %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_make_room
static bool path_make_room(struct path *path, size_t size)
{
	size_t target_size = size ? size : path->allocated_size * 2;

	if(target_size > path->allocated_size) {
		char *newpath = realloc(path->path, target_size);
		if(newpath == NULL)
			return false;

		path->allocated_size = target_size;
		path->path = newpath;
	}
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x8(%rdi), %rax
leaq (%rax,%rax), %r15
testq %rsi, %rsi
cmovneq %rsi, %r15
movb $0x1, %bl
cmpq %rax, %r15
jbe 0x7e82
movq %rdi, %r14
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x3520
testq %rax, %rax
je 0x7e80
movq %r15, 0x8(%r14)
movq %rax, (%r14)
jmp 0x7e82
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_remove_component
bool path_remove_component(struct path *path, const char **component)
{
	if(path->path[0] == '\0')
		return false;

	char *slash = strrchr(path->path, '/');
	*slash = '\0';

	if(component)
		*component = slash + 1;

	return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rdi
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x7eb1
movq %rsi, %rbx
pushq $0x2f
popq %rsi
callq 0x32b0
movb $0x0, (%rax)
testq %rbx, %rbx
je 0x7eb1
incq %rax
movq %rax, (%rbx)
testb %bpl, %bpl
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_set_to_current_working_directory
bool path_set_to_current_working_directory(struct path *path)
{
	while(getcwd(path->path, path->allocated_size) == NULL)
	{
		if(errno == ERANGE) {
			if(!path_make_room(path, 0))
				return false;
		} else
			return false;
	}
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x3310
movq %rax, %r14
testq %rax, %rax
jne 0x7ef1
callq 0x30d0
cmpl $0x22, (%rax)
jne 0x7ef1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7e49
testb %al, %al
jne 0x7ec5
testq %r14, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_set_from_string
int path_set_from_string(struct path *path, const char *cstr)
{
	if(strcmp(cstr, "~") == 0) {
		const char *home = getenv("HOME");
		if(home == NULL || strcmp(home, "~") == 0)
			return EINVAL;
		return path_set_from_string(path, home);
	}

	if(!(path_cstr_is_valid(cstr)))
		return EINVAL;

	if(!path_make_room(path, strlen(cstr) + 1))
		return ENOMEM;
	strcpy(path->path, cstr);

	/* reduce multiple consecutive slashes to a single one */
	size_t s = 0, d = 0;
	do {
		s++;
		if(path->path[s] == '/' && path->path[d] == '/')
			continue;
		d++;
		path->path[d] = path->path[s];
	} while(path->path[s] != '\0');

	/* remove trailing slash, this also ensures that the string will be
	 * empty for the root directory */
	if(path->path[d - 1] == '/')
		path->path[d - 1] = '\0';

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %al
pushq $0x16
popq %rbp
leaq 0x15d1(%rip), %r15      # 0x94e9
cmpb $0x7e, %al
jne 0x7f4c
cmpb $0x0, 0x1(%r14)
jne 0x7fbf
movq %r15, %rdi
callq 0x3070
testq %rax, %rax
je 0x7fbf
movq %rax, %r14
movb (%rax), %al
cmpb $0x7e, %al
jne 0x7f18
movb $0x7e, %al
cmpb $0x0, 0x1(%r14)
jne 0x7f18
jmp 0x7fbf
movzbl %al, %eax
cmpl $0x2f, %eax
jne 0x7fbf
movq %r14, %rdi
callq 0x3230
leaq 0x1(%rax), %rsi
movq %rbx, %rdi
callq 0x7e49
testb %al, %al
je 0x7fbc
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x3110
movq (%rbx), %rax
xorl %edx, %edx
xorl %ecx, %ecx
incq %rdx
movq %rdx, %rdi
movq %rdi, %rdx
movb (%rax,%rdi), %sil
cmpb $0x2f, %sil
jne 0x7f9b
leaq 0x1(%rdx), %rdi
cmpb $0x2f, (%rax,%rcx)
je 0x7f84
movb %sil, 0x1(%rax,%rcx)
incq %rcx
movq (%rbx), %rax
cmpb $0x0, (%rax,%rdx)
jne 0x7f7e
xorl %ebp, %ebp
cmpb $0x2f, -0x1(%rax,%rcx)
jne 0x7fbf
movb $0x0, -0x1(%rax,%rcx)
jmp 0x7fbf
pushq $0xc
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_new_from_string
int path_new_from_string(struct path **path, const char *cstr)
{
	/* this check is done again in path_set_from_string,
	 * but the the allocations can be saved, if cstr is invalid */
	if(!(path_cstr_is_valid(cstr)))
		return EINVAL;

	*path = path_new();
	if(*path == NULL)
		return ENOMEM;

	int ret = path_set_from_string(*path, cstr);
	if(ret != 0) {
		path_delete(*path);
		*path = NULL;
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x2f, (%rsi)
jne 0x8007
movq %rsi, %r14
movq %rdi, %rbx
callq 0x8019
movq %rax, (%rbx)
testq %rax, %rax
je 0x800b
movq %rax, %rdi
movq %r14, %rsi
callq 0x7eff
testl %eax, %eax
je 0x8015
movl %eax, %ebp
movq (%rbx), %rdi
callq 0x8047
andq $0x0, (%rbx)
jmp 0x800e
pushq $0x16
jmp 0x800d
pushq $0xc
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x800e
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_new
struct path *path_new(void)
{
	struct path *path = malloc(sizeof(*path));
	if(path == NULL)
		return NULL;

	if(!path_init(path, 0)) {
		free(path);
		return NULL;
	}
	return path;
}

// Assembly:
pushq %rbx
pushq $0x10
popq %rdi
callq 0x3490
testq %rax, %rax
je 0x8040
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x805f
testb %al, %al
jne 0x8042
movq %rbx, %rdi
callq 0x3740
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/path.c
// Function: path_init
bool path_init(struct path *path, size_t size)
{
	path->allocated_size = size;
	if(path->allocated_size < 1)
		path->allocated_size = 1;

	path->path = malloc(path->allocated_size);
	if(path->path == NULL)
		return false;

	path->path[0] = '\0';

	return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x1, %rsi
adcq $0x0, %rsi
movq %rsi, 0x8(%rdi)
movq %rsi, %rdi
callq 0x3490
movq %rax, (%rbx)
testq %rax, %rax
je 0x8082
movb $0x0, (%rax)
testq %rax, %rax
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/processmanager.c
// Function: processmanager_spawn
int processmanager_spawn(struct processmanager *pm, const char *program, char * const argv[], const char *tmpdir, pre_exec_callback cb, pid_t *pid)
{
	struct process *process = NULL;

	if(tmpdir) {
		if(!pm->processlist) {
			pm->processlist = list_new(0);
			if(!pm->processlist)
				return ENOMEM;
		}

		process = malloc(sizeof(*process));
		if(!process)
			return ENOMEM;

		process->tmpdir = strdup(tmpdir);
		if(!process->tmpdir) {
			free(process);
			return ENOMEM;
		}

		if(!list_append(pm->processlist, process)) {
			process_delete(process);
			return ENOMEM;
		}
	}

	*pid = fork();

	if(*pid < 0)
		return errno;
	if(*pid > 0) {
		if(process)
			process->pid = *pid;
		return 0;
	}

	if(cb)
		cb();

	execvp(program, argv);
	exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r12
movq %r8, %rbp
movq %rdx, %r14
movq %rsi, %r15
testq %rcx, %rcx
je 0x8139
movq %rcx, %rbx
movq %rdi, %r13
movq %rbp, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, %r15
movq (%rdi), %r14
pushq $0xc
popq %rbp
testq %r14, %r14
jne 0x80fa
xorl %edi, %edi
callq 0x7480
movq %rax, %r14
movq %rax, (%r13)
testq %rax, %rax
je 0x8173
pushq $0x10
popq %rdi
callq 0x3490
testq %rax, %rax
je 0x8173
movq %rax, %r13
movq %rbx, %rdi
callq 0x36a0
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x8161
movq %r14, %rdi
movq %r13, %rsi
callq 0x7519
testb %al, %al
je 0x816b
movq %r15, %r14
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rbp
jmp 0x813c
xorl %r13d, %r13d
callq 0x3700
movl %eax, (%r12)
testl %eax, %eax
js 0x8158
je 0x8184
xorl %ebp, %ebp
testq %r13, %r13
je 0x8173
movl %eax, (%r13)
jmp 0x8173
callq 0x30d0
movl (%rax), %ebp
jmp 0x8173
movq %r13, %rdi
callq 0x3740
jmp 0x8173
movq %r13, %rdi
callq 0x8094
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %rbp, %rbp
je 0x818b
callq *%rbp
movq %r15, %rdi
movq %r14, %rsi
callq 0x3640
pushq $0x1
popq %rdi
callq 0x3690
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/processmanager.c
// Function: processmanager_waitpid
pid_t processmanager_waitpid(struct processmanager *pm, pid_t pid, int *wstatus)
{
	pid = waitpid(pid, wstatus, 0);
	if(pid <= 0)
		return pid;

	if(!pm->processlist)
		return pid;

	size_t length = list_length(pm->processlist);

	for(size_t i = 0; i < length; i++) {
		struct process *process = list_get_item(pm->processlist, i);

		if(process->pid == pid) {
			remove_directory_recursively(process->tmpdir);
			process_delete(process);
			list_remove(pm->processlist, i);
			break;
		}
	}

	return pid;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movl %esi, %edi
movq %rdx, %rsi
xorl %edx, %edx
callq 0x35e0
movl %eax, %ebx
testl %eax, %eax
jle 0x8207
movq (%r14), %rdi
testq %rdi, %rdi
je 0x8207
callq 0x7515
movq %rax, %r12
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x8207
movq (%r14), %rdi
movq %r15, %rsi
callq 0x76e4
cmpl %ebx, (%rax)
je 0x81e8
incq %r15
jmp 0x81cf
movq %rax, %r13
movq 0x8(%rax), %rdi
callq 0x8430
movq %r13, %rdi
callq 0x8094
movq (%r14), %rdi
movq %r15, %rsi
callq 0x7694
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/xdg.c
// Function: xdg_get_config_home
int xdg_get_config_home(struct path **path)
{
	int ret = 0;
	*path = NULL;

	const char *config_home = getenv("XDG_CONFIG_HOME");
	if(config_home)
		ret = path_new_from_string(path, config_home);

	if(ret == ENOMEM)
		return ENOMEM;

	if(*path == NULL) {
		const char *home = getenv("HOME");
		if(home) {
			ret = path_new_from_string(path, home);

			if(ret == ENOMEM)
				return ENOMEM;

			if(*path == NULL)
				return ENOENT;

			if(!path_add_component(*path, ".config")) {
				path_delete(*path);
				*path = NULL;
				return ENOMEM;
			}
		} else
			return ENOENT;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
andq $0x0, (%rdi)
leaq 0x129c(%rip), %rdi      # 0x94de
callq 0x3070
pushq $0xc
popq %r14
testq %rax, %rax
je 0x826a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7fcc
cmpl $0xc, %eax
je 0x82b2
cmpq $0x0, (%rbx)
je 0x826a
xorl %ebp, %ebp
jmp 0x82b5
leaq 0x1278(%rip), %rdi      # 0x94e9
callq 0x3070
pushq $0x2
popq %rbp
testq %rax, %rax
je 0x82b5
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7fcc
cmpl $0xc, %eax
je 0x82b2
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x82b5
leaq 0x1251(%rip), %rsi      # 0x94ee
callq 0x7dda
testb %al, %al
jne 0x8266
movq (%rbx), %rdi
callq 0x8047
andq $0x0, (%rbx)
movl %r14d, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/xdg.c
// Function: xdg_get_config_dirs
struct list *xdg_get_config_dirs(bool include_config_home)
{
	struct path *path;
	int ret;

	struct list *list = list_new(0);
	if(list == NULL)
		return NULL;

	const char *config_dirs = getenv("XDG_CONFIG_DIRS");
	if(config_dirs) {
		char *curpath, *saveptr;
		char config_dirs_copy[strlen(config_dirs) + 1];

		strcpy(config_dirs_copy, config_dirs);

		if((curpath = strtok_r(config_dirs_copy, ":", &saveptr))) {
			do {
				ret = path_new_from_string(&path, curpath);
				if(ret == EINVAL)
					continue;
				if(path != NULL) {
					if(!list_append(list, path))
						goto err_delete_list_and_path;
				} else
					goto err_delete_list;
			} while((curpath = strtok_r(NULL, ":", &saveptr)));

		}
	}

	if(list_length(list) == 0) {
		ret = path_new_from_string(&path, "/etc/xdg");
		if(path != NULL) {
			if(!list_append(list, path))
				goto err_delete_list_and_path;
		} else
			goto err_delete_list;
	}

	if(include_config_home) {
		ret = xdg_get_config_home(&path);
		if(path != NULL) {
			if(!list_insert(list, 0, path))
				goto err_delete_list_and_path;
		} else if(ret == ENOMEM)
			goto err_delete_list;
	}

	return list;

err_delete_list_and_path:
	path_delete(path);
err_delete_list:
	list_delete(list, (list_item_deallocator)path_delete);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %r14d
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x7480
testq %rax, %rax
je 0x841e
movq %rax, %rbx
leaq 0x1209(%rip), %rdi      # 0x94f6
callq 0x3070
testq %rax, %rax
je 0x8390
movq %rax, %r15
movq %rax, %rdi
callq 0x3230
movq %rsp, -0x38(%rbp)
movq %rsp, %r12
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq %r12, %rdi
movq %r15, %rsi
callq 0x3110
leaq 0x11d9(%rip), %rsi      # 0x9506
leaq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0x33b0
testq %rax, %rax
je 0x838c
leaq -0x30(%rbp), %r15
leaq 0x11bd(%rip), %r12      # 0x9506
leaq -0x40(%rbp), %r13
movq %r15, %rdi
movq %rax, %rsi
callq 0x7fcc
cmpl $0x16, %eax
je 0x837a
movq -0x30(%rbp), %rsi
testq %rsi, %rsi
je 0x83f9
movq %rbx, %rdi
callq 0x7519
testb %al, %al
je 0x83ff
xorl %edi, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x33b0
testq %rax, %rax
jne 0x834d
movq -0x38(%rbp), %rsp
movq %rbx, %rdi
callq 0x7515
testq %rax, %rax
je 0x83c6
testb %r14b, %r14b
je 0x83f4
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x8230
movq (%r14), %rdx
testq %rdx, %rdx
je 0x83ef
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7581
testb %al, %al
jne 0x83f4
jmp 0x8403
leaq 0x113b(%rip), %rsi      # 0x9508
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x7fcc
movq (%r15), %rsi
testq %rsi, %rsi
je 0x840c
movq %rbx, %rdi
callq 0x7519
testb %al, %al
jne 0x839d
jmp 0x8403
cmpl $0xc, %eax
je 0x840c
movq %rbx, %r15
jmp 0x841e
movq -0x38(%rbp), %rsp
jmp 0x840c
movq -0x38(%rbp), %rsp
movq -0x30(%rbp), %rdi
callq 0x8047
leaq -0x3cc(%rip), %rsi      # 0x8047
movq %rbx, %rdi
callq 0x74d1
xorl %r15d, %r15d
movq %r15, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/util.c
// Function: determine_usable_config_file
struct path *determine_usable_config_file(const char *project, const char *subdir, const char *config, int flags)
{
	struct path *path = NULL;
	struct list *list = xdg_get_config_dirs(true);

	if(list == NULL)
		return NULL;

	size_t length = list_length(list);;

	for(size_t i = 0; i < length; i++) {
		struct path *curpath = list_get_item(list, i);
		if(!path_add_component(curpath, project))
			goto err;
		if(subdir) {
			if(!path_add_component(curpath, subdir))
				goto err;
		}
		if(!path_add_component(curpath, config))
			goto err;
		if(path == NULL && access(path_tocstr(curpath), flags) == 0) {
			path = curpath;
			list_set_item(list, i, NULL);
		}
	}
err:
	list_delete(list, (list_item_deallocator)path_delete);
	return path;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0x4(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, 0x10(%rsp)
pushq $0x1
popq %rdi
callq 0x82bc
testq %rax, %rax
je 0x8520
movq %rax, %r13
movq %rax, %rdi
callq 0x7515
movq %rax, %rbp
xorl %r12d, %r12d
xorl %ebx, %ebx
cmpq %rbx, %rbp
je 0x850f
movq %r13, %rdi
movq %rbx, %rsi
callq 0x76e4
movq %rax, %r14
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x7dda
testb %al, %al
je 0x850f
testq %r15, %r15
je 0x84c7
movq %r14, %rdi
movq %r15, %rsi
callq 0x7dda
testb %al, %al
je 0x850f
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x7dda
testb %al, %al
je 0x850f
testq %r12, %r12
jne 0x850a
movq %r14, %rdi
callq 0x7dc8
movq %rax, %rdi
movl 0x4(%rsp), %esi
callq 0x3610
testl %eax, %eax
je 0x84fa
xorl %r12d, %r12d
jmp 0x850a
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x7710
movq %r14, %r12
incq %rbx
jmp 0x848f
leaq -0x4cf(%rip), %rsi      # 0x8047
movq %r13, %rdi
callq 0x74d1
jmp 0x8523
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/util.c
// Function: dump_string_to_file
bool dump_string_to_file(int dir_fd, const char *filename, const char *value)
{
	int fd = openat(dir_fd, filename, O_CREAT|O_WRONLY, 0700);
	if(fd < 0)
		return false;

	int ret = write(fd, value, strlen(value));

	close(fd);

	return ret < 0 ? false : true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
xorl %r14d, %r14d
pushq $0x41
popq %rdx
movl $0x1c0, %ecx            # imm = 0x1C0
xorl %eax, %eax
callq 0x3240
testl %eax, %eax
js 0x8579
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3230
movl %ebp, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x31c0
movq %rax, %rbx
movl %ebp, %edi
callq 0x3320
testl %ebx, %ebx
setns %r14b
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/util.c
// Function: dump_filelist_to_file
bool dump_filelist_to_file(int dir_fd, const char *filename, const struct list *list)
{
	int ret = 0;

	int fd = openat(dir_fd, filename, O_CREAT|O_WRONLY, 0700);
	if(fd < 0)
		return false;

	size_t length = list_length(list);;

	for(size_t i = 0; i < length; i++) {
		const char *file = list_get_item(list, i);
		if((ret = write(fd, file, strlen(file))) < 0)
			break;
		if((ret = write(fd, "\0", 1)) < 0)
			break;
	}
	close(fd);

	return ret < 0 ? false : true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
xorl %r14d, %r14d
pushq $0x41
popq %rdx
movl $0x1c0, %ecx            # imm = 0x1C0
xorl %eax, %eax
callq 0x3240
testl %eax, %eax
js 0x860e
movl %eax, %ebp
movq %rbx, %rdi
callq 0x7515
movq %rax, %r14
xorl %ecx, %ecx
pushq $0x1
popq %r12
movq %rcx, %r13
cmpq %rcx, %r14
je 0x8600
movq %rbx, %rdi
movq %r13, %rsi
callq 0x76e4
movq %rax, %r15
movq %rax, %rdi
callq 0x3230
movl %ebp, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x31c0
testl %eax, %eax
js 0x8600
movl %ebp, %edi
leaq 0xf21(%rip), %rsi       # 0x9511
movq %r12, %rdx
callq 0x31c0
leaq 0x1(%r13), %rcx
testl %eax, %eax
jns 0x85b8
cmpq %r14, %r13
setae %r14b
movl %ebp, %edi
callq 0x3320
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/util.c
// Function: run_in_foreground
bool run_in_foreground()
{
	const char *display = getenv("DISPLAY");

	if(display == NULL || strlen(display) == 0)
		return true;

	const char *foreground = getenv("DFM_FOREGROUND");

	if(foreground != NULL && strcmp(foreground, "yes") == 0)
		return true;

	return false;
}

// Assembly:
pushq %rbx
leaq 0xeeb(%rip), %rdi       # 0x9513
callq 0x3070
movb $0x1, %bl
testq %rax, %rax
je 0x865f
cmpb $0x0, (%rax)
je 0x865f
leaq 0xedb(%rip), %rdi       # 0x951b
callq 0x3070
testq %rax, %rax
je 0x865d
leaq 0xed9(%rip), %rsi       # 0x952a
movq %rax, %rdi
callq 0x33d0
testl %eax, %eax
je 0x865f
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/main.c
// Function: init_ncurses
void init_ncurses()
{
	initscr();
	noecho();
	raw();

	start_color();
	init_pair(1, COLOR_WHITE, COLOR_BLUE);
	init_pair(2, COLOR_YELLOW, COLOR_BLACK);
	init_pair(3, COLOR_YELLOW, COLOR_BLUE);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
callq 0x3530
callq 0x3080
callq 0x3420
callq 0x3040
pushq $0x1
popq %rdi
pushq $0x7
popq %rsi
pushq $0x4
popq %rbx
movl %ebx, %edx
callq 0x34c0
pushq $0x2
popq %rdi
pushq $0x3
popq %rbp
movl %ebp, %esi
xorl %edx, %edx
callq 0x34c0
movl %ebp, %edi
movl %ebp, %esi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x34c0
// File: /workspace/github_c_makefile_star2_O2/cglindkamp[P]dfm/src/main.c
// Function: main
int main(void)
{
	struct application app;
	int ret = 0;

	setlocale(LC_ALL, "");
	tzset();
	init_ncurses();

	if(application_init(&app)) {
		application_run(&app);
	} else {
		endwin();
		puts("Failed to initialize the application, exiting");
	}
	application_destroy(&app);

	endwin();
	_nc_freeall();

	return ret;
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
leaq 0xb57(%rip), %rsi       # 0x9210
pushq $0x6
popq %rdi
callq 0x3570
callq 0x3460
callq 0x8664
movq %rsp, %rdi
callq 0x4751
testb %al, %al
je 0x86e1
movq %rsp, %rdi
callq 0x4174
jmp 0x86f2
callq 0x36c0
leaq 0xe41(%rip), %rdi       # 0x952e
callq 0x3160
movq %rsp, %rdi
callq 0x4c2f
callq 0x36c0
xorl %eax, %eax
callq 0x32f0
xorl %eax, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]dhara/ecc/crc32.c
// Function: crc32_nand
uint32_t crc32_nand(const uint8_t *block, size_t len,
		    uint32_t c)
{
	size_t i;

	for (i = 0; i < len; i++)
		c = (c >> 8) ^ reduce[(c ^ block[i]) & 0xff] ^ 0xff000000;

	return c;
}

// Assembly:
movl %edx, %eax
xorl %ecx, %ecx
leaq 0xe79(%rip), %rdx       # 0x2010
cmpq %rcx, %rsi
je 0x11bc
movl %eax, %r8d
shrl $0x8, %r8d
xorb (%rdi,%rcx), %al
movzbl %al, %eax
orl $0xff000000, %r8d       # imm = 0xFF000000
xorl (%rdx,%rax,4), %r8d
incq %rcx
movl %r8d, %eax
jmp 0x1197
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]dhara/tests/crc32.c
// Function: main
int main(void)
{
	uint8_t block[BLOCK_SIZE];
	int i;

	memset(block, 0xff, sizeof(block));
	assert(crc32_nand(block, BLOCK_SIZE, CRC32_INIT) == 0xffffffff);

	srandom(0);
	for (i = 0; i < 10; i++)
		test_random_block();

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x618, %rsp            # imm = 0x618
leaq 0x410(%rsp), %rbx
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
movl $0xff, %esi
callq 0x1050
pushq $-0x1
popq %rdx
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
callq 0x118c
cmpl $-0x1, %eax
jne 0x131a
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x1030
leaq 0x10(%rsp), %rbx
leaq 0x210(%rsp), %r14
movl $0x1000, %r13d          # imm = 0x1000
pushq $0x1
popq %rbp
cmpl $0xa, %r15d
je 0x12e9
movq %r15, 0x8(%rsp)
xorl %r15d, %r15d
cmpq $0x200, %r15            # imm = 0x200
je 0x124e
callq 0x1070
movb %al, 0x10(%rsp,%r15)
incq %r15
jmp 0x1236
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
pushq $-0x1
popq %rdx
callq 0x118c
movl %eax, 0x4(%rsp)
xorl %r15d, %r15d
cmpl $0x14, %r15d
je 0x12dc
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1060
pushq $0x4
popq %r12
subl $0x1, %r12d
jb 0x12a9
callq 0x1070
cqto
idivq %r13
movq %rdx, %rcx
movl %ecx, %eax
sarl $0x3, %eax
andb $0x7, %cl
movl %ebp, %edx
shll %cl, %edx
cltq
xorb %dl, 0x210(%rsp,%rax)
jmp 0x127f
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdi
pushq $-0x1
popq %rdx
callq 0x118c
movl %eax, %r12d
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1080
testl %eax, %eax
je 0x12d7
cmpl 0x4(%rsp), %r12d
je 0x12fd
incl %r15d
jmp 0x1265
movq 0x8(%rsp), %r15
incl %r15d
jmp 0x1224
xorl %eax, %eax
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1161(%rip), %rdi      # 0x2465
leaq 0x113d(%rip), %rsi      # 0x2448
leaq 0x118b(%rip), %rcx      # 0x249d
pushq $0x2d
popq %rdx
callq 0x1040
leaq 0x10ef(%rip), %rdi      # 0x2410
leaq 0x1120(%rip), %rsi      # 0x2448
leaq 0x1127(%rip), %rcx      # 0x2456
pushq $0x45
jmp 0x1314
// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wctool.c
// Function: utf8_to_ucs4
unsigned 
utf8_to_ucs4(unsigned char *buf, size_t sizeof_buf)
{
    if (sizeof_buf >= 1 && buf[0] < 0x80) {
        return buf[0];
    } else if (sizeof_buf >= 2 && (buf[0]&0xE0) == 0xC0) {
        return  (buf[0]&0x1F)<<6 
                | (buf[1] & 0x3F) << 0;
    } else if (sizeof_buf >= 3 && (buf[0]&0xF0) == 0xE0) {
        return (buf[0]&0x0F)<<12 
                | (buf[1] & 0x3F) << 6
                | (buf[2] & 0x3F) << 0;
    } else if (sizeof_buf >= 4 && (buf[0]&0xF1) == 0xF0) {
        return (buf[0]&0x07)<<18 
                | (buf[1] & 0x3F) << 12
                | (buf[2] & 0x3F) << 6
                | (buf[3] & 0x3F) << 0;
    } else
        return 0xFFFFFFFF;
}

// Assembly:
pushq $-0x1
popq %rax
testq %rsi, %rsi
je 0x1250
movsbl (%rdi), %edx
testl %edx, %edx
js 0x11c2
movl %edx, %eax
retq
cmpq $0x1, %rsi
je 0x1250
movzbl %dl, %ecx
andl $0xe0, %edx
cmpl $0xc0, %edx
jne 0x11ee
andl $0x1f, %ecx
shll $0x6, %ecx
movzbl 0x1(%rdi), %eax
andl $0x3f, %eax
orl %ecx, %eax
jmp 0x1250
cmpq $0x3, %rsi
jb 0x1250
movl %ecx, %edx
andl $-0x10, %edx
cmpl $0xe0, %edx
jne 0x1219
shll $0xc, %ecx
movzwl %cx, %eax
movzbl 0x1(%rdi), %ecx
andl $0x3f, %ecx
shll $0x6, %ecx
orl %eax, %ecx
movzbl 0x2(%rdi), %eax
jmp 0x11e7
cmpq $0x3, %rsi
je 0x1250
movl %ecx, %edx
andl $-0xf, %edx
cmpl $0xf0, %edx
jne 0x1250
andl $0x6, %ecx
shll $0x12, %ecx
movzbl 0x1(%rdi), %eax
andl $0x3f, %eax
shll $0xc, %eax
orl %ecx, %eax
movzbl 0x2(%rdi), %ecx
andl $0x3f, %ecx
shll $0x6, %ecx
orl %eax, %ecx
movzbl 0x3(%rdi), %eax
jmp 0x11e7
retq
// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wctool.c
// Function: ucs4_to_utf8
size_t ucs4_to_utf8(unsigned char *buf, size_t sizeof_buf, unsigned wchar)
{
	#if 0
    if (0xD800 <= wchar && wchar <= 0xDFFF) {
        /* surrogates must not be encoded */
        return 0;
    }
	#endif

    if (0x10000 <= wchar && wchar <= 0x10FFFF && sizeof_buf >= 4) {
        buf[0] = 0xF0 | ((wchar >> 18) & 0x07);
        buf[1] = 0x80 | ((wchar >> 12) & 0x3F);
        buf[2] = 0x80 | ((wchar >>  6) & 0x3F);
        buf[3] = 0x80 | ((wchar >>  0) & 0x3F);
        return 4;
    } else if (0x0800 <= wchar && wchar <= 0xFFFF && sizeof_buf >= 3) {
        buf[0] = 0xE0 | ((wchar >> 12) & 0x0F);
        buf[1] = 0x80 | ((wchar >>  6) & 0x3F);
        buf[2] = 0x80 | ((wchar >>  0) & 0x3F);
        return 3;
    } else if (0x0080 <= wchar && wchar <= 0x7FF && sizeof_buf >= 2) {
        buf[0] = 0xC0 | ((wchar >>  6) & 0x1F);
        buf[1] = 0x80 | ((wchar >>  0) & 0x3F);
        return 2;
    } else if (wchar <= 0x7F && sizeof_buf >= 1) {
        buf[0] = wchar;
        return 1;
    } else
        return 0;
}

// Assembly:
leal -0x10000(%rdx), %eax
cmpl $0x100000, %eax         # imm = 0x100000
setae %al
cmpq $0x4, %rsi
setb %cl
orb %al, %cl
jne 0x1298
movl %edx, %eax
shrl $0x12, %eax
orb $-0x10, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %edx, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x2(%rdi)
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, 0x3(%rdi)
pushq $0x4
jmp 0x1313
leal -0x800(%rdx), %eax
cmpl $0xf800, %eax           # imm = 0xF800
setae %al
cmpq $0x3, %rsi
setb %cl
orb %al, %cl
jne 0x12d3
movl %edx, %eax
shrl $0xc, %eax
orb $-0x20, %al
movb %al, (%rdi)
movl %edx, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rdi)
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, 0x2(%rdi)
pushq $0x3
jmp 0x1313
leal -0x80(%rdx), %eax
cmpl $0x780, %eax            # imm = 0x780
setae %al
cmpq $0x2, %rsi
setb %cl
orb %al, %cl
jne 0x12ff
movl %edx, %eax
shrl $0x6, %eax
orb $-0x40, %al
movb %al, (%rdi)
andb $0x3f, %dl
orb $-0x80, %dl
movb %dl, 0x1(%rdi)
pushq $0x2
jmp 0x1313
cmpl $0x7f, %edx
seta %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x1315
movb %dl, (%rdi)
pushq $0x1
popq %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wctool.c
// Function: gen_utf8
void gen_utf8(void)
{
    size_t i;
    unsigned seed = 0;
    static const char *list[] = { 
        "\xe7\x9a\x84",     /* U+7684 的 */
        "\xe4\xb8\x80",     /* U+4e00 一 */
        "\xe6\x98\xaf",     /* U+662f 是 */
        "\xe6\x96\x87",     /* U+6587 文 */
        "\xe3\x81\xaa",     /* U+306a な */
        "\xf0\x9f\x98\x82", /* U+1f602 😂 */
        "\xe2\x9d\xa4\xef\xb8\x8f", /* U+2764 ❤️ */
        "\xf0\x9f\x92\xa9", /* U+1f4a9 💩 */
        "\xe2\x80\x83",     /* U+2003   */
        "\xe1\xa0\x8e",     /* U+180e ᠎ */
        "\xe3\x80\x80",     /* U+3000 　 */
        "\n",               /* U+000a */
        " ",                /* U+0020   */
        "\xef\xbb\xbf",     /* U+feff ﻿ */
        "\xe1\x9a\x80",     /* U+1680   */
        "\t",               /* U+0009   */
        0};

        
    fprintf(stderr, "[+] generating utf8 rabndom file\n");
    for (i=0; i<FILESIZE; ) {
        const char *out = list[r_rand(&seed)%16];
        printf("%s", out);
        i += strlen(out);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x2cd1(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xd10(%rip), %rdi       # 0x2041
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x1090
leaq 0x2a1d(%rip), %r15      # 0x3d60
leaq 0xd19(%rip), %rbx       # 0x2063
xorl %ebp, %ebp
xorl %r12d, %r12d
cmpq $0x5805558, %r12        # imm = 0x5805558
ja 0x138a
imull $0x343fd, %ebp, %ebp    # imm = 0x343FD
addl $0x269ec3, %ebp         # imm = 0x269EC3
movl %ebp, %eax
shrl $0xd, %eax
andl $0x78, %eax
movq (%rax,%r15), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
callq 0x1040
addq %rax, %r12
jmp 0x134f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wctool.c
// Function: gen_allword
void gen_allword(void)
{
    size_t i;
    char buf[1024];
    memset(buf, 'x', sizeof(buf));
    
    fprintf(stderr, "[+] generating all-word file\n");
    for (i=0; i<FILESIZE-1024; i += sizeof(buf)) {
        fwrite(buf, 1, sizeof(buf), stdout);
    }
    for (; i<FILESIZE; i++) {
        putchar('x');
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsp, %rbx
pushq $0x78
popq %rsi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
callq 0x1060
movq 0x2c3d(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xca1(%rip), %rdi       # 0x2066
pushq $0x1d
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x1090
xorl %r15d, %r15d
movq 0x2bfa(%rip), %r12      # 0x3fd8
cmpq $0x5805159, %r15        # imm = 0x5805159
jae 0x1404
movq (%r12), %rcx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1090
addq $0x400, %r15            # imm = 0x400
jmp 0x13de
movl $0x159, %r14d           # imm = 0x159
pushq $0x78
popq %rbx
subq $0x1, %r14
jb 0x141c
movl %ebx, %edi
callq 0x1030
jmp 0x140d
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wctool.c
// Function: gen_allspace
void gen_allspace(void)
{
    size_t i;
    char buf[1024];
    memset(buf, ' ', sizeof(buf));
    
    fprintf(stderr, "[+] generating all-space file\n");
    for (i=0; i<FILESIZE-1024; i += sizeof(buf)) {
        fwrite(buf, 1, sizeof(buf), stdout);
    }
    for (; i<FILESIZE; i++) {
        putchar(' ');
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsp, %rbx
pushq $0x20
popq %rsi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
callq 0x1060
movq 0x2ba5(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xc27(%rip), %rdi       # 0x2084
pushq $0x1e
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x1090
xorl %r15d, %r15d
movq 0x2b62(%rip), %r12      # 0x3fd8
cmpq $0x5805159, %r15        # imm = 0x5805159
jae 0x149c
movq (%r12), %rcx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1090
addq $0x400, %r15            # imm = 0x400
jmp 0x1476
movl $0x159, %r14d           # imm = 0x159
pushq $0x20
popq %rbx
subq $0x1, %r14
jb 0x14b4
movl %ebx, %edi
callq 0x1030
jmp 0x14a5
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wctool.c
// Function: gen_ascii
void gen_ascii(void)
{
    size_t i;
    unsigned seed = 0;

    fprintf(stderr, "[+] generating ascii random file\n");
    for (i=0; i<FILESIZE; i++) {
        putchar(" x\ty\rz\na"[r_rand(&seed)%8]);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x2b29(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xbca(%rip), %rdi       # 0x20a3
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x1090
xorl %ebx, %ebx
movl $0x5805559, %r14d       # imm = 0x5805559
leaq 0xbd2(%rip), %r15       # 0x20c5
subq $0x1, %r14
jb 0x1519
imull $0x343fd, %ebx, %ebx    # imm = 0x343FD
addl $0x269ec3, %ebx         # imm = 0x269EC3
movl %ebx, %eax
shrl $0x10, %eax
andl $0x7, %eax
movsbl (%rax,%r15), %edi
callq 0x1030
jmp 0x14f3
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/robertdavidgraham[P]wc2/wctool.c
// Function: main
int main(int argc, char *argv[])
{
    if (argc > 1 && (tolower(argv[1][0]) == 'u' || strcmp(argv[1], "-u") == 0 || strcmp(argv[1], "--utf8") == 0))
        gen_utf8();
    else if (argc > 1 && (tolower(argv[1][0]) == 'w' || strcmp(argv[1], "-w") == 0 || strcmp(argv[1], "--allword") == 0))
        gen_allword();
    else if (argc > 1 && (tolower(argv[1][0]) == 's' || strcmp(argv[1], "-s") == 0 || strcmp(argv[1], "--allspace") == 0))
        gen_allspace();
    else if (argc > 1 && (tolower(argv[1][0]) == 'a' || strcmp(argv[1], "-a") == 0 || strcmp(argv[1], "--ascii") == 0))
        gen_ascii();
    else {
        setlocale(LC_CTYPE, "");
        printf("LC_CTYPE=%s\n", setlocale(LC_CTYPE, NULL));
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x2, %edi
jl 0x1607
movq %rsi, %rbx
callq 0x10a0
movq (%rax), %rax
movq 0x8(%rbx), %rbx
movsbq (%rbx), %r14
movl (%rax,%r14,4), %ebp
cmpl $0x75, %ebp
je 0x1631
cmpb $0x2d, %r14b
jne 0x1562
cmpb $0x75, 0x1(%rbx)
jne 0x1562
cmpb $0x0, 0x2(%rbx)
je 0x1631
leaq 0xb65(%rip), %rsi       # 0x20ce
movq %rbx, %rdi
callq 0x1070
testl %eax, %eax
je 0x1631
cmpl $0x77, %ebp
je 0x1638
cmpb $0x2d, %r14b
jne 0x1598
cmpb $0x77, 0x1(%rbx)
jne 0x1598
cmpb $0x0, 0x2(%rbx)
je 0x1638
leaq 0xb36(%rip), %rsi       # 0x20d5
movq %rbx, %rdi
callq 0x1070
testl %eax, %eax
je 0x1638
cmpl $0x73, %ebp
je 0x163f
cmpb $0x2d, %r14b
jne 0x15ca
cmpb $0x73, 0x1(%rbx)
jne 0x15ca
cmpb $0x0, 0x2(%rbx)
je 0x163f
leaq 0xb0e(%rip), %rsi       # 0x20df
movq %rbx, %rdi
callq 0x1070
testl %eax, %eax
je 0x163f
cmpl $0x61, %ebp
je 0x1646
cmpb $0x2d, %r14b
jne 0x15f4
cmpb $0x61, 0x1(%rbx)
jne 0x15f4
cmpb $0x0, 0x2(%rbx)
je 0x1646
leaq 0xaef(%rip), %rsi       # 0x20ea
movq %rbx, %rdi
callq 0x1070
testl %eax, %eax
je 0x1646
leaq 0xa32(%rip), %rsi       # 0x2040
xorl %edi, %edi
callq 0x1080
xorl %edi, %edi
xorl %esi, %esi
callq 0x1080
leaq 0xacd(%rip), %rdi       # 0x20f2
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x164b
callq 0x1318
jmp 0x164b
callq 0x1393
jmp 0x164b
callq 0x142b
jmp 0x164b
callq 0x14c3
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vidarr[P]ringbuffer/test/../src/buffercache.c
// Function: buffercache_get_buffer
Buffer* buffercache_get_buffer(Ringbuffer* cache, size_t min_length_bytes) {

    Buffer* db =  0;

    if(0 != cache) {
        db = cache->pop(cache);
    }

    if(0 == db) {
        db = calloc(1, sizeof(Buffer));
    }

    if(db->capacity_bytes < min_length_bytes) {
        if(0 != db->data) {
            free(db->data);
            db->data = 0;
        }
    }

    if(0 == db->data) {
        db->data = calloc(1, sizeof(min_length_bytes) * sizeof(uint8_t));
        db->capacity_bytes = min_length_bytes;
    }

    db->bytes_used = 0;

    return db;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
je 0x1366
callq *0x10(%rdi)
testq %rax, %rax
je 0x1366
movq %rax, %r14
movq (%rax), %rax
jmp 0x1376
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x1060
movq %rax, %r14
xorl %eax, %eax
movq 0x10(%r14), %rdi
cmpq %rbx, %rax
jae 0x1386
callq 0x1030
jmp 0x138b
testq %rdi, %rdi
jne 0x139d
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0x1060
movq %rax, 0x10(%r14)
movq %rbx, (%r14)
andq $0x0, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_08/memalign.c
// Function: main
int main(int argc, char *argv[])
{
	size_t alignment, size;
	void *ptr;
	int ret;

	/* Parse the command line */
	if (argc < 3) {
		fprintf(stderr,
			"usage: %s <align-size> <size>\n", argv[0]);
		return -1;
	}
	alignment = atoi(argv[1]);
	size = atoi(argv[2]);

	/* Try memory allocation */
	ret = posix_memalign(&ptr, alignment, size);
	if (ret) {
		/* Set errno is such a way perror() may work correctly */
		errno = ret;
		perror("posix_memalign");
		return -1;
	}
	printf("posix_memalign(%ld, %ld) returned %p\n",
		alignment, size, ptr);
	free(ptr);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
cmpl $0x2, %edi
jle 0x1208
movq 0x8(%r14), %rdi
callq 0x1080
movslq %eax, %rbx
movq 0x10(%r14), %rdi
callq 0x1080
movslq %eax, %r14
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1090
testl %eax, %eax
jne 0x1225
movq 0x8(%rsp), %rcx
leaq 0xe4e(%rip), %rdi       # 0x2032
xorl %ebp, %ebp
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1050
movq 0x8(%rsp), %rdi
callq 0x1030
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x2de9(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%r14), %rdx
leaq 0xde8(%rip), %rsi       # 0x2004
xorl %eax, %eax
callq 0x1060
jmp 0x123a
movl %eax, %ebp
callq 0x1040
movl %ebp, (%rax)
leaq 0xdee(%rip), %rdi       # 0x2023
callq 0x1070
pushq $-0x1
popq %rbp
jmp 0x11fd
// File: /workspace/github_c_makefile_star2_O2/codeniko[P]CS214-Malloc-Free/main.c
// Function: main
void main()
{
        printf("mallocing p 25000\n");
        void *p = malloc(25000);
        printf("p 25000 '%p'\n", p);
        printf("mallocing p2 1000\n");
        void *p2 = malloc(1000);
        printf("p2 1000 '%p'\n", p2);
        printf("mallocing p4 should be success 20000\n");
        void *p4 = malloc(20000);
        printf("p4 20000 '%p'\n", p4);
        printf("Freeing p4\n");
        free(p4);

        printf("mallocing p3 6000\n");
        void *p3 = malloc(6000);
        printf("p3 6000 '%p'\n", p3);
        printf("mallocing p4 20000\n");
        p4 = malloc(20000);
        printf("p4 20000 '%p'\n", p4);

        printf("Freeing p\n");
        free(p);
        printf("Freeing p2\n");
        free(p2);
        printf("Freeing p3\n");
        free(p3);
        printf("Freeing p4\n");
        free(p4);
        printf("Freeing p3\n");
        free(p3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xed3(%rip), %rdi       # 0x2044
callq 0x1030
leaq 0xe87(%rip), %rbx       # 0x2004
pushq $0x7
popq %rdx
movl $0x61a8, %edi           # imm = 0x61A8
movq %rbx, %rsi
callq 0x130c
movq %rax, %r14
leaq 0xe74(%rip), %rdi       # 0x200b
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0xeae(%rip), %rdi       # 0x2056
callq 0x1030
pushq $0xa
popq %rdx
movl $0x3e8, %edi            # imm = 0x3E8
movq %rbx, %rsi
callq 0x130c
movq %rax, %r15
leaq 0xe52(%rip), %rdi       # 0x2019
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0xe90(%rip), %rdi       # 0x2068
callq 0x1030
pushq $0xd
popq %rdx
movl $0x4e20, %edi           # imm = 0x4E20
movq %rbx, %rsi
callq 0x130c
movq %rax, %r12
leaq 0xe30(%rip), %rdi       # 0x2027
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0xebf(%rip), %rdi       # 0x20c7
callq 0x1030
pushq $0x10
popq %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1445
leaq 0xe6b(%rip), %rdi       # 0x208d
callq 0x1030
pushq $0x13
popq %rdx
movl $0x1770, %edi           # imm = 0x1770
movq %rbx, %rsi
callq 0x130c
movq %rax, %r13
leaq 0xdf5(%rip), %rdi       # 0x2036
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0xe4d(%rip), %rdi       # 0x209f
callq 0x1030
pushq $0x16
popq %rdx
movl $0x4e20, %edi           # imm = 0x4E20
movq %rbx, %rsi
callq 0x130c
movq %rax, %r12
leaq 0xdb6(%rip), %rdi       # 0x2027
movq %rax, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0xe30(%rip), %rdi       # 0x20b2
callq 0x1030
pushq $0x1a
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1445
leaq 0xe20(%rip), %rdi       # 0x20bc
callq 0x1030
pushq $0x1c
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1445
leaq 0xe1c(%rip), %r14       # 0x20d2
movq %r14, %rdi
callq 0x1030
pushq $0x1e
popq %rdx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1445
leaq 0xdf4(%rip), %rdi       # 0x20c7
callq 0x1030
pushq $0x20
popq %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1445
movq %r14, %rdi
callq 0x1030
pushq $0x22
popq %rdx
movq %r13, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1445
nop
// File: /workspace/github_c_makefile_star2_O2/kisom[P]kam/stest.c
// Function: main
static void
test_stack8(void)
{
	uint8_t val;
	stack8	st;

	st = new_stack8();
	if (st == NULL) {
		errx(EX_OSERR, "FAILED: malloc failure");
	}

	push8(st, 1);
	push8(st, 2);
	if (2 != (val = pop8(st))) {
		fprintf(stderr,
		    "FAILED: should have received 2 from the stack.\n");
		fprintf(stderr,
		    "        (received %d)\n", val);
		exit(EXIT_FAILURE);
	}

	push8(st, 3);
	if (3 != (val = pop8(st))) {
		fprintf(stderr,
		    "FAILED: should have received 3 from the stack.\n");
		fprintf(stderr,
		    "        (received %d)\n", val);
		exit(EXIT_FAILURE);
	}
	if (1 != (val = pop8(st)))
		errx(EX_SOFTWARE,
		    "FAILED: should have received 1 from the stack.");
	if (!empty8(st))
		errx(EX_SOFTWARE,
		    "FAILED: stack should report empty.");
	push8(st, 5);
	push8(st, 5);
	destroy8(st);
	printf("stack8: OK\n");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0x11ac
testq %rax, %rax
je 0x1418
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x11c0
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x11c0
movq %rbx, %rdi
callq 0x11ee
cmpb $0x2, %al
jne 0x143d
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x11c0
movq %rbx, %rdi
callq 0x11ee
cmpb $0x3, %al
jne 0x1442
movq %rbx, %rdi
callq 0x11ee
cmpb $0x1, %al
jne 0x1423
movq %rbx, %rdi
callq 0x1211
testl %eax, %eax
je 0x142c
pushq $0x5
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11c0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11c0
movq %rbx, %rdi
callq 0x121b
leaq 0xd74(%rip), %rdi       # 0x20e4
callq 0x1050
callq 0x123e
testq %rax, %rax
je 0x1418
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x1252
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1252
movq %rbx, %rdi
callq 0x1280
cmpw $0x2, %ax
jne 0x1447
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1252
movq %rbx, %rdi
callq 0x1280
cmpw $0x3, %ax
jne 0x145d
movq %rbx, %rdi
callq 0x1280
cmpw $0x1, %ax
jne 0x1423
movq %rbx, %rdi
callq 0x12a4
testl %eax, %eax
je 0x142c
xorl %ebp, %ebp
cmpw $0x3e80, %bp            # imm = 0x3E80
je 0x13fd
movzwl %bp, %esi
movq %rbx, %rdi
callq 0x1252
incl %ebp
jmp 0x13e7
movq %rbx, %rdi
callq 0x12ae
leaq 0xce3(%rip), %rdi       # 0x20ef
callq 0x1050
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xbe5(%rip), %rsi       # 0x2004
pushq $0x47
jmp 0x1435
leaq 0xc68(%rip), %rsi       # 0x2092
jmp 0x1433
leaq 0xc8e(%rip), %rsi       # 0x20c1
pushq $0x46
popq %rdi
xorl %eax, %eax
callq 0x1060
movzbl %al, %ebx
jmp 0x144a
movzbl %al, %ebx
jmp 0x1460
movzwl %ax, %ebx
movq 0x2ba7(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0xbc0(%rip), %rdi       # 0x201b
jmp 0x1471
movzwl %ax, %ebx
movq 0x2b91(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0xbf1(%rip), %rdi       # 0x2062
pushq $0x2f
popq %rsi
pushq $0x1
popq %rdx
callq 0x10a0
movq (%r14), %rdi
leaq 0xbc5(%rip), %rsi       # 0x204b
movl %ebx, %edx
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rdi
callq 0x1090
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro11/dumpobj.c
// Function: dump_bytes
void dump_bytes(
    char *buf,
    int len)
{
    int             i,
                    j;

    for (i = 0; i < len; i += 8) {
        printf("\t%3.3o: ", i);
        for (j = i; j < len && j < i + 8; j++)
            printf("%3.3o ", buf[j] & 0xff);

        printf("%*s", (i + 8 - j) * 4, "");

        for (j = i; j < len && j < i + 8; j++) {
            int             c = buf[j] & 0xff;

            if (!isprint(c))
                c = '.';
            putchar(c);
        }

        putchar('\n');
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r13
xorl %r15d, %r15d
cmpq %r13, %r15
jge 0x147a
leaq 0x1d95(%rip), %rdi      # 0x3176
movl %r15d, %esi
xorl %eax, %eax
callq 0x10c0
leaq 0x8(%r15), %rbp
pushq $0x20
popq %r12
movq %r15, %r14
cmpq %r13, %r14
jge 0x141c
cmpq %rbp, %r14
jae 0x141c
movzbl (%rbx,%r14), %esi
leaq 0x1d73(%rip), %rdi      # 0x317f
xorl %eax, %eax
callq 0x10c0
incq %r14
addl $-0x4, %r12d
jmp 0x13f6
leaq 0x1d63(%rip), %rdi      # 0x3186
movl %r12d, %esi
leaq 0x1cbd(%rip), %rdx      # 0x30ea
xorl %eax, %eax
callq 0x10c0
pushq $0x2e
popq %r12
cmpq %r13, %r15
jge 0x146a
cmpq %rbp, %r15
jae 0x146a
movzbl (%rbx,%r15), %r14d
callq 0x11a0
movq (%rax), %rax
movzwl (%rax,%r14,2), %eax
btl $0xe, %eax
movl %r12d, %edi
jae 0x1460
movl %r14d, %edi
callq 0x1050
incq %r15
jmp 0x1438
pushq $0xa
popq %rdi
callq 0x1050
movq %rbp, %r15
jmp 0x13d1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq