LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gaultier[P]lox-c/vm.c
// Function: fn_call
static Result fn_call(Vm* vm, ObjFunction* fn, uint8_t arg_count) {
    if (fn->arity != arg_count) {
        VM_ERROR(vm, get_location(vm),
                 "Wrong arity in function call: expected %d, got: %d",
                 fn->arity, arg_count);
    }

    if ((vm->frame_len + 1) == FRAMES_MAX) {
        VM_ERROR(vm, get_location(vm), "Reached maximum number of frames: %d",
                 FRAMES_MAX);
    }

    CallFrame* frame = &vm->frames[vm->frame_len++];

    LOG("frames=%d\n", vm->frame_len);
    frame->fn = fn;

    frame->ip = fn->chunk.opcodes;
    frame->slots = vm->stack_top - arg_count - 1;

    return RES_OK;
}

// Assembly:
pushq %rax
movq %rsi, %rax
movq %rdi, %rsi
cmpb %dl, 0x10(%rax)
jne 0x601a
movsbq 0x40618(%rsi), %rcx
cmpq $0x3f, %rcx
je 0x602b
leal 0x1(%rcx), %edi
movb %dil, 0x40618(%rsi)
leaq (%rcx,%rcx,2), %rcx
movq %rax, 0x40018(%rsi,%rcx,8)
movq 0x18(%rax), %rax
movq %rax, 0x40020(%rsi,%rcx,8)
movq 0x40000(%rsi), %rax
movzbl %dl, %edx
shll $0x4, %edx
subq %rdx, %rax
addq $-0x10, %rax
movq %rax, 0x40028(%rsi,%rcx,8)
xorl %eax, %eax
popq %rcx
retq
addq $0x10, %rax
movzbl %dl, %edi
movq %rax, %rdx
callq 0x1bec
jmp 0x6033
movq %rsi, %rdi
callq 0x1c4a
movl $0x2, %eax
jmp 0x6018
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/main.c
// Function: args_next_fname
char *args_next_fname(bool pop)
{
	char *fname = remaining_fnames ? *remaining_fnames : NULL;
	if(pop && fname)
		remaining_fnames++;
	return fname;
}

