LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/keymap.c
// Function: keymap_parse_line
static int keymap_parse_line(struct keymap_entry *entry, char *line, struct commandexecutor *commandexecutor)
{
	size_t length = strcspn(line, " \t");
	if(length > 0) {
		if(line[length] == '\0')
			return EINVAL;
		line[length] = '\0';
		keymap_string_to_keyspec(&entry->keyspec, line);
		if(entry->keyspec.key == WEOF)
			return EINVAL;
	} else
		return EINVAL;

	char *command = line + length + 1;
	command = command + strspn(command, " \t");

	int ret = commandexecutor_verify(commandexecutor, command);
	if(ret == 0) {
		entry->command = strdup(command);
		if(entry->command == NULL)
			return ENOMEM;
	} else
		return ret;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x443f(%rip), %rsi      # 0xd1ee
callq 0x33a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jbe 0x8e0d
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x8ddc
movl $0x16, -0x4(%rbp)
jmp 0x8e9e
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8f40
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0x8e0b
movl $0x16, -0x4(%rbp)
jmp 0x8e9e
jmp 0x8e19
movl $0x16, -0x4(%rbp)
jmp 0x8e9e
movq -0x18(%rbp), %rax
addq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x43b2(%rip), %rsi      # 0xd1ee
callq 0x3340
movq %rax, %rcx
movq -0x40(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x6280
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x8e8f
movq -0x30(%rbp), %rdi
callq 0x36a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8e8d
movl $0xc, -0x4(%rbp)
jmp 0x8e9e
jmp 0x8e97
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8e9e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/keymap.c
// Function: keymap_string_to_keyspec
static void keymap_string_to_keyspec(struct keyspec *keyspec, const char *keystring)
{
	if(mbstowcs(NULL, keystring, 0) == 1) {
		wchar_t key;
		mbstowcs(&key, keystring, 1);
		keyspec->key = key;
		keyspec->iskeycode = false;
		return;
	}

	for(size_t i = 0; i < sizeof(keycodetable)/sizeof(keycodetable[0]); i++) {
		if(strcmp(keycodetable[i].string, keystring) == 0) {
			keyspec->key = keycodetable[i].keyspec.key;
			keyspec->iskeycode = keycodetable[i].keyspec.iskeycode;
			return;
		}
	}
	keyspec->key = WEOF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rdi
callq 0x31a0
cmpq $0x1, %rax
jne 0x8f8e
movq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rdi
movl $0x1, %edx
callq 0x31a0
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x9017
movq $0x0, -0x20(%rbp)
cmpq $0x13, -0x20(%rbp)
jae 0x900c
movq -0x20(%rbp), %rcx
leaq 0x86c8(%rip), %rax      # 0x11670
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x33d0
cmpl $0x0, %eax
jne 0x8ffc
movq -0x20(%rbp), %rcx
leaq 0x86a5(%rip), %rax      # 0x11670
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rcx
leaq 0x8689(%rip), %rax      # 0x11670
shlq $0x4, %rcx
addq %rcx, %rax
movb 0x8(%rax), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
jmp 0x9017
jmp 0x8ffe
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x8f96
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: filedata_listcompare_directory_filename
int filedata_listcompare_directory_filename(const void *a, const void *b)
{
	struct filedata *filedata1 = *(struct filedata **)a;
	struct filedata *filedata2 = *(struct filedata **)b;

	if(!(S_ISDIR(filedata1->stat.st_mode) ^ S_ISDIR(filedata2->stat.st_mode)))
		return strcoll(filedata1->filename, filedata2->filename);
	if(S_ISDIR(filedata1->stat.st_mode))
		return -1;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0x28(%rbp), %rcx
movl 0x28(%rcx), %ecx
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x4000, %ecx           # imm = 0x4000
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
jne 0x90da
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x34e0
movl %eax, -0x4(%rbp)
jmp 0x90fd
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x90f6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x90fd
movl $0x1, -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/filedata.c
// Function: filedata_listcompare_directory_filename_descending
int filedata_listcompare_directory_filename_descending(const void *a, const void *b)
{
	struct filedata *filedata1 = *(struct filedata **)a;
	struct filedata *filedata2 = *(struct filedata **)b;

	if(!(S_ISDIR(filedata1->stat.st_mode) ^ S_ISDIR(filedata2->stat.st_mode)))
		return -strcoll(filedata1->filename, filedata2->filename);
	if(S_ISDIR(filedata1->stat.st_mode))
		return -1;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0x28(%rbp), %rcx
movl 0x28(%rcx), %ecx
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x4000, %ecx           # imm = 0x4000
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
jne 0x9190
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x34e0
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x91b3
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x91ac
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x91b3
movl $0x1, -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/filedata.c
// Function: filedata_listcompare_directory_size_filename
int filedata_listcompare_directory_size_filename(const void *a, const void *b)
{
	struct filedata *filedata1 = *(struct filedata **)a;
	struct filedata *filedata2 = *(struct filedata **)b;

	if(!S_ISDIR(filedata1->stat.st_mode) && !S_ISDIR(filedata2->stat.st_mode)) {
		if(filedata1->stat.st_size < filedata2->stat.st_size)
			return -1;
		else if(filedata1->stat.st_size > filedata2->stat.st_size)
			return 1;
		return strcoll(filedata1->filename, filedata2->filename);
	}
	if(S_ISDIR(filedata1->stat.st_mode) && S_ISDIR(filedata2->stat.st_mode))
		return strcoll(filedata1->filename, filedata2->filename);
	if(S_ISDIR(filedata1->stat.st_mode))
		return -1;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
je 0x925f
movq -0x28(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
je 0x925f
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jge 0x922a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x92c0
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jle 0x9245
movl $0x1, -0x4(%rbp)
jmp 0x92c0
jmp 0x9247
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x34e0
movl %eax, -0x4(%rbp)
jmp 0x92c0
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x929d
movq -0x28(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x929d
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x34e0
movl %eax, -0x4(%rbp)
jmp 0x92c0
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x92b9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x92c0
movl $0x1, -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/filedata.c
// Function: filedata_listcompare_directory_mtime_filename
int filedata_listcompare_directory_mtime_filename(const void *a, const void *b)
{
	struct filedata *filedata1 = *(struct filedata **)a;
	struct filedata *filedata2 = *(struct filedata **)b;

	if(!(S_ISDIR(filedata1->stat.st_mode) ^ S_ISDIR(filedata2->stat.st_mode))) {
		if(filedata1->stat.st_mtime < filedata2->stat.st_mtime)
			return -1;
		else if(filedata1->stat.st_mtime > filedata2->stat.st_mtime)
			return 1;
		return strcoll(filedata1->filename, filedata2->filename);
	}
	if(S_ISDIR(filedata1->stat.st_mode))
		return -1;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0x28(%rbp), %rcx
movl 0x28(%rcx), %ecx
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x4000, %ecx           # imm = 0x4000
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
jne 0x9492
movq -0x20(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x68(%rcx), %rax
jge 0x945d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x94b5
movq -0x20(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x68(%rcx), %rax
jle 0x9478
movl $0x1, -0x4(%rbp)
jmp 0x94b5
jmp 0x947a
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x34e0
movl %eax, -0x4(%rbp)
jmp 0x94b5
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x94ae
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x94b5
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: filetype_character
static char filetype_character(const struct stat *statbuf)
{
	switch(statbuf->st_mode & S_IFMT) {
	case S_IFBLK:
		return 'b';
	case S_IFCHR:
		return 'b';
	case S_IFDIR:
		return 'd';
	case S_IFIFO:
		return 'p';
	case S_IFLNK:
		return 'l';
	case S_IFSOCK:
		return 's';
	case S_IFREG:
	default:
		return '-';
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
movl %eax, -0x14(%rbp)
subl $0x1000, %eax           # imm = 0x1000
je 0x97ea
jmp 0x9790
movl -0x14(%rbp), %eax
subl $0x2000, %eax           # imm = 0x2000
je 0x97de
jmp 0x979c
movl -0x14(%rbp), %eax
subl $0x4000, %eax           # imm = 0x4000
je 0x97e4
jmp 0x97a8
movl -0x14(%rbp), %eax
subl $0x6000, %eax           # imm = 0x6000
je 0x97d8
jmp 0x97b4
movl -0x14(%rbp), %eax
subl $0x8000, %eax           # imm = 0x8000
je 0x97fc
jmp 0x97c0
movl -0x14(%rbp), %eax
subl $0xa000, %eax           # imm = 0xA000
je 0x97f0
jmp 0x97cc
movl -0x14(%rbp), %eax
subl $0xc000, %eax           # imm = 0xC000
je 0x97f6
jmp 0x97fe
movb $0x62, -0x1(%rbp)
jmp 0x9802
movb $0x62, -0x1(%rbp)
jmp 0x9802
movb $0x64, -0x1(%rbp)
jmp 0x9802
movb $0x70, -0x1(%rbp)
jmp 0x9802
movb $0x6c, -0x1(%rbp)
jmp 0x9802
movb $0x73, -0x1(%rbp)
jmp 0x9802
jmp 0x97fe
movb $0x2d, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: permission_characters
static void permission_characters(char *buffer, char mode)
{
	if(mode & 4)
		buffer[0] = 'r';
	else
		buffer[0] = '-';
	if(mode & 2)
		buffer[1] = 'w';
	else
		buffer[1] = '-';
	if(mode & 1)
		buffer[2] = 'x';
	else
		buffer[2] = '-';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movsbl -0x9(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x9833
movq -0x8(%rbp), %rax
movb $0x72, (%rax)
jmp 0x983a
movq -0x8(%rbp), %rax
movb $0x2d, (%rax)
movsbl -0x9(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x9850
movq -0x8(%rbp), %rax
movb $0x77, 0x1(%rax)
jmp 0x9858
movq -0x8(%rbp), %rax
movb $0x2d, 0x1(%rax)
movsbl -0x9(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x986e
movq -0x8(%rbp), %rax
movb $0x78, 0x2(%rax)
jmp 0x9876
movq -0x8(%rbp), %rax
movb $0x2d, 0x2(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: filesize_to_string
void filesize_to_string(wchar_t *buf, off_t filesize)
{
	char suffix[] = {' ', 'K', 'M', 'G', 'T', 'P', 'E'};
	size_t cs = 0;
	off_t cv = filesize;

	while(cv > 1024 && cs < sizeof(suffix) - 1) {
		filesize = cv;
		cv /= 1024;
		cs++;
	}

	if(cv >= 10000)
		wcscpy(buf, INFO_SIZE_OVERFLOW);
	else if(cv < 100 && cs > 0)
		swprintf(buf, 6, L"%lu.%1lu%c", cv, (filesize - cv * 1024) * 10 / 1024, suffix[cs]);
	else
		swprintf(buf, 6, L"%lu%c", cv, suffix[cs]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x39ca(%rip), %eax      # 0xd260
movl %eax, -0x17(%rbp)
movw 0x39c4(%rip), %ax       # 0xd264
movw %ax, -0x13(%rbp)
movb 0x39bc(%rip), %al       # 0xd266
movb %al, -0x11(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x400, -0x28(%rbp)     # imm = 0x400
movb %al, -0x29(%rbp)
jle 0x98d7
cmpq $0x6, -0x20(%rbp)
setb %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x98e0
jmp 0x9908
movq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movl $0x400, %ecx            # imm = 0x400
cqto
idivq %rcx
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x98bd
cmpq $0x2710, -0x28(%rbp)    # imm = 0x2710
jl 0x9924
movq -0x8(%rbp), %rdi
leaq 0x396b(%rip), %rsi      # 0xd288
callq 0x33e0
jmp 0x99a0
cmpq $0x64, -0x28(%rbp)
jge 0x9979
cmpq $0x0, -0x20(%rbp)
jbe 0x9979
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rdx
shlq $0xa, %rdx
subq %rdx, %rax
imulq $0xa, %rax, %rax
movl $0x400, %esi            # imm = 0x400
cqto
idivq %rsi
movq %rax, %r8
movq -0x20(%rbp), %rax
movsbl -0x17(%rbp,%rax), %r9d
movl $0x6, %esi
leaq 0x3930(%rip), %rdx      # 0xd2a0
movb $0x0, %al
callq 0x3410
jmp 0x999e
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movsbl -0x17(%rbp,%rax), %r8d
movl $0x6, %esi
leaq 0x3935(%rip), %rdx      # 0xd2cc
movb $0x0, %al
callq 0x3410
jmp 0x99a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: filedata_format_list_line
size_t filedata_format_list_line(struct filedata *filedata, wchar_t *buffer, size_t len, size_t width)
{
	wchar_t info[INFO_SEPARATOR_LENGTH + INFO_LINK_LENGTH + INFO_SIZE_DIR_LENGTH + 1];
	size_t info_size;
	size_t char_count = 0;
	size_t display_count = 0;

	info_size = render_info(info, filedata);

	if(width > info_size) {
		char_count = render_filename(buffer, len - info_size, width - info_size, filedata->filename);
		if(char_count + info_size > len)
			return char_count + info_size;

		display_count = wcswidth(buffer, len);
	} else
		info_size = width;


	if(display_count + info_size < width) {
		size_t padlength = width - display_count - info_size;

		if(char_count + padlength + info_size <= len)
			wmemset(&buffer[char_count], L' ', padlength);

		char_count += padlength;
	}
	buffer[char_count] = L'\0';

	if(char_count + info_size <= len)
		wcsncat(buffer, info + wcslen(info) - info_size, info_size);

	return char_count + info_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9b30
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x58(%rbp), %rax
jbe 0x9a4e
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
subq -0x58(%rbp), %rsi
movq -0x28(%rbp), %rdx
subq -0x58(%rbp), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
callq 0x9c40
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
addq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0x9a39
movq -0x60(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x9b16
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3180
cltq
movq %rax, -0x68(%rbp)
jmp 0x9a56
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x68(%rbp), %rax
addq -0x58(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x9aaf
movq -0x28(%rbp), %rax
subq -0x68(%rbp), %rax
subq -0x58(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rax
addq -0x70(%rbp), %rax
addq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
ja 0x9aa3
movq -0x18(%rbp), %rdi
movq -0x60(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x70(%rbp), %rdx
movl $0x20, %esi
callq 0x3330
movq -0x70(%rbp), %rax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x60(%rbp), %rax
addq -0x58(%rbp), %rax
cmpq -0x20(%rbp), %rax
ja 0x9b0a
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3280
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdi
shlq $0x2, %rax
addq %rax, %rsi
xorl %eax, %eax
subq -0x58(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq -0x58(%rbp), %rdx
callq 0x31b0
movq -0x60(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: render_info
static size_t render_info(wchar_t *buffer, struct filedata *filedata)
{
	size_t info_size = INFO_SIZE_DIR_LENGTH + 1;

	wcscpy(buffer, INFO_SEPARATOR);

	if(filedata->is_link) {
		info_size += INFO_LINK_LENGTH;
		if(filedata->is_link_broken)
			wcscat(buffer, INFO_LINK_BROKEN);
		else
			wcscat(buffer, INFO_LINK);
	}

	if(S_ISDIR(filedata->stat.st_mode))
		wcscat(buffer, INFO_DIR);
	else {
		wchar_t size[INFO_SIZE_DIR_LENGTH + 1] = L"? ";
		if(filedata->is_stat_valid)
			filesize_to_string(size, filedata->stat.st_size);
		swprintf(buffer + wcslen(buffer), sizeof(size)/sizeof(size[0]), L"%5ls", size);
	}

	return info_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x6, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x37a9(%rip), %rsi      # 0xd2fc
callq 0x33e0
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x9b9c
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x9b8a
movq -0x8(%rbp), %rdi
leaq 0x3761(%rip), %rsi      # 0xd2e4
callq 0x3050
jmp 0x9b9a
movq -0x8(%rbp), %rdi
leaq 0x375f(%rip), %rsi      # 0xd2f4
callq 0x3050
jmp 0x9b9c
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x9bc1
movq -0x8(%rbp), %rdi
leaq 0x374a(%rip), %rsi      # 0xd304
callq 0x3050
jmp 0x9c33
movq 0x36a8(%rip), %rax      # 0xd270
movq %rax, -0x30(%rbp)
movq 0x36a5(%rip), %rax      # 0xd278
movq %rax, -0x28(%rbp)
movq 0x36a2(%rip), %rax      # 0xd280
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0xa9(%rax)
je 0x9c00
leaq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x9880
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3280
movq -0x38(%rbp), %rdi
shlq $0x2, %rax
addq %rax, %rdi
leaq -0x30(%rbp), %rcx
movl $0x6, %esi
leaq 0x36f0(%rip), %rdx      # 0xd31c
movb $0x0, %al
callq 0x3410
movq -0x18(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: render_filename
static size_t render_filename(wchar_t *buffer, size_t len, size_t width, const char *filename)
{
	size_t char_count = 0, display_count = 0;
	size_t flen = strlen(filename);

	while(flen > 0) {
		wchar_t c;

		int consumed = mbtowc(&c, filename, flen);
		if(consumed < 0) {
			c = L'\uFFFD';
			consumed = 1;
		}

		flen -= consumed;
		filename += consumed;

		int w = wcwidth(c);
		if(w == -1)
			continue;
		if(w + display_count > width)
			break;

		if(char_count < len) {
			*buffer++ = c;
			display_count += w;
		}
		char_count++;
	}
	*buffer = L'\0';

	return char_count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3230
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jbe 0x9d26
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x3c(%rbp), %rdi
callq 0x3440
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jge 0x9ca8
movl $0xfffd, -0x3c(%rbp)    # imm = 0xFFFD
movl $0x1, -0x40(%rbp)
movslq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x38(%rbp)
movl -0x40(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x3c(%rbp), %edi
callq 0x3480
movl %eax, -0x44(%rbp)
cmpl $-0x1, -0x44(%rbp)
jne 0x9cdb
jmp 0x9c75
movslq -0x44(%rbp), %rax
addq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x9ceb
jmp 0x9d26
movq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x9d15
movl -0x3c(%rbp), %ecx
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x8(%rbp)
movl %ecx, (%rax)
movslq -0x44(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x9c75
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x28(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: filedata_delete
void filedata_delete(struct filedata *filedata)
{
	if(filedata == NULL)
		return;
	free((void *)filedata->filename);
	free(filedata);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x9f45
jmp 0x9f5a
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x3740
movq -0x8(%rbp), %rdi
callq 0x3740
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/list.c
// Function: list_new
struct list *list_new(size_t initial_size)
{
	struct list *list;

	list = malloc(sizeof(*list));
	if(list == NULL)
		return NULL;

	list->length = 0;
	list->allocated_items = initial_size;
	if(list->allocated_items == 0)
		list->allocated_items = 1;

	list->items = malloc(list->allocated_items * sizeof(void *));
	if(list->items == NULL) {
		free(list);
		return NULL;
	}

	return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x18, %edi
callq 0x3490
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x9f8b
movq $0x0, -0x8(%rbp)
jmp 0x9ffb
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x9fb9
movq -0x18(%rbp), %rax
movq $0x1, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
callq 0x3490
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x9ff3
movq -0x18(%rbp), %rdi
callq 0x3740
movq $0x0, -0x8(%rbp)
jmp 0x9ffb
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/list.c
// Function: list_delete
void list_delete(const struct list *list, list_item_deallocator deallocator)
{
	if(list == NULL)
		return;
	if(deallocator)
		for(size_t i = 0; i < list->length; i++)
			deallocator(list->items[i]);
	free(list->items);
	free((void *)list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xa029
jmp 0xa081
cmpq $0x0, -0x10(%rbp)
je 0xa06b
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xa069
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
callq *%rax
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xa038
jmp 0xa06b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x3740
movq -0x8(%rbp), %rdi
callq 0x3740
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/list.c
// Function: list_append
bool list_append(struct list *list, void *item)
{
	if(list->length == list->allocated_items)
		if(!list_make_room(list))
			return false;

	list->items[list->length] = item;
	list->length++;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xa0e6
movq -0x10(%rbp), %rdi
callq 0xa120
testb $0x1, %al
jne 0xa0e4
movb $0x0, -0x1(%rbp)
jmp 0xa10f
jmp 0xa0e6
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/list.c
// Function: list_make_room
static bool list_make_room(struct list *list)
{
	void *newitems = realloc(list->items, 2 * list->allocated_items * sizeof(void *));
	if(newitems == NULL)
		return false;

	list->allocated_items *= 2;
	list->items = newitems;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq %rsi
shlq $0x3, %rsi
callq 0x3520
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa159
movb $0x0, -0x1(%rbp)
jmp 0xa178
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
shlq %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
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/list.c
// Function: list_insert
bool list_insert(struct list *list, size_t index, void *item)
{
	assert(index <= list->length);

	if(list->length == list->allocated_items)
		if(!list_make_room(list))
			return false;

	memmove(&list->items[index + 1], &list->items[index], (list->length - index) * sizeof(list->items[0]));
	list->items[index] = item;
	list->length++;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
ja 0xa1b3
jmp 0xa1d2
leaq 0x3176(%rip), %rdi      # 0xd330
leaq 0x3185(%rip), %rsi      # 0xd346
movl $0x4e, %edx
leaq 0x3184(%rip), %rcx      # 0xd351
callq 0x32c0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xa1f8
movq -0x10(%rbp), %rdi
callq 0xa120
testb $0x1, %al
jne 0xa1f6
movb $0x0, -0x1(%rbp)
jmp 0xa25c
jmp 0xa1f8
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
addq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
subq -0x18(%rbp), %rdx
shlq $0x3, %rdx
callq 0x35b0
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/list.c
// Function: list_move_item
void list_move_item(struct list *list, size_t oldindex, size_t newindex)
{
	assert(oldindex < list->length);
	assert(newindex < list->length);

	void *item = list->items[oldindex];

	if(oldindex < newindex)
		memmove(&list->items[oldindex], &list->items[oldindex + 1], (newindex - oldindex) * sizeof(list->items[0]));
	else
		memmove(&list->items[newindex + 1], &list->items[newindex], (oldindex - newindex) * sizeof(list->items[0]));

	list->items[newindex] = item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xa293
jmp 0xa2b2
leaq 0x30e8(%rip), %rdi      # 0xd382
leaq 0x30a5(%rip), %rsi      # 0xd346
movl $0x5d, %edx
leaq 0x30ed(%rip), %rcx      # 0xd39a
callq 0x32c0
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xa2c1
jmp 0xa2e0
leaq 0x3105(%rip), %rdi      # 0xd3cd
leaq 0x3077(%rip), %rsi      # 0xd346
movl $0x5e, %edx
leaq 0x30bf(%rip), %rcx      # 0xd39a
callq 0x32c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0xa33b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
addq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x18(%rbp), %rdx
subq -0x10(%rbp), %rdx
shlq $0x3, %rdx
callq 0x35b0
jmp 0xa376
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
addq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x10(%rbp), %rdx
subq -0x18(%rbp), %rdx
shlq $0x3, %rdx
callq 0x35b0
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/list.c
// Function: list_find_item_or_insertpoint
bool list_find_item_or_insertpoint(const struct list *list, int (*compare)(const void *, const void *), const void *item, size_t *index)
{
	void *currentitem;
	size_t min, middle, max;
	int ret;

	if(list_length(list) == 0) {
		*index = 0;
		return false;
	}

	min = 0;
	max = list_length(list) - 1;

	while(min < max) {
		middle = (min + max) / 2;
		currentitem = list_get_item(list, middle);
		ret = compare(&item, &currentitem);
		if(ret <= 0)
			max = middle;
		else
			min = middle + 1;
	}

	*index = min;
	currentitem = list_get_item(list, *index);
	ret = compare(&item, &currentitem);

	if(ret > 0 && *index == list_length(list) - 1)
		*index = list_length(list);
	return ret == 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa090
cmpq $0x0, %rax
jne 0xa56b
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0xa650
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa090
subq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0xa5da
movq -0x38(%rbp), %rax
addq -0x48(%rbp), %rax
shrq %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xa430
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq *-0x18(%rbp)
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jg 0xa5cc
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xa5d8
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xa584
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0xa430
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq *-0x18(%rbp)
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jle 0xa644
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa090
movq %rax, %rcx
movq -0x58(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0xa644
movq -0x10(%rbp), %rdi
callq 0xa090
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0x4c(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/listmodel.c
// Function: listmodel_register_change_callback
bool listmodel_register_change_callback(struct listmodel *model, model_change_callback callback, void *data)
{
	if(model->change_callbacks == NULL)
		model->change_callbacks = list_new(0);

	if(model->change_callbacks == NULL)
		return false;

	struct callback *cb = malloc(sizeof(*cb));
	if(cb == NULL)
		return false;

	cb->cb = callback;
	cb->data = data;

	if(!list_append(model->change_callbacks, cb)) {
		free(cb);
		return false;
	}

	return true;
}

// 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
cmpq $0x0, 0x20(%rax)
jne 0xa793
xorl %eax, %eax
movl %eax, %edi
callq 0x9f60
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xa7a4
movb $0x0, -0x1(%rbp)
jmp 0xa7fe
movl $0x10, %edi
callq 0x3490
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xa7bf
movb $0x0, -0x1(%rbp)
jmp 0xa7fe
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0xa0b0
testb $0x1, %al
jne 0xa7fa
movq -0x28(%rbp), %rdi
callq 0x3740
movb $0x0, -0x1(%rbp)
jmp 0xa7fe
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/listmodel.c
// Function: listmodel_unregister_change_callback
void listmodel_unregister_change_callback(struct listmodel *model, model_change_callback callback, void *data)
{
	struct list *list = model->change_callbacks;
	struct callback *cb;
	size_t length = list_length(list);;

	for(size_t i = 0; i < length; i++) {
		cb = list_get_item(list, i);
		if(cb->cb == callback && cb->data == data) {
			free(cb);
			list_remove(list, i);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa090
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0xa8a1
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xa430
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0xa891
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xa891
movq -0x28(%rbp), %rdi
callq 0x3740
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xa390
jmp 0xa893
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xa845
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/listmodel.c
// Function: listmodel_notify_change
void listmodel_notify_change(struct listmodel *model, enum model_change change, size_t newindex, size_t oldindex)
{
	struct list *list = model->change_callbacks;
	if(list == NULL)
		return;

	struct callback *cb;
	size_t length = list_length(list);;

	for(size_t i = 0; i < length; i++) {
		cb = list_get_item(list, i);
		cb->cb(change, newindex, oldindex, cb->data);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xa8dc
jmp 0xa936
movq -0x28(%rbp), %rdi
callq 0xa090
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0xa936
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xa430
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
callq *%rax
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xa8f1
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/listview.c
// Function: attrs_for_index
static int attrs_for_index(struct listmodel *model, size_t index, size_t selected)
{
	if(index == selected) {
		if(listmodel_ismarked(model, index))
			return A_BOLD | COLOR_PAIR(3);
		else
			return A_BOLD | COLOR_PAIR(1);
	} else {
		if(listmodel_ismarked(model, index))
			return COLOR_PAIR(2);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0xabd3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa710
testb $0x1, %al
jne 0xabc1
jmp 0xabca
movl $0x200300, -0x4(%rbp)   # imm = 0x200300
jmp 0xabf8
movl $0x200100, -0x4(%rbp)   # imm = 0x200100
jmp 0xabf8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa710
testb $0x1, %al
jne 0xabe6
jmp 0xabef
movl $0x200, -0x4(%rbp)      # imm = 0x200
jmp 0xabf8
jmp 0xabf1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/listview.c
// Function: listview_pageup
void listview_pageup(struct listview *view)
{
	unsigned int rowcount = getmaxy(view->window);

	if(view->index == view->first)
		listview_setindex_internal(view, view->index - rowcount, -1, false);
	else
		listview_setindex_internal(view, view->first, -1, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
je 0xae6a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xae74
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x10(%rbp)
jmp 0xae74
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xaeac
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0xc(%rbp), %eax
subq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0xac40
jmp 0xaec4
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0xac40
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/listview.c
// Function: listview_pagedown
void listview_pagedown(struct listview *view)
{
	unsigned int rowcount = getmaxy(view->window);

	if(view->index - view->first < rowcount - 1)
		listview_setindex_internal(view, view->first + rowcount - 1, 1, false);
	else
		listview_setindex_internal(view, view->index + rowcount, 1, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
je 0xaefa
movq -0x8(%rbp), %rax
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xaf04
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x10(%rbp)
jmp 0xaf04
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
subq 0x10(%rcx), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0xaf4b
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0xc(%rbp), %eax
addq %rax, %rsi
subq $0x1, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xac40
jmp 0xaf69
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0xc(%rbp), %eax
addq %rax, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xac40
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/listview.c
// Function: listview_init
bool listview_init(struct listview *view, struct listmodel *model, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
{
	view->window = newwin(height, width, y, x);
	if(view->window == NULL)
		return false;

	view->index = 0;
	view->first = 0;
	view->model = model;
	view->needs_refresh = true;

	if(!listmodel_register_change_callback(view->model, change_cb, view)) {
		delwin(view->window);
		view->window = NULL;
		return false;
	}

	listview_refresh(view);

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl -0x28(%rbp), %edi
movl -0x24(%rbp), %esi
movl -0x20(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x3030
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xb069
movb $0x0, -0x1(%rbp)
jmp 0xb0db
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x48(%rip), %rsi        # 0xb0f0
callq 0xa760
testb $0x1, %al
jne 0xb0ce
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x31e0
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0xb0db
movq -0x10(%rbp), %rdi
callq 0xa990
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3230
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3230
movq %rax, %rcx
movq -0x20(%rbp), %rax
addq %rcx, %rax
addq $0x2, %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0xb3aa
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xb3e0
testb $0x1, %al
jne 0xb3a8
movb $0x0, -0x1(%rbp)
jmp 0xb3d1
jmp 0xb360
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x1dcd(%rip), %rsi      # 0xd185
callq 0x3670
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x3670
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/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xb401
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xb410
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0xb45e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x3520
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xb447
movb $0x0, -0x1(%rbp)
jmp 0xb462
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xb495
movb $0x0, -0x1(%rbp)
jmp 0xb4cb
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x2f, %esi
callq 0x32b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0xb4c7
movq -0x20(%rbp), %rcx
addq $0x1, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
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/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3310
cmpq $0x0, %rax
jne 0xb531
callq 0x30d0
cmpl $0x22, (%rax)
jne 0xb529
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xb3e0
testb $0x1, %al
jne 0xb527
movb $0x0, -0x1(%rbp)
jmp 0xb535
jmp 0xb52f
movb $0x0, -0x1(%rbp)
jmp 0xb535
jmp 0xb4ec
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq