LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_yankregion_f
static
void buffer_yankregion_f(buffer_t *buf, const region_t *region, point_t *out)
{
	list_t *yanked = list_delregion(&buf->head, region);

	if(yanked){
		yank *yank = yank_new(yanked, region->type);
		yank_push(yank);

		point_t ui_pos = region->begin;

		buffer_insyank(buf, yank, &ui_pos,
				/*prepend:*/true, /*modify:*/false);

		release(yank, yank_free);
	}

	/* restore ui pos (set in buffer_insyank) */
	*out = region->begin;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x8, %r15
movq %r15, %rdi
callq 0x9a81
testq %rax, %rax
je 0x8f59
movl 0x10(%r14), %esi
movq %rax, %rdi
callq 0xbdd8
movq %rax, %r12
movq %rax, %rdi
callq 0xbe3d
movq (%r14), %rax
leaq 0x4(%rsp), %rcx
movq %rax, -0x4(%rcx)
pushq $0x1
popq %rdx
movq %rsp, %r8
movq %r12, %rdi
movq %r15, %rsi
callq 0xbe72
leaq 0x2ed7(%rip), %rsi      # 0xbe28
movq %r12, %rdi
callq 0xc25f
movq (%r14), %rax
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_insyank
void buffer_insyank(
		buffer_t *buf, const yank *y,
		point_t *ui_pos,
		bool prepend, bool modify)
{
	yank_put_in_list(y,
			&buf->head,
			prepend,
			&ui_pos->y,
			&ui_pos->x);

	if(modify)
		buf->modified = true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rdx, %r8
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
leaq 0x4(%rdx), %r9
movq %rax, %rdi
movl %ecx, %edx
movq %r9, %rcx
callq 0xbe72
testl %ebp, %ebp
je 0x8f97
movb $0x1, 0x39(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_caseregion
void buffer_caseregion(
		buffer_t *buf,
		enum case_tog tog_type,
		const region_t *r)
{
	int (*f)(int) = NULL;

	switch(tog_type){
		case CASE_TOGGLE: f = ctoggle; break;
		case CASE_UPPER:  f = toupper; break;
		case CASE_LOWER:  f = tolower; break;
	}
	assert(f);

	list_iter_region(buf->head, r, 0, buffer_case_cb, &f);
	buf->modified = true;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x2, %esi
je 0x9006
cmpl $0x1, %esi
je 0x8ffd
testl %esi, %esi
jne 0x9036
leaq 0x5a(%rip), %rax        # 0x9055
jmp 0x900d
movq 0xcf94(%rip), %rax      # 0x15f98
jmp 0x900d
movq 0xcfbb(%rip), %rax      # 0x15fc8
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rdi
leaq 0x5d(%rip), %rcx        # 0x907a
leaq 0x8(%rsp), %r8
movq %rdx, %rsi
xorl %edx, %edx
callq 0xa1fa
movb $0x1, 0x39(%rbx)
addq $0x10, %rsp
popq %rbx
retq
leaq 0x5100(%rip), %rdi      # 0xe13d
leaq 0x555b(%rip), %rsi      # 0xe59f
leaq 0x555d(%rip), %rcx      # 0xe5a8
movl $0x1e2, %edx            # imm = 0x1E2
callq 0x4210
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_findat
bool buffer_findat(const buffer_t *buf, const char *search, point_t *at, int dir)
{
	list_t *l = list_seek(buf->head, at->y, 0);

	if(!l){
		if(dir < 0){
			l = list_last(buf->head, &at->y);
		}else{
			return false;
		}
	}

	/* search at the next char */
	l = list_advance_x(l, dir, &at->y, &at->x);

	while(l){
		char *p;
		if((unsigned)at->x < l->len_line
		&& (p = buffer_find2(l->line, l->len_line, search, at->x, dir)))
		{
			at->x = p - l->line;
			at->y = at->y;
			return true;
		}

		l = list_advance_y(l, dir, &at->y, &at->x);
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq 0x8(%rdi), %rdi
leaq 0x4(%rdx), %r15
movl 0x4(%rdx), %esi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x9136
movq %rax, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xa38f
movq %rax, %r12
testq %rax, %rax
je 0x913a
movl (%rbx), %esi
movq 0x8(%r12), %rax
subq %rsi, %rax
jbe 0x9124
movq (%r12), %rdi
testl %ebp, %ebp
js 0x9117
addq %rsi, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0xb57b
jmp 0x911f
movq %r14, %rdx
callq 0xb52f
testq %rax, %rax
jne 0x913e
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xa350
jmp 0x90eb
testl %ebp, %ebp
js 0x914f
xorl %eax, %eax
jmp 0x9146
subl (%r12), %eax
movl %eax, (%rbx)
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r12), %rdi
movq %r15, %rsi
callq 0xa3ba
jmp 0x90db
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_joinregion_f
static
void buffer_joinregion_f(
		buffer_t *buf,
		const region_t *region,
		point_t *out,
		const bool space)
{
	/* could use 'how' here - columns and lines only make sense */
	list_t *l = list_seek(buf->head, region->begin.y, 0);
	const int mid = l ? l->len_line : 0;

	list_joinregion(&buf->head, region, space);

	if(l)
		out->x = mid;
	buf->modified = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdi), %r12
movq 0x8(%rdi), %rdi
movl 0x4(%rsi), %esi
xorl %r14d, %r14d
xorl %edx, %edx
callq 0x9737
movq %rax, %r13
testq %rax, %rax
je 0x9199
movl 0x8(%r13), %r14d
movzbl %bpl, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x9eb0
testq %r13, %r13
je 0x91b4
movq (%rsp), %rax
movl %r14d, (%rax)
movb $0x1, 0x39(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_indent2
static
void buffer_indent2(
		buffer_t *buf, const region_t *region,
		point_t *out, int dir)
{
	/* region is sorted by y */
	const int min_x = MIN(region->begin.x, region->end.x);
	list_t *pos = dir < 0
		? list_seek(buf->head, region->begin.y, 0)
		: NULL;

	for(int y = region->begin.y; y <= region->end.y; y++){
		int x = 0;

		switch(region->type){
			case REGION_CHAR:
			case REGION_LINE:
				break;
			case REGION_COL:
				/* indent from the first col onwards */
				x = min_x;
		}

		if(dir > 0){
			buffer_inschar_at(buf, '\t', &x, &y);
		}else{
			if(pos){
				if(pos->len_line > 0 && pos->line[0] == '\t')
					memmove(pos->line, pos->line + 1, --pos->len_line);

				pos = pos->next;
			}else{
				break;
			}
		}
	}
	buf->modified = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
movl 0x8(%rsi), %r13d
cmpl %r13d, %eax
cmovll %eax, %r13d
xorl %r15d, %r15d
testl %edx, %edx
jns 0x9200
movq 0x8(%rbx), %rdi
movl 0x4(%r14), %esi
xorl %edx, %edx
callq 0x9737
movq %rax, %r15
movl 0x4(%r14), %eax
movq %rsp, %r12
movl %eax, (%rsp)
cmpl 0xc(%r14), %eax
jg 0x926c
cmpl $0x1, 0x10(%r14)
movl $0x0, %eax
cmovel %r13d, %eax
movl %eax, 0x4(%rsp)
testl %ebp, %ebp
jle 0x923b
movq %rbx, %rdi
pushq $0x9
popq %rsi
leaq 0x4(%rsp), %rdx
movq %r12, %rcx
callq 0x8d6f
jmp 0x9265
testq %r15, %r15
je 0x926c
movq 0x8(%r15), %rdx
testq %rdx, %rdx
je 0x9261
movq (%r15), %rdi
cmpb $0x9, (%rdi)
jne 0x9261
leaq 0x1(%rdi), %rsi
decq %rdx
movq %rdx, 0x8(%r15)
callq 0x4400
movq 0x18(%r15), %r15
movl (%rsp), %eax
incl %eax
jmp 0x9207
movb $0x1, 0x39(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_copy_deep
list_t *list_copy_deep(const list_t *const l, list_t *prev)
{
	if(!l)
		return NULL;
	list_t *new = list_new(prev);
	new->len_line = l->len_line;
	new->len_malloc = l->len_line; /* len_line, not len_malloc */
	new->line = ustrdup_len(l->line, l->len_line);
	new->next = list_copy_deep(l->next, new);
	return new;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x92d2
movq %rdi, %r14
movq %rsi, %rdi
callq 0x9280
movq %rax, %rbx
movq 0x8(%r14), %rsi
movq %rsi, 0x8(%rax)
movq %rsi, 0x10(%rax)
movq (%r14), %rdi
callq 0x5690
movq %rax, (%rbx)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x9292
movq %rax, 0x18(%rbx)
jmp 0x92d4
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_new_fd
static list_t *list_new_fd(int fd, bool *eol)
{
	struct stat st;
	if(fstat(fd, &st) == -1)
		return NULL;

	if(st.st_size == 0)
		goto fallback; /* could be stdin */

	if(S_ISDIR(st.st_mode)){
		errno = EISDIR;
		return NULL;
	}

	void *mem = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);

	if(mem == MAP_FAILED){
		if(errno == EINVAL)
fallback:
			return list_new_fd_read(fd, eol);

		return NULL;
	}

	list_t *l = mmap_to_lines(mem, st.st_size, eol);
	munmap(mem, st.st_size);

	return l;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r14
movl %edi, %ebp
leaq 0x28(%rsp), %rsi
callq 0x4510
cmpl $-0x1, %eax
je 0x933e
movq 0x58(%rsp), %r15
testq %r15, %r15
je 0x93ec
movl $0xf000, %eax           # imm = 0xF000
andl 0x40(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x9346
callq 0x40a0
movl $0x15, (%rax)
xorl %r14d, %r14d
jmp 0x948e
pushq $0x1
popq %rdx
pushq $0x2
popq %rcx
xorl %edi, %edi
movq %r15, %rsi
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x4190
cmpq $-0x1, %rax
je 0x93de
movq %rax, %rbx
movq %r14, 0x18(%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x9280
movq %rax, %r14
leaq 0x10(%rsp), %r13
movq %rax, (%r13)
leaq (%rbx,%r15), %rax
movq %rax, 0x20(%rsp)
movq %rsp, %rbp
movq %rbx, (%rbp)
cmpq %r12, %r15
je 0x93ae
leaq (%rbx,%r12), %rsi
cmpb $0xa, (%rsi)
jne 0x93a9
movq %r13, %rdi
movq %rbp, %rdx
callq 0xa668
incq %r12
jmp 0x9390
movq 0x20(%rsp), %rsi
cmpq (%rsp), %rsi
movq 0x18(%rsp), %rax
sete (%rax)
je 0x93ce
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0xa668
movq %rbx, %rdi
movq %r15, %rsi
callq 0x43f0
jmp 0x948e
callq 0x40a0
cmpl $0x16, (%rax)
jne 0x933e
movq %r14, 0x18(%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x9280
movq %rax, %r14
leaq 0x10(%rsp), %rax
andl $0x0, (%rax)
movq %rsp, %rax
andl $0x0, (%rax)
leaq 0xc(%rsp), %rax
andl $0x0, (%rax)
movb $0x1, %r13b
pushq $0x1
popq %rbx
movl %ebp, %edi
leaq 0xc(%rsp), %rsi
movq %rbx, %rdx
callq 0x42b0
cmpl $0x1, %eax
jne 0x947f
movl %r12d, %r15d
testb $0x1, %r12b
je 0x9451
movq %r14, %rdi
movq %rsp, %rsi
leaq 0x10(%rsp), %rdx
pushq $0xa
popq %rcx
pushq $0x20
popq %r8
callq 0x98d7
xorl %r15d, %r15d
movl 0xc(%rsp), %eax
movb $0x1, %r12b
xorl %r13d, %r13d
cmpl $0xa, %eax
je 0x941a
movsbl %al, %ecx
movq %r14, %rdi
movq %rsp, %rsi
leaq 0x10(%rsp), %rdx
pushq $0x20
popq %r8
callq 0x98d7
xorl %r13d, %r13d
movl %r15d, %r12d
jmp 0x941a
andb $0x1, %r12b
orb %r13b, %r12b
movq 0x18(%rsp), %rax
movb %r12b, (%rax)
movq %r14, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_from_dir
list_t *list_from_dir(DIR *d)
{
	list_t *head = list_new(NULL), *prev = NULL;
	int dfd = dirfd(d);

	struct dirent *dent;
	while((errno = 0, dent = readdir(d))){
		size_t len = strlen(dent->d_name);
		struct stat st;
		const bool is_dir = (dfd != -1
				&& fstatat(dfd, dent->d_name, &st, 0) == 0
				&& S_ISDIR(st.st_mode));

		char *line;
		if(is_dir){
			len++;
			line = umalloc(len + 1);
			snprintf(line, len + 1, "%s/", dent->d_name);

		}else{
			line = ustrdup_len(dent->d_name, len);
		}

		list_t *l;

		if(!head->line){
			l = head;
		}else{
			assert(prev);
			l = list_new(prev);
			prev->next = l;
		}
		prev = l;

		l->line = line;
		l->len_line = len;
		l->len_malloc = len + 1;
	}

	if(errno){
		int save = errno;
		list_free(head);
		head = NULL;
		errno = save;
	}

	return head;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %r14
xorl %edi, %edi
callq 0x9280
movq %rax, %rbx
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0x4300
movl %eax, 0x4(%rsp)
callq 0x40a0
movq %rax, %r15
xorl %r13d, %r13d
andl $0x0, (%r15)
movq 0x10(%rsp), %rdi
callq 0x4390
testq %rax, %rax
je 0x95b1
movq %rax, %r14
movq %r15, %rbp
addq $0x13, %r14
movq %r14, %rdi
callq 0x4170
movq %rax, %r12
cmpl $-0x1, 0x4(%rsp)
je 0x9570
movl 0x4(%rsp), %edi
movq %r14, %rsi
leaq 0x18(%rsp), %rdx
xorl %ecx, %ecx
callq 0x4530
testl %eax, %eax
jne 0x9570
movl 0x30(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x9570
leaq 0x1(%r12), %rax
movq %rax, 0x8(%rsp)
addq $0x2, %r12
movq %r12, %rdi
callq 0x5648
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
leaq 0x508d(%rip), %rdx      # 0xe5ec
movq %r14, %rcx
xorl %eax, %eax
callq 0x41e0
movq 0x8(%rsp), %r12
jmp 0x957e
movq %r14, %rdi
movq %r12, %rsi
callq 0x5690
movq %rax, %r15
cmpq $0x0, (%rbx)
movq %rbx, %rax
je 0x9598
testq %r13, %r13
je 0x95da
movq %r13, %rdi
callq 0x9280
movq %rax, 0x18(%r13)
movq %r15, (%rax)
movq %r12, 0x8(%rax)
incq %r12
movq %r12, 0x10(%rax)
movq %rax, %r13
movq %rbp, %r15
jmp 0x94dd
movl (%r15), %ebp
testl %ebp, %ebp
je 0x95c5
movq %rbx, %rdi
callq 0x95f9
movl %ebp, (%r15)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5309(%rip), %rdi      # 0xe8ea
leaq 0x5008(%rip), %rsi      # 0xe5f0
leaq 0x5008(%rip), %rcx      # 0xe5f7
movl $0xcc, %edx
callq 0x4210
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_free
void list_free(list_t *l)
{
	while(l){
		list_t *next = l->next;

		free(l->line);
		free(l);

		l = next;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rbx, %rbx
je 0x961e
movq (%rbx), %rdi
movq 0x18(%rbx), %r14
callq 0x4080
movq %rbx, %rdi
callq 0x4080
movq %r14, %rbx
jmp 0x9600
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_write_fd
static int list_write_fd(list_t *l, int n, int fd, bool eol)
{
	for(; l && (n == -1 || n --> 0); l = l->next){
		if(write(fd, l->line, l->len_line) != (int)l->len_line)
			goto got_err;

		if(l->next || eol)
			if(write(fd, "\n", 1) != 1)
				goto got_err;
	}

	return 0;
got_err:
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
pushq $-0x1
popq %r15
xorb $0x1, %bpl
pushq $0x1
popq %r12
testq %rdi, %rdi
je 0x96cb
movq %rdi, %rbx
movl %r15d, %r13d
cmpl $-0x1, %esi
je 0x967d
testl %esi, %esi
jle 0x96cb
decl %esi
movl %esi, %r13d
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movl %r14d, %edi
callq 0x4110
movslq 0x8(%rbx), %rcx
cmpq %rcx, %rax
jne 0x96cf
cmpq $0x0, 0x18(%rbx)
sete %al
movl %r13d, %esi
movl $0x0, %edi
testb %bpl, %al
jne 0x9664
movl %r14d, %edi
leaq 0x5094(%rip), %rsi      # 0xe748
movq %r12, %rdx
callq 0x4110
cmpq $0x1, %rax
jne 0x96cf
movq 0x18(%rbx), %rdi
movl %r13d, %esi
jmp 0x9664
xorl %eax, %eax
jmp 0x96d2
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_seekp
list_t **list_seekp(list_t **pl, int y, bool creat)
{
	if(!*pl){
		if(creat)
			*pl = list_new(NULL);
		else
			return NULL;
	}

	while(y > 0){
		if(!(*pl)->next){
			if(creat)
				(*pl)->next = list_new(*pl);
			else
				return NULL;
		}

		pl = &(*pl)->next;
		y--;
	}

	return pl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
cmpq $0x0, (%rdi)
jne 0x9700
testb %bl, %bl
je 0x972c
xorl %edi, %edi
callq 0x9280
movq %rax, (%r14)
testl %ebp, %ebp
jle 0x972f
movq (%r14), %rdi
cmpq $0x0, 0x18(%rdi)
jne 0x9721
testb %bl, %bl
je 0x972c
callq 0x9280
movq (%r14), %rcx
movq %rax, 0x18(%rcx)
movq (%r14), %rdi
addq $0x18, %rdi
decl %ebp
movq %rdi, %r14
jmp 0x9700
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_evalnewlines1
int list_evalnewlines1(list_t *l)
{
	if(l->len_line == 0)
		return 0;

	int r = 0;
	for(size_t i = l->len_line - 1; ; i--){
		char ch = l->line[i];

		if(ch == '\n' /* XXX: not '\r' / ^M */){
			int cut_len = l->len_line - i;
			char *cut;
			if(cut_len > 0){
				cut = umalloc(cut_len);
				/* cut_len-1, don't copy the \n */
				memcpy(cut, l->line + i + 1, cut_len-1);
			}else{
				cut = NULL;
				cut_len = 0;
			}

			l->len_line = i;

			/* insert a line after */
			list_insline(&l, &(int){0}, &(int){0}, 1);

			list_t *nl = l->next;
			nl->line = cut;
			nl->len_malloc = cut_len;
			nl->len_line = cut_len - 1;

			r = 1; /* we replaced */
		}

		if(i == 0)
			break;
	}

	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x9852
leaq -0x1(%rax), %r14
movabsq $0x100000000, %r15      # imm = 0x100000000
subq %rax, %r15
pushq $0x1
popq %r12
subq %rax, %r12
pushq $0x1
popq %rcx
movl %ecx, %ebx
subl %eax, %ebx
xorl %ebp, %ebp
movq 0x8(%rsp), %rcx
movq (%rcx), %rdx
cmpb $0xa, (%rdx,%r14)
jne 0x983d
movq 0x8(%rcx), %rbp
leaq (%rbx,%rbp), %r13
testl %r13d, %r13d
jle 0x97ed
leaq (%r12,%rbp), %rdi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
callq 0x5648
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
leaq (%rax,%r14), %rsi
incq %rsi
addl %r15d, %ebp
movq %rdi, 0x18(%rsp)
movq %rbp, %rdx
callq 0x4360
movq 0x8(%rsp), %rcx
jmp 0x97f9
xorl %r13d, %r13d
movq $0x0, 0x18(%rsp)
movq %r14, 0x8(%rcx)
andl $0x0, 0x14(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x24(%rsp), %rsi
leaq 0x14(%rsp), %rdx
pushq $0x1
popq %rbp
movl %ebp, %ecx
callq 0x9865
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
movl %r13d, %ecx
movq %rcx, 0x10(%rax)
decl %r13d
movslq %r13d, %rcx
movq %rcx, 0x8(%rax)
incq %r15
incq %r12
incq %rbx
addq $-0x1, %r14
jb 0x9795
jmp 0x9854
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_insline
void list_insline(list_t **pl, int *x, int *y, int dir)
{
	list_t *l, *save;

	*x = 0;

	if(dir < 0 && *y == 0){
		/* special case */
		l = *pl;
		(*pl = list_new(NULL))->next = l;
		if(l)
			l->prev = *pl;
		return;
	}

	if(dir < 0)
		--*y;

	/* list_seekp() to create if necessary,
	 * and make that creation available in *pl */
	l = *list_seekp(pl, *y, true);

	save = l->next;
	l->next = list_new(l);
	l->next->next = save;
	if(save)
		save->prev = l->next;

	++*y;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
andl $0x0, (%rsi)
movq %rdx, %rbx
movq %rdi, %r14
movl (%rdx), %esi
testl %ecx, %ecx
jns 0x9881
testl %esi, %esi
je 0x98b8
decl %esi
movl %esi, (%rbx)
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x96e1
movq (%rax), %r14
movq 0x18(%r14), %r15
movq %r14, %rdi
callq 0x9280
movq %rax, 0x18(%r14)
movq %r15, 0x18(%rax)
testq %r15, %r15
je 0x98b0
movq 0x18(%r14), %rax
movq %rax, 0x20(%r15)
incl (%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rbx
xorl %edi, %edi
callq 0x9280
movq %rax, (%r14)
movq %rbx, 0x18(%rax)
testq %rbx, %rbx
je 0x98b2
movq (%r14), %rax
movq %rax, 0x20(%rbx)
jmp 0x98b2
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_inschar
void list_inschar(
		list_t *l, int *x, int *y,
		char ch, char gapchar)
{
	l = list_seek(l, *y, true);

	if((unsigned)*x >= l->len_malloc){
		const int old_len = l->len_malloc;

		l->len_malloc = *x + 1;
		l->line = urealloc(l->line, l->len_malloc);

		memset(l->line + old_len, 0, l->len_malloc - old_len);
	}else{
		/* shift stuff up */
		l->line = urealloc(l->line, ++l->len_malloc);
		memmove(l->line + *x + 1, l->line + *x, l->len_malloc - *x - 1);
	}

	if(!gapchar){
		/* autogap */
		for(int i = 0; i < *x && (unsigned)i < l->len_line; i++){
			if(!isspace(l->line[i])){
				gapchar = ' ';
				break;
			}
		}

		if(!gapchar){
			/* all space, go with a tab */
			gapchar = '\t';
		}
	}

	for(int i = l->len_line; i < *x; i++){
		l->line[i] = gapchar;
		l->len_line++;
	}

	l->line[*x] = ch;
	l->len_line++;
	if(list_evalnewlines1(l)){
		*x = 0;
		++*y;
	}else{
		++*x;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r12d
movl %ecx, 0x4(%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movl (%rdx), %esi
pushq $0x1
popq %rdx
callq 0x9737
movq %rax, %r15
movl (%r14), %eax
movq 0x10(%r15), %r13
cmpq %rax, %r13
jbe 0x9939
movq (%r15), %rdi
incq %r13
movq %r13, 0x10(%r15)
movq %r13, %rsi
callq 0x5660
movq %rax, (%r15)
movslq (%r14), %rdx
leaq (%rax,%rdx), %rdi
incq %rdi
leaq (%rax,%rdx), %rsi
notq %rdx
addq 0x10(%r15), %rdx
callq 0x4400
jmp 0x9963
movslq %eax, %rsi
incq %rsi
movq %rsi, 0x10(%r15)
movq (%r15), %rdi
callq 0x5660
movq %rax, (%r15)
movslq %r13d, %rcx
leaq (%rax,%rcx), %rdi
movq 0x10(%r15), %rdx
subq %rcx, %rdx
xorl %esi, %esi
callq 0x4240
testb %r12b, %r12b
je 0x99a1
movslq 0x8(%r15), %rax
movslq (%r14), %rcx
movq (%r15), %rdx
cmpq %rcx, %rax
jge 0x9984
movb %r12b, (%rdx,%rax)
incq 0x8(%r15)
incq %rax
jmp 0x996c
movl 0x4(%rsp), %eax
movb %al, (%rdx,%rcx)
incq 0x8(%r15)
movq %r15, %rdi
callq 0x9754
testl %eax, %eax
je 0x99da
andl $0x0, (%r14)
jmp 0x99dd
movl (%r14), %r13d
xorl %ebp, %ebp
testl %r13d, %r13d
cmovlel %ebp, %r13d
movb $0x9, %r12b
cmpq %rbp, %r13
je 0x9968
cmpq %rbp, 0x8(%r15)
jbe 0x9968
callq 0x4540
movq (%rax), %rax
movq (%r15), %rcx
movsbq (%rcx,%rbp), %rcx
incq %rbp
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x99ad
movb $0x20, %r12b
jmp 0x9968
movq %r14, %rbx
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_delchar
void list_delchar(list_t *l, int *x, int *y)
{
	l = list_seek(l, *y, false);

	--*x;

	if(!l)
		return;

	if((unsigned)*x >= l->len_line)
		return;

	memmove(l->line + *x, l->line + *x + 1, --l->len_line - *x);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movl (%rdx), %esi
xorl %edx, %edx
callq 0x9737
movslq (%rbx), %rcx
decq %rcx
movl %ecx, (%rbx)
testq %rax, %rax
je 0x9a30
movl %ecx, %esi
movq 0x8(%rax), %rdx
cmpq %rsi, %rdx
jbe 0x9a30
movq (%rax), %rdi
leaq (%rdi,%rcx), %rsi
incq %rsi
addq %rcx, %rdi
decq %rdx
movq %rdx, 0x8(%rax)
subq %rcx, %rdx
popq %rbx
jmp 0x4400
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_append
list_t *list_append(list_t *accum, list_t *at, list_t *new)
{
	if(!accum)
		return new;

	list_t *after = at->next;
	at->next = new;
	new->prev = at;

	if(after){
		list_t *newtail = list_tail(new);
		newtail->next = after;
		after->prev = newtail;
	}

	return accum;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x9a73
movq %rdi, %rbx
movq 0x18(%rsi), %r14
movq %rdx, 0x18(%rsi)
movq %rsi, 0x20(%rdx)
testq %r14, %r14
je 0x9a76
movq %rdx, %rdi
callq 0x9a32
movq %r14, 0x18(%rax)
movq %rax, 0x20(%r14)
jmp 0x9a76
movq %rdx, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_dellines
static
list_t *list_dellines(list_t **pl, list_t *prev, unsigned n)
{
	if(n == 0)
		return NULL;

	list_t *l = *pl;

	if(!l)
		return NULL;
	l->prev = NULL;

	list_t *end_m1 = list_seek(l, n - 1, false);

	if(end_m1){
		*pl = end_m1->next;
		end_m1->next = NULL;
	}else{
		/* delete everything */
		*pl = NULL;
	}

	if(*pl)
		(*pl)->prev = prev;
	if(l)
		l->prev = NULL;

	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testl %edx, %edx
je 0x9e9a
movq %rdi, %r15
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x9e9a
movq %rsi, %r14
andq $0x0, 0x20(%rbx)
decl %edx
movq %rbx, %rdi
movl %edx, %esi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x9e9e
movq 0x18(%rax), %rcx
movq %rcx, (%r15)
andq $0x0, 0x18(%rax)
movq (%r15), %rax
testq %rax, %rax
je 0x9ea2
movq %r14, 0x20(%rax)
jmp 0x9ea2
xorl %ebx, %ebx
jmp 0x9ea7
andq $0x0, (%r15)
andq $0x0, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_joinregion
void list_joinregion(list_t **pl, const region_t *region, const bool space)
{
	if(region->begin.y == region->end.y)
		return;

	assert(region->begin.y < region->end.y);

	list_t *l, *start = list_seek(*pl, region->begin.y, false);

	if(!start)
		return;

	if(start->line)
		str_rtrim(start->line, &start->len_line);

	size_t i;

	for(l = start->next, i = region->begin.y + 1;
			l && i <= (unsigned)region->end.y;
			l = l->next, i++)
	{
		if(!l->line)
			continue;

		str_ltrim(l->line, &l->len_line);

		/* + 1 for \0, +1 for JOIN_CHAR */
		const size_t target = start->len_line + l->len_line + 2;

		if(start->len_malloc < target)
			start->len_malloc = target;

		start->line = urealloc(
				start->line,
				start->len_malloc);

		if(space)
			start->line[start->len_line++] = JOIN_CHAR;

		memcpy(start->line + start->len_line,
				l->line,
				l->len_line);

		start->len_line += l->len_line;
	}

	size_t ndelete = i - (region->begin.y + 1);
	if(ndelete)
		list_dellines(&start->next, start, ndelete);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x4(%rsi), %esi
cmpl 0xc(%rbx), %esi
je 0x9faf
jge 0x9fdd
movl %edx, %ebp
movq (%rdi), %rdi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x9faf
movq %rax, %r14
movq (%rax), %rdi
testq %rdi, %rdi
je 0x9ef9
leaq 0x8(%r14), %rsi
callq 0xb706
movq %r14, %r15
addq $0x18, %r15
movslq 0x4(%rbx), %r12
movq %r12, %r13
incq %r13
negl %r12d
movq %r15, (%rsp)
movq (%r15), %r15
testq %r15, %r15
je 0x9fa2
movl 0xc(%rbx), %eax
cmpq %rax, %r13
ja 0x9fa2
movq (%r15), %rdi
testq %rdi, %rdi
je 0x9f93
leaq 0x8(%r15), %rsi
callq 0xb6a0
movq 0x8(%r15), %rax
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rsi
addq %rcx, %rax
addq $0x2, %rax
cmpq %rax, %rsi
jae 0x9f55
movq %rax, 0x10(%r14)
movq %rax, %rsi
movq (%r14), %rdi
callq 0x5660
movq %rax, (%r14)
testb %bpl, %bpl
je 0x9f78
movq 0x8(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r14)
movb $0x20, (%rax,%rcx)
movq (%r14), %rax
addq 0x8(%r14), %rax
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rax, %rdi
callq 0x4360
movq 0x8(%r15), %rax
addq %rax, 0x8(%r14)
addq $0x18, %r15
incq %r13
decl %r12d
jmp 0x9f11
movslq 0x4(%rbx), %rdx
leaq 0x1(%rdx), %rax
cmpq %r13, %rax
jne 0x9fbe
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl %r12d, %edx
negl %edx
movq (%rsp), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9e51
leaq 0x4675(%rip), %rdi      # 0xe659
leaq 0x4605(%rip), %rsi      # 0xe5f0
leaq 0x4687(%rip), %rcx      # 0xe679
movl $0x273, %edx            # imm = 0x273
callq 0x4210
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_iter_region
void list_iter_region(
		list_t *l, const region_t *r,
		enum list_iter_flags flags,
		list_iter_f fn, void *ctx)
{
	size_t i = 0;
	size_t end = r->end.y - r->begin.y + 1;

	for(l = list_seek(l, r->begin.y, false);
			l && i < end; l = l->next, i++)
	{
		const size_t y = i + r->begin.y;
		bool next = true;

		switch(r->type){
			case REGION_LINE:
				if(flags & LIST_ITER_WHOLE_LINE)
					next = fn(l->line, l, y, ctx);
				else
					next = line_iter(l, 0, l->len_line, y, fn, ctx);
				break;
			case REGION_COL:
				next = line_iter(l, r->begin.x, r->end.x, y, fn, ctx);
				break;
			case REGION_CHAR:
				next = line_iter(l,
						i == 0 ? r->begin.x : 0,
						i+1 == end ? (unsigned)r->end.x : l->len_line,
						y, fn, ctx);
				break;
		}
		if(flags & LIST_ITER_EVAL_NL)
			list_evalnewlines1(l);
		if(!next)
			break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, (%rsp)
movl %edx, %ebp
movq %rsi, %r15
movl 0x4(%rsi), %esi
movl 0xc(%r15), %eax
subl %esi, %eax
incl %eax
movslq %eax, %rbx
xorl %r14d, %r14d
xorl %edx, %edx
callq 0x9737
movq %rax, %r12
leaq -0x1(%rbx), %rax
movq %rax, 0x10(%rsp)
testq %r12, %r12
je 0xa2ec
cmpq %rbx, %r14
jae 0xa2ec
movslq 0x4(%r15), %rax
leaq (%r14,%rax), %rcx
movl 0x10(%r15), %edx
testl %edx, %edx
je 0xa284
cmpl $0x1, %edx
je 0xa27b
movb $0x1, %r13b
cmpl $0x2, %edx
jne 0xa2cc
testb $0x2, %bpl
jne 0xa28d
movq 0x8(%r12), %rdx
movq %r12, %rdi
xorl %esi, %esi
jmp 0xa2bb
movslq (%r15), %rsi
movslq 0x8(%r15), %rdx
jmp 0xa2b8
testq %r14, %r14
je 0xa2a3
xorl %esi, %esi
jmp 0xa2a6
movl %eax, %edx
movq (%r12), %rdi
addl %r14d, %edx
movq %r12, %rsi
movq 0x8(%rsp), %rcx
callq *(%rsp)
jmp 0xa2c9
movslq (%r15), %rsi
cmpq %r14, 0x10(%rsp)
jne 0xa2b3
movl 0x8(%r15), %edx
jmp 0xa2b8
movq 0x8(%r12), %rdx
movq %r12, %rdi
movq (%rsp), %r8
movq 0x8(%rsp), %r9
callq 0xa2fb
movl %eax, %r13d
testb $0x1, %bpl
je 0xa2da
movq %r12, %rdi
callq 0x9754
testb %r13b, %r13b
je 0xa2ec
movq 0x18(%r12), %r12
incq %r14
jmp 0xa23a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_advance_y
list_t *list_advance_y(
		list_t *l, const int dir, int *py, int *px)
{
	if(!l)
		return NULL;

	*py += dir;

	if(dir > 0){
		if(px)
			*px = 0;
		return l->next;
	}else{
		l = l->prev;
		if(px && l)
			*px = l->len_line > 0 ? l->len_line - 1 : 0;
		return l;
	}
}

// Assembly:
addl %esi, (%rdx)
testl %esi, %esi
jle 0xa363
testq %rcx, %rcx
je 0xa35e
andl $0x0, (%rcx)
movq 0x18(%rdi), %rax
retq
movq 0x20(%rdi), %rax
testq %rcx, %rcx
setne %dl
testq %rax, %rax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xa362
movq 0x8(%rax), %rdx
leal -0x1(%rdx), %esi
xorl %edi, %edi
testq %rdx, %rdx
cmovnel %esi, %edi
movl %edi, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_word_at
char *list_word_at(list_t *l, point_t const *pt)
{
	l = list_seek(l, pt->y, false);
	if(!l)
		return NULL;

	const bool bigwords = false;

	/* forwards until we hit a word */
	point_t found = *pt;
	l = word_seek(l, +1, &found, W_KEYWORD, bigwords);
	if(!l || found.y != pt->y)
		return NULL;

	/* back until the start of the word */
	word_seek_to_end(l, -1, &found, bigwords);

	/* forwards until the end of the word */
	point_t end = found;
	word_seek_to_end(l, +1, &end, bigwords);

	return ustrdup_len(l->line + found.x, end.x - found.x + 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movl 0x4(%rsi), %esi
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0xa46f
movq (%r15), %rcx
movq %rsp, %rdx
movq %rcx, (%rdx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rcx
xorl %ebx, %ebx
movq %rax, %rdi
xorl %r8d, %r8d
callq 0xc8ee
testq %rax, %rax
je 0xa46f
movq %rax, %r14
movl 0x4(%rsp), %eax
cmpl 0x4(%r15), %eax
jne 0xa46d
pushq $-0x1
popq %rsi
movq %rsp, %rbx
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0xc95a
movq (%rbx), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xc95a
movslq (%rbx), %rdi
movl (%r15), %eax
subl %edi, %eax
addq (%r14), %rdi
incl %eax
movslq %eax, %rsi
callq 0x5690
movq %rax, %rbx
jmp 0xa46f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_fname_at
char *list_fname_at(list_t *l, point_t const *pt)
{
	l = list_seek(l, pt->y, false);
	if(!l)
		return NULL;

	if((unsigned)pt->x >= l->len_line)
		return NULL;

	int start = pt->x;
	if(isfnamechar(l->line[start])){
		/* look backwards for the start */
		for(; start >= 0 && isfnamechar(l->line[start]); start--)
			;

		if(start < 0)
			start = 0;
		else /* !isfnamechar(line[start]) */
			start++;

	}else{
		/* look forwards for the beginning */
		for(; !isfnamechar(l->line[start]) && (unsigned)start < l->len_line; start++)
			;

		if((unsigned)start == l->len_line)
			return NULL;
	}


	int end = start;
	for(; (unsigned)end < l->len_line && isfnamechar(l->line[end]); end++)
		;

	/* end is either at the end of the line or not a fnamechar,
	 * either way: */
	end--;

	/* avoid '.' at the end */
	if(end > 0 && l->line[end] == '.')
		end--;

	if(end < start)
		return NULL;

	return ustrdup_len(&l->line[start], end - start + 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x4(%rsi), %esi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0xa562
movl (%rbx), %r14d
movq 0x8(%rax), %r15
cmpq %r14, %r15
jbe 0xa562
movslq %r14d, %r12
movq (%rax), %rbx
movsbl (%rbx,%r12), %edi
callq 0xa591
testb %al, %al
je 0xa4e7
cmpl $-0x1, %r14d
pushq $-0x1
popq %r12
cmovll %r14d, %r12d
testl %r14d, %r14d
js 0xa510
movl %r14d, %eax
movsbl (%rbx,%rax), %edi
callq 0xa591
testb %al, %al
je 0xa50d
decl %r14d
jmp 0xa4cd
decl %r14d
movsbl (%rbx,%r12), %edi
callq 0xa591
movl %r12d, %ecx
incl %r14d
cmpq %rcx, %r15
jbe 0xa506
incq %r12
testb %al, %al
je 0xa4ea
cmpq %rcx, %r15
jne 0xa51f
jmp 0xa562
movl %r14d, %r12d
leal 0x1(%r12), %eax
xorl %r14d, %r14d
testl %r12d, %r12d
cmovnsl %eax, %r14d
movslq %r14d, %r12
leal -0x2(%r12), %r13d
movq %r12, %rbp
movl %ebp, %eax
cmpq %rax, %r15
jbe 0xa546
movsbl (%rbx,%rbp), %edi
callq 0xa591
testb %al, %al
je 0xa546
incq %rbp
incl %r13d
jmp 0xa52a
leal 0x1(%r13), %eax
cmpq $0x2, %rbp
jl 0xa55d
movl %eax, %ecx
cmpb $0x2e, (%rbx,%rcx)
cmovnel %eax, %r13d
movl %r13d, %eax
subl %r14d, %eax
jge 0xa573
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq %r12, %rbx
incl %eax
movslq %eax, %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5690
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: isfnamechar
static bool isfnamechar(char c)
{
	switch(c){
		case 'a' ... 'z':
		case 'A' ... 'Z':
		case '0' ... '9':
			return true;
	}

	const char *fname_chars = "/.-_+,#$%~=";
	return strchr(fname_chars, c);
}

// Assembly:
movb $0x1, %al
leal -0x41(%rdi), %ecx
cmpl $0x39, %ecx
ja 0xa5ac
movabsq $0x3ffffff03ffffff, %rdx # imm = 0x3FFFFFF03FFFFFF
btq %rcx, %rdx
jae 0xa5ac
retq
leal -0x30(%rdi), %ecx
cmpl $0xa, %ecx
jb 0xa5ab
pushq %rax
movsbl %dil, %esi
leaq 0x4103(%rip), %rdi      # 0xe6c3
pushq $0xc
popq %rdx
callq 0x42a0
testq %rax, %rax
setne %al
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: list_flag_range
void list_flag_range(list_t *l, const struct range *r, int v)
{
	size_t n = r->end - r->start + 1;
	for(l = list_seek(l, r->start, false);
	    l && n > 0;
	    l = l->next, n--)
	{
		l->flag = v;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl (%rsi), %eax
movl 0x4(%rsi), %ecx
subl %eax, %ecx
incl %ecx
movslq %ecx, %r14
movl %eax, %esi
xorl %edx, %edx
callq 0x9737
addq $-0x1, %r14
setb %cl
testq %rax, %rax
je 0xa617
testb %cl, %cl
je 0xa617
movl %ebx, 0x28(%rax)
movq 0x18(%rax), %rax
jmp 0xa5fe
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/list.c
// Function: mmap_new_line
static void mmap_new_line(list_t **pcur, char *p, char **panchor)
{
	const size_t nchars = p - *panchor;
	char *data = umalloc(nchars + 1);

	memcpy(data, *panchor, nchars);
	data[nchars] = '\0';

	list_t *cur = *pcur;
	if(cur->line){
		cur->next = list_new(cur);
		cur = cur->next;
	}
	cur->line = data;
	cur->len_malloc = nchars + 1;
	cur->len_line = nchars;
	*pcur = cur;

	*panchor = p + 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %r12
subq (%rdx), %r12
leaq 0x1(%r12), %r13
movq %r13, %rdi
callq 0x5648
movq %rax, %rbp
movq (%rbx), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x4360
movb $0x0, (%rbp,%r12)
movq %r15, (%rsp)
movq (%r15), %r15
cmpq $0x0, (%r15)
je 0xa6c2
movq %r15, %rdi
callq 0x9280
movq %rax, 0x18(%r15)
movq %rax, %r15
movq %rbp, (%r15)
movq %r13, 0x10(%r15)
movq %r12, 0x8(%r15)
movq (%rsp), %rax
movq %r15, (%rax)
incq %r14
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_line_goto
static int m_line_goto(point_t *const pt, unsigned repeat, bool end, window *win)
{
	if(repeat == 0) /* default */
		pt->y = end ? list_count(win->buf->head) : 0;
	else
		pt->y = repeat - 1;

	start_of_line(pt, win);

	return MOTION_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
testl %esi, %esi
je 0xa798
decl %esi
jmp 0xa7ac
xorl %esi, %esi
testb %dl, %dl
je 0xa7ac
movq (%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x9ffc
movl %eax, %esi
movl %esi, 0x4(%r14)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa6ec
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_eol
int m_eol(motion_arg const *m, unsigned repeat, window *win, point_t *to)
{
	list_t *l = window_current_line(win, false);

	to->x = l && l->len_line > 0 ? l->len_line - 1 : 0;

	bool nonblank = m->i;
	if(nonblank){
		for(; to->x > 0 && isspace(l->line[to->x]); to->x--);
	}

	return MOTION_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r15
xorl %ebp, %ebp
movq %rdx, %rdi
xorl %esi, %esi
callq 0xcef6
movq %rax, %r14
testq %rax, %rax
je 0xa7f0
movq 0x8(%r14), %rax
testq %rax, %rax
je 0xa7f0
decl %eax
movl %eax, %ebp
movl %ebp, (%rbx)
cmpl $0x0, (%r15)
je 0xa81b
testl %ebp, %ebp
jle 0xa81b
callq 0x4540
movq (%rax), %rax
movq (%r14), %rcx
movl %ebp, %edx
movsbq (%rcx,%rdx), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0xa81b
decl %ebp
movl %ebp, (%rbx)
jmp 0xa7f8
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_eos
int m_eos(motion_arg const *m, unsigned repeat, window *win, point_t *to)
{
	int y, h;
	screen_or_buf_dimensions(win, &y, &h);
	to->y = y + h;

	start_of_line(to, win);
	return MOTION_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
leaq 0x4(%rsp), %r15
movq %rsp, %r12
movq %rdx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xa888
movl (%r12), %eax
addl (%r15), %eax
movl %eax, 0x4(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa6ec
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: screen_or_buf_dimensions
static void screen_or_buf_dimensions(
		window *win, int *const y, int *const height)
{
	int nlines = list_count(win->buf->head);

	*y = UI_TOP(win);

	if(nlines < win->screen_coord.h)
		*height = nlines - *y;
	else
		*height = win->screen_coord.h - 1;

	if(*height < 0)
		*height = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movq 0x8(%rax), %rdi
callq 0x9ffc
movl 0xc(%r15), %ecx
movl %ecx, (%r14)
movl 0x1c(%r15), %edx
leal -0x1(%rdx), %esi
movl %eax, %edi
subl %ecx, %edi
cmpl %edx, %eax
cmovgel %esi, %edi
xorl %eax, %eax
testl %edi, %edi
cmovgl %edi, %eax
movl %eax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_goto
int m_goto(motion_arg const *m, unsigned repeat, window *win, point_t *to)
{
	if(m->pos.y > -1)
		to->y = m->pos.y * DEFAULT_REPEAT(repeat);

	if(m->pos.x > -1)
		to->x = m->pos.x * DEFAULT_REPEAT(repeat);

	return MOTION_SUCCESS;
}

// Assembly:
movl 0x4(%rdi), %eax
testl %eax, %eax
js 0xa92b
cmpl $0x1, %esi
movl %esi, %edx
adcl $0x0, %edx
imull %edx, %eax
movl %eax, 0x4(%rcx)
movl (%rdi), %eax
testl %eax, %eax
js 0xa93c
cmpl $0x1, %esi
adcl $0x0, %esi
imull %esi, %eax
movl %eax, (%rcx)
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_linesearch
static int m_linesearch(
		motion_arg const *arg, unsigned repeat, window *win, point_t *to,
		list_t *sfn(motion_arg const *, list_t *, int *, const void *),
		const void *ctx)
{
	list_t *l = window_current_line(win, false); /* fine - repeat handled */
	int n = 0;

	*to = *win->ui_pos;

	if(!l)
		goto limit;

	for(repeat = DEFAULT_REPEAT(repeat);
			repeat > 0;
			repeat--)
	{
		l = sfn(arg, l, &n, ctx);
		if(!l)
			goto limit;
	}

	to->y += n;

	return MOTION_SUCCESS;
limit:
	to->y = arg->dir > 0 ? buffer_nlines(win->buf) : 0;
	return MOTION_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %r12
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r13
movq %rdx, %rdi
xorl %esi, %esi
callq 0xcef6
andl $0x0, 0xc(%rsp)
movq 0x30(%r14), %rcx
movq (%rcx), %rcx
movq %rbx, 0x10(%rsp)
movq %rcx, (%rbx)
testq %rax, %rax
je 0xaa1d
cmpl $0x1, %ebp
adcl $0x1, %ebp
leaq 0xc(%rsp), %rbx
decl %ebp
je 0xaa3d
movq %r13, %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq *%r12
testq %rax, %rax
jne 0xaa05
cmpb $0x0, (%r13)
movl $0x0, %ecx
jle 0xaa33
movq (%r14), %rdi
callq 0x90a8
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x4(%rax)
jmp 0xaa49
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
addl %eax, 0x4(%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_search_para
static list_t *m_search_para(
		motion_arg const *a, list_t *l,
		int *pn, const void *ctx)
{
	/* while in space, find non-space */
	for(; l && (!l->line || isallspace(l->line, l->len_line));
			l = list_advance_y(l, a->dir, pn, NULL));

	/* while in non-space, find space */
	for(; l && (l->line && !isallspace(l->line, l->len_line));
			l = list_advance_y(l, a->dir, pn, NULL));

	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testq %r15, %r15
je 0xaabf
movq (%r15), %rdi
testq %rdi, %rdi
je 0xaa80
movq 0x8(%r15), %rsi
callq 0xb5cc
testb %al, %al
je 0xaabf
movsbl (%r14), %esi
movq %r15, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0xa350
movq %rax, %r15
jmp 0xaa66
movq (%r15), %rdi
testq %rdi, %rdi
je 0xaac4
movq 0x8(%r15), %rsi
callq 0xb5cc
testb %al, %al
jne 0xaac4
movsbl (%r14), %esi
movq %r15, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0xa350
movq %rax, %r15
testq %r15, %r15
jne 0xaa96
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_search_func
static list_t *m_search_func(
		motion_arg const *a, list_t *l,
		int *pn, const void *ctx)
{
	int ch = *(int *)ctx;

	if(l && l->len_line && *l->line == ch)
		l = list_advance_y(l, a->dir, pn, NULL);

	for(;
	    l && (l->len_line == 0 || *l->line != ch);
	    l = list_advance_y(l, a->dir, pn, NULL));

	return l;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movl (%rcx), %ebp
testq %rsi, %rsi
je 0xab10
movq %rsi, %rax
cmpq $0x0, 0x8(%rsi)
je 0xab25
movq (%rax), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %ebp
je 0xab14
jmp 0xab25
xorl %eax, %eax
jmp 0xab25
movsbl (%r14), %esi
movq %rax, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0xa350
testq %rax, %rax
je 0xab3b
cmpq $0x0, 0x8(%rax)
je 0xab14
movq (%rax), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %ebp
jne 0xab14
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_word
int m_word(motion_arg const *m, unsigned repeat, window *win, point_t *to)
{
	const int dir = m->word_type & WORD_BACKWARD ? -1 : 1;
	const bool end = m->word_type & WORD_END;
	const bool space = m->word_type & WORD_SPACE;

	for(repeat = DEFAULT_REPEAT(repeat); repeat > 0; repeat--)
		if(m_word1(win->buf, dir, end, space, to) == MOTION_FAILURE)
			return MOTION_FAILURE;

	return MOTION_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, 0x10(%rsp)
movl %esi, %ebp
movl (%rdi), %eax
movl %eax, %ecx
andl $0x1, %ecx
negl %ecx
orl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movl %eax, %ecx
andl $0x2, %ecx
shrl %ecx
cmpl $0x1, %esi
adcl $0x0, %ebp
xorl %eax, %ecx
movl %ecx, 0x8(%rsp)
movl %eax, %r15d
andl $0x4, %r15d
shrl $0x2, %r15d
shrl $0x2, %eax
andl $0x1, %eax
movl %eax, 0xc(%rsp)
subl $0x1, %ebp
jb 0xac6e
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
movl 0x4(%rbx), %esi
xorl %edx, %edx
callq 0x9737
movq %rax, %r14
movl (%rbx), %esi
movq %rax, %rdi
movl %r15d, %edx
callq 0xc88c
movl %eax, %r13d
andl $0x6, %r13d
je 0xac2a
testb $0x1, 0x8(%rsp)
je 0xabe8
movl %eax, %r12d
movl (%rbx), %esi
addl 0x4(%rsp), %esi
movq %r14, %rdi
movl %r15d, %edx
callq 0xc88c
cmpl %r12d, %eax
je 0xac52
xorl $0x6, %r13d
movl %r13d, %ecx
orl $0x1, %ecx
movq %r14, %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
movl 0xc(%rsp), %r12d
movl %r12d, %r8d
callq 0xc8ee
movq %rax, %r14
movl (%rbx), %esi
movq %rax, %rdi
movl %r12d, %edx
callq 0xc88c
testl %r13d, %eax
jne 0xac47
testq %r14, %r14
je 0xac69
cmpq $0x0, 0x8(%r14)
je 0xac47
movq %r14, %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
pushq $0x6
popq %rcx
movl %r15d, %r8d
callq 0xc8ee
movq %rax, %r14
testq %rax, %rax
je 0xac73
testb $0x1, 0x8(%rsp)
je 0xab90
movq %r14, %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
movl %r15d, %ecx
callq 0xc95a
jmp 0xab90
xorl %r14d, %r14d
jmp 0xac47
pushq $0x1
popq %rax
jmp 0xac75
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/motion.c
// Function: m_findnext2
static int m_findnext2(const int ch, enum find_type ftype, unsigned repeat, window *win, point_t *to)
{
	list_t *l = window_current_line(win, false); /* fine - repeat handled */

	if(!l)
		return MOTION_FAILURE;

	point_t bpos = *win->ui_pos;

	if(!(ftype & F_REV)){
		bpos.x++;
		if((unsigned)bpos.x >= l->len_line)
			return MOTION_FAILURE;
	}else{
		if(l->len_line == 0)
			return MOTION_FAILURE;

		/* if we're after the actual length, move from logical to it */
		if((unsigned)bpos.x >= l->len_line)
			bpos.x = l->len_line;

		bpos.x--;

		if(bpos.x < 0)
			return MOTION_FAILURE;
	}

	repeat = DEFAULT_REPEAT(repeat);

	for(;;){
		char *p = l->line + bpos.x;

		p = strchrdir(p, ch, ftype & F_REV, l->line, l->len_line);

		if(!p)
			return MOTION_FAILURE;

		bpos.x = p - l->line;

		if(--repeat == 0){
			const int adj = ftype & F_TIL ? ftype & F_REV ? 1 : -1 : 0;

			*to = bpos;
			to->x += adj;
			break;
		}else{
			bpos.x += ftype & F_REV ? -1 : +1;
		}
	}

	return MOTION_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r12
movl %edx, %r14d
movl %esi, %ebp
movl %edi, %r13d
movq %rcx, %rdi
xorl %esi, %esi
callq 0xcef6
testq %rax, %rax
je 0xad98
movq %rax, %r15
movq 0x30(%r12), %rax
movl (%rax), %ecx
movl 0x4(%rax), %edx
testb $0x2, %bpl
jne 0xacfa
incl %ecx
cmpq %rcx, 0x8(%r15)
jbe 0xad98
movl %edx, 0xc(%rsp)
movq %rbx, 0x10(%rsp)
pushq $0x1
popq %rbx
jmp 0xad25
movq 0x8(%r15), %rax
testq %rax, %rax
je 0xad98
cmpq %rcx, %rax
cmoval %ecx, %eax
testl %eax, %eax
jle 0xad98
movl %edx, 0xc(%rsp)
movq %rbx, 0x10(%rsp)
decl %eax
pushq $-0x1
popq %rbx
movl %eax, %ecx
pushq $0x1
popq %r12
cmpl $0x1, %r14d
adcl $0x0, %r14d
movsbl %r13b, %r13d
movq (%r15), %rdx
movslq %ecx, %rax
leaq (%rdx,%rax), %rdi
testb $0x2, %bpl
jne 0xad56
movq 0x8(%r15), %rdx
subq %rax, %rdx
movl %r13d, %esi
callq 0x42a0
jmp 0xad5e
movl %r13d, %esi
callq 0xb518
testq %rax, %rax
je 0xad98
movq (%r15), %rdx
subl %edx, %eax
leal (%rbx,%rax), %ecx
decl %r14d
jne 0xad38
movl %ebp, %ecx
andl $0x2, %ecx
andl $0x1, %ebp
negl %ebp
xorl %edx, %edx
cmpl $0x1, %ecx
sbbl %edx, %edx
orl $0x1, %edx
andl %ebp, %edx
movq 0x10(%rsp), %rcx
movl 0xc(%rsp), %esi
movl %esi, 0x4(%rcx)
addl %eax, %edx
movl %edx, (%rcx)
jmp 0xad9b
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq