LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_escape
void k_escape(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();

	const bool was_insert = win->ui_mode & UI_INSERT_ANY;

	/* set normal mode before the move - lets us capture the position */
	ui_set_bufmode(UI_NORMAL);

	if(was_insert){
		motion move = {
			.func = m_move,
			.arg = { .pos = { -1, 0 } }
		};

		motion_apply_win(&move, /*repeat:*/1, win);
	}
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
callq 0xd170
movq %rax, %rbx
movb 0x40(%rax), %bpl
pushq $0x1
popq %rdi
callq 0x4b74
testb $0x6, %bpl
je 0x5803
movq 0x10269(%rip), %rax     # 0x15a50
movq %rsp, %rdi
movq %rax, 0x10(%rdi)
movups 0x1024b(%rip), %xmm0    # 0x15a40
movaps %xmm0, (%rdi)
pushq $0x1
popq %rsi
movq %rbx, %rdx
callq 0xb26b
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_set_mode
void k_set_mode(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();

	/* if we're in visual-col and told to insert like that... */
	if(win->ui_mode == UI_VISUAL_COL && a->i == UI_INSERT_COL){
		region_t r;

		if(around_motion(repeat, from_ch, false, /*noop:*/NULL, &r)){
			win->buf->col_insert_height = r.end.y - r.begin.y + 1;
			ui_set_bufmode(UI_INSERT_COL);
		}
	}else{
		ui_set_bufmode(a->i);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
callq 0xd170
movq %rax, %rbx
movl 0x40(%rax), %eax
xorl $0x10, %eax
movl (%r15), %edi
movl %edi, %ecx
xorl $0x4, %ecx
orl %eax, %ecx
jne 0x586e
leaq 0x4(%rsp), %rcx
movl %r14d, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x6b9a
testb %al, %al
je 0x5863
movl 0x10(%rsp), %eax
subl 0x8(%rsp), %eax
incl %eax
movq (%rbx), %rcx
movl %eax, 0x48(%rcx)
pushq $0x4
popq %rdi
callq 0x4b74
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4b74
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_open
void k_open(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();
	buffer_insline(win->buf, a->i, win->ui_pos);
	window_smartindent(win);

	ui_set_bufmode(UI_INSERT);
	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xd170
movq %rax, %r14
movl (%rbx), %esi
movq (%rax), %rdi
movq 0x30(%rax), %rdx
callq 0x9089
movq %r14, %rdi
callq 0xd15c
pushq $0x2
popq %rdi
callq 0x4b74
callq 0x4cc7
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x501c
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_del
void k_del(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	region_t region;

	bool deleted = around_motion_bufaction(
			repeat, from_ch, &buffer_delregion, &region);

	if(deleted && region.type == REGION_LINE){
		start_of_line(NULL, windows_cur());
		ui_cur_changed();
	}
}

// Assembly:
subq $0x18, %rsp
movl %esi, %edi
leaq 0x10a78(%rip), %rax     # 0x16360
leaq 0x4(%rsp), %rcx
movl %edx, %esi
movq %rax, %rdx
callq 0x6ccb
testb %al, %al
je 0x5916
cmpl $0x2, 0x14(%rsp)
jne 0x5916
callq 0xd170
xorl %edi, %edi
movq %rax, %rsi
callq 0xa6ec
callq 0x501c
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_change
void k_change(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	region_t r;

	if(around_motion_bufaction(repeat, from_ch, &buffer_delregion, &r)){
		window *win = windows_cur();
		buffer_t *buf = win->buf;

		switch(r.type){
			case REGION_COL:
				buf->col_insert_height = r.end.y - r.begin.y + 1;
				ui_set_bufmode(UI_INSERT_COL);
				break;
			case REGION_LINE:
				k_open(&(keyarg_u){ .i = -1 }, 0, 0);
				break;
			case REGION_CHAR:
				ui_set_bufmode(UI_INSERT);
				/* handle S / 0c$ */
				list_t *curline;
				if(r.begin.x == 0
				&& (curline = window_current_line(win, false))
				&& (unsigned)r.end.x >= curline->len_line)
				{
					window_smartindent(win);
				}
				break;
		}
	}
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movl %esi, %edi
leaq 0x10a37(%rip), %rax     # 0x16360
leaq 0xc(%rsp), %rcx
movl %edx, %esi
movq %rax, %rdx
callq 0x6ccb
testb %al, %al
je 0x599d
callq 0xd170
movq %rax, %rbx
movl 0x1c(%rsp), %eax
testl %eax, %eax
je 0x598e
cmpl $0x2, %eax
je 0x5970
cmpl $0x1, %eax
jne 0x599d
movq (%rbx), %rax
movl 0x18(%rsp), %ecx
subl 0x10(%rsp), %ecx
incl %ecx
movl %ecx, 0x48(%rax)
pushq $0x4
popq %rdi
callq 0x4b74
jmp 0x599d
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
orl $-0x1, (%rdi)
callq 0x587d
jmp 0x599d
pushq $0x2
popq %rdi
callq 0x4b74
cmpl $0x0, 0xc(%rsp)
je 0x59a3
addq $0x50, %rsp
popq %rbx
retq
movq %rbx, %rdi
xorl %esi, %esi
callq 0xcef6
testq %rax, %rax
je 0x599d
movl 0x14(%rsp), %ecx
cmpq %rcx, 0x8(%rax)
ja 0x599d
movq %rbx, %rdi
callq 0xd15c
jmp 0x599d
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_put
void k_put(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	bool prepend = a->b;
	const yank *yank = retain(yank_top());
	if(!yank)
		return;

	window *win = windows_cur();
	if(win->ui_mode & UI_VISUAL_ANY){
		/* delete what we have, then paste */
		region_t r;
		unsigned mrepeat;
		const motion *m = motion_read_or_visual(&mrepeat, false);

		if(!motion_to_region(m, mrepeat, win, &r))
			return;

		/* necessary so we insert at the right place later on */
		point_sort_full(&win->ui_npos, &win->ui_vpos);

		buffer_t *buf = win->buf;

		buffer_delregion.fn(buf, &r, &(point_t){0});

		/* unconditional for visual-put */
		prepend = true;
	}

	repeat = DEFAULT_REPEAT(repeat);
	while(repeat --> 0)
		buffer_insyank(buffers_cur(), yank, win->ui_pos, prepend, /*modify:*/true);

	win->ui_mode = UI_NORMAL; /* remove visual */

	start_of_line(NULL, win);

	ui_redraw();
	ui_cur_changed();

	release(yank, yank_free);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movb (%rdi), %r15b
callq 0xbe6a
movq %rax, %rdi
callq 0xc254
testq %rax, %rax
je 0x5ac0
movq %rax, %rbx
callq 0xd170
movq %rax, %r14
testb $0x38, 0x40(%rax)
je 0x5a66
movq %rsp, %r15
movq %r15, %rdi
callq 0x6b4c
movl (%r15), %esi
leaq 0xc(%rsp), %rcx
movq %rax, %rdi
movq %r14, %rdx
callq 0xb2ab
testb %al, %al
je 0x5ac0
leaq 0x20(%r14), %rdi
movq %r14, %rsi
addq $0x28, %rsi
callq 0xc13d
movq (%r14), %rdi
leaq 0x1090d(%rip), %rax     # 0x16360
leaq 0x4(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0xc(%rsp), %rsi
callq *(%rax)
movb $0x1, %r15b
cmpl $0x1, %ebp
adcl $0x0, %ebp
movzbl %r15b, %r15d
pushq $0x1
popq %r12
subl $0x1, %ebp
jb 0x5a95
callq 0xd170
movq (%rax), %rdi
movq 0x30(%r14), %rdx
movq %rbx, %rsi
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x8f6b
jmp 0x5a74
movl $0x1, 0x40(%r14)
xorl %edi, %edi
movq %r14, %rsi
callq 0xa6ec
callq 0x4cc7
callq 0x501c
leaq 0x6370(%rip), %rsi      # 0xbe28
movq %rbx, %rdi
callq 0xc25f
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_replace
void k_replace(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	if(a->i == 1){
		// TODO: repeated
	}else{
		/* single char */
		bool raw;
		int ch = io_getch(IO_NOMAP | IO_MAPRAW, &raw, true);

		if(!raw && ch == K_ESC)
			return;

		repeat = DEFAULT_REPEAT(repeat);

		motion move_repeat = {
			.func = m_move,
			.arg.pos.x = repeat - 1,
			.how = M_NONE
		};

		window *win = windows_cur();
		const motion *mchosen =
			win->ui_mode & UI_VISUAL_ANY
			? motion_read_or_visual(&(unsigned){0}, false)
			: &move_repeat;


		region_t r;
		if(!motion_to_region(mchosen, 1, win, &r))
			return;

		/* special case - single _line_ replace
		 * we differ from vim in that multi-char-single-line
		 * replace adds N many '\n's
		 */
		const bool ins_nl = r.type == REGION_CHAR
			&& r.begin.y == r.end.y
			&& !raw
			&& isnewline(ch);

		if(ins_nl)
			ch = '\n';
		else if(ch == '\n')
			ch = '\r'; /* not an explicit newline - force ^M / \r */

		buffer_t *const buf = win->buf;

		list_iter_region(buf->head, &r, LIST_ITER_EVAL_NL, replace_iter, &ch);

		if(ins_nl){
			win->ui_pos->x = 0;
			win->ui_pos->y += repeat;
		}

		buf->modified = true;
		win->ui_mode = UI_NORMAL;
	}
	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
cmpl $0x1, (%rdi)
jne 0x5b42
callq 0x4cc7
callq 0x501c
jmp 0x5c29
movl %esi, %ebx
pushq $0x11
popq %rdi
leaq 0x3(%rsp), %r14
pushq $0x1
popq %rdx
movq %r14, %rsi
callq 0xbbc8
movl %eax, %ebp
movl %eax, 0x4(%rsp)
cmpl $0x1b, %eax
setne %al
orb (%r14), %al
je 0x5c29
cmpl $0x1, %ebx
adcl $0x0, %ebx
leaq 0x4dc7(%rip), %rax      # 0xa940
movq %rax, 0x20(%rsp)
leal -0x1(%rbx), %eax
movl %eax, 0x28(%rsp)
andq $0x0, 0x2c(%rsp)
callq 0xd170
movq %rax, %r14
testb $0x38, 0x40(%rax)
je 0x5ba8
leaq 0x1c(%rsp), %rdi
callq 0x6b4c
movq %rax, %rdi
jmp 0x5bad
leaq 0x20(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x8(%rsp), %rcx
movq %r14, %rdx
callq 0xb2ab
testb %al, %al
je 0x5c29
cmpl $0x0, 0x18(%rsp)
jne 0x5bd9
movl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jne 0x5bd9
cmpb $0x0, 0x3(%rsp)
je 0x5c34
cmpl $0xa, %ebp
jne 0x5be6
movl $0xd, 0x4(%rsp)
xorl %ebp, %ebp
movq (%r14), %r15
movq 0x8(%r15), %rdi
leaq 0xf7c(%rip), %rcx       # 0x6b72
leaq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x4(%rsp), %r8
callq 0xa1fa
testb %bpl, %bpl
je 0x5c17
movq 0x30(%r14), %rax
andl $0x0, (%rax)
addl %ebx, 0x4(%rax)
movb $0x1, 0x39(%r15)
movl $0x1, 0x40(%r14)
jmp 0x5b33
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xd, %ebp
je 0x5c3e
cmpl $0xa, %ebp
jne 0x5be6
movl $0xa, 0x4(%rsp)
movb $0x1, %bpl
jmp 0x5be8
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_prompt_cmd
void k_prompt_cmd(const keyarg_u *arg, unsigned repeat, const int from_ch)
{
	char *initial = NULL;
	char initial_buf[32];

	window *win = windows_cur();

	if(win->ui_mode & UI_VISUAL_ANY){
		int y1 = 1 + win->ui_pos->y;
		int y2 = 1 + window_uipos_alt(win)->y;

		if(y2 < y1){
			int tmp = y1;
			y1 = y2;
			y2 = tmp;
		}

		snprintf(initial_buf, sizeof initial_buf, "%d,%d", y1, y2);

		initial = initial_buf;
	}

	char *const cmd = prompt(from_ch, initial);

	if(!cmd)
		goto cancel_cmd;

	prompt_finish(cmd);

cancel_cmd:
	free(cmd);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebx
callq 0xd170
testb $0x38, 0x40(%rax)
je 0x5ca0
movq 0x30(%rax), %rcx
movl 0x4(%rcx), %r14d
leal 0x1(%r14), %ebp
movq %rax, %rdi
callq 0xcee5
movl 0x4(%rax), %eax
leal 0x1(%rax), %ecx
cmpl %r14d, %eax
movl %ecx, %r8d
cmovll %ebp, %r8d
cmovgel %ebp, %ecx
leaq 0x84ef(%rip), %rdx      # 0xe17d
movq %rsp, %r14
pushq $0x20
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x41e0
jmp 0x5ca3
xorl %r14d, %r14d
movsbl %bl, %edi
movq %r14, %rsi
callq 0xb7f4
movq %rax, %rbx
testq %rax, %rax
je 0x5cbe
movq %rbx, %rdi
callq 0x6abd
movq %rbx, %rdi
callq 0x4080
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_filter
void k_filter(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	struct around_motion around = {
		.fn = filter,
		.filter = &a->filter
	};
	region_t r;

	if(around_motion(repeat, from_ch, /*always_linewise:*/true, &around, &r)){
		size_t n = r.end.y - r.begin.y;
		ui_status("filtered %lu line%s", n, n == 1 ? "" : "s");
	}
}

// Assembly:
subq $0x28, %rsp
leaq 0x1018(%rip), %rcx      # 0x6cf2
leaq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq %rdi, 0x8(%rax)
leaq 0x4(%rsp), %rcx
movl %esi, %edi
movl %edx, %esi
movq %rax, %rdx
callq 0x6b9a
testb %al, %al
je 0x5d2b
movslq 0x10(%rsp), %rsi
movslq 0x8(%rsp), %rax
subq %rax, %rsi
cmpl $0x1, %esi
leaq 0x8a37(%rip), %rax      # 0xe749
leaq 0x8d67(%rip), %rdx      # 0xea80
cmoveq %rax, %rdx
leaq 0x84c8(%rip), %rdi      # 0xe1ec
xorl %eax, %eax
callq 0x50b5
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_go_insert
void k_go_insert(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();
	buffer_t *buf = win->buf;

	*win->ui_pos = buf->prev_insert;
	ui_set_bufmode(UI_INSERT);

	ui_cur_changed();
}

// Assembly:
pushq %rax
callq 0xd170
movq (%rax), %rcx
movq 0x30(%rax), %rax
movq 0x24(%rcx), %rcx
movq %rcx, (%rax)
pushq $0x2
popq %rdi
callq 0x4b74
popq %rax
jmp 0x501c
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_go_visual
void k_go_visual(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();
	buffer_t *buf = win->buf;

	ui_set_bufmode(buf->prev_visual.mode);

	*win->ui_pos = buf->prev_visual.npos;
	*window_uipos_alt(win) = buf->prev_visual.vpos;

	ui_cur_changed();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0xd170
movq %rax, %rbx
movq (%rax), %r14
movl 0x20(%r14), %edi
callq 0x4b74
movq 0x30(%rbx), %rax
movq 0x10(%r14), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
callq 0xcee5
movq 0x18(%r14), %rcx
movq %rcx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x501c
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: word_search
void word_search(const char *word, bool backwards)
{
	m_setlastsearch(ustrdup(word), !backwards);

	motion m_search = {
		.func = m_searchnext,
		.arg.i = +1,
		.how = M_EXCLUSIVE
	};

	motion_apply_win(&m_search, /*repeat:*/1, windows_cur());
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
callq 0x5672
xorb $0x1, %bl
movzbl %bl, %esi
movq %rax, %rdi
callq 0xadf7
movq 0xfc79(%rip), %rax      # 0x15a68
movq %rsp, %rbx
movq %rax, 0x10(%rbx)
movups 0xfc5b(%rip), %xmm0     # 0x15a58
movaps %xmm0, (%rbx)
callq 0xd170
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xb26b
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: word_list
void word_list(const char *word, bool flag)
{
	buffer_t *b = buffers_cur();

	int hit = 0, n = 0;
	for(list_t *i = b->head; i; i = i->next, n++)
		if(tim_strstr(i->line, i->len_line, word))
			ui_printf("%d: %d %s", ++hit, n, i->line);

	ui_want_return();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0xd170
movq (%rax), %r12
addq $0x8, %r12
leaq 0x83ce(%rip), %r14      # 0xe205
xorl %ebp, %ebp
xorl %r15d, %r15d
movq (%r12), %r12
testq %r12, %r12
je 0x5e79
movq (%r12), %rdi
movq 0x8(%r12), %rsi
movq %rbx, %rdx
callq 0xb57b
testq %rax, %rax
je 0x5e70
incl %ebp
movq (%r12), %rcx
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x555e
addq $0x18, %r12
incl %r15d
jmp 0x5e3c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x563f
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: word_tag
void word_tag(const char *word, bool flag)
{
	struct ctag_result tag;

	if(buffers_cur()->modified){
		ui_err("buffer modified");
		return;
	}

	if(!ctag_search(word, &tag)){
		ui_err("couldn't find tag \"%s\"", word);
		return;
	}

	char *search = tag.line;

	{
		if(strncmp(search, "/^", 2))
			goto out_badtag;
		char *end = strchr(search, '\0');
		if(end - search < 5)
			goto out_badtag;
		if(!strcmp(end - 2, "$/"))
			end[-2] = '\0';
		search += 2;
	}

	const char *current = buffer_fname(buffers_cur());
	if(current && !strcmp(tag.fname, current)){
		/* we're the same file, don't need to replace/do modification check */
	}else if(!edit_common(tag.fname, false)){
		goto out;
	}

	{
		*windows_cur()->ui_pos = (point_t){ 0 };
		word_search(search, false);
	}

	ui_redraw();
	ui_cur_changed();

out:
	ctag_free(&tag);
	return;
out_badtag:
	ui_err("bad tag '%s'", tag.line);
	goto out;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xd170
movq (%rax), %rax
cmpb $0x1, 0x39(%rax)
jne 0x5eb3
leaq 0x836a(%rip), %rdi      # 0xe20f
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x4c34
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xd4c0
testb %al, %al
je 0x5eff
movq 0x10(%rsp), %rbx
cmpb $0x2f, (%rbx)
jne 0x5ee2
cmpb $0x5e, 0x1(%rbx)
jne 0x5ee2
movq %rbx, %rdi
callq 0x4170
cmpq $0x5, %rax
jge 0x5f18
leaq 0x834d(%rip), %rdi      # 0xe236
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4c34
leaq 0x8(%rsp), %rdi
callq 0xd5b8
jmp 0x5f10
leaq 0x8319(%rip), %rdi      # 0xe21f
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4c34
addq $0x18, %rsp
popq %rbx
popq %r14
retq
cmpb $0x24, -0x2(%rbx,%rax)
jne 0x5f31
cmpb $0x2f, -0x1(%rbx,%rax)
jne 0x5f31
cmpb $0x0, (%rbx,%rax)
jne 0x5f31
movb $0x0, -0x2(%rbx,%rax)
callq 0xd170
movq (%rax), %rdi
callq 0x8cc6
movq 0x8(%rsp), %r14
testq %rax, %rax
je 0x5f57
movq %r14, %rdi
movq %rax, %rsi
callq 0x42e0
testl %eax, %eax
je 0x5f65
movq %r14, %rdi
xorl %esi, %esi
callq 0x6fb0
testb %al, %al
je 0x5ef3
addq $0x2, %rbx
callq 0xd170
movq 0x30(%rax), %rax
andq $0x0, (%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5dce
callq 0x4cc7
callq 0x501c
jmp 0x5ef3
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: word_man
void word_man(const char *word, bool flag)
{
	/* if the word is all hexadecimal, try git show */
	bool hex = true;

	for(const char *p = word; *p; p++){
		if(!isxdigit(*p)){
			hex = false;
			break;
		}
	}

	char *cmd = join(" ",
			(char *[]){ hex ? "git show" : "man", (char *)word },
			2);

	shellout(cmd);

	free(cmd);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x829d(%rip), %r14      # 0xe243
leaq 0x829f(%rip), %r15      # 0xe24c
movq %rdi, %r12
movsbq (%r12), %r13
testq %r13, %r13
je 0x5fd0
callq 0x4540
movq (%rax), %rax
incq %r12
testb $0x10, 0x1(%rax,%r13,2)
jne 0x5fb0
movq %r15, %r14
movq %rsp, %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x8380(%rip), %rdi      # 0xe361
pushq $0x2
popq %rdx
callq 0x56c3
movq %rax, %rbx
movq %rax, %rdi
callq 0xb38e
movq %rbx, %rdi
callq 0x4080
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: word_gofile
void word_gofile(const char *fname, const bool new_window)
{
	if(!new_window && buffers_modified_single(buffers_cur())){
		ui_err("buffer modified");
		return;
	}

	/* just expand ~ */
	bool free_expanded = true;
	char *expanded = expand_tilde(fname);
	if(!expanded){
		expanded = (char *)fname;
		free_expanded = false;
	}

	/* race condition testing existence, then opening,
	 * but this isn't race-important code / the race condition can't cause
	 * unexpected behaviour */
	if(access(expanded, F_OK) && errno == ENOENT){
		attempt_relative_fname(&expanded, &free_expanded);
	}

	if(new_window){
		buffer_t *new;
		const char *err;
		buffer_new_fname(&new, expanded, &err);

		if(err)
			ui_err("%s: %s", expanded, err);

		/* open a window there anyway */
		window *wnew = window_new(new);

		window_add_neighbour(windows_cur(), neighbour_up, wnew);
		buffer_release(new);

		windows_set_cur(wnew);

	}else{
		edit_common(expanded, false);
	}

	ui_redraw();
	ui_cur_changed();

	if(free_expanded)
		free(expanded);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movl %esi, %ebp
movq %rdi, %rbx
testl %esi, %esi
jne 0x6063
callq 0xd170
movq (%rax), %rdi
callq 0xca35
testb %al, %al
je 0x6063
leaq 0x81c2(%rip), %rdi      # 0xe20f
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4c34
movq %rbx, %rdi
callq 0xb74f
movq %rax, %r14
testq %rax, %rax
setne %r12b
cmovneq %rax, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4420
testl %eax, %eax
je 0x6131
callq 0x40a0
cmpl $0x2, (%rax)
jne 0x6131
cmpb $0x2f, (%rbx)
je 0x6131
callq 0xd170
movq (%rax), %rdi
callq 0x8cc6
testq %rax, %rax
je 0x6131
movq %rax, %r15
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x4340
testl %eax, %eax
jne 0x60dd
movl $0xf000, %eax           # imm = 0xF000
andl 0x28(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x60dd
xorl %r12d, %r12d
jmp 0x60fb
movq %r15, %rdi
callq 0x5672
movq %rax, %r12
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0x4200
testq %rax, %rax
je 0x60fb
movb $0x0, (%rax)
testq %r12, %r12
cmovneq %r12, %r15
movq %rsp, %rsi
movq %r15, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x84db(%rip), %rdi      # 0xe5ee
pushq $0x2
popq %rdx
callq 0x56c3
movq %rax, %rbx
movq %r12, %rdi
callq 0x4080
movq %r14, %rdi
callq 0x4080
movb $0x1, %r12b
testb %bpl, %bpl
je 0x619c
leaq 0x10(%rsp), %rdi
movq %rsp, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8ba2
movq (%r14), %rdx
testq %rdx, %rdx
je 0x6162
leaq 0x83cd(%rip), %rdi      # 0xe525
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4c34
movq 0x10(%rsp), %rdi
callq 0xce57
movq %rax, %r14
callq 0xd170
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xcd47
movq 0x10(%rsp), %rdi
leaq 0x28ab(%rip), %rsi      # 0x8a38
callq 0xc25f
movq %r14, %rdi
callq 0xd184
jmp 0x61a6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6fb0
callq 0x4cc7
callq 0x501c
testb %r12b, %r12b
je 0x61bd
movq %rbx, %rdi
callq 0x4080
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_go_tab
void k_go_tab(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	repeat = DEFAULT_REPEAT(repeat);

	tab *t = tabs_cur();
	unsigned nforward;

	if(a->pos.x > 0){
		nforward = repeat;
	}else{
		unsigned ntabs = tabs_count();
		unsigned nback = -a->pos.x;

		/* 5 tabs, go 2 back means go 5-2 forwards, i.e. 3 */
		nforward = repeat * (ntabs - nback);
	}

	while(nforward --> 0)
		t = tab_next(t);

	tabs_set_cur(t);

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
cmpl $0x1, %esi
adcl $0x0, %ebx
callq 0xd250
movq %rax, %r14
cmpl $0x0, (%r15)
jg 0x6200
callq 0xd27e
addl (%r15), %eax
imull %eax, %ebx
jmp 0x6200
callq 0xd210
movq %rax, %r14
movq %r14, %rdi
subl $0x1, %ebx
jae 0x61f8
callq 0xd258
callq 0x4cc7
popq %rbx
popq %r14
popq %r15
jmp 0x501c
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_scroll
void k_scroll(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();

	if(a->pos.x){
		/* y: 0=mid, -1=top, 1=bot */
		int h = 0;
		switch(a->pos.y){
			case 0:
				h = win->screen_coord.h / 2;
				break;
			case -1:
				break;
			case 1:
				h = win->screen_coord.h - 1;
				break;
		}
		win->ui_start.y = win->ui_pos->y - h;
	}else{
		win->ui_start.y += a->pos.y;
	}

	if(win->ui_start.y < 0)
		win->ui_start.y = 0;

	if(win->ui_pos->y < win->ui_start.y)
		win->ui_pos->y = win->ui_start.y;
	else if(win->ui_pos->y >= win->ui_start.y + win->screen_coord.h)
		win->ui_pos->y = win->ui_start.y + win->screen_coord.h - 1;

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xd170
movq %rax, %rcx
cmpl $0x0, (%rbx)
movl 0x4(%rbx), %edx
je 0x6257
cmpl $0x1, %edx
je 0x625c
xorl %eax, %eax
testl %edx, %edx
jne 0x6261
movl 0x1c(%rcx), %eax
pushq $0x2
popq %rsi
cltd
idivl %esi
jmp 0x6261
addl 0xc(%rcx), %edx
jmp 0x626a
movl 0x1c(%rcx), %eax
decl %eax
movq 0x30(%rcx), %rdx
movl 0x4(%rdx), %edx
subl %eax, %edx
movl %edx, 0xc(%rcx)
testl %edx, %edx
jns 0x6277
andl $0x0, 0xc(%rcx)
xorl %edx, %edx
movq 0x30(%rcx), %rax
movl 0x4(%rax), %esi
cmpl %edx, %esi
jl 0x628b
addl 0x1c(%rcx), %edx
cmpl %edx, %esi
jl 0x628e
decl %edx
movl %edx, 0x4(%rax)
callq 0x4cc7
popq %rbx
jmp 0x501c
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_jumpscroll
void k_jumpscroll(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *w = windows_cur();
	const int height = w->screen_coord.h + 1;

	int inc = 0;

	switch(abs(a->i)){
		case 2:  inc = height;     break;
		case 1:  inc = height / 2; break;
	}

	if(a->i < 0)
		inc = -inc;

	w->ui_pos->y += inc;
	w->ui_start.y += inc;

	start_of_line(NULL, w);

	ui_cur_changed();
	ui_redraw();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xd170
movq %rax, %rsi
movl 0x1c(%rax), %eax
incl %eax
movl (%rbx), %edi
movl %edi, %edx
negl %edx
cmovsl %edi, %edx
cmpl $0x1, %edx
je 0x62c1
xorl %ecx, %ecx
cmpl $0x2, %edx
je 0x62c7
jmp 0x62c9
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %ecx
movl %ecx, %eax
negl %eax
testl %edi, %edi
cmovnsl %ecx, %eax
movq 0x30(%rsi), %rcx
addl %eax, 0x4(%rcx)
addl %eax, 0xc(%rsi)
xorl %edi, %edi
callq 0xa6ec
callq 0x501c
popq %rbx
jmp 0x4cc7
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_winsel
void k_winsel(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	enum neighbour dir = pos2dir(&a->pos);

	window *const curwin = windows_cur();
	window *found = NULL;

	switch(dir){
		case neighbour_up:
			found = curwin->neighbours.above;
			break;

		case neighbour_down:
			found = curwin->neighbours.below;
			break;

		case neighbour_left:
		case neighbour_right:
			for(found = curwin; found->neighbours.above; found = found->neighbours.above);
			found = (dir == neighbour_left ? found->neighbours.left : found->neighbours.right);
			if(!found)
				break;

			const int to_match = curwin->screen_coord.y + curwin->ui_pos->y - curwin->ui_start.y;

			while(found->neighbours.below)
			{
				if(found->screen_coord.y <= to_match
				&& to_match <= found->screen_coord.y + found->screen_coord.h)
				{
					break;
				}
				found = found->neighbours.below;
			}
	}

	if(found && found != curwin){
		windows_set_cur(found);
		ui_redraw();
		ui_cur_changed();
	}else{
		ui_err("no buffers in that direction");
	}
}

// Assembly:
pushq %rbx
callq 0x6b33
movl %eax, %ebx
callq 0xd170
leal -0x2(%rbx), %ecx
cmpl $0x2, %ecx
jae 0x634d
movq %rax, %rdx
movq %rdx, %rcx
movq 0x60(%rdx), %rdx
testq %rdx, %rdx
jne 0x6306
xorl %edx, %edx
cmpl $0x2, %ebx
setne %dl
movq 0x48(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
je 0x636c
movq 0x30(%rax), %rdx
movl 0x4(%rdx), %edx
addl 0x14(%rax), %edx
subl 0xc(%rax), %edx
movq %rcx, %rdi
movq 0x58(%rcx), %rcx
testq %rcx, %rcx
je 0x635c
movl 0x14(%rdi), %esi
cmpl %edx, %esi
jg 0x6331
addl 0x1c(%rdi), %esi
cmpl %esi, %edx
jg 0x6331
jmp 0x635c
testl %ebx, %ebx
jne 0x6355
pushq $0x60
jmp 0x6357
pushq $0x58
popq %rcx
movq (%rax,%rcx), %rdi
testq %rdi, %rdi
sete %cl
cmpq %rax, %rdi
sete %al
orb %cl, %al
je 0x637b
leaq 0x7e10(%rip), %rdi      # 0xe183
xorl %eax, %eax
popq %rbx
jmp 0x4c34
callq 0xd184
callq 0x4cc7
popq %rbx
jmp 0x501c
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_winmove
void k_winmove(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	enum neighbour dir = pos2dir(&a->pos);
	int count = 0;

	window *w;
	ITER_WINDOWS(w){
		count++;
		if(count == 2){
			/* now have >1 */
			break;
		}
	}
	if(count < 2)
		return;

	w = windows_cur();
	window *target = window_next(w);

	window_evict(w);

	switch(dir){
		case neighbour_up:
			for(; target->neighbours.above;
					target = target->neighbours.above);
			break;

		case neighbour_down:
			for(; target->neighbours.below;
					target = target->neighbours.below);
			break;

		case neighbour_right:
			for(; target->neighbours.above;
					target = target->neighbours.above);
			for(; target->neighbours.right;
					target = target->neighbours.right);
			break;

		case neighbour_left:
			for(; target->neighbours.above;
					target = target->neighbours.above);
			for(; target->neighbours.left;
					target = target->neighbours.left);
			break;
	}

	window_add_neighbour(target, dir, w);

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x6b33
movl %eax, %ebx
callq 0xd170
movq %rax, %rdi
callq 0xcb9a
xorl %ecx, %ecx
pushq $0x2
popq %rdx
testq %rax, %rax
je 0x63cb
movq %rax, %rsi
testq %rsi, %rsi
je 0x63c5
cmpl $0x1, %ecx
je 0x63c3
movq 0x58(%rsi), %rsi
incl %ecx
jmp 0x63b1
movl %edx, %ecx
movq 0x50(%rax), %rax
jmp 0x63a9
cmpl $0x2, %ecx
jge 0x63d6
popq %rbx
popq %r14
popq %r15
retq
callq 0xd170
movq %rax, %r14
movq %rax, %rdi
callq 0xcb79
movq %rax, %r15
movq %r14, %rdi
callq 0xcbf4
movl %ebx, %eax
leaq 0x7cb6(%rip), %rcx      # 0xe0b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
movq 0x60(%r15), %r15
testq %r15, %r15
jne 0x6403
jmp 0x6451
movq %r15, %rax
movq 0x60(%r15), %r15
testq %r15, %r15
jne 0x6411
movq %rax, %rdi
movq 0x48(%rax), %rax
testq %rax, %rax
jne 0x641d
jmp 0x6451
movq %r15, %rax
movq 0x60(%r15), %r15
testq %r15, %r15
jne 0x642b
movq %rax, %rdi
movq 0x50(%rax), %rax
testq %rax, %rax
jne 0x6437
jmp 0x6451
movq %r15, %rdi
movq 0x58(%r15), %r15
testq %r15, %r15
jne 0x6445
movl %ebx, %esi
movq %r14, %rdx
callq 0xcd47
callq 0x4cc7
popq %rbx
popq %r14
popq %r15
jmp 0x501c
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_show
void k_show(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();
	buffer_t *buf = win->buf;
	(void)a;
	ui_status("%s%s%s, %sx=%d y=%d eol=%c",
			buf->fname ? "\"" : "",
			buf->fname ? buf->fname : "<no name>",
			buf->fname ? "\"" : "",
			buf->modified ? "[+] " : "",
			win->ui_pos->x, win->ui_pos->y,
			"ny"[buf->eol]);
}

// Assembly:
pushq %rax
callq 0xd170
movq (%rax), %rsi
movq 0x30(%rax), %rax
movq 0x30(%rsi), %rdi
testq %rdi, %rdi
leaq 0x8296(%rip), %r9       # 0xe749
leaq 0x80e3(%rip), %rcx      # 0xe59d
cmoveq %r9, %rcx
leaq 0x7cf6(%rip), %rdx      # 0xe1bb
cmovneq %rdi, %rdx
cmpb $0x0, 0x39(%rsi)
leaq 0x7cf1(%rip), %r8       # 0xe1c5
cmoveq %r9, %r8
movl (%rax), %r9d
movl 0x4(%rax), %r10d
movzbl 0x38(%rsi), %eax
leaq 0x7ce0(%rip), %rsi      # 0xe1ca
movsbl (%rax,%rsi), %r11d
leaq 0x7caa(%rip), %rdi      # 0xe1a0
movq %rcx, %rsi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x50b5
popq %rax
popq %rcx
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_ins_colcopy
void k_ins_colcopy(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();

	list_t *line = window_current_line(win, false);
	if(!line)
		return;
	line = a->i > 0 ? line->next : line->prev;
	if(!line)
		return;

	if((unsigned)win->ui_pos->x >= line->len_line)
		return;

	window_inschar(win, line->line[win->ui_pos->x]);

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0xd170
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0xcef6
testq %rax, %rax
je 0x6568
xorl %ecx, %ecx
cmpl $0x0, (%r14)
setle %cl
movq 0x18(%rax,%rcx,8), %rax
testq %rax, %rax
je 0x6568
movq 0x30(%rbx), %rcx
movl (%rcx), %ecx
cmpq %rcx, 0x8(%rax)
jbe 0x6568
movslq %ecx, %rcx
movq (%rax), %rax
movsbl (%rax,%rcx), %esi
movq %rbx, %rdi
callq 0xd039
callq 0x4cc7
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x501c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_normal1
void k_normal1(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();

	const enum buf_mode save = win->ui_mode;
	win->ui_mode = UI_NORMAL;

	ui_normal_1(&repeat, IO_MAPRAW | bufmode_to_iomap(win->ui_mode));

	win->ui_mode = save;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rbx
movl %esi, (%rbx)
callq 0xd170
movq %rax, %r14
movl 0x40(%rax), %ebp
movl $0x1, 0x40(%rax)
pushq $0x1
popq %rdi
callq 0xbbb0
orl $0x10, %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x5236
movl %ebp, 0x40(%r14)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_docmd
void k_docmd(const keyarg_u *arg, unsigned repeat, const int from_ch)
{
	const char **i;
	char **argv;
	size_t l;

	for(l = 0, i = arg->cmd.argv; i && *i; i++, l++);

	argv = umalloc((l + 1) * sizeof *argv);

	for(l = 0, i = arg->cmd.argv; i && *i; i++, l++)
		argv[l] = ustrdup(*i);

	cmd_dispatch(&arg->cmd.fn, 1, argv, arg->cmd.force, /*range:*/NULL);

	if(arg->cmd.argv[0])
		for(l = 0; argv[l]; l++)
			free(argv[l]);
	free(argv);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
pushq $0x8
popq %rdi
testq %rax, %rax
je 0x65da
cmpq $0x0, (%rax)
je 0x65da
addq $0x8, %rax
addq $0x8, %rdi
jmp 0x65c5
callq 0x5648
movq %rax, %r14
movq 0x18(%rbx), %r15
xorl %r12d, %r12d
movq %r15, %rax
addq %r12, %rax
je 0x6608
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6608
callq 0x5672
movq %rax, (%r14,%r12)
addq $0x8, %r12
jmp 0x65e9
movzbl 0x20(%rbx), %ecx
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x89fb
movq 0x18(%rbx), %rax
cmpq $0x0, (%rax)
je 0x663d
movq %r14, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x663d
callq 0x4080
addq $0x8, %rbx
jmp 0x662a
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4080
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_showch
void k_showch(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();
	list_t *l = window_current_line(win, false);
	if(l){
		if((unsigned)win->ui_pos->x < l->len_line){
			const int ch = l->line[win->ui_pos->x];

			ui_status("<%s> %d Hex %x Octal %o",
					ch ? (char[]){ ch, 0 } : "^@",
					ch, ch, ch);
			return;
		}
	}

	ui_status("NUL");
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
callq 0xd170
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0xcef6
testq %rax, %rax
je 0x685d
movq 0x30(%rbx), %rcx
movl (%rcx), %ecx
cmpq %rcx, 0x8(%rax)
jbe 0x685d
movslq %ecx, %rcx
movq (%rax), %rax
movsbl (%rax,%rcx), %ecx
testl %ecx, %ecx
je 0x6870
leaq 0xe(%rsp), %rsi
movb %cl, (%rsi)
movb $0x0, 0x1(%rsi)
jmp 0x6877
leaq 0x7984(%rip), %rdi      # 0xe1e8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
jmp 0x50b5
leaq 0x796e(%rip), %rsi      # 0xe1e5
leaq 0x794f(%rip), %rdi      # 0xe1cd
movl %ecx, %edx
movl %ecx, %r8d
xorl %eax, %eax
callq 0x50b5
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: motion_read
const motion *motion_read(unsigned *repeat, bool apply_maps)
{
	const enum io io_m =
		apply_maps ? bufmode_to_iomap(windows_cur()->ui_mode) : IO_NOMAP;

	*repeat = io_read_repeat(io_m);

	int i = keys_filter(
			io_m,
			(char *)motion_keys, motion_keys_cnt,
			offsetof(motionkey_t, keys), sizeof(motionkey_t),
			-1);

	if(i == -1)
		return NULL;
	return &motion_keys[i].motion;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x6a73
callq 0xd170
movl 0x40(%rax), %edi
callq 0xbbb0
movl %eax, %ebp
jmp 0x6a76
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0xbd5b
movl %eax, (%rbx)
leaq 0xd77a(%rip), %rbx      # 0x14200
pushq $0x2b
popq %rdx
xorl %r14d, %r14d
pushq $0x20
popq %r8
pushq $-0x1
popq %r9
movl %ebp, %edi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x6890
cltq
movq %rax, %rcx
shlq $0x5, %rcx
cmpl $-0x1, %eax
leaq 0x8(%rcx,%rbx), %rax
cmovneq %rax, %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: prompt_finish
static void prompt_finish(char *cmd)
{
	const cmd_t *cmd_f;
	char **argv;
	int argc;
	bool force;
	struct range rstore, *range = &rstore;

	if(parse_ranged_cmd(
			cmd,
			&cmd_f,
			&argv, &argc,
			&force, &range))
	{
		cmd_dispatch(cmd_f, argc, argv, force, range);
	}
	else
	{
		ui_err("unknown command %s", cmd);
	}

	free_argv(argv, argc);
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x28(%rsp), %rax
leaq 0x18(%rsp), %r9
movq %rax, (%r9)
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
leaq 0xb(%rsp), %r8
callq 0xc5c5
testb %al, %al
je 0x6b0e
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdx
movzbl 0xb(%rsp), %ecx
movq 0x18(%rsp), %r8
callq 0x89fb
jmp 0x6b1f
leaq 0x7740(%rip), %rdi      # 0xe255
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4c34
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0xc856
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: around_motion
static bool around_motion(
		unsigned repeat, const int from_ch,
		bool always_linewise,
		struct around_motion *action,
		region_t *used_region)
{
	motion m_doubletap = {
		.func = m_move,
		.how = M_LINEWISE,
	};

	unsigned repeat_motion;
	const motion *m = motion_read_or_visual(
			&repeat_motion, /* operator pending - no maps: */ false);

	if(!m){
		/* check for dd, etc */
		bool raw;
		int ch = io_getch(IO_NOMAP, &raw, true);
		(void)raw;

		if(ch == from_ch){
			/* dd - stay where we are, +the repeat */
			m_doubletap.arg.pos.y = DEFAULT_REPEAT(repeat) - 1;
			repeat = 0;
			m = &m_doubletap;
		}else{
			if(ch != K_ESC)
				ui_err("no motion '%c'", ch);
			/*io_ungetch(ch);*/
		}
	}

	if(m){
		if(!repeat && !repeat_motion){
			/* leave repeat as zero
			 * e.g. dG will not set any repeats, telling 'G' / m_eof
			 * to go to the default, end of file.
			 */
		}else{
			repeat = DEFAULT_REPEAT(repeat) * DEFAULT_REPEAT(repeat_motion);
		}

		window *win = windows_cur();

		region_t r;
		if(!motion_to_region(m, repeat, win, &r))
			return false;

		if(used_region)
			*used_region = r;

		/* reset cursor to beginning, then allow adjustments */
		*win->ui_pos = r.begin;
		if(action)
			action->fn(win->buf, &r, win->ui_pos, action);

		ui_set_bufmode(UI_NORMAL);

		ui_redraw();
		ui_cur_changed();

		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %r12d
movl %edi, %ebp
movq 0xeec6(%rip), %rax      # 0x15a80
movq %rax, 0x30(%rsp)
movups 0xeeaa(%rip), %xmm0     # 0x15a70
movaps %xmm0, 0x20(%rsp)
leaq 0x4(%rsp), %rdi
callq 0x6b4c
testq %rax, %rax
je 0x6bdf
movq %rax, %r15
jmp 0x6c08
leaq 0x8(%rsp), %rsi
pushq $0x1
popq %rdi
movl %edi, %edx
callq 0xbbc8
cmpl %r12d, %eax
jne 0x6ca3
cmpl $0x1, %ebp
adcl $-0x1, %ebp
leaq 0x20(%rsp), %r15
movl %ebp, 0xc(%r15)
xorl %ebp, %ebp
testl %ebp, %ebp
movl 0x4(%rsp), %eax
pushq $0x1
popq %rcx
movl %ecx, %edx
cmovnel %ebp, %edx
testl %eax, %eax
setne %sil
cmovnel %eax, %ecx
imull %edx, %ecx
xorl %r13d, %r13d
testb $0x1, %sil
cmovnel %ecx, %r13d
testl %ebp, %ebp
cmovnel %ecx, %r13d
callq 0xd170
movq %rax, %r12
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
movl %r13d, %esi
movq %rax, %rdx
callq 0xb2ab
movl %eax, %ebp
testb %al, %al
je 0x6cba
testq %r14, %r14
je 0x6c6a
movl 0x18(%rsp), %eax
movl %eax, 0x10(%r14)
movups 0x8(%rsp), %xmm0
movups %xmm0, (%r14)
movq 0x30(%r12), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
testq %rbx, %rbx
je 0x6c8f
movq (%r12), %rdi
movq 0x30(%r12), %rdx
leaq 0x8(%rsp), %rsi
movq %rbx, %rcx
callq *(%rbx)
pushq $0x1
popq %rdi
callq 0x4b74
callq 0x4cc7
callq 0x501c
jmp 0x6cba
cmpl $0x1b, %eax
je 0x6cb8
leaq 0x75b9(%rip), %rdi      # 0xe268
movl %eax, %esi
xorl %eax, %eax
callq 0x4c34
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: filter
static void filter(
		buffer_t *buf,
		const region_t *region,
		point_t *out,
		struct around_motion *around)
{
	const struct filter_input *pf = around->filter;
	bool free_cmd = false;
	char *cmd;

	switch(pf->type){
		case FILTER_CMD:
			cmd = pf->s;
			if(!cmd){
				char initial[32];

				snprintf(initial, sizeof initial, "%d,%d!",
						region->begin.y,
						region->end.y);

				cmd = prompt(':', initial);
				if(!cmd)
					return;

				prompt_finish(cmd);

				free(cmd);
				return;
			}else{
				break;
			}

		case FILTER_SELF:
			cmd = "sh";
	}

	if(buffer_filter(buf, region, cmd))
		ui_err("filter: %s", strerror(errno));

	if(free_cmd)
		free(cmd);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq 0x8(%rcx), %rax
cmpl $0x1, (%rax)
jne 0x6d4c
movq 0x8(%rax), %rdx
testq %rdx, %rdx
jne 0x6d53
movl 0x4(%rsi), %ecx
movl 0xc(%rsi), %r8d
leaq 0x7560(%rip), %rdx      # 0xe277
movq %rsp, %rbx
pushq $0x20
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41e0
pushq $0x3a
popq %rdi
movq %rbx, %rsi
callq 0xb7f4
testq %rax, %rax
je 0x6d7e
movq %rax, %rbx
movq %rax, %rdi
callq 0x6abd
movq %rbx, %rdi
callq 0x4080
jmp 0x6d7e
leaq 0x796a(%rip), %rdx      # 0xe6bd
callq 0x8fad
testl %eax, %eax
je 0x6d7e
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x750f(%rip), %rdi      # 0xe27e
movq %rax, %rsi
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x4c34
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/keys.c
// Function: k_on_wordfile
static void k_on_wordfile(const keyarg_u *a, char *fn(const window *), const char *desc)
{
	char *word = fn(windows_cur());

	if(!word){
		ui_err("no %s under cursor", desc);
		return;
	}

	a->word_action.fn(word, a->word_action.flag);

	free(word);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0xd170
movq %rax, %rdi
callq *%r15
testq %rax, %rax
je 0x6dc8
movq %rax, %r15
movzbl 0x8(%r14), %esi
movq %rax, %rdi
callq *(%r14)
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4080
leaq 0x74ba(%rip), %rdi      # 0xe289
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x4c34
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: quit_common
static bool quit_common(
		bool qall,
		int argc, char **argv,
		bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	if(!force){
		bool modified = false;

		if(qall){
			tab *modtab;
			window *modwin = buffers_modified_excluding(NULL, &modtab);

			if(modwin){
				modified = true;

				tabs_set_cur(modtab);
				tab_set_focus(modtab, modwin);
				ui_redraw();
				ui_cur_changed();
			}
		}else{
			modified = buffers_modified_single(buffers_cur());
		}

		if(modified){
			ui_err("buffer modified");
			return false;
		}
	}

	if(qall){
		ui_run = UI_EXIT_0;
	}else{
		window *win = windows_cur();
		window *focus = window_next(win);

		/* check remaining buffers */
		if(!force && !focus && args_next_fname(false)){
			ui_err("more files to edit");
			return false;
		}

		window_evict(win);
		window_free(win);
		windows_set_cur(focus);

		if(!focus){
			/* fallback to another tab? */
			tab *current = tabs_cur();
			tab *tabfocus = tab_next(current);

			if(tabfocus == current){
				/* no more tabs */
				ui_run = UI_EXIT_0;
				tabfocus = NULL;
			}

			tabs_set_cur(tabfocus);
			tab_evict(current);
			tab_free(current);
		}

		switch(ui_run){
			case UI_EXIT_0:
			case UI_EXIT_1:
				break;
			case UI_RUNNING:
				ui_redraw();
				ui_cur_changed();
				break;
		}
	}

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
testq %r8, %r8
je 0x6e0c
movq (%rdx), %rsi
leaq 0x7492(%rip), %rdi      # 0xe29c
jmp 0x6e2b
cmpl $0x1, %esi
jne 0x6e21
movl %ecx, %ebx
testb %bl, %bl
je 0x6e40
testb %dil, %dil
jne 0x6e7c
jmp 0x6ea7
movq (%rdx), %rsi
leaq 0x748c(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
testb %dil, %dil
je 0x6e8d
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0xca4f
testq %rax, %rax
je 0x6e7c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0xd258
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xd1e3
callq 0x4cc7
callq 0x501c
jmp 0x6e9e
leaq 0xf551(%rip), %rax      # 0x163d4
movl $0x1, (%rax)
movb $0x1, %bl
jmp 0x6e34
callq 0xd170
movq (%rax), %rdi
callq 0xca35
testb %al, %al
je 0x6ea7
leaq 0x736a(%rip), %rdi      # 0xe20f
jmp 0x6ed7
callq 0xd170
movq %rax, %r15
movq %rax, %rdi
callq 0xcb79
movq %rax, %r14
testq %rax, %rax
setne %al
orb %al, %bl
jne 0x6ee5
xorl %edi, %edi
callq 0x465c
testq %rax, %rax
je 0x6ee5
leaq 0x75ed(%rip), %rdi      # 0xe4c4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
jmp 0x6e34
movq %r15, %rdi
callq 0xcbf4
movq %r15, %rdi
callq 0xce94
movq %r14, %rdi
callq 0xd184
testq %r14, %r14
jne 0x6f3e
callq 0xd250
movq %rax, %rbx
movq %rax, %rdi
callq 0xd210
cmpq %rbx, %rax
jne 0x6f26
leaq 0xf4b6(%rip), %rax      # 0x163d4
movl $0x1, (%rax)
xorl %eax, %eax
movq %rax, %rdi
callq 0xd258
movq %rbx, %rdi
callq 0xd1e7
movq %rbx, %rdi
callq 0xd1b2
leaq 0xf48f(%rip), %rax      # 0x163d4
movb $0x1, %bl
cmpl $0x0, (%rax)
jne 0x6e34
callq 0x4cc7
callq 0x501c
jmp 0x6e34
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_cq
bool c_cq(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	/* no buffer checks */
	ui_run = UI_EXIT_1;

	return true;
}

// Assembly:
pushq %rbx
testq %rcx, %rcx
je 0x6f83
movq (%rsi), %rsi
leaq 0x731b(%rip), %rdi      # 0xe29c
jmp 0x6fa3
cmpl $0x1, %edi
jne 0x6f99
leaq 0xf445(%rip), %rax      # 0x163d4
movl $0x2, (%rax)
movb $0x1, %bl
jmp 0x6fac
movq (%rsi), %rsi
leaq 0x7314(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: edit_common
bool edit_common(const char *fname, bool const force)
{
	window *win = windows_cur();

	const bool reload = !fname;
	if(reload)
		fname = buffer_fname(win->buf);

	if(!fname){ /* shouldn't be the case */
		ui_err("no filename");
		return false;
	}

	/* if it's a reload, we care about whether the buffer is modified, no matter
	 * how many times it's open. otherwise we are loading another file, which is
	 * fine as long as it's not the only instance of the modified-buffer
	 */
	if(!force && (reload ? win->buf->modified : buffers_modified_single(win->buf))){
		ui_err("buffer modified");
		return false;
	}

	bool ret = false;

	const char *err;
	bool loaded = reload
		? window_reload_buffer(win, &err)
		: window_replace_fname(win, fname, &err);

	if(loaded){
		ui_status("%s: loaded", fname);
		buffers_cur()->modified = false;
		ret = true;
	}else{
		ui_err("%s: %s", fname, err);
		if(!reload){
			/* wipe the buffer, e.g. :e /root/hi */
			buffer_t *empty = buffer_new();
			window_replace_buffer(win, empty);
			buffer_release(empty);
		}
	}

	buffer_set_fname(buffers_cur(), fname);

	ui_redraw();
	ui_cur_changed();

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r15
callq 0xd170
movq %rax, %r14
testq %r15, %r15
je 0x6ff4
testb %bpl, %bpl
jne 0x6fda
movq (%r14), %rdi
callq 0xca35
testb %al, %al
jne 0x7016
movq %rsp, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0xd0d9
movq %r15, %rbx
testb %al, %al
je 0x7053
movq %r15, %rbx
jmp 0x7031
movq (%r14), %rdi
callq 0x8cc6
testq %rax, %rax
je 0x70af
movq %rax, %rbx
testb %bpl, %bpl
jne 0x7022
movq (%r14), %rax
cmpb $0x0, 0x39(%rax)
je 0x7022
leaq 0x71f2(%rip), %rdi      # 0xe20f
jmp 0x70b6
movq %rsp, %rsi
movq %r14, %rdi
callq 0xd124
testb %al, %al
je 0x7053
leaq 0x7295(%rip), %rdi      # 0xe2cd
movq %rbx, %rsi
xorl %eax, %eax
callq 0x50b5
callq 0xd170
movq (%rax), %rax
movb $0x0, 0x39(%rax)
movb $0x1, %bpl
jmp 0x7093
movq (%rsp), %rdx
leaq 0x74c7(%rip), %rdi      # 0xe525
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4c34
testq %r15, %r15
je 0x7093
callq 0x8a57
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0xd083
leaq 0x19af(%rip), %rsi      # 0x8a38
movq %r15, %rdi
callq 0xc25f
xorl %ebp, %ebp
callq 0xd170
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x8b43
callq 0x4cc7
callq 0x501c
jmp 0x70bf
leaq 0x720b(%rip), %rdi      # 0xe2c1
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4c34
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_n
bool c_n(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	if(buffers_modified_single(buffers_cur()) && !force){
		ui_err("buffer modified");
		return false;
	}

	char *fname = args_next_fname(true);
	if(!fname){
		ui_err("no more files");
		return false;
	}

	return edit_common(fname, force);
}

// Assembly:
pushq %rbx
testq %rcx, %rcx
je 0x70de
movq (%rsi), %rsi
leaq 0x71c0(%rip), %rdi      # 0xe29c
jmp 0x711b
cmpl $0x1, %edi
jne 0x7111
movl %edx, %ebx
callq 0xd170
movq (%rax), %rdi
callq 0xca35
xorb $0x1, %al
orb %bl, %al
je 0x7126
pushq $0x1
popq %rdi
callq 0x465c
testq %rax, %rax
je 0x712f
movzbl %bl, %esi
movq %rax, %rdi
popq %rbx
jmp 0x6fb0
movq (%rsi), %rsi
leaq 0x719c(%rip), %rdi      # 0xe2b7
xorl %eax, %eax
callq 0x4c34
xorl %eax, %eax
popq %rbx
retq
leaq 0x70e2(%rip), %rdi      # 0xe20f
jmp 0x7136
leaq 0x71a2(%rip), %rdi      # 0xe2d8
xorl %eax, %eax
callq 0x4c34
jmp 0x7122