// Assembly:
movq 0x11c05(%rip), %rcx     # 0x163c8
testq %rcx, %rcx
je 0x47e5
movq (%rcx), %rax
testq %rax, %rax
setne %dl
andb %dil, %dl
cmpb $0x1, %dl
jne 0x47e7
addq $0x8, %rcx
movq %rcx, 0x11be4(%rip)     # 0x163c8
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/main.c
// Function: main
int main(int argc, char **argv)
{
	int i;
	unsigned offset = 0;
	enum init_args initargs = INIT_NONE;

	for(i = 1; i < argc; i++){
		if(!strcmp(argv[i], "-O")){
			initargs = INIT_VALL;
		}else if(!strcmp(argv[i], "-o")){
			initargs = INIT_HALL;
		}else if(*argv[i] == '+'){
			char *p = argv[i] + 1;

			while(isdigit(*p))
				p++;

			if(*p == '\0' && sscanf(argv[i]+1, "%u", &offset) == 1){
				/* continue */
				if(offset > 0)
					offset--; /* 1-base -> 0-base */
			}else{
				break;
			}
		}else{
			break;
		}
	}
	remaining_fnames = argv + i;

	ui_init(); /* must be before buffers_init() */

	tabs_init(initargs, offset);

	int r = ui_main();
	ui_term();

	tabs_term();

	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl $0x0, 0x4(%rsp)
cmpl $0x2, %edi
jl 0x48b3
movl %edi, %ebp
movl %edi, %r12d
movl $0x1, %r15d
xorl %eax, %eax
movl %eax, %r14d
movq (%rbx,%r15,8), %r13
movzbl (%r13), %eax
cmpl $0x2b, %eax
je 0x4851
cmpl $0x2d, %eax
jne 0x48bd
cmpb $0x4f, 0x1(%r13)
jne 0x483c
cmpb $0x0, 0x2(%r13)
je 0x48ac
cmpb $0x6f, 0x1(%r13)
jne 0x48bd
movl $0x2, %eax
cmpb $0x0, 0x2(%r13)
je 0x489e
jmp 0x48bd
callq 0x4540
movq (%rax), %rax
leaq 0x1(%r13), %rcx
movsbq (%rcx), %rdx
incq %rcx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x485d
testb %dl, %dl
jne 0x48bd
incq %r13
movq %r13, %rdi
leaq 0x9788(%rip), %rsi      # 0xe004
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x43d0
cmpl $0x1, %eax
jne 0x48bd
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x489b
decl %eax
movl %eax, 0x4(%rsp)
movl %r14d, %eax
incq %r15
cmpq %r12, %r15
jne 0x4814
jmp 0x48c2
movl $0x1, %eax
jmp 0x489e
xorl %r14d, %r14d
movl $0x1, %eax
jmp 0x48c7
movl %r15d, %ebp
jmp 0x48c5
movl %eax, %r14d
movl %ebp, %eax
leaq (%rbx,%rax,8), %rax
movq %rax, 0x11af6(%rip)     # 0x163c8
callq 0x5305
movl 0x4(%rsp), %esi
movl %r14d, %edi
callq 0xdc38
callq 0x55a6
movl %eax, %ebx
callq 0x5737
callq 0xde57
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ncurses.c
// Function: nc_init
void nc_init()
{
	static int init = 0;

	if(!init){
		init = 1;

		initscr();
		noecho();
		cbreak();
		raw();
		scrollok(stdscr, 1);

		nonl();
		intrflush(stdscr, 0);

		set_escdelay(0);

		if(has_colors()){
			start_color();
			use_default_colors();

			init_pair(1 + COLOR_BLACK,   COLOR_BLACK,   -1);
			init_pair(1 + COLOR_GREEN,   COLOR_GREEN,   -1);
			init_pair(1 + COLOR_WHITE,   COLOR_WHITE,   -1);
			init_pair(1 + COLOR_RED,     COLOR_RED,     -1);
			init_pair(1 + COLOR_CYAN,    COLOR_CYAN,    -1);
			init_pair(1 + COLOR_MAGENTA, COLOR_MAGENTA, -1);
			init_pair(1 + COLOR_BLUE,    COLOR_BLUE,    -1);
			init_pair(1 + COLOR_YELLOW,  COLOR_YELLOW,  -1);

			init_pair(9 + COLOR_BLACK,   -1, COLOR_BLACK);
			init_pair(9 + COLOR_GREEN,   -1, COLOR_GREEN);
			init_pair(9 + COLOR_WHITE,   -1, COLOR_WHITE);
			init_pair(9 + COLOR_RED,     -1, COLOR_RED);
			init_pair(9 + COLOR_CYAN,    -1, COLOR_CYAN);
			init_pair(9 + COLOR_MAGENTA, -1, COLOR_MAGENTA);
			init_pair(9 + COLOR_BLUE,    -1, COLOR_BLUE);
			init_pair(9 + COLOR_YELLOW,  -1, COLOR_YELLOW);
		}
	}else{
		refresh();
	}
}

// Assembly:
pushq %rbx
cmpb $0x0, 0x11ac0(%rip)     # 0x163d0
je 0x4922
movq 0x1168f(%rip), %rax     # 0x15fa8
movq (%rax), %rdi
popq %rbx
jmp 0x4230
movb $0x1, 0x11aa7(%rip)     # 0x163d0
callq 0x4220
callq 0x4180
callq 0x43b0
callq 0x4330
movq 0x11664(%rip), %rbx     # 0x15fa8
movq (%rbx), %rdi
movl $0x1, %esi
callq 0x40b0
callq 0x40d0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x43a0
xorl %edi, %edi
callq 0x4140
callq 0x4030
testb %al, %al
je 0x4ab9
callq 0x4260
callq 0x41f0
movl $0x1, %edi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x3, %edi
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x8, %edi
movl $0x7, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x2, %edi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x7, %edi
movl $0x6, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x6, %edi
movl $0x5, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x5, %edi
movl $0x4, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x4, %edi
movl $0x3, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43c0
movl $0x9, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x43c0
movl $0xb, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x2, %edx
callq 0x43c0
movl $0x10, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x7, %edx
callq 0x43c0
movl $0xa, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x43c0
movl $0xf, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x6, %edx
callq 0x43c0
movl $0xe, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x5, %edx
callq 0x43c0
movl $0xd, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x4, %edx
callq 0x43c0
movl $0xc, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x3, %edx
popq %rbx
jmp 0x43c0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ncurses.c
// Function: nc_status
void nc_status(const char *fmt, int right)
{
	scrollok(stdscr, 0);

	int x = 0;
	if(right)
		x = COLS / 2;

	move(LINES - 1, x);
	clrtoeol();
	addstr(fmt);

	scrollok(stdscr, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq 0x114aa(%rip), %r15     # 0x15fa8
movq (%r15), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x40b0
testl %r14d, %r14d
je 0x4b21
movq 0x114ba(%rip), %rax     # 0x15fd0
movl (%rax), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movq (%r15), %rdi
movq 0x114ad(%rip), %rax     # 0x15fd8
movl (%rax), %esi
decl %esi
movl %ebp, %edx
callq 0x4460
movq (%r15), %rdi
callq 0x4470
movq (%r15), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4500
movq (%r15), %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x40b0
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ncurses.c
// Function: nc_charlen
int nc_charlen(int ch)
{
	int l = 1;
	switch(ch){
		case '\r':
			l++; /* ^M */
			break;
		case '\t':
			break;
		default:
			if(!isprint(ch))
				l++; /* ^X */
	}
	return l;
}

// Assembly:
cmpl $0x9, %edi
je 0x4bb3
pushq %rbx
movl %edi, %ebx
cmpl $0xd, %edi
jne 0x4bb9
movl $0x2, %eax
jmp 0x4bd3
movl $0x1, %eax
retq
callq 0x4540
movq (%rax), %rax
movslq %ebx, %rcx
movb 0x1(%rax,%rcx,2), %cl
andb $0x40, %cl
xorl %eax, %eax
cmpb $0x1, %cl
adcl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ncurses.c
// Function: nc_getch
int nc_getch(bool mapraw, bool *wasraw)
{
	/* TODO: interrupts, winch */
	bool ctrl_v = false;
	int ch;
restart:
	errno = 0;
	ch = getch();
	if(ch < 0 && errno == EINTR)
		goto restart;

	if(ctrl_v)
		return ch;

	if(ch == CTRL_AND('z')){
		raise(SIGTSTP);
		goto restart;
	}
	if(mapraw){
		if(ch == '\r'){
			ch = '\n';
		}else if(ch == CTRL_AND('v')){
			if(wasraw)
				*wasraw = true;
			ctrl_v = true;
			goto restart;
		}
		if(wasraw)
			*wasraw = false;
	}
	return ch;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
xorl %r12d, %r12d
callq 0x40a0
movq %rax, %r14
movq 0x113b4(%rip), %r15     # 0x15fa8
movl $0x0, (%r14)
movq (%r15), %rdi
callq 0x4120
testl %eax, %eax
jns 0x4c0d
cmpl $0x4, (%r14)
je 0x4bf4
testb $0x1, %r12b
jne 0x4c4d
cmpl $0x1a, %eax
jne 0x4c24
movl $0x14, %edi
callq 0x4070
jmp 0x4bf4
testb %bpl, %bpl
je 0x4c4d
cmpl $0x16, %eax
jne 0x4c3b
movb $0x1, %r12b
testq %rbx, %rbx
je 0x4bf4
movb $0x1, (%rbx)
jmp 0x4bf4
cmpl $0xd, %eax
jne 0x4c45
movl $0xa, %eax
testq %rbx, %rbx
je 0x4c4d
movb $0x0, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ncurses.c
// Function: nc_addch
void nc_addch(char c)
{
	if(c == '\t'){
		c = ' ';
	}else if(c == '\r'){
		/* TODO: all non-printables */
		addch('^');
		addch('M');
		return;
	}

	addch(c & 0xff);
}

// Assembly:
pushq %rax
cmpl $0x9, %edi
je 0x4c7c
cmpl $0xd, %edi
jne 0x4c83
movq 0x11340(%rip), %rax     # 0x15fa8
movq (%rax), %rdi
movl $0x5e, %esi
callq 0x4480
movl $0x4d, %esi
jmp 0x4c87
movl $0x20, %esi
jmp 0x4c87
movzbl %dil, %esi
movq 0x1131a(%rip), %rax     # 0x15fa8
movq (%rax), %rdi
popq %rax
jmp 0x4480
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_set_bufmode
void ui_set_bufmode(enum buf_mode m)
{
	window *win = windows_cur();

	if(window_setmode(win, m)){
		ui_err("bad mode 0x%x", m);
	}else{
		ui_redraw();
		ui_cur_changed();
		nc_style(COL_BROWN);
		ui_status("%s", ui_bufmode_str(win->ui_mode));
		nc_style(0);
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
callq 0xdaf0
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0xd934
testl %eax, %eax
je 0x4d51
leaq 0x92e6(%rip), %rdi      # 0xe028
movl %ebp, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4de2
callq 0x4e77
callq 0x51ce
movl $0x4, %edi
callq 0x4c97
movl 0x40(%rbx), %eax
leal -0x1(%rax), %ecx
cmpl $0x7, %ecx
ja 0x4d89
leaq 0x9291(%rip), %rax      # 0xe008
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x92c3(%rip), %rsi      # 0xe04a
jmp 0x4dc7
cmpl $0x10, %eax
je 0x4dc0
cmpl $0x20, %eax
jne 0x4d9c
leaq 0x92d2(%rip), %rsi      # 0xe06c
jmp 0x4dc7
leaq 0x92e2(%rip), %rsi      # 0xe085
jmp 0x4dc7
leaq 0x92b9(%rip), %rsi      # 0xe065
jmp 0x4dc7
leaq 0x92a9(%rip), %rsi      # 0xe05e
jmp 0x4dc7
leaq 0x9293(%rip), %rsi      # 0xe051
jmp 0x4dc7
leaq 0x92b1(%rip), %rsi      # 0xe078
leaq 0x9cb1(%rip), %rdi      # 0xea7f
xorl %eax, %eax
callq 0x5273
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4c97
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_cur_changed
void ui_cur_changed()
{
	int need_redraw = 0;
	window *win = windows_cur();
	const int nl = win->screen_coord.h;

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

	if(win->ui_pos->x < 0)
		win->ui_pos->x = 0;

	if(win->ui_pos->y < 0)
		win->ui_pos->y = 0;

	if(win->ui_pos->y > win->ui_start.y + nl - 1){
		win->ui_start.y = win->ui_pos->y - nl + 1;
		need_redraw = 1;
	}else if(win->ui_pos->y < win->ui_start.y){
		win->ui_start.y = win->ui_pos->y;
		need_redraw = 1;
	}

	if(win->ui_mode & UI_VISUAL_ANY)
		need_redraw = 1;

	if(ui_match_paren(win))
		need_redraw = 1;

	if(need_redraw)
		ui_redraw();

	point_t cursor = window_toscreen(win, win->ui_pos);
	nc_set_yx(cursor.y, cursor.x);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0xdaf0
movq %rax, %rbx
movl 0xc(%rax), %eax
testl %eax, %eax
jns 0x51ea
movl $0x0, 0xc(%rbx)
xorl %eax, %eax
cmpl $0x0, 0x8(%rbx)
jns 0x51f7
movl $0x0, 0x8(%rbx)
movl 0x1c(%rbx), %ecx
movq 0x30(%rbx), %rsi
cmpl $0x0, (%rsi)
jns 0x5209
movl $0x0, (%rsi)
movl 0x4(%rsi), %edx
testl %edx, %edx
jns 0x521c
movl $0x0, 0x4(%rsi)
movl 0xc(%rbx), %eax
xorl %edx, %edx
leal (%rax,%rcx), %esi
cmpl %esi, %edx
jge 0x522b
cmpl %eax, %edx
jl 0x522f
xorl %ebp, %ebp
jmp 0x5235
subl %ecx, %edx
incl %edx
movl %edx, 0xc(%rbx)
movb $0x1, %bpl
movl 0x40(%rbx), %r14d
movq %rbx, %rdi
callq 0x5517
testb %al, %al
jne 0x5250
testb %bpl, %bpl
jne 0x5250
andl $0x38, %r14d
je 0x5255
callq 0x4e77
movq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0xd89d
movq %rax, %rdi
shrq $0x20, %rdi
movl %eax, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4b8c
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_vstatus
static
void ui_vstatus(bool err, const char *fmt, va_list l, int right)
{
	int y, x;

	nc_get_yx(&y, &x);

	if(err)
		nc_style(COL_BG_RED);

	char *message = ustrvprintf(fmt, l);
	/* just truncate in the middle if too long */
	const size_t msglen = strlen(message);
	const int cols = nc_COLS();

	if(msglen >= (unsigned)cols){
		const int dotslen = 3;
		int half = (cols - dotslen) / 2;
		char *replace = umalloc(msglen + 1);

		snprintf(replace, msglen + 1, "%.*s...%s",
				half, message, message + msglen - half);

		free(message);
		message = replace;
	}

	nc_status(message, right);
	if(err)
		nc_style(0);

	nc_set_yx(y, x);

	free(message);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebx
leaq 0x14(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4b65
testl %ebx, %ebx
je 0x533f
movl $0x8, %edi
callq 0x4c97
movq %r15, %rdi
movq %r14, %rsi
callq 0x598d
movq %rax, %r14
movq %rax, %rdi
callq 0x4170
movq %rax, %r15
callq 0x4d05
movl %eax, %ecx
cmpq %rcx, %r15
jb 0x53c9
movl %eax, %ecx
addl $-0x3, %ecx
shrl $0x1f, %ecx
movl %ebx, 0xc(%rsp)
leal (%rax,%rcx), %ebx
addl $-0x3, %ebx
sarl %ebx
movl %ebx, %r12d
negl %r12d
leaq 0x1(%r15), %r13
movq %r13, %rdi
callq 0x5830
movl %ebp, 0x8(%rsp)
movq %rax, %rbp
movq %r14, %rax
addq %r15, %rax
movslq %r12d, %r9
addq %rax, %r9
leaq 0x8ce3(%rip), %rdx      # 0xe087
movq %rbp, %rdi
movq %r13, %rsi
movl %ebx, %ecx
movl 0xc(%rsp), %ebx
movq %r14, %r8
xorl %eax, %eax
callq 0x41e0
movq %r14, %rdi
callq 0x4080
movq %rbp, %r14
movl 0x8(%rsp), %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x4aea
testb %bl, %bl
je 0x53de
xorl %edi, %edi
callq 0x4c97
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
callq 0x4b8c
movq %r14, %rdi
callq 0x4080
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_normal_1
void ui_normal_1(unsigned *repeat, enum io io_mode)
{
	window *win = windows_cur();
	const bool ins = win->ui_mode & UI_INSERT_ANY;

	if(!ins){
		const motion *m = motion_read(repeat, /*map:*/true);
		if(m){
			motion_apply_win(m, *repeat, win);

			/* check if we're now on a paren */
			if(ui_match_paren(win))
				ui_redraw();

			return;
		} /* else no motion */
	} /* else insert */

	ui_handle_next_ch(io_mode, *repeat);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %r14
callq 0xdaf0
testb $0x6, 0x40(%rax)
je 0x546f
movl (%r14), %ebx
leaq 0x8ca4(%rip), %rax      # 0xe0c8
movl (%rax), %edx
leaq 0xf333(%rip), %r14      # 0x14760
movl %ebp, %edi
movq %r14, %rsi
xorl %ecx, %ecx
movl $0x40, %r8d
movl $0x38, %r9d
callq 0x6c8f
cmpl $-0x1, %eax
je 0x54ab
cltq
shlq $0x6, %rax
leaq (%r14,%rax), %rdi
addq $0x10, %rdi
movq -0x10(%rdi), %rax
movq -0x8(%rdi), %rcx
movsbl (%rax), %edx
movl %ebx, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmpq *%rcx
movq %rax, %rbx
movq %r14, %rdi
movl $0x1, %esi
callq 0x6e77
testq %rax, %rax
je 0x541a
movl (%r14), %esi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xbb5a
movq %rbx, %rdi
callq 0x5517
testb %al, %al
je 0x550e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4e77
leaq 0xf(%rsp), %rsi
xorl %edi, %edi
movl $0x1, %edx
callq 0xc3de
movl %eax, %ebx
testl %eax, %eax
setne %al
cmpb $-0x1, %bl
setne %cl
testb %cl, %al
jne 0x54d7
movl $0x2, 0x10efd(%rip)     # 0x163d4
callq 0xdaf0
testb $0x6, 0x40(%rax)
je 0x54f9
movsbl %bl, %esi
movq %rax, %rdi
callq 0xd9af
callq 0x4e77
callq 0x51ce
jmp 0x550e
cmpl $0x1b, %ebx
je 0x550e
leaq 0x8b8c(%rip), %rdi      # 0xe091
movl %ebx, %esi
xorl %eax, %eax
callq 0x4de2
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_match_paren
static bool ui_match_paren(window *win)
{
	list_t *l = window_current_line(win, false);
	int x = win->ui_pos->x;
	bool redraw = false;

	if(win->ui_paren.x != -1)
		redraw = true;

	win->ui_paren = (point_t){ -1, -1 };

	if(!l || (size_t)x >= l->len_line)
		goto out;

	char ch = l->line[x];
	char other;
	if(!paren_match(ch, &other))
		goto out;

	motion opposite = {
		.func = m_paren,
		.arg.i = other,
		.how = M_EXCLUSIVE
	};
	point_t loc;
	if(!motion_apply_win_dry(&opposite, 0, win, &loc))
		goto out;

	win->ui_paren = loc;
	redraw = true;

out:
	return redraw;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorl %esi, %esi
callq 0xd868
movq 0x30(%rbx), %rcx
movslq (%rcx), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl %edx, 0x38(%rbx)
setne %bpl
movl %edx, 0x38(%rbx)
movl %edx, 0x3c(%rbx)
testq %rax, %rax
je 0x559d
cmpq %rcx, 0x8(%rax)
jbe 0x559d
movq (%rax), %rax
movsbl (%rax,%rcx), %edi
leaq 0x7(%rsp), %rsi
callq 0xbe5e
testb %al, %al
je 0x559d
leaq 0x62ee(%rip), %rax      # 0xb855
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movsbl 0x7(%rsp), %eax
movl %eax, 0x8(%rdi)
movl $0x2, 0x10(%rdi)
leaq 0x8(%rsp), %rcx
xorl %esi, %esi
movq %rbx, %rdx
callq 0xbb27
testl %eax, %eax
je 0x559d
movq 0x8(%rsp), %rax
movq %rax, 0x38(%rbx)
movb $0x1, %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_main
int ui_main()
{
	ui_redraw(); /* this first, to frame buf_sel */
	ui_cur_changed(); /* this, in case there's an initial buf offset */

	while(1){
		ui_wait_return();

		switch(ui_run){
			case UI_RUNNING: break;
			case UI_EXIT_0: return 0;
			case UI_EXIT_1: return 1;
		}

		window *win = windows_cur();

		if(win->ui_mode & UI_VISUAL_ANY){
			point_t *alt = window_uipos_alt(win);

			ui_rstatus("%d,%d - %d,%d %dx%d",
					win->ui_pos->y, win->ui_pos->x,
					alt->y, alt->x,
					1 + abs(win->ui_pos->x - alt->x),
					1 + abs(win->ui_pos->y - alt->y));
		}

		const enum io io_mode = bufmode_to_iomap(win->ui_mode);

		unsigned repeat = 0;
		ui_normal_1(&repeat, io_mode | IO_MAPRAW);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
callq 0x4e77
callq 0x51ce
leaq 0x14(%rsp), %rbx
callq 0x565a
movl 0x10e0d(%rip), %eax     # 0x163d4
cmpl $0x1, %eax
je 0x5650
cmpl $0x2, %eax
je 0x5649
callq 0xdaf0
movl 0x40(%rax), %edi
testb $0x38, %dil
je 0x562a
movq %rax, %r14
movq %rax, %rdi
callq 0xd857
movq 0x30(%r14), %rcx
movl (%rcx), %edx
movl 0x4(%rcx), %esi
movl (%rax), %r8d
movl 0x4(%rax), %ecx
movl %edx, %eax
subl %r8d, %eax
movl %eax, %r9d
negl %r9d
cmovsl %eax, %r9d
incl %r9d
movl %esi, %eax
subl %ecx, %eax
movl %eax, %edi
negl %edi
cmovsl %eax, %edi
incl %edi
movl %edi, (%rsp)
xorl %eax, %eax
callq 0x56a1
movl 0x40(%r14), %edi
callq 0xc3c4
movl $0x0, 0x14(%rsp)
orl $0x10, %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x5402
jmp 0x55bc
movl $0x1, %eax
jmp 0x5652
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_wait_return
void ui_wait_return(void)
{
	if(!want_return)
		return;

	want_return = false;

	bool raw;
	int ch = io_getch(IO_NOMAP, &raw, true);
	(void)raw; /* pushed straight back */
	if(!isnewline(ch))
		io_ungetch(ch, false);

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
cmpb $0x1, 0x10d77(%rip)     # 0x163d8
jne 0x56a0
pushq %rax
movb $0x0, 0x10d6d(%rip)     # 0x163d8
leaq 0x7(%rsp), %rsi
movl $0x1, %edi
movl $0x1, %edx
callq 0xc3de
cmpl $0xa, %eax
je 0x5692
cmpl $0xd, %eax
je 0x5692
movl %eax, %edi
xorl %esi, %esi
callq 0xc50d
callq 0x4e77
callq 0x51ce
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ui.c
// Function: ui_print
void ui_print(const char *s, size_t n)
{
	nc_set_yx(nc_LINES() - 1, 0);
	while(n --> 0)
		nc_addch(*s++);
	nc_addch('\n');
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4cfb
leal -0x1(%rax), %edi
xorl %esi, %esi
callq 0x4b8c
testq %rbx, %rbx
je 0x5818
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x4c56
incq %r15
cmpq %r15, %rbx
jne 0x5806
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x4c56
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/mem.c
// Function: umalloc
void *umalloc(size_t l)
{
	void *p = malloc(l);
	if(!p)
		abort();
	memset(p, 0, l);
	return p;
}

// Assembly:
pushq %rax
movq %rdi, %rsi
movl $0x1, %edi
callq 0x42d0
testq %rax, %rax
je 0x5845
popq %rcx
retq
callq 0x4090
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/mem.c
// Function: urealloc
void *urealloc(void *p, size_t l)
{
	void *r = realloc(p, l);
	if(!r)
		abort();
	return r;
}

// Assembly:
pushq %rax
callq 0x43e0
testq %rax, %rax
je 0x5857
popq %rcx
retq
callq 0x4090
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/mem.c
// Function: ustrdup_len
char *ustrdup_len(const char *s, size_t len)
{
	char *r = umalloc(len + 1);
	memcpy(r, s, len);
	r[len] = '\0';
	return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
incq %rsi
movl $0x1, %edi
callq 0x42d0
testq %rax, %rax
je 0x58c5
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4360
movb $0x0, (%r15,%rbx)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x4090
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/mem.c
// Function: join
char *join(const char *sep, char **vec, int n)
{
	const int len_sep = strlen(sep);
	int len = 1;

	for(int i = 0; i < n; i++)
		len += len_sep + strlen(vec[i]);

	char *p, *r = p = umalloc(len);
	const char *sep_actual = "";

	for(int i = 0; i < n; i++){
		p += sprintf(p, "%s%s", sep_actual, vec[i]);
		sep_actual = sep;
	}

	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4170
testl %ebp, %ebp
jle 0x5965
movq %rax, %r15
movl %ebp, (%rsp)
movl %ebp, %ebp
movl $0x1, %r13d
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
callq 0x4170
addl %r15d, %r13d
addl %eax, %r13d
incq %r12
cmpq %r12, %rbp
jne 0x58f7
movslq %r13d, %rsi
movl $0x1, %edi
callq 0x42d0
testq %rax, %rax
je 0x5988
cmpl $0x0, (%rsp)
jle 0x5979
leaq 0x8e1c(%rip), %rdx      # 0xe749
leaq 0x8776(%rip), %r12      # 0xe0aa
xorl %r15d, %r15d
movq %rax, (%rsp)
movq %rax, %r13
movq (%rbx,%r15,8), %rcx
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x44a0
cltq
addq %rax, %r13
incq %r15
movq %r14, %rdx
cmpq %r15, %rbp
jne 0x593e
movq (%rsp), %rax
jmp 0x5979
movl $0x1, %edi
movl $0x1, %esi
callq 0x42d0
testq %rax, %rax
je 0x5988
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4090
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movq %rax, %rbx
movb 0x40(%rax), %bpl
movl $0x1, %edi
callq 0x4d20
testb $0x6, %bpl
je 0x5a4b
movq 0x10023(%rip), %rax     # 0x15a50
movq %rsp, %rdi
movq %rax, 0x10(%rdi)
movups 0x10005(%rip), %xmm0    # 0x15a40
movaps %xmm0, (%rdi)
movl $0x1, %esi
movq %rbx, %rdx
callq 0xbb5a
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movq %rax, %rbx
movl 0x40(%rax), %eax
xorl $0x10, %eax
movl (%r15), %edi
movl %edi, %ecx
xorl $0x4, %ecx
orl %eax, %ecx
jne 0x5ab8
leaq 0x4(%rsp), %rcx
movl %r14d, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x6faa
testb %al, %al
je 0x5aad
movl 0x10(%rsp), %eax
subl 0x8(%rsp), %eax
incl %eax
movq (%rbx), %rcx
movl %eax, 0x48(%rcx)
movl $0x4, %edi
callq 0x4d20
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4d20
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movq %rax, %r14
movl (%rbx), %esi
movq (%rax), %rdi
movq 0x30(%rax), %rdx
callq 0x95ef
movq %r14, %rdi
callq 0xdadb
movl $0x2, %edi
callq 0x4d20
callq 0x4e77
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x51ce
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movl %esi, %edi
leaq 0x1082c(%rip), %rax     # 0x16360
movq (%rax), %rcx
leaq 0x164a(%rip), %rsi      # 0x7188
leaq 0x18(%rsp), %rax
movq %rsi, (%rax)
movq %rcx, 0x8(%rax)
leaq 0x4(%rsp), %rcx
movl %edx, %esi
movq %rax, %rdx
callq 0x6faa
testb %al, %al
je 0x5b78
cmpl $0x2, 0x14(%rsp)
jne 0x5b78
callq 0xdaf0
xorl %edi, %edi
movq %rax, %rsi
callq 0xaf80
callq 0x51ce
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x60, %rsp
movl %esi, %edi
leaq 0x107d5(%rip), %rax     # 0x16360
movq (%rax), %rcx
leaq 0x15f3(%rip), %rsi      # 0x7188
leaq 0x20(%rsp), %rax
movq %rsi, (%rax)
movq %rcx, 0x8(%rax)
leaq 0xc(%rsp), %rcx
movl %edx, %esi
movq %rax, %rdx
callq 0x6faa
testb %al, %al
je 0x5c1f
callq 0xdaf0
movq %rax, %rbx
movl 0x1c(%rsp), %eax
testl %eax, %eax
je 0x5c0e
cmpl $0x2, %eax
je 0x5bea
cmpl $0x1, %eax
jne 0x5c1f
movq (%rbx), %rax
movl 0x18(%rsp), %ecx
subl 0x10(%rsp), %ecx
incl %ecx
movl %ecx, 0x48(%rax)
movl $0x4, %edi
callq 0x4d20
jmp 0x5c1f
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
callq 0x5ac7
jmp 0x5c1f
movl $0x2, %edi
callq 0x4d20
cmpl $0x0, 0xc(%rsp)
je 0x5c25
addq $0x60, %rsp
popq %rbx
retq
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd868
testq %rax, %rax
je 0x5c1f
movl 0x14(%rsp), %ecx
cmpq %rcx, 0x8(%rax)
ja 0x5c1f
movq %rbx, %rdi
callq 0xdadb
jmp 0x5c1f
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x28, %rsp
movl %esi, %ebp
movb (%rdi), %r15b
callq 0xc6d2
movq %rax, %rdi
callq 0xcaf4
testq %rax, %rax
je 0x5d60
movq %rax, %rbx
callq 0xdaf0
movq %rax, %r14
testb $0x38, 0x40(%rax)
je 0x5d0a
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x6f59
movl (%r15), %esi
leaq 0x14(%rsp), %rcx
movq %rax, %rdi
movq %r14, %rdx
callq 0xbbbc
testb %al, %al
je 0x5d60
leaq 0x20(%r14), %rdi
movq %r14, %rsi
addq $0x28, %rsi
callq 0xc9dd
movq (%r14), %rdi
leaq 0x1066c(%rip), %rax     # 0x16360
leaq 0xc(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x14(%rsp), %rsi
callq *(%rax)
movb $0x1, %r15b
cmpl $0x1, %ebp
adcl $0x0, %ebp
movzbl %r15b, %r15d
callq 0xdaf0
movq (%rax), %rdi
movq 0x30(%r14), %rdx
movq %rbx, %rsi
movl %r15d, %ecx
movl $0x1, %r8d
callq 0x94cb
decl %ebp
jne 0x5d14
movl $0x1, 0x40(%r14)
xorl %edi, %edi
movq %r14, %rsi
callq 0xaf80
callq 0x4e77
callq 0x51ce
leaq 0x6938(%rip), %rsi      # 0xc690
movq %rbx, %rdi
callq 0xcaff
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: k_join
void k_join(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	const bool space = a->b;

	around_motion_bufaction(
			repeat,
			from_ch,
			space ? &buffer_joinregion_space : &buffer_joinregion_nospace,
			NULL);
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x5d79
leaq 0x10609(%rip), %rax     # 0x16380
jmp 0x5d80
leaq 0x10610(%rip), %rax     # 0x16390
subq $0x18, %rsp
movq (%rax), %rcx
leaq 0x13fa(%rip), %rdi      # 0x7188
leaq 0x8(%rsp), %rax
movq %rdi, (%rax)
movq %rcx, 0x8(%rax)
movl %esi, %edi
movl %edx, %esi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x6faa
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5e1c
callq 0x4e77
callq 0x51ce
jmp 0x5efd
movl %esi, %ebx
leaq 0x3(%rsp), %r14
movl $0x11, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0xc3de
movl %eax, %ebp
movl %eax, 0x4(%rsp)
cmpl $0x1b, %eax
setne %al
orb (%r14), %al
je 0x5efd
cmpl $0x1, %ebx
adcl $0x0, %ebx
leaq 0x534d(%rip), %rax      # 0xb1a4
movq %rax, 0x20(%rsp)
leal -0x1(%rbx), %eax
movl %eax, 0x28(%rsp)
movq $0x0, 0x2c(%rsp)
callq 0xdaf0
movq %rax, %r14
testb $0x38, 0x40(%rax)
je 0x5e89
leaq 0x1c(%rsp), %rdi
callq 0x6f59
movq %rax, %rdi
jmp 0x5e8e
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rcx
movl $0x1, %esi
movq %r14, %rdx
callq 0xbbbc
testb %al, %al
je 0x5efd
cmpl $0x0, 0x18(%rsp)
jne 0x5ebc
movl 0xc(%rsp), %eax
cmpl 0x14(%rsp), %eax
jne 0x5ebc
cmpb $0x0, 0x3(%rsp)
je 0x5f08
cmpl $0xa, %ebp
jne 0x5ec9
movl $0xd, 0x4(%rsp)
movq (%r14), %r15
movq 0x8(%r15), %rdi
leaq 0x10ab(%rip), %rcx      # 0x6f82
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %r8
movl $0x1, %edx
callq 0xa9a8
movb $0x1, 0x39(%r15)
movl $0x1, 0x40(%r14)
jmp 0x5e0d
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xa, %ebp
je 0x5f12
cmpl $0xd, %ebp
jne 0x5ec9
leaq 0x4(%rsp), %r8
movl $0xa, (%r8)
movq (%r14), %r15
movq 0x8(%r15), %rdi
leaq 0x1056(%rip), %rcx      # 0x6f82
leaq 0x8(%rsp), %rsi
movl $0x1, %edx
callq 0xa9a8
movq 0x30(%r14), %rax
movl $0x0, (%rax)
addl %ebx, 0x4(%rax)
jmp 0x5eeb
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
testb $0x38, 0x40(%rax)
je 0x5fa1
movq 0x30(%rax), %rcx
movl 0x4(%rcx), %r14d
leal 0x1(%r14), %ebp
movq %rax, %rdi
callq 0xd857
movl 0x4(%rax), %eax
leal 0x1(%rax), %ecx
cmpl %r14d, %eax
movl %ecx, %r8d
cmovll %ebp, %r8d
cmovgel %ebp, %ecx
leaq 0x81f0(%rip), %rdx      # 0xe17d
movq %rsp, %r14
movl $0x20, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x41e0
jmp 0x5fa4
xorl %r14d, %r14d
movsbl %bl, %edi
movq %r14, %rsi
callq 0xbff0
movq %rax, %rbx
testq %rax, %rax
je 0x5fbf
movq %rbx, %rdi
callq 0x6ee3
movq %rbx, %rdi
callq 0x4080
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x110c(%rip), %rcx      # 0x70e7
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 0x6faa
testb %al, %al
je 0x602c
movslq 0x10(%rsp), %rsi
movslq 0x8(%rsp), %rax
subq %rax, %rsi
cmpl $0x1, %esi
leaq 0x8736(%rip), %rax      # 0xe749
leaq 0x8a66(%rip), %rdx      # 0xea80
cmoveq %rax, %rdx
leaq 0x81c7(%rip), %rdi      # 0xe1ec
xorl %eax, %eax
callq 0x5273
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movq (%rax), %rcx
movq 0x30(%rax), %rax
movq 0x24(%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, %edi
callq 0x4d20
popq %rax
jmp 0x51ce
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movq %rax, %rbx
movq (%rax), %r14
movl 0x20(%r14), %edi
callq 0x4d20
movq 0x30(%rbx), %rax
movq 0x10(%r14), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
callq 0xd857
movq 0x18(%r14), %rcx
movq %rcx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x51ce
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movq (%rax), %rax
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x61bb
leaq 0x8087(%rip), %r14      # 0xe205
xorl %ebp, %ebp
xorl %r15d, %r15d
movq (%r12), %rdi
movq 0x8(%r12), %rsi
movq %rbx, %rdx
callq 0xbd69
testq %rax, %rax
je 0x61af
incl %r15d
movq (%r12), %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x5741
incl %ebp
movq 0x18(%r12), %r12
testq %r12, %r12
jne 0x6183
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5827
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movq (%rax), %rax
cmpb $0x1, 0x39(%rax)
jne 0x61f5
leaq 0x8028(%rip), %rdi      # 0xe20f
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x4de2
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xde7c
testb %al, %al
je 0x6241
movq 0x10(%rsp), %rbx
cmpb $0x2f, (%rbx)
jne 0x6224
cmpb $0x5e, 0x1(%rbx)
jne 0x6224
movq %rbx, %rdi
callq 0x4170
cmpq $0x5, %rax
jge 0x625a
leaq 0x800b(%rip), %rdi      # 0xe236
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4de2
leaq 0x8(%rsp), %rdi
callq 0xdf85
jmp 0x6252
leaq 0x7fd7(%rip), %rdi      # 0xe21f
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4de2
addq $0x18, %rsp
popq %rbx
popq %r14
retq
cmpb $0x24, -0x2(%rbx,%rax)
jne 0x6273
cmpb $0x2f, -0x1(%rbx,%rax)
jne 0x6273
cmpb $0x0, (%rbx,%rax)
jne 0x6273
movb $0x0, -0x2(%rbx,%rax)
callq 0xdaf0
movq (%rax), %rdi
callq 0x9216
movq 0x8(%rsp), %r14
testq %rax, %rax
je 0x6299
movq %r14, %rdi
movq %rax, %rsi
callq 0x42e0
testl %eax, %eax
je 0x62a7
movq %r14, %rdi
xorl %esi, %esi
callq 0x735e
testb %al, %al
je 0x6235
addq $0x2, %rbx
callq 0xdaf0
movq 0x30(%rax), %rax
movq $0x0, (%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x610e
callq 0x4e77
callq 0x51ce
jmp 0x6235
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb (%rdi), %bpl
leaq 0x7f5a(%rip), %r14      # 0xe243
testb %bpl, %bpl
je 0x631c
callq 0x4540
movq (%rax), %rax
leaq 0x1(%rbx), %rdx
leaq 0x7f4b(%rip), %rcx      # 0xe24c
movsbq %bpl, %rsi
testb $0x10, 0x1(%rax,%rsi,2)
je 0x6319
movb (%rdx), %bpl
incq %rdx
testb %bpl, %bpl
jne 0x6301
jmp 0x631c
movq %rcx, %r14
movq %rsp, %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x8034(%rip), %rdi      # 0xe361
movl $0x2, %edx
callq 0x58ca
movq %rax, %rbx
movq %rax, %rdi
callq 0x459e
movq %rbx, %rdi
callq 0x4080
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x63e9
callq 0xdaf0
movq (%rax), %rdi
callq 0xd335
testb %al, %al
je 0x63e9
leaq 0x7e3c(%rip), %rdi      # 0xe20f
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4de2
movq %rbx, %rdi
callq 0xbf4e
movq %rax, %r14
testq %rax, %rax
setne %r12b
cmovneq %rax, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4420
testl %eax, %eax
je 0x64c4
callq 0x40a0
cmpl $0x2, (%rax)
jne 0x64c4
cmpb $0x2f, (%rbx)
je 0x64c4
callq 0xdaf0
movq (%rax), %rdi
callq 0x9216
testq %rax, %rax
je 0x64c4
movq %rax, %r15
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x4340
testl %eax, %eax
jne 0x6467
movl $0xf000, %eax           # imm = 0xF000
andl 0x28(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x6467
xorl %r12d, %r12d
jmp 0x6487
movq %r15, %rdi
callq 0x585c
movq %rax, %r12
movq %rax, %rdi
movl $0x2f, %esi
callq 0x4200
testq %rax, %rax
je 0x6487
movb $0x0, (%rax)
testq %r12, %r12
cmovneq %r12, %r15
movq %rsp, %rsi
movq %r15, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x814f(%rip), %rdi      # 0xe5ee
movl $0x2, %edx
callq 0x58ca
movq %rax, %rbx
movq %r12, %rdi
callq 0x4080
testq %r14, %r14
je 0x64c1
movq %r14, %rdi
callq 0x4080
movb $0x1, %r12b
testb %bpl, %bpl
je 0x652f
leaq 0x10(%rsp), %rdi
movq %rsp, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x90cd
movq (%r14), %rdx
testq %rdx, %rdx
je 0x64f5
leaq 0x803a(%rip), %rdi      # 0xe525
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4de2
movq 0x10(%rsp), %rdi
callq 0xd7c4
movq %rax, %r14
callq 0xdaf0
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xd6b4
movq 0x10(%rsp), %rdi
leaq 0x2a14(%rip), %rsi      # 0x8f34
callq 0xcaff
movq %r14, %rdi
callq 0xdb04
jmp 0x6539
movq %rbx, %rdi
xorl %esi, %esi
callq 0x735e
callq 0x4e77
callq 0x51ce
testb %r12b, %r12b
je 0x6550
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_O3/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 0xdbdc
movq %rax, %r14
cmpl $0x0, (%r15)
jg 0x658d
callq 0xdc21
addl (%r15), %eax
imull %eax, %ebx
testl %ebx, %ebx
je 0x659c
movq %r14, %rdi
callq 0xdb9b
movq %rax, %r14
decl %ebx
jne 0x658d
movq %r14, %rdi
callq 0xdbe4
callq 0x4e77
popq %rbx
popq %r14
popq %r15
jmp 0x51ce
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
cmpl $0x0, (%rbx)
movl 0x4(%rbx), %ecx
je 0x65ee
cmpl $0x1, %ecx
je 0x65f3
xorl %edx, %edx
testl %ecx, %ecx
jne 0x65f8
movl 0x1c(%rax), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
jmp 0x65f8
addl 0xc(%rax), %ecx
jmp 0x6601
movl 0x1c(%rax), %edx
decl %edx
movq 0x30(%rax), %rcx
movl 0x4(%rcx), %ecx
subl %edx, %ecx
movl %ecx, 0xc(%rax)
testl %ecx, %ecx
jns 0x6611
movl $0x0, 0xc(%rax)
xorl %ecx, %ecx
movq 0x30(%rax), %rdx
movl 0x4(%rdx), %esi
cmpl %ecx, %esi
jl 0x6625
addl 0x1c(%rax), %ecx
cmpl %ecx, %esi
jl 0x6628
decl %ecx
movl %ecx, 0x4(%rdx)
callq 0x4e77
popq %rbx
jmp 0x51ce