LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/commandline.c
// Function: commandline_makeroom
static int commandline_makeroom(struct commandline *commandline)
{
	size_t newsize = commandline->allocated_size * 2;
	wchar_t *newbuffer = realloc(commandline->buffer, newsize * sizeof(wchar_t));

	if(newbuffer == NULL)
		return ENOMEM;

	commandline->buffer = newbuffer;
	commandline->allocated_size = newsize;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
shlq %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
shlq $0x2, %rsi
callq 0x3520
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x7194
movl $0xc, -0x4(%rbp)
jmp 0x71b3
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/commandline.c
// Function: commandline_resize
void commandline_resize(struct commandline *commandline, unsigned int x, unsigned int y, unsigned int width)
{
	mvwin(commandline->window, y, x);
	wresize(commandline->window, 1, width);
	if(commandline->buffer)
		commandline_updateview(commandline);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x35c0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %edx
movl $0x1, %esi
callq 0x3650
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x722f
movq -0x8(%rbp), %rdi
callq 0x6680
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/commandline.c
// Function: commandline_history_add
int commandline_history_add(struct commandline *commandline, const wchar_t *command)
{
	if(command == NULL)
		return EINVAL;

	/* filter out commands only consisting of whitespace */
	for(size_t i = 0; ; i++) {
		if(i == wcslen(command))
			return EINVAL;
		if(!iswspace(command[i]))
			break;
	}

	/* make old entry with same content the newest entry and ignore the new addition */
	for(size_t i = 0; i < list_length(commandline->history); i++) {
		if(wcscmp(command, list_get_item(commandline->history, i)) == 0) {
			list_move_item(commandline->history, i, list_length(commandline->history) - 1);
			return 0;
		}
	}

	wchar_t *commanddup = wcsdup(command);
	if(commanddup == NULL) {
		return ENOMEM;
	}

	if(list_append(commandline->history, commanddup))
		return 0;
	else {
		free(commanddup);
		return ENOMEM;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x7263
movl $0x16, -0x4(%rbp)
jmp 0x73ac
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3280
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jne 0x7294
movl $0x16, -0x4(%rbp)
jmp 0x73ac
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x3590
cmpl $0x0, %eax
jne 0x72ab
jmp 0x72bb
jmp 0x72ad
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x726b
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa090
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x735f
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0xa430
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x30b0
cmpl $0x0, %eax
jne 0x734c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa090
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
subq $0x1, %rdx
callq 0xa270
movl $0x0, -0x4(%rbp)
jmp 0x73ac
jmp 0x734e
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x72c3
movq -0x18(%rbp), %rdi
callq 0x34f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x737c
movl $0xc, -0x4(%rbp)
jmp 0x73ac
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0xa0b0
testb $0x1, %al
jne 0x7393
jmp 0x739c
movl $0x0, -0x4(%rbp)
jmp 0x73ac
movq -0x30(%rbp), %rdi
callq 0x3740
movl $0xc, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/commandline.c
// Function: commandline_init
bool commandline_init(struct commandline *commandline, unsigned int x, unsigned int y, unsigned int width)
{
	commandline->allocated_size = 1;
	commandline->buffer = NULL;
	commandline->backup_buffer = NULL;
	commandline->prompt[1] = L'\0';
	commandline->window = newwin(1, width, y, x);
	if(commandline->window == NULL)
		return false;
	commandline->history = list_new(0);
	if(commandline->history == NULL) {
		delwin(commandline->window);
		commandline->window = NULL;
		return false;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq $0x1, 0x28(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x34(%rax)
movl -0x1c(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x14(%rbp), %ecx
movl $0x1, %edi
callq 0x3030
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x7431
movb $0x0, -0x1(%rbp)
jmp 0x7471
xorl %eax, %eax
movl %eax, %edi
callq 0x9f60
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x746d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x31e0
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x7471
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/commandline.c
// Function: commandline_destroy
void commandline_destroy(struct commandline *commandline)
{
	if(commandline->window != NULL)
		delwin(commandline->window);
	if(commandline->backup_buffer)
		free(commandline->backup_buffer);
	else
		free(commandline->buffer);
	list_delete(commandline->history, free);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x74a2
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x31e0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x74bc
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x3740
jmp 0x74c9
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3740
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x9ae0(%rip), %rsi      # 0x10fb8
callq 0xa010
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dict.c
// Function: dict_delete
void dict_delete(struct list *list, bool free_value)
{
	struct dict_item *item;

	if(list == NULL)
		return;

	size_t length = list_length(list);;
	for(size_t i = 0; i < length; i++) {
		item = list_get_item(list, i);
		if(free_value)
			free(item->value);
		free((void*)item->key);
		free(item);
	}
	list_delete(list, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x751d
jmp 0x7590
movq -0x8(%rbp), %rdi
callq 0xa090
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x7583
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xa430
movq %rax, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0x7560
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3740
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x3740
movq -0x18(%rbp), %rdi
callq 0x3740
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x7532
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa010
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dict.c
// Function: dict_set
bool dict_set(struct list *list, const char *key, void *value)
{
	struct dict_item *item, needle;

	size_t index;
	bool found;

	needle.key = key;

	found = list_find_item_or_insertpoint(list, compare_key, &needle, &index);
	if(found) {
		item = list_get_item(list, index);
	} else {
		item = malloc(sizeof(*item));
		if(item == NULL)
			return false;

		item->key = strdup(key);
		if(item->key == NULL) {
			free(item);
			return false;
		}
		if(!list_insert(list, index, item)) {
			free((void*)item->key);
			free(item);
			return false;
		}
	}
	item->value = value;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xc9(%rip), %rsi        # 0x7690
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0xa530
andb $0x1, %al
movb %al, -0x41(%rbp)
testb $0x1, -0x41(%rbp)
je 0x75f2
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xa430
movq %rax, -0x28(%rbp)
jmp 0x766b
movl $0x10, %edi
callq 0x3490
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x760d
movb $0x0, -0x1(%rbp)
jmp 0x767b
movq -0x18(%rbp), %rdi
callq 0x36a0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x7639
movq -0x28(%rbp), %rdi
callq 0x3740
movb $0x0, -0x1(%rbp)
jmp 0x767b
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xa190
testb $0x1, %al
jne 0x7669
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x3740
movq -0x28(%rbp), %rdi
callq 0x3740
movb $0x0, -0x1(%rbp)
jmp 0x767b
jmp 0x766b
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dict.c
// Function: dict_get
void *dict_get(struct list *list, const char *key)
{
	struct dict_item item;
	size_t index;
	bool found;

	item.key = key;

	found = list_find_item_or_insertpoint(list, compare_key, &item, &index);
	if(found) {
		struct dict_item *item = list_get_item(list, index);
		return item->value;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x63(%rip), %rsi       # 0x7690
leaq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0xa530
andb $0x1, %al
movb %al, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
je 0x772a
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xa430
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x7732
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_count
size_t dirmodel_count(struct listmodel *listmodel)
{
	struct dirmodel *model = container_of(listmodel, struct dirmodel, listmodel);
	struct list *list = model->list;
	if(list == NULL)
		return 0;
	return list_length(list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x7771
movq $0x0, -0x8(%rbp)
jmp 0x777e
movq -0x20(%rbp), %rdi
callq 0xa090
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_getmarkedfilenames
int dirmodel_getmarkedfilenames(struct dirmodel *model, const struct list **markedlist_out)
{
	struct list *list = model->sortedlist;
	struct list *markedlist = list_new(0);

	if(markedlist == NULL)
		return ENOMEM;

	size_t length = list_length(list);

	for(size_t i = 0; i < length; i++)
	{
		struct filedata *filedata = list_get_item(list, i);
		if(filedata->is_marked) {
			char *filename = strdup(filedata->filename);
			if(filename == NULL) {
				list_delete(markedlist, free);
				return ENOMEM;
			}
			if(!list_append(markedlist, filename)) {
				free(filename);
				list_delete(markedlist, free);
				return ENOMEM;
			}
		}
	}
	if(list_length(markedlist) == 0) {
		list_delete(markedlist, NULL);
		return ENOENT;
	}

	*markedlist_out = markedlist;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x9f60
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x77cc
movl $0xc, -0x4(%rbp)
jmp 0x78bc
movq -0x20(%rbp), %rdi
callq 0xa090
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x7885
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xa430
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
testb $0x1, 0xa8(%rax)
je 0x7872
movq -0x40(%rbp), %rax
movq (%rax), %rdi
callq 0x36a0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x783d
movq -0x28(%rbp), %rdi
movq 0x9789(%rip), %rsi      # 0x10fb8
callq 0xa010
movl $0xc, -0x4(%rbp)
jmp 0x78bc
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xa0b0
testb $0x1, %al
jne 0x7870
movq -0x48(%rbp), %rdi
callq 0x3740
movq -0x28(%rbp), %rdi
movq 0x9756(%rip), %rsi      # 0x10fb8
callq 0xa010
movl $0xc, -0x4(%rbp)
jmp 0x78bc
jmp 0x7872
jmp 0x7874
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x77e1
movq -0x28(%rbp), %rdi
callq 0xa090
cmpq $0x0, %rax
jne 0x78aa
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa010
movl $0x2, -0x4(%rbp)
jmp 0x78bc
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_get_internal_index
bool dirmodel_get_internal_index(struct dirmodel *model, const char *filename, size_t *internal_index, size_t *index)
{
	struct filedata filedata;

	filedata.filename = filename;

	if(!list_find_item_or_insertpoint(model->list, filedata_listcompare_filename, &filedata, internal_index))
		return false;

	struct filedata *internal_filedata = list_get_item(model->list, *internal_index);
	if(!list_find_item_or_insertpoint(model->sortedlist, model->sort_compare, internal_filedata, index))
		return false;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rcx
leaq 0x16e7(%rip), %rsi      # 0x9020
leaq -0xd8(%rbp), %rdx
callq 0xa530
testb $0x1, %al
jne 0x794f
movb $0x0, -0x1(%rbp)
jmp 0x799b
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0xa430
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rsi
movq -0xe0(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xa530
testb $0x1, %al
jne 0x7997
movb $0x0, -0x1(%rbp)
jmp 0x799b
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_regex_getnext
size_t dirmodel_regex_getnext(struct dirmodel *model, const char *regex, size_t start_index, int direction)
{
	struct list *list = model->sortedlist;
	regex_t cregex;
	size_t result = start_index;

	int ret = regcomp(&cregex, regex, REG_EXTENDED | REG_ICASE | REG_NOSUB);
	if(ret != 0)
		return start_index;

	if(direction > 0 && start_index < SIZE_MAX) {
		size_t length = list_length(list);
		for(size_t i = start_index + 1; i < length; i++) {
			struct filedata *filedata = list_get_item(list, i);
			if(regexec(&cregex, filedata->filename, 0, NULL, 0) == 0) {
				result = i;
				break;
			}
		}
	} else if(direction < 0 && start_index > 0) {
		for(size_t i = start_index - 1; i > 0; i--) {
			struct filedata *filedata = list_get_item(list, i);
			if(regexec(&cregex, filedata->filename, 0, NULL, 0) == 0) {
				result = i;
				break;
			}
		}
	}

	regfree(&cregex);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movl $0xb, %edx
callq 0x3370
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
je 0x7a46
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7b82
cmpl $0x0, -0x24(%rbp)
jle 0x7aeb
cmpq $-0x1, -0x20(%rbp)
jae 0x7aeb
movq -0x30(%rbp), %rdi
callq 0xa090
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
jae 0x7ae6
movq -0x30(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0xa430
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq (%rax), %rsi
leaq -0x70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
movq %rcx, %rdx
callq 0x34d0
cmpl $0x0, %eax
jne 0x7ad0
movq -0x90(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x7ae6
jmp 0x7ad2
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x7a7a
jmp 0x7b71
cmpl $0x0, -0x24(%rbp)
jge 0x7b6f
cmpq $0x0, -0x20(%rbp)
jbe 0x7b6f
movq -0x20(%rbp), %rax
subq $0x1, %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
jbe 0x7b6d
movq -0x30(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0xa430
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq (%rax), %rsi
leaq -0x70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
movq %rcx, %rdx
callq 0x34d0
cmpl $0x0, %eax
jne 0x7b57
movq -0xa0(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x7b6d
jmp 0x7b59
movq -0xa0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x7b07
jmp 0x7b6f
jmp 0x7b71
leaq -0x70(%rbp), %rdi
callq 0x3220
movq -0x78(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_regex_setmark
void dirmodel_regex_setmark(struct dirmodel *model, const char *regex, bool mark)
{
	struct list *list = model->sortedlist;
	regex_t cregex;

	int ret = regcomp(&cregex, regex, REG_EXTENDED | REG_ICASE | REG_NOSUB);
	if(ret != 0)
		return;

	size_t length = list_length(list);

	for(size_t i = 0; i < length; i++) {
		struct filedata *filedata = list_get_item(list, i);
		if(regexec(&cregex, filedata->filename, 0, NULL, 0) == 0 &&
		   filedata->is_marked != mark) {
			if(mark) {
				dirmodel_update_marked_stats(model, NULL, filedata);
			} else {
				dirmodel_update_marked_stats(model, filedata, NULL);
			}
			filedata->is_marked = mark;
			listmodel_notify_change(&model->listmodel, MODEL_CHANGE, i, i);
		}
	}

	regfree(&cregex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movl $0xb, %edx
callq 0x3370
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
je 0x7bd6
jmp 0x7cb1
movq -0x20(%rbp), %rdi
callq 0xa090
movq %rax, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0x7ca8
movq -0x20(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0xa430
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rsi
leaq -0x60(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
movq %rcx, %rdx
callq 0x34d0
cmpl $0x0, %eax
jne 0x7c95
movq -0x80(%rbp), %rax
movb 0xa8(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x11(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x7c95
testb $0x1, -0x11(%rbp)
je 0x7c5e
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x7cc0
jmp 0x7c6f
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x7cc0
movb -0x11(%rbp), %cl
movq -0x80(%rbp), %rax
andb $0x1, %cl
movb %cl, 0xa8(%rax)
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x78(%rbp), %rcx
movl $0x2, %esi
callq 0xa8b0
jmp 0x7c97
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x7beb
leaq -0x60(%rbp), %rdi
callq 0x3220
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_update_marked_stats
static void dirmodel_update_marked_stats(struct dirmodel *model, struct filedata *oldfiledata, struct filedata *newfiledata)
{
	if(oldfiledata) {
		if(oldfiledata->is_link) {
			model->marked_stats.size -= oldfiledata->link_size;
		} else {
			model->marked_stats.size -= oldfiledata->stat.st_size;
		}
		model->marked_stats.count--;
	}
	if(newfiledata) {
		if(newfiledata->is_link) {
			model->marked_stats.size += newfiledata->link_size;
		} else {
			model->marked_stats.size += newfiledata->stat.st_size;
		}
		model->marked_stats.count++;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7d36
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x7d03
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0xa8(%rax)
jmp 0x7d20
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0xa8(%rax)
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0xa0(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x7d96
movq -0x18(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x7d66
movq -0x18(%rbp), %rax
movq 0xa0(%rax), %rcx
movq -0x8(%rbp), %rax
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
jmp 0x7d80
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xa0(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_setfilter
bool dirmodel_setfilter(struct dirmodel *model, const char *regex)
{
	if(model->filter_active)
		regfree(&model->filter);

	if(regex == NULL) {
		model->filter_active = false;
	} else {
		int ret = regcomp(&model->filter, regex, REG_EXTENDED | REG_ICASE | REG_NOSUB);
		model->filter_active = (ret == 0);
	}

	return model->filter_active;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x88(%rax)
je 0x7dca
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
callq 0x3220
cmpq $0x0, -0x10(%rbp)
jne 0x7dde
movq -0x8(%rbp), %rax
movb $0x0, 0x88(%rax)
jmp 0x7e0b
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movq -0x10(%rbp), %rsi
movl $0xb, %edx
callq 0x3370
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
sete %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x88(%rax)
movq -0x8(%rbp), %rax
movb 0x88(%rax), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_notify_file_deleted
void dirmodel_notify_file_deleted(struct dirmodel *model, const char *filename)
{
	struct list *list = model->list;
	size_t index, internal_index;

	bool found = dirmodel_get_internal_index(model, filename, &internal_index, &index);
	if(found) {
		struct filedata *filedata = list_get_item(list, internal_index);
		if(filedata->is_marked) {
			dirmodel_update_marked_stats(model, filedata, NULL);
		}
		dirmodel_update_dirsize(model, filedata, NULL);
		filedata_delete(filedata);
		list_remove(list, internal_index);
		list_remove(model->sortedlist, index);
		listmodel_notify_change(&model->listmodel, MODEL_REMOVE, 0, index);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x20(%rbp), %rcx
callq 0x7900
andb $0x1, %al
movb %al, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
je 0x7f09
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xa430
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
testb $0x1, 0xa8(%rax)
je 0x7ebb
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x7cc0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x7f10
movq -0x38(%rbp), %rdi
callq 0x9f30
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xa390
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xa390
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xa8b0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_update_dirsize
static void dirmodel_update_dirsize(struct dirmodel *model, struct filedata *oldfiledata, struct filedata *newfiledata)
{
	if(oldfiledata) {
		if(oldfiledata->is_link) {
			model->dirsize -= oldfiledata->link_size;
		} else {
			model->dirsize -= oldfiledata->stat.st_size;
		}
	}
	if(newfiledata) {
		if(newfiledata->is_link) {
			model->dirsize += newfiledata->link_size;
		} else {
			model->dirsize += newfiledata->stat.st_size;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7f72
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x7f53
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0xb0(%rax)
jmp 0x7f70
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0xb0(%rax)
jmp 0x7f72
cmpq $0x0, -0x18(%rbp)
je 0x7fbe
movq -0x18(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x7fa2
movq -0x18(%rbp), %rax
movq 0xa0(%rax), %rcx
movq -0x8(%rbp), %rax
addq 0xb0(%rax), %rcx
movq %rcx, 0xb0(%rax)
jmp 0x7fbc
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
addq 0xb0(%rax), %rcx
movq %rcx, 0xb0(%rax)
jmp 0x7fbe
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_notify_file_added_or_changed
int dirmodel_notify_file_added_or_changed(struct dirmodel *model, const char *filename)
{
	size_t index;
	bool found = list_find_item_or_insertpoint(model->addchange_queue, listcompare_strcmp, filename, &index);
	if(!found) {
		char *filename_copy = strdup(filename);
		if(filename_copy == NULL)
			return ENOMEM;
		if(!list_insert(model->addchange_queue, index, filename_copy)) {
			free(filename_copy);
			return ENOMEM;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x7d(%rip), %rsi        # 0x8060
leaq -0x20(%rbp), %rcx
callq 0xa530
andb $0x1, %al
movb %al, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x8041
movq -0x18(%rbp), %rdi
callq 0x36a0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x8014
movl $0xc, -0x4(%rbp)
jmp 0x8048
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xa190
testb $0x1, %al
jne 0x803f
movq -0x30(%rbp), %rdi
callq 0x3740
movl $0xc, -0x4(%rbp)
jmp 0x8048
jmp 0x8041
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/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_notify_flush
int dirmodel_notify_flush(struct dirmodel *model)
{
	int ret = 0;
	size_t length = list_length(model->addchange_queue);
	for(size_t i = 0; i < length; i++) {
		ret = dirmodel_notify_file_added_or_changed_real(model, list_get_item(model->addchange_queue, i));
		if(ret == ENOMEM)
			break;
	}
	for(size_t i = length; i > 0; i--) {
		free(list_get_item(model->addchange_queue, i - 1));
		list_remove(model->addchange_queue, i - 1);
	}
	return ret == ENOMEM ? ENOMEM : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xa090
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x8116
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xa430
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x8180
movl %eax, -0xc(%rbp)
cmpl $0xc, -0xc(%rbp)
jne 0x8106
jmp 0x8116
jmp 0x8108
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x80cc
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jbe 0x8165
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x28(%rbp), %rsi
subq $0x1, %rsi
callq 0xa430
movq %rax, %rdi
callq 0x3740
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x28(%rbp), %rsi
subq $0x1, %rsi
callq 0xa390
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x811e
movl -0xc(%rbp), %edx
xorl %eax, %eax
movl $0xc, %ecx
cmpl $0xc, %edx
cmovel %ecx, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_notify_file_added_or_changed_real
static int dirmodel_notify_file_added_or_changed_real(struct dirmodel *model, const char *filename)
{
	struct filedata *filedata;
	size_t internal_index;

	if(model->filter_active && regexec(&model->filter, filename, 0, NULL, 0) != 0)
		return 0;

	int ret = filedata_new_from_file(&filedata, dirfd(model->dir), filename);
	if(ret != 0)
		return ret;

	bool found = list_find_item_or_insertpoint(model->list, filedata_listcompare_filename, filedata, &internal_index);
	if(found)
		return dirmodel_update_file(model, filedata, internal_index);
	else
		return dirmodel_add_file(model, filedata, internal_index);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x88(%rax)
je 0x81c6
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
movq %rcx, %rdx
callq 0x34d0
cmpl $0x0, %eax
je 0x81c6
movl $0x0, -0x4(%rbp)
jmp 0x8244
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x33f0
movl %eax, %esi
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rdi
callq 0x9d40
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x81f3
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8244
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0xe1a(%rip), %rsi       # 0x9020
leaq -0x28(%rbp), %rcx
callq 0xa530
andb $0x1, %al
movb %al, -0x2d(%rbp)
testb $0x1, -0x2d(%rbp)
je 0x8230
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x88a0
movl %eax, -0x4(%rbp)
jmp 0x8244
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x8a00
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_change_directory
bool dirmodel_change_directory(struct dirmodel *model, const char *path)
{
	internal_destroy(model);
	if(!internal_init(model, path))
		return false;
	listmodel_notify_change(&model->listmodel, MODEL_RELOAD, 0, 0);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8390
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8410
testb $0x1, %al
jne 0x8360
movb $0x0, -0x1(%rbp)
jmp 0x8379
movq -0x10(%rbp), %rdi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0xa8b0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: internal_destroy
static void internal_destroy(struct dirmodel *model)
{
	struct list *list = model->list;
	if(list == NULL)
		return;

	closedir(model->dir);

	list_delete(list, (list_item_deallocator)filedata_delete);
	list_delete(model->sortedlist, NULL);
	list_delete(model->addchange_queue, free);
	model->list = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x83b1
jmp 0x83ff
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x3350
movq -0x10(%rbp), %rdi
leaq 0x1b67(%rip), %rsi      # 0x9f30
callq 0xa010
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa010
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq 0x8bca(%rip), %rsi      # 0x10fb8
callq 0xa010
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_init
void dirmodel_init(struct dirmodel *model)
{
	listmodel_init(&model->listmodel);

	model->list = NULL;
	model->sortedlist = NULL;
	model->listmodel.count = dirmodel_count;
	model->listmodel.render = dirmodel_render;
	model->listmodel.setmark = dirmodel_setmark;
	model->listmodel.ismarked = dirmodel_ismarked;
	model->filter_active = false;
	model->sort_compare = filedata_listcompare_directory_filename;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa940
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x8(%rbp), %rax
leaq -0xf68(%rip), %rcx      # 0x7740
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
leaq 0x4a(%rip), %rcx        # 0x8700
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
leaq 0x9b(%rip), %rcx        # 0x8760
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
leaq 0x13c(%rip), %rcx       # 0x8810
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x88(%rax)
movq -0x8(%rbp), %rax
leaq 0x972(%rip), %rcx       # 0x9060
movq %rcx, 0x90(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_render
static size_t dirmodel_render(struct listmodel *listmodel, wchar_t *buffer, size_t len, size_t width, size_t index)
{
	struct dirmodel *model = container_of(listmodel, struct dirmodel, listmodel);;
	struct list *list = model->sortedlist;
	struct filedata *filedata = list_get_item(list, index);

	return filedata_format_list_line(filedata, buffer, len, width);
}

// 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)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xa430
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x99b0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_setmark
static void dirmodel_setmark(struct listmodel *listmodel, size_t index, bool mark)
{
	struct dirmodel *model = container_of(listmodel, struct dirmodel, listmodel);;
	struct list *list = model->sortedlist;
	struct filedata *filedata = list_get_item(list, index);

	if(filedata->is_marked == mark)
		return;

	if(mark) {
		dirmodel_update_marked_stats(model, NULL, filedata);
	} else {
		dirmodel_update_marked_stats(model, filedata, NULL);
	}
	filedata->is_marked = mark;
	listmodel_notify_change(listmodel, MODEL_CHANGE, index, index);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa430
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb 0xa8(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x11(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x87ba
jmp 0x880a
testb $0x1, -0x11(%rbp)
je 0x87d3
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x7cc0
jmp 0x87e4
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x7cc0
movb -0x11(%rbp), %cl
movq -0x30(%rbp), %rax
andb $0x1, %cl
movb %cl, 0xa8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
movl $0x2, %esi
callq 0xa8b0
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_ismarked
static bool dirmodel_ismarked(struct listmodel *listmodel, size_t index)
{
	struct dirmodel *model = container_of(listmodel, struct dirmodel, listmodel);;
	struct list *list = model->sortedlist;
	struct filedata *filedata = list_get_item(list, index);
	return filedata->is_marked;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa430
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb 0xa8(%rax), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_destroy
void dirmodel_destroy(struct dirmodel *model)
{
	internal_destroy(model);
	listmodel_destroy(&model->listmodel);
	if(model->filter_active)
		regfree(&model->filter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8390
movq -0x8(%rbp), %rdi
callq 0xa960
movq -0x8(%rbp), %rax
testb $0x1, 0x88(%rax)
je 0x8898
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
callq 0x3220
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_update_file
static int dirmodel_update_file(struct dirmodel *model, struct filedata *newfiledata, size_t internal_index)
{
	struct filedata *oldfiledata = list_get_item(model->list, internal_index);
	size_t newindex, oldindex;

	newfiledata->is_marked = oldfiledata->is_marked;
	if(newfiledata->is_marked) {
		dirmodel_update_marked_stats(model, oldfiledata, newfiledata);
	}
	dirmodel_update_dirsize(model, oldfiledata, newfiledata);

	list_find_item_or_insertpoint(model->sortedlist, model->sort_compare, oldfiledata, &oldindex);
	list_find_item_or_insertpoint(model->sortedlist, model->sort_compare, newfiledata, &newindex);

	if((newindex == oldindex) || (newindex == oldindex + 1)) {
		list_set_item(model->sortedlist, oldindex, newfiledata);
		listmodel_notify_change(&model->listmodel, MODEL_CHANGE, oldindex, oldindex);
	} else {
		if(oldindex < newindex)
			newindex--;
		list_move_item(model->sortedlist, oldindex, newindex);
		listmodel_notify_change(&model->listmodel, MODEL_CHANGE, newindex, oldindex);
	}
	list_set_item(model->list, internal_index, newfiledata);
	filedata_delete(oldfiledata);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xa430
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0xa8(%rax), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0xa8(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0xa8(%rax)
je 0x88fe
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x7cc0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x7f10
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rsi
movq -0x20(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0xa530
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rsi
movq -0x10(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0xa530
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x896a
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x8997
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xa490
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x2, %esi
callq 0xa8b0
jmp 0x89d8
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x89ad
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xa270
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x2, %esi
callq 0xa8b0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xa490
movq -0x20(%rbp), %rdi
callq 0x9f30
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/dirmodel.c
// Function: dirmodel_add_file
static int dirmodel_add_file(struct dirmodel *model, struct filedata *filedata, size_t internal_index)
{
	if(!list_insert(model->list, internal_index, filedata)) {
		filedata_delete(filedata);
		return ENOMEM;
	}

	size_t index;
	list_find_item_or_insertpoint(model->sortedlist, model->sort_compare, filedata, &index);

	if(!list_insert(model->sortedlist, index, filedata)) {
		filedata_delete(filedata);
		list_remove(model->list, internal_index);
		return ENOMEM;
	}
	dirmodel_update_dirsize(model, NULL, filedata);
	listmodel_notify_change(&model->listmodel, MODEL_ADD, index, 0);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xa190
testb $0x1, %al
jne 0x8a42
movq -0x18(%rbp), %rdi
callq 0x9f30
movl $0xc, -0x4(%rbp)
jmp 0x8ac9
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rsi
movq -0x18(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0xa530
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xa190
testb $0x1, %al
jne 0x8a9e
movq -0x18(%rbp), %rdi
callq 0x9f30
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xa390
movl $0xc, -0x4(%rbp)
jmp 0x8ac9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x7f10
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0xa8b0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/keymap.c
// Function: keymap_handlekey
int keymap_handlekey(struct keymap *keymap, wint_t key, bool iskeycode)
{
	if(keymap->entries == NULL)
		return EINVAL;

	size_t length = list_length(keymap->entries);

	for(size_t i = 0; i < length; i++) {
		struct keymap_entry *curitem = list_get_item(keymap->entries, i);
		if(curitem->keyspec.key == key && curitem->keyspec.iskeycode == iskeycode) {
			char buffer[strlen(curitem->command) + 1];
			strcpy(buffer, curitem->command);

			return commandexecutor_execute(keymap->commandexecutor, buffer);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8b0d
movl $0x16, -0x4(%rbp)
jmp 0x8be6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa090
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x8bdf
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0xa430
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x8bcc
movq -0x30(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x15(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x8bcc
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3230
movq %rax, %rcx
movq %rcx, %rax
incq %rax
movq %rsp, %rdx
movq %rdx, -0x38(%rbp)
addq $0x10, %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x48(%rbp)
movq %rdi, %rsp
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3110
movq -0x48(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x6410
movl %eax, -0x4(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rsp
jmp 0x8be6
jmp 0x8bce
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x8b26
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/keymap.c
// Function: keymap_addmapping
int keymap_addmapping(struct keymap *keymap, char *keymapstring)
{
	if(keymap->entries == NULL)
		keymap->entries = list_new(0);
	if(keymap->entries == NULL)
		return ENOMEM;

	struct keymap_entry *entry = malloc(sizeof(*entry));
	if(entry == NULL)
		return ENOMEM;

	entry->command = NULL;
	int ret = keymap_parse_line(entry, keymapstring, keymap->commandexecutor);
	if(ret != 0) {
		keymap_entry_delete(entry);
		return ret;
	}

	if(entry->command != NULL) {
		struct keymap_entry *oldentry;
		size_t length = list_length(keymap->entries);
		size_t i;
		for(i = 0; i < length; i++) {
			oldentry = list_get_item(keymap->entries, i);
			if(oldentry->keyspec.iskeycode == entry->keyspec.iskeycode &&
			   oldentry->keyspec.key == entry->keyspec.key)
				break;
		}

		if(i < length) {
			free((void*)oldentry->command);
			oldentry->command = entry->command;
			free(entry);
		} else if(!list_append(keymap->entries, entry)) {
			keymap_entry_delete(entry);
			return ENOMEM;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8c1f
xorl %eax, %eax
movl %eax, %edi
callq 0x9f60
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8c36
movl $0xc, -0x4(%rbp)
jmp 0x8d7c
movl $0x10, %edi
callq 0x3490
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x8c57
movl $0xc, -0x4(%rbp)
jmp 0x8d7c
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
callq 0x8d90
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x8c94
movq -0x20(%rbp), %rdi
callq 0x8eb0
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8d7c
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x8d75
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa090
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x8d18
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0xa430
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x20(%rbp), %rcx
movb (%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x8d08
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x8d08
jmp 0x8d18
jmp 0x8d0a
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x8cbc
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x8d4a
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3740
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x3740
jmp 0x8d73
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0xa0b0
testb $0x1, %al
jne 0x8d71
movq -0x20(%rbp), %rdi
callq 0x8eb0
movl $0xc, -0x4(%rbp)
jmp 0x8d7c
jmp 0x8d73
jmp 0x8d75
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)