LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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, (%rsp)
cmpl $0x2, %edi
jl 0x48b1
movl %edi, 0x4(%rsp)
movl %edi, %r14d
movl $0x1, %r12d
leaq 0xa7e8(%rip), %r15      # 0xf004
xorl %ebp, %ebp
movq (%rbx,%r12,8), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x42d0
testl %eax, %eax
je 0x4893
movq %r13, %rdi
leaq 0xa7cc(%rip), %rsi      # 0xf007
callq 0x42d0
testl %eax, %eax
je 0x489a
cmpb $0x2b, (%r13)
jne 0x48ba
callq 0x4540
movq (%rax), %rax
leaq 0x1(%r13), %rcx
movsbq (%rcx), %rdx
incq %rcx
testb $0x8, 0x1(%rax,%rdx,2)
jne 0x4857
testb %dl, %dl
jne 0x48ba
incq %r13
movq %r13, %rdi
leaq 0xa794(%rip), %rsi      # 0xf00a
movq %rsp, %rdx
xorl %eax, %eax
callq 0x43d0
cmpl $0x1, %eax
jne 0x48ba
movl (%rsp), %eax
testl %eax, %eax
je 0x489f
decl %eax
movl %eax, (%rsp)
jmp 0x489f
movl $0x1, %ebp
jmp 0x489f
movl $0x2, %ebp
incq %r12
cmpq %r14, %r12
jne 0x481e
movl 0x4(%rsp), %eax
jmp 0x48bd
xorl %ebp, %ebp
movl $0x1, %eax
jmp 0x48bf
movl %r12d, %eax
movl %eax, %eax
leaq (%rbx,%rax,8), %rax
movq %rax, 0x12afe(%rip)     # 0x173c8
callq 0x530c
movl (%rsp), %esi
movl %ebp, %edi
callq 0xdfb8
callq 0x55ad
movl %eax, %ebx
callq 0x5737
callq 0xe1bc
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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, 0x12acc(%rip)     # 0x173d0
je 0x4916
movq 0x1269b(%rip), %rax     # 0x16fa8
movq (%rax), %rdi
popq %rbx
jmp 0x4230
movb $0x1, 0x12ab3(%rip)     # 0x173d0
callq 0x4220
callq 0x4180
callq 0x43a0
callq 0x4320
movq 0x12670(%rip), %rbx     # 0x16fa8
movq (%rbx), %rdi
movl $0x1, %esi
callq 0x40b0
callq 0x40d0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x4390
xorl %edi, %edi
callq 0x4140
callq 0x4030
testb %al, %al
je 0x4aad
callq 0x4260
callq 0x41f0
movl $0x1, %edi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x3, %edi
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x8, %edi
movl $0x7, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x2, %edi
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x7, %edi
movl $0x6, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x6, %edi
movl $0x5, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x5, %edi
movl $0x4, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x4, %edi
movl $0x3, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x43b0
movl $0x9, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x43b0
movl $0xb, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x2, %edx
callq 0x43b0
movl $0x10, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x7, %edx
callq 0x43b0
movl $0xa, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x43b0
movl $0xf, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x6, %edx
callq 0x43b0
movl $0xe, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x5, %edx
callq 0x43b0
movl $0xd, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x4, %edx
callq 0x43b0
movl $0xc, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x3, %edx
popq %rbx
jmp 0x43b0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x124b6(%rip), %r15     # 0x16fa8
movq (%r15), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x40b0
testl %r14d, %r14d
je 0x4b15
movq 0x124c6(%rip), %rax     # 0x16fd0
movl (%rax), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movq (%r15), %rdi
movq 0x124b9(%rip), %rax     # 0x16fd8
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_O1/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 0x4ba8
pushq %rbx
movl %edi, %ebx
cmpl $0xd, %edi
jne 0x4bae
movl $0x2, %eax
jmp 0x4bc8
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_O1/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 0x123bf(%rip), %r15     # 0x16fa8
movl $0x0, (%r14)
movq (%r15), %rdi
callq 0x4120
testl %eax, %eax
jns 0x4c02
cmpl $0x4, (%r14)
je 0x4be9
testb $0x1, %r12b
jne 0x4c42
cmpl $0x1a, %eax
jne 0x4c19
movl $0x14, %edi
callq 0x4070
jmp 0x4be9
testb %bpl, %bpl
je 0x4c42
cmpl $0x16, %eax
jne 0x4c30
movb $0x1, %r12b
testq %rbx, %rbx
je 0x4be9
movb $0x1, (%rbx)
jmp 0x4be9
cmpl $0xd, %eax
jne 0x4c3a
movl $0xa, %eax
testq %rbx, %rbx
je 0x4c42
movb $0x0, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4c71
cmpl $0xd, %edi
jne 0x4c78
movq 0x1234b(%rip), %rax     # 0x16fa8
movq (%rax), %rdi
movl $0x5e, %esi
callq 0x4480
movl $0x4d, %esi
jmp 0x4c7c
movl $0x20, %esi
jmp 0x4c7c
movzbl %dil, %esi
movq 0x12325(%rip), %rax     # 0x16fa8
movq (%rax), %rdi
popq %rax
jmp 0x4480
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0xdcb5
testl %eax, %eax
je 0x4d51
leaq 0xa2ee(%rip), %rdi      # 0xf030
movl %ebp, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4de2
callq 0x4e77
callq 0x51d8
movl $0x4, %edi
callq 0x4c8c
movl 0x40(%rbx), %eax
leal -0x1(%rax), %ecx
cmpl $0x7, %ecx
ja 0x4d89
leaq 0xa299(%rip), %rax      # 0xf010
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0xa2cb(%rip), %rsi      # 0xf052
jmp 0x4dc7
cmpl $0x10, %eax
je 0x4dc0
cmpl $0x20, %eax
jne 0x4d9c
leaq 0xa2da(%rip), %rsi      # 0xf074
jmp 0x4dc7
leaq 0xa2ea(%rip), %rsi      # 0xf08d
jmp 0x4dc7
leaq 0xa2c1(%rip), %rsi      # 0xf06d
jmp 0x4dc7
leaq 0xa2b1(%rip), %rsi      # 0xf066
jmp 0x4dc7
leaq 0xa29b(%rip), %rsi      # 0xf059
jmp 0x4dc7
leaq 0xa2b9(%rip), %rsi      # 0xf080
leaq 0xacc3(%rip), %rdi      # 0xfa91
xorl %eax, %eax
callq 0x527a
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4c8c
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
movq %rax, %rbx
cmpl $0x0, 0xc(%rax)
jns 0x51f1
movl $0x0, 0xc(%rbx)
cmpl $0x0, 0x8(%rbx)
jns 0x51fe
movl $0x0, 0x8(%rbx)
movl 0x1c(%rbx), %eax
movq 0x30(%rbx), %rcx
cmpl $0x0, (%rcx)
jns 0x5210
movl $0x0, (%rcx)
cmpl $0x0, 0x4(%rcx)
jns 0x521d
movl $0x0, 0x4(%rcx)
movl 0x4(%rcx), %ecx
movl 0xc(%rbx), %edx
leal (%rdx,%rax), %esi
cmpl %esi, %ecx
jge 0x5232
cmpl %edx, %ecx
jl 0x5236
xorl %ebp, %ebp
jmp 0x523c
subl %eax, %ecx
incl %ecx
movl %ecx, 0xc(%rbx)
movb $0x1, %bpl
movl 0x40(%rbx), %r14d
movq %rbx, %rdi
callq 0x551e
testb %al, %al
jne 0x5257
testb %bpl, %bpl
jne 0x5257
andl $0x38, %r14d
je 0x525c
callq 0x4e77
movq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0xdc1e
movq %rax, %rdi
shrq $0x20, %rdi
movl %eax, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4b81
// File: /workspace/github_c_makefile_star2_O1/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 0x4b59
testl %ebx, %ebx
je 0x5346
movl $0x8, %edi
callq 0x4c8c
movq %r15, %rdi
movq %r14, %rsi
callq 0x59c6
movq %rax, %r14
movq %rax, %rdi
callq 0x4170
movq %rax, %r15
callq 0x4d04
movl %eax, %ecx
cmpq %rcx, %r15
jb 0x53d0
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 0x9ce4(%rip), %rdx      # 0xf08f
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 0x4ade
testb %bl, %bl
je 0x53e5
xorl %edi, %edi
callq 0x4c8c
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
callq 0x4b81
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_O1/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 0xde6c
testb $0x6, 0x40(%rax)
je 0x5476
movl (%r14), %ebx
leaq 0x9ca5(%rip), %rax      # 0xf0d0
movl (%rax), %edx
leaq 0x1032c(%rip), %r14     # 0x15760
movl %ebp, %edi
movq %r14, %rsi
xorl %ecx, %ecx
movl $0x40, %r8d
movl $0x38, %r9d
callq 0x6cf0
cmpl $-0x1, %eax
je 0x54b2
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 0x6f17
testq %rax, %rax
je 0x5421
movl (%r14), %esi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xbea7
movq %rbx, %rdi
callq 0x551e
testb %al, %al
je 0x5515
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4e77
leaq 0xf(%rsp), %rsi
xorl %edi, %edi
movl $0x1, %edx
callq 0xc772
movl %eax, %ebx
testl %eax, %eax
setne %al
cmpb $-0x1, %bl
setne %cl
testb %cl, %al
jne 0x54de
movl $0x2, 0x11ef6(%rip)     # 0x173d4
callq 0xde6c
testb $0x6, 0x40(%rax)
je 0x5500
movsbl %bl, %esi
movq %rax, %rdi
callq 0xdd30
callq 0x4e77
callq 0x51d8
jmp 0x5515
cmpl $0x1b, %ebx
je 0x5515
leaq 0x9b8d(%rip), %rdi      # 0xf099
movl %ebx, %esi
xorl %eax, %eax
callq 0x4de2
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xdbe9
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 0x55a4
cmpq %rcx, 0x8(%rax)
jbe 0x55a4
movq (%rax), %rax
movsbl (%rax,%rcx), %edi
leaq 0x7(%rsp), %rsi
callq 0xc1cf
testb %al, %al
je 0x55a4
leaq 0x65d0(%rip), %rax      # 0xbb3e
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 0xbe74
testl %eax, %eax
je 0x55a4
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_O1/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 0x51d8
leaq 0x14(%rsp), %rbx
callq 0x565a
movl 0x11e06(%rip), %eax     # 0x173d4
cmpl $0x1, %eax
je 0x5650
cmpl $0x2, %eax
je 0x5649
callq 0xde6c
movq %rax, %r14
testb $0x38, 0x40(%rax)
je 0x5626
movq %r14, %rdi
callq 0xdbd8
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 0xc758
movl $0x0, 0x14(%rsp)
orl $0x10, %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x5409
jmp 0x55c3
movl $0x1, %eax
jmp 0x5652
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x11d77(%rip)     # 0x173d8
jne 0x56a0
pushq %rax
movb $0x0, 0x11d6d(%rip)     # 0x173d8
leaq 0x7(%rsp), %rsi
movl $0x1, %edi
movl $0x1, %edx
callq 0xc772
cmpl $0xa, %eax
je 0x5692
cmpl $0xd, %eax
je 0x5692
movl %eax, %edi
xorl %esi, %esi
callq 0xc8a5
callq 0x4e77
callq 0x51d8
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4cfa
leal -0x1(%rax), %edi
xorl %esi, %esi
callq 0x4b81
testq %rbx, %rbx
je 0x5818
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x4c4b
incq %r15
cmpq %r15, %rbx
jne 0x5806
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x4c4b
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
callq 0x43c0
testq %rax, %rax
je 0x584c
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
jmp 0x4240
callq 0x4090
// File: /workspace/github_c_makefile_star2_O1/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 0x585e
popq %rcx
retq
callq 0x4090
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1(%rsi), %r12
movq %r12, %rdi
callq 0x43c0
testq %rax, %rax
je 0x58f9
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4240
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4350
movb $0x0, (%r15,%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x4090
// File: /workspace/github_c_makefile_star2_O1/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, %r13d
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4170
movl %r13d, %ebp
testl %r13d, %r13d
jle 0x594f
movq %rax, %r15
movl %r13d, (%rsp)
movl $0x1, %r12d
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rdi
callq 0x4170
addl %r15d, %r12d
addl %eax, %r12d
incq %r13
cmpq %r13, %rbp
jne 0x592f
movslq %r12d, %r12
movl (%rsp), %r13d
jmp 0x5955
movl $0x1, %r12d
movq %r12, %rdi
callq 0x43c0
testq %rax, %rax
je 0x59c1
movq %rax, (%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4240
testl %r13d, %r13d
jle 0x59ae
leaq 0x9dd9(%rip), %rdx      # 0xf758
leaq 0x972c(%rip), %r12      # 0xf0b2
xorl %r15d, %r15d
movq (%rsp), %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 0x598d
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4090
// File: /workspace/github_c_makefile_star2_O1/bobrippling[P]tim/mem.c
// Function: ustrvprintf
char *ustrvprintf(const char *fmt, va_list l)
{
	char *buf = NULL;
	int len = 8, ret;

	do{
		va_list lcp;

		len *= 2;
		buf = urealloc(buf, len);

		va_copy(lcp, l);
		ret = vsnprintf(buf, len, fmt, lcp);
		va_end(lcp);

	}while(ret >= len);

	return buf;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl $0x8, %ebp
xorl %r12d, %r12d
movq %rsp, %r15
addl %ebp, %ebp
movslq %ebp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x43e0
testq %rax, %rax
je 0x5a35
movq %rax, %r12
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x4100
cmpl %r13d, %eax
jge 0x59e5
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4090
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
movq %rax, %rbx
movb 0x40(%rax), %bpl
movl $0x1, %edi
callq 0x4d20
testb $0x6, %bpl
je 0x5a83
movq 0x10feb(%rip), %rax     # 0x16a50
movq %rsp, %rdi
movq %rax, 0x10(%rdi)
movups 0x10fcd(%rip), %xmm0    # 0x16a40
movaps %xmm0, (%rdi)
movl $0x1, %esi
movq %rbx, %rdx
callq 0xbea7
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
cmpl $0x10, 0x40(%rax)
jne 0x5aea
cmpl $0x4, (%r15)
jne 0x5aea
movq %rax, %rbx
leaq 0x4(%rsp), %rcx
movl %r14d, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x704a
testb %al, %al
je 0x5adf
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
movl (%r15), %edi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4d20
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
movq %rax, %r14
movl (%rbx), %esi
movq (%rax), %rdi
movq 0x30(%rax), %rdx
callq 0x975f
movq %r14, %rdi
callq 0xde58
movl $0x2, %edi
callq 0x4d20
callq 0x4e77
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x51d8
// File: /workspace/github_c_makefile_star2_O1/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 0x16cb(%rip), %rcx      # 0x7234
leaq 0x18(%rsp), %rax
movq %rcx, (%rax)
leaq 0x117e8(%rip), %rcx     # 0x17360
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
leaq 0x4(%rsp), %rcx
movl %edx, %esi
movq %rax, %rdx
callq 0x704a
testb %al, %al
je 0x5bad
cmpl $0x2, 0x14(%rsp)
jne 0x5bad
callq 0xde6c
xorl %edi, %edi
movq %rax, %rsi
callq 0xb280
callq 0x51d8
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1674(%rip), %rcx      # 0x7234
leaq 0x20(%rsp), %rax
movq %rcx, (%rax)
leaq 0x11791(%rip), %rcx     # 0x17360
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
leaq 0xc(%rsp), %rcx
movl %edx, %esi
movq %rax, %rdx
callq 0x704a
testb %al, %al
je 0x5c54
callq 0xde6c
movq %rax, %rbx
movl 0x1c(%rsp), %eax
testl %eax, %eax
je 0x5c43
cmpl $0x2, %eax
je 0x5c1f
cmpl $0x1, %eax
jne 0x5c54
movq (%rbx), %rax
movl 0x18(%rsp), %ecx
subl 0x10(%rsp), %ecx
incl %ecx
movl %ecx, 0x48(%rax)
movl $0x4, %edi
callq 0x4d20
jmp 0x5c54
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
callq 0x5afc
jmp 0x5c54
movl $0x2, %edi
callq 0x4d20
cmpl $0x0, 0xc(%rsp)
je 0x5c5a
addq $0x60, %rsp
popq %rbx
retq
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdbe9
testq %rax, %rax
je 0x5c54
movl 0x14(%rsp), %ecx
cmpq %rcx, 0x8(%rax)
ja 0x5c54
movq %rbx, %rdi
callq 0xde58
jmp 0x5c54
// File: /workspace/github_c_makefile_star2_O1/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), %r12b
callq 0xca72
movq %rax, %rdi
callq 0xce90
testq %rax, %rax
je 0x5d99
movq %rax, %rbx
callq 0xde6c
movq %rax, %r14
testb $0x38, 0x40(%rax)
je 0x5d43
movq %rsp, %r15
movq %r15, %rdi
callq 0x6ff9
movl (%r15), %esi
leaq 0xc(%rsp), %rcx
movq %rax, %rdi
movq %r14, %rdx
callq 0xbf0c
movl %eax, %r15d
testb %al, %al
je 0x5d3e
leaq 0x20(%r14), %rdi
movq %r14, %rsi
addq $0x28, %rsi
callq 0xcd79
movq (%r14), %rdi
leaq 0x11638(%rip), %rax     # 0x17360
leaq 0x4(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0xc(%rsp), %rsi
callq *(%rax)
movb $0x1, %r12b
testb %r15b, %r15b
je 0x5d99
cmpl $0x1, %ebp
adcl $0x0, %ebp
movzbl %r12b, %r15d
callq 0xde6c
movq (%rax), %rdi
movq 0x30(%r14), %rdx
movq %rbx, %rsi
movl %r15d, %ecx
movl $0x1, %r8d
callq 0x962a
decl %ebp
jne 0x5d4d
movl $0x1, 0x40(%r14)
xorl %edi, %edi
movq %r14, %rsi
callq 0xb280
callq 0x4e77
callq 0x51d8
leaq 0x6c9f(%rip), %rsi      # 0xca30
movq %rbx, %rdi
callq 0xce9b
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
subq $0x18, %rsp
cmpb $0x0, (%rdi)
leaq 0x1480(%rip), %rax      # 0x7234
movq %rax, 0x8(%rsp)
je 0x5dc4
leaq 0x115be(%rip), %rax     # 0x17380
jmp 0x5dcb
leaq 0x115c5(%rip), %rax     # 0x17390
movq (%rax), %rcx
leaq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movl %esi, %edi
movl %edx, %esi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x704a
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x40, %rsp
cmpl $0x1, (%rdi)
jne 0x5e5d
callq 0x4e77
callq 0x51d8
jmp 0x5f76
movl %esi, %ebx
leaq 0xb(%rsp), %r14
movl $0x11, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0xc772
movl %eax, 0xc(%rsp)
cmpl $0x1b, %eax
setne %al
orb (%r14), %al
cmpb $0x1, %al
jne 0x5f76
cmpl $0x1, %ebx
adcl $0x0, %ebx
leaq 0x5605(%rip), %rax      # 0xb49d
movq %rax, 0x28(%rsp)
leal -0x1(%rbx), %eax
movl %eax, 0x30(%rsp)
movq $0x0, 0x34(%rsp)
callq 0xde6c
movq %rax, %r14
testb $0x38, 0x40(%rax)
je 0x5ed0
leaq 0x24(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x6ff9
movq %rax, %rdi
jmp 0x5ed5
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rcx
movl $0x1, %esi
movq %r14, %rdx
callq 0xbf0c
testb %al, %al
je 0x5f76
movl %eax, %ebp
cmpl $0x0, 0x20(%rsp)
jne 0x5f09
movl 0x14(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jne 0x5f09
cmpb $0x0, 0xb(%rsp)
je 0x5f83
xorl %r15d, %r15d
testb %r15b, %r15b
je 0x5f1b
movl $0xa, 0xc(%rsp)
jmp 0x5f2a
cmpl $0xa, 0xc(%rsp)
jne 0x5f2a
movl $0xd, 0xc(%rsp)
movq (%r14), %r12
movq 0x8(%r12), %rdi
leaq 0x10e9(%rip), %rcx      # 0x7022
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %r8
movl $0x1, %edx
callq 0xabf8
testb %r15b, %r15b
je 0x5f5f
movq 0x30(%r14), %rax
movl $0x0, (%rax)
addl %ebx, 0x4(%rax)
movb $0x1, 0x39(%r12)
movl $0x1, 0x40(%r14)
testb %bpl, %bpl
jne 0x5e4e
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0xc(%rsp), %eax
cmpl $0xa, %eax
sete %cl
cmpl $0xd, %eax
sete %r15b
orb %cl, %r15b
jmp 0x5f0c
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
testb $0x38, 0x40(%rax)
je 0x5ff3
movq 0x30(%rax), %rcx
movl 0x4(%rcx), %r14d
leal 0x1(%r14), %ebp
movq %rax, %rdi
callq 0xdbd8
movl 0x4(%rax), %eax
leal 0x1(%rax), %ecx
cmpl %r14d, %eax
movl %ecx, %r8d
cmovll %ebp, %r8d
cmovgel %ebp, %ecx
leaq 0x91a4(%rip), %rdx      # 0xf183
movq %rsp, %r14
movl $0x20, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x41e0
jmp 0x5ff6
xorl %r14d, %r14d
movsbl %bl, %edi
movq %r14, %rsi
callq 0xc364
movq %rax, %rbx
testq %rax, %rax
je 0x6011
movq %rbx, %rdi
callq 0x6f83
movq %rbx, %rdi
callq 0x4080
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1166(%rip), %rcx      # 0x7193
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 0x704a
testb %al, %al
je 0x607e
movslq 0x10(%rsp), %rsi
movslq 0x8(%rsp), %rax
subq %rax, %rsi
cmpl $0x1, %esi
leaq 0x96f3(%rip), %rax      # 0xf758
leaq 0x9a26(%rip), %rdx      # 0xfa92
cmoveq %rax, %rdx
leaq 0x917b(%rip), %rdi      # 0xf1f2
xorl %eax, %eax
callq 0x527a
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
movq (%rax), %rcx
movq 0x30(%rax), %rax
movq 0x24(%rcx), %rcx
movq %rcx, (%rax)
movl $0x2, %edi
callq 0x4d20
popq %rax
jmp 0x51d8
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
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 0xdbd8
movq 0x18(%r14), %rcx
movq %rcx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x51d8
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
movq (%rax), %rax
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x620d
leaq 0x903b(%rip), %r14      # 0xf20b
xorl %ebp, %ebp
xorl %r15d, %r15d
movq (%r12), %rdi
movq 0x8(%r12), %rsi
movq %rbx, %rdx
callq 0xc0c9
testq %rax, %rax
je 0x6201
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 0x61d5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5827
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0xde6c
movq (%rax), %rax
cmpb $0x1, 0x39(%rax)
jne 0x624b
leaq 0x8fda(%rip), %rdi      # 0xf215
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x4de2
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xe1e0
testb %al, %al
je 0x6310
movq 0x8(%rsp), %rbx
leaq 0x8fd2(%rip), %rsi      # 0xf23c
movl $0x2, %edx
movq %rbx, %rdi
callq 0x40c0
testl %eax, %eax
jne 0x6323
movq %rbx, %rdi
callq 0x4170
movq %rax, %r14
cmpq $0x5, %rax
jl 0x62b3
leaq (%rbx,%r14), %r15
addq $-0x2, %r15
leaq 0x8fa0(%rip), %rsi      # 0xf23f
movq %r15, %rdi
callq 0x42d0
testl %eax, %eax
jne 0x62af
movb $0x0, (%r15)
addq $0x2, %rbx
cmpq $0x5, %r14
jl 0x6323
callq 0xde6c
movq (%rax), %rdi
callq 0x9348
testq %rax, %rax
je 0x62db
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x42d0
testl %eax, %eax
je 0x62ea
movq (%rsp), %rdi
xorl %esi, %esi
callq 0x7407
testb %al, %al
je 0x6336
callq 0xde6c
movq 0x30(%rax), %rax
movq $0x0, (%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6160
callq 0x4e77
callq 0x51d8
jmp 0x6336
leaq 0x8f0e(%rip), %rdi      # 0xf225
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4de2
jmp 0x633e
movq 0x8(%rsp), %rsi
leaq 0x8f13(%rip), %rdi      # 0xf242
xorl %eax, %eax
callq 0x4de2
movq %rsp, %rdi
callq 0xe2e6
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8ef2(%rip), %r14      # 0xf24f
testb %bpl, %bpl
je 0x6390
callq 0x4540
movq (%rax), %rax
leaq 0x1(%rbx), %rdx
leaq 0x8ee3(%rip), %rcx      # 0xf258
movsbq %bpl, %rsi
testb $0x10, 0x1(%rax,%rsi,2)
je 0x638d
movb (%rdx), %bpl
incq %rdx
testb %bpl, %bpl
jne 0x6375
jmp 0x6390
movq %rcx, %r14
movq %rsp, %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x8fcc(%rip), %rdi      # 0xf36d
movl $0x2, %edx
callq 0x58fe
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_O1/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 0x645d
callq 0xde6c
movq (%rax), %rdi
callq 0xd6d2
testb %al, %al
je 0x645d
leaq 0x8dce(%rip), %rdi      # 0xf215
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4de2
movq %rbx, %rdi
callq 0xc2c1
movq %rax, %r14
testq %rax, %rax
setne %r12b
cmovneq %rax, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4420
testl %eax, %eax
je 0x653b
callq 0x40a0
cmpl $0x2, (%rax)
jne 0x653b
cmpb $0x2f, (%rbx)
je 0x653b
callq 0xde6c
movq (%rax), %rdi
callq 0x9348
testq %rax, %rax
je 0x653b
movq %rax, %r15
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x4330
testl %eax, %eax
jne 0x64db
movl $0xf000, %eax           # imm = 0xF000
andl 0x28(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x64db
xorl %r12d, %r12d
jmp 0x64fb
movq %r15, %rdi
callq 0x5863
movq %rax, %r12
movq %rax, %rdi
movl $0x2f, %esi
callq 0x4200
testq %rax, %rax
je 0x64fb
movb $0x0, (%rax)
testq %r12, %r12
cmovneq %r12, %r15
movq %rsp, %rsi
movq %r15, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x8d2d(%rip), %rdi      # 0xf240
movl $0x2, %edx
callq 0x58fe
movq %rax, %r15
movq %r12, %rdi
callq 0x4080
testq %r14, %r14
je 0x6535
movq %rbx, %rdi
callq 0x4080
movb $0x1, %r12b
movq %r15, %rbx
testb %bpl, %bpl
je 0x65a6
leaq 0x10(%rsp), %rdi
movq %rsp, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x91f5
movq (%r14), %rdx
testq %rdx, %rdx
je 0x656c
leaq 0x8fd2(%rip), %rdi      # 0xf534
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4de2
movq 0x10(%rsp), %rdi
callq 0xdb45
movq %rax, %r14
callq 0xde6c
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0xda27
movq 0x10(%rsp), %rdi
leaq 0x2ac5(%rip), %rsi      # 0x905c
callq 0xce9b
movq %r14, %rdi
callq 0xde80
jmp 0x65b0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7407
callq 0x4e77
callq 0x51d8
testb %r12b, %r12b
je 0x65c7
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_O1/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 0xdf5c
movq %rax, %r14
cmpl $0x0, (%r15)
jg 0x6600
callq 0xdfa1
addl (%r15), %eax
imull %eax, %ebx
testl %ebx, %ebx
je 0x6613
movq %r14, %rdi
callq 0xdf17
movq %rax, %r14
decl %ebx
jne 0x6604
movq %r14, %rdi
callq 0xdf64
callq 0x4e77
popq %rbx
popq %r14
popq %r15
jmp 0x51d8
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
cmpl $0x0, (%rbx)
movl 0x4(%rbx), %edx
je 0x6665
cmpl $0x1, %edx
je 0x666a
xorl %ecx, %ecx
testl %edx, %edx
jne 0x666f
movl 0x1c(%rax), %edx
movl %edx, %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
sarl %ecx
jmp 0x666f
addl %edx, 0xc(%rax)
jmp 0x667b
movl 0x1c(%rax), %ecx
decl %ecx
movq 0x30(%rax), %rdx
movl 0x4(%rdx), %edx
subl %ecx, %edx
movl %edx, 0xc(%rax)
cmpl $0x0, 0xc(%rax)
jns 0x6688
movl $0x0, 0xc(%rax)
movq 0x30(%rax), %rcx
movl 0x4(%rcx), %esi
movl 0xc(%rax), %edx
cmpl %edx, %esi
jl 0x669f
addl 0x1c(%rax), %edx
cmpl %edx, %esi
jl 0x66a2
decl %edx
movl %edx, 0x4(%rcx)
callq 0x4e77
popq %rbx
jmp 0x51d8
// File: /workspace/github_c_makefile_star2_O1/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 0xde6c
movl 0x1c(%rax), %edx
incl %edx
movl (%rbx), %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl $0x1, %edi
je 0x66d4
xorl %esi, %esi
cmpl $0x2, %edi
jne 0x66dd
movl %edx, %esi
jmp 0x66dd
movl %edx, %esi
shrl $0x1f, %esi
addl %edx, %esi
sarl %esi
movl %esi, %edx
negl %edx
testl %ecx, %ecx
cmovnsl %esi, %edx
movq 0x30(%rax), %rcx
addl %edx, 0x4(%rcx)
addl %edx, 0xc(%rax)
xorl %edi, %edi
movq %rax, %rsi
callq 0xb280
callq 0x51d8
popq %rbx
jmp 0x4e77