LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0xdaf0
movl 0x1c(%rax), %edx
incl %edx
movl (%rbx), %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl $0x1, %edi
je 0x665a
xorl %esi, %esi
cmpl $0x2, %edi
jne 0x6663
movl %edx, %esi
jmp 0x6663
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 0xaf80
callq 0x51ce
popq %rbx
jmp 0x4e77
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: k_winsel
void k_winsel(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	enum neighbour dir = pos2dir(&a->pos);

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

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

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

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

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

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

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

// Assembly:
pushq %rbx
movl (%rdi), %ebx
testl %ebx, %ebx
je 0x66ef
callq 0xdaf0
movq %rax, %rdx
movq %rdx, %rcx
movq 0x60(%rdx), %rdx
testq %rdx, %rdx
jne 0x669a
xorl %edx, %edx
testl %ebx, %ebx
setg %dl
movq 0x48(%rcx,%rdx,8), %rdi
testq %rdi, %rdi
je 0x6712
movq 0x58(%rdi), %rdx
testq %rdx, %rdx
je 0x6702
movq 0x30(%rax), %rcx
movl 0x4(%rcx), %ecx
addl 0x14(%rax), %ecx
subl 0xc(%rax), %ecx
movq %rdx, %rsi
movl 0x14(%rdi), %edx
cmpl %ecx, %edx
jg 0x66de
addl 0x1c(%rdi), %edx
cmpl %edx, %ecx
jle 0x6702
movq 0x58(%rsi), %rdx
movq %rsi, %rdi
testq %rdx, %rdx
jne 0x66cd
movq %rsi, %rdi
jmp 0x6702
xorl %ebx, %ebx
cmpl $0x0, 0x4(%rdi)
setle %bl
callq 0xdaf0
movq 0x58(%rax,%rbx,8), %rdi
testq %rdi, %rdi
sete %cl
cmpq %rax, %rdi
sete %al
orb %cl, %al
je 0x6721
leaq 0x7a6a(%rip), %rdi      # 0xe183
xorl %eax, %eax
popq %rbx
jmp 0x4de2
callq 0xdb04
callq 0x4e77
popq %rbx
jmp 0x51ce
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: k_winmove
void k_winmove(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	enum neighbour dir = pos2dir(&a->pos);
	int count = 0;

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

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

	window_evict(w);

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

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

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

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

	window_add_neighbour(target, dir, w);

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl $0x3, %ebx
cmpl $0x0, (%rdi)
jg 0x6752
js 0x674d
xorl %ebx, %ebx
cmpl $0x0, 0x4(%rdi)
setg %bl
jmp 0x6752
movl $0x2, %ebx
callq 0xdaf0
movq %rax, %rdi
callq 0xd4d9
testq %rax, %rax
je 0x683d
xorl %edx, %edx
negl %edx
movl %edx, %ecx
movq %rax, %rdx
cmpl $-0x1, %ecx
je 0x6790
movq 0x58(%rdx), %rdx
decl %ecx
testq %rdx, %rdx
jne 0x6771
movq 0x50(%rax), %rax
movl %ecx, %edx
negl %edx
testq %rax, %rax
jne 0x676a
jmp 0x67a0
movq 0x50(%rax), %rax
movl $0x2, %edx
testq %rax, %rax
jne 0x676a
jmp 0x67a9
cmpl $-0x2, %ecx
jg 0x683d
callq 0xdaf0
movq %rax, %r14
movq %rax, %rdi
callq 0xd4b8
movq %rax, %r15
movq %r14, %rdi
callq 0xd533
movl %ebx, %eax
leaq 0x78e3(%rip), %rcx      # 0xe0b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
movq 0x60(%r15), %r15
testq %r15, %r15
jne 0x67d6
jmp 0x6824
movq %r15, %rax
movq 0x60(%r15), %r15
testq %r15, %r15
jne 0x67e4
movq %rax, %rdi
movq 0x48(%rax), %rax
testq %rax, %rax
jne 0x67f0
jmp 0x6824
movq %r15, %rax
movq 0x60(%r15), %r15
testq %r15, %r15
jne 0x67fe
movq %rax, %rdi
movq 0x50(%rax), %rax
testq %rax, %rax
jne 0x680a
jmp 0x6824
movq %r15, %rdi
movq 0x58(%r15), %r15
testq %r15, %r15
jne 0x6818
movl %ebx, %esi
movq %r14, %rdx
callq 0xd6b4
callq 0x4e77
popq %rbx
popq %r14
popq %r15
jmp 0x51ce
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: k_show
void k_show(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();
	buffer_t *buf = win->buf;
	(void)a;
	ui_status("%s%s%s, %sx=%d y=%d eol=%c",
			buf->fname ? "\"" : "",
			buf->fname ? buf->fname : "<no name>",
			buf->fname ? "\"" : "",
			buf->modified ? "[+] " : "",
			win->ui_pos->x, win->ui_pos->y,
			"ny"[buf->eol]);
}

// Assembly:
pushq %rax
callq 0xdaf0
movq (%rax), %rsi
movq 0x30(%rax), %rax
movq 0x30(%rsi), %rdi
testq %rdi, %rdi
leaq 0x7ebd(%rip), %r9       # 0xe749
leaq 0x7d0a(%rip), %rcx      # 0xe59d
cmoveq %r9, %rcx
leaq 0x791d(%rip), %rdx      # 0xe1bb
cmovneq %rdi, %rdx
cmpb $0x0, 0x39(%rsi)
leaq 0x7918(%rip), %r8       # 0xe1c5
cmoveq %r9, %r8
movl (%rax), %r9d
movl 0x4(%rax), %r10d
movzbl 0x38(%rsi), %eax
leaq 0x7907(%rip), %rsi      # 0xe1ca
movsbl (%rax,%rsi), %r11d
leaq 0x78d1(%rip), %rdi      # 0xe1a0
movq %rcx, %rsi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x5273
addq $0x10, %rsp
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: k_ins_colcopy
void k_ins_colcopy(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();

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

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

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

	ui_redraw();
	ui_cur_changed();
}

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

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

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

	win->ui_mode = save;
}

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

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

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

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rax
movl $0x8, %edi
testq %rax, %rax
je 0x69c2
cmpq $0x0, (%rax)
je 0x69c2
movl $0x8, %ecx
leaq 0x8(%rcx), %rdi
cmpq $0x0, (%rax,%rcx)
movq %rdi, %rcx
jne 0x69b4
callq 0x5830
movq %rax, %rbx
movq 0x18(%r14), %r15
testq %r15, %r15
je 0x69f5
movq (%r15), %rdi
testq %rdi, %rdi
je 0x69f5
xorl %r12d, %r12d
callq 0x585c
movq %rax, (%rbx,%r12)
movq 0x8(%r15,%r12), %rdi
addq $0x8, %r12
testq %rdi, %rdi
jne 0x69de
movzbl 0x20(%r14), %ecx
movq %r14, %rdi
movl $0x1, %esi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0x8ef8
movq 0x18(%r14), %rax
cmpq $0x0, (%rax)
je 0x6a37
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x6a37
movq %rbx, %r14
addq $0x8, %r14
callq 0x4080
movq (%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x6a26
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4080
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: k_showch
void k_showch(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	window *win = windows_cur();
	list_t *l = window_current_line(win, false);
	if(l){
		if((unsigned)win->ui_pos->x < l->len_line){
			const int ch = l->line[win->ui_pos->x];

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

	ui_status("NUL");
}

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

	*repeat = io_read_repeat(io_m);

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %ebp
testl %esi, %esi
je 0x6e96
callq 0xdaf0
movl 0x40(%rax), %edi
callq 0xc3c4
movl %eax, %ebp
movl %ebp, %edi
callq 0xc590
movl %eax, (%rbx)
leaq 0xd35a(%rip), %rbx      # 0x14200
xorl %r14d, %r14d
movl %ebp, %edi
movq %rbx, %rsi
movl $0x2b, %edx
xorl %ecx, %ecx
movl $0x20, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x6c8f
cltq
movq %rax, %rcx
shlq $0x5, %rcx
cmpl $-0x1, %eax
leaq 0x8(%rcx,%rbx), %rax
cmovneq %rax, %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: prompt_finish
static void prompt_finish(char *cmd)
{
	const cmd_t *cmd_f;
	char **argv;
	int argc;
	bool force;
	struct range rstore, *range = &rstore;

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

	free_argv(argv, argc);
}

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

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

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

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

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

		window *win = windows_cur();

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

		if(used_region)
			*used_region = r;

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

		ui_set_bufmode(UI_NORMAL);

		ui_redraw();
		ui_cur_changed();

		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %r12d
movl %edi, %ebp
movq 0xeab6(%rip), %rax      # 0x15a80
movq %rax, 0x30(%rsp)
movups 0xea9a(%rip), %xmm0     # 0x15a70
movaps %xmm0, 0x20(%rsp)
leaq 0x4(%rsp), %rdi
callq 0x6f59
testq %rax, %rax
je 0x6fef
movq %rax, %r15
jmp 0x701d
leaq 0x8(%rsp), %rsi
movl $0x1, %edi
movl $0x1, %edx
callq 0xc3de
cmpl %r12d, %eax
jne 0x70bf
cmpl $0x1, %ebp
adcl $-0x1, %ebp
leaq 0x20(%rsp), %r15
movl %ebp, 0xc(%r15)
xorl %ebp, %ebp
testl %ebp, %ebp
movl 0x4(%rsp), %eax
movl $0x1, %ecx
movl $0x1, %edx
cmovnel %ebp, %edx
testl %eax, %eax
setne %sil
cmovnel %eax, %ecx
imull %edx, %ecx
xorl %r13d, %r13d
testb $0x1, %sil
cmovnel %ecx, %r13d
testl %ebp, %ebp
cmovnel %ecx, %r13d
callq 0xdaf0
movq %rax, %r12
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
movl %r13d, %esi
movq %rax, %rdx
callq 0xbbbc
movl %eax, %ebp
testb %al, %al
je 0x70d6
testq %r14, %r14
je 0x7084
movl 0x18(%rsp), %eax
movl %eax, 0x10(%r14)
movups 0x8(%rsp), %xmm0
movups %xmm0, (%r14)
movq 0x30(%r12), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
testq %rbx, %rbx
je 0x70a9
movq (%r12), %rdi
movq 0x30(%r12), %rdx
leaq 0x8(%rsp), %rsi
movq %rbx, %rcx
callq *(%rbx)
movl $0x1, %edi
callq 0x4d20
callq 0x4e77
callq 0x51ce
jmp 0x70d6
cmpl $0x1b, %eax
je 0x70d4
leaq 0x719d(%rip), %rdi      # 0xe268
movl %eax, %esi
xorl %eax, %eax
callq 0x4de2
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/keys.c
// Function: filter
static void filter(
		buffer_t *buf,
		const region_t *region,
		point_t *out,
		struct around_motion *around)
{
	const struct filter_input *pf = around->filter;
	bool free_cmd = false;
	char *cmd;

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

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

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

				prompt_finish(cmd);

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

		case FILTER_SELF:
			cmd = "sh";
	}

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

	if(free_cmd)
		free(cmd);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq 0x8(%rcx), %rax
cmpl $0x1, (%rax)
jne 0x7145
movq 0x8(%rax), %rdx
testq %rdx, %rdx
jne 0x714c
movl 0x4(%rsi), %ecx
movl 0xc(%rsi), %r8d
leaq 0x716b(%rip), %rdx      # 0xe277
movq %rsp, %rbx
movl $0x20, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41e0
movl $0x3a, %edi
movq %rbx, %rsi
callq 0xbff0
testq %rax, %rax
je 0x7177
movq %rax, %rbx
movq %rax, %rdi
callq 0x6ee3
movq %rbx, %rdi
callq 0x4080
jmp 0x7177
leaq 0x7571(%rip), %rdx      # 0xe6bd
callq 0x950f
testl %eax, %eax
je 0x7177
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x7116(%rip), %rdi      # 0xe27e
movq %rax, %rsi
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x4de2
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: quit_common
static bool quit_common(
		bool qall,
		int argc, char **argv,
		bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	if(!force){
		bool modified = false;

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

			if(modwin){
				modified = true;

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

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

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

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

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

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

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

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

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

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
testq %r8, %r8
je 0x71b8
movq (%rdx), %rsi
leaq 0x70e6(%rip), %rdi      # 0xe29c
jmp 0x71d7
cmpl $0x1, %esi
jne 0x71cd
movl %ecx, %ebx
testb %bl, %bl
je 0x71ec
testb %dil, %dil
jne 0x7228
jmp 0x7253
movq (%rdx), %rsi
leaq 0x70e0(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
testb %dil, %dil
je 0x7239
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0xd34f
testq %rax, %rax
je 0x7228
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0xdbe4
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xdb6b
callq 0x4e77
callq 0x51ce
jmp 0x724a
leaq 0xf1a5(%rip), %rax      # 0x163d4
movl $0x1, (%rax)
movb $0x1, %bl
jmp 0x71e0
callq 0xdaf0
movq (%rax), %rdi
callq 0xd335
testb %al, %al
je 0x7253
leaq 0x6fbe(%rip), %rdi      # 0xe20f
jmp 0x7283
callq 0xdaf0
movq %rax, %r15
movq %rax, %rdi
callq 0xd4b8
movq %rax, %r14
testq %rax, %rax
setne %al
orb %al, %bl
jne 0x7291
xorl %edi, %edi
callq 0x47bc
testq %rax, %rax
je 0x7291
leaq 0x7241(%rip), %rdi      # 0xe4c4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
jmp 0x71e0
movq %r15, %rdi
callq 0xd533
movq %r15, %rdi
callq 0xd806
movq %r14, %rdi
callq 0xdb04
testq %r14, %r14
jne 0x72ea
callq 0xdbdc
movq %rax, %rbx
movq %rax, %rdi
callq 0xdb9b
cmpq %rbx, %rax
jne 0x72d2
leaq 0xf10a(%rip), %rax      # 0x163d4
movl $0x1, (%rax)
xorl %eax, %eax
movq %rax, %rdi
callq 0xdbe4
movq %rbx, %rdi
callq 0xdb6f
movq %rbx, %rdi
callq 0xdb37
leaq 0xf0e3(%rip), %rax      # 0x163d4
movb $0x1, %bl
cmpl $0x0, (%rax)
jne 0x71e0
callq 0x4e77
callq 0x51ce
jmp 0x71e0
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_cq
bool c_cq(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	/* no buffer checks */
	ui_run = UI_EXIT_1;

	return true;
}

// Assembly:
pushq %rbx
testq %rcx, %rcx
je 0x7331
movq (%rsi), %rsi
leaq 0x6f6d(%rip), %rdi      # 0xe29c
jmp 0x7351
cmpl $0x1, %edi
jne 0x7347
leaq 0xf097(%rip), %rax      # 0x163d4
movl $0x2, (%rax)
movb $0x1, %bl
jmp 0x735a
movq (%rsi), %rsi
leaq 0x6f66(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: edit_common
bool edit_common(const char *fname, bool const force)
{
	window *win = windows_cur();

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

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

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

	bool ret = false;

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

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

	buffer_set_fname(buffers_cur(), fname);

	ui_redraw();
	ui_cur_changed();

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0xdaf0
movq %rax, %r14
testq %rbx, %rbx
je 0x73d8
testb %bpl, %bpl
jne 0x7388
movq (%r14), %rdi
callq 0xd335
testb %al, %al
jne 0x73f6
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xda55
testb %al, %al
jne 0x740e
movq (%rsp), %rdx
leaq 0x7180(%rip), %rdi      # 0xe525
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4de2
callq 0x8f53
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0xd9ff
leaq 0x1b69(%rip), %rsi      # 0x8f34
movq %r15, %rdi
callq 0xcaff
jmp 0x7459
movq (%r14), %rdi
callq 0x9216
testq %rax, %rax
je 0x7430
movq %rax, %rbx
testb %bpl, %bpl
jne 0x73ff
movq (%r14), %rax
cmpb $0x0, 0x39(%rax)
je 0x73ff
leaq 0x6e12(%rip), %rdi      # 0xe20f
jmp 0x7437
movq %rsp, %rsi
movq %r14, %rdi
callq 0xdaa3
testb %al, %al
je 0x7442
leaq 0x6eb8(%rip), %rdi      # 0xe2cd
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5273
callq 0xdaf0
movq (%rax), %rax
movb $0x0, 0x39(%rax)
movb $0x1, %bpl
jmp 0x7459
leaq 0x6e8a(%rip), %rdi      # 0xe2c1
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4de2
jmp 0x7473
movq (%rsp), %rdx
leaq 0x70d8(%rip), %rdi      # 0xe525
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4de2
callq 0xdaf0
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x9054
callq 0x4e77
callq 0x51ce
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_n
bool c_n(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

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

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

	return edit_common(fname, force);
}

// Assembly:
pushq %rbx
testq %rcx, %rcx
je 0x7492
movq (%rsi), %rsi
leaq 0x6e0c(%rip), %rdi      # 0xe29c
jmp 0x74d1
cmpl $0x1, %edi
jne 0x74c7
movl %edx, %ebx
callq 0xdaf0
movq (%rax), %rdi
callq 0xd335
xorb $0x1, %al
orb %bl, %al
je 0x74dc
movl $0x1, %edi
callq 0x47bc
testq %rax, %rax
je 0x74e5
movzbl %bl, %esi
movq %rax, %rdi
popq %rbx
jmp 0x735e
movq (%rsi), %rsi
leaq 0x6de6(%rip), %rdi      # 0xe2b7
xorl %eax, %eax
callq 0x4de2
xorl %eax, %eax
popq %rbx
retq
leaq 0x6d2c(%rip), %rdi      # 0xe20f
jmp 0x74ec
leaq 0x6dec(%rip), %rdi      # 0xe2d8
xorl %eax, %eax
callq 0x4de2
jmp 0x74d8
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_w
bool c_w(char *cmd, char *arg, bool force, struct range *range)
{
	arg = skipspace(arg);

	if(range)
		return write_range(arg, force, range);

	buffer_t *const buf = buffers_cur();

	bool newfname = false;
	if(*arg){
		const char *old = buffer_fname(buf);

		newfname = !old || strcmp(old, arg);

		buffer_set_fname(buf, arg);
	}

	if(!write_buf(buf, force, newfname))
		return false;

	ui_status("written to \"%s\"", buffer_fname(buf));
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movl %edx, %ebp
movq %rsi, %rdi
callq 0xbe3b
movq %rax, %r14
testq %r12, %r12
je 0x757d
movq %r14, %rdi
callq 0xbe3b
movq %rax, %rbx
callq 0xdaf0
movq (%rax), %r13
movq 0x8(%r13), %rdi
movl (%r12), %esi
xorl %edx, %edx
callq 0x9d35
testq %rax, %rax
je 0x75b2
movq %rax, %r14
movl 0x4(%r12), %r15d
subl (%r12), %r15d
incl %r15d
movzbl (%rbx), %eax
cmpl $0x5c, %eax
je 0x75ee
cmpl $0x21, %eax
je 0x75cf
testl %eax, %eax
jne 0x7610
testb %bpl, %bpl
je 0x76c7
movq %r13, %rdi
callq 0x9216
movq %rax, %rbx
jmp 0x7610
callq 0xdaf0
movq (%rax), %rbx
cmpb $0x0, (%r14)
je 0x75c7
movq %rbx, %rdi
callq 0x9216
testq %rax, %rax
je 0x7674
movq %rax, %rdi
movq %r14, %rsi
callq 0x42e0
testl %eax, %eax
setne %r15b
jmp 0x7677
leaq 0x6f1e(%rip), %rdi      # 0xe4d7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4de2
jmp 0x76b6
xorl %r15d, %r15d
jmp 0x7682
incq %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbc84
cmpb $0x21, 0x1(%rbx)
jne 0x7610
movq %rbx, %r12
incq %r12
movq %rbx, %rdi
callq 0x4170
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x4400
leaq 0x7377(%rip), %rsi      # 0xe98e
movq %rbx, %rdi
callq 0x4440
testq %rax, %rax
je 0x7650
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
movl $0x1, %ecx
callq 0x9c00
testl %eax, %eax
je 0x76af
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x6ed1(%rip), %rdi      # 0xe51f
jmp 0x7663
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x6eb0(%rip), %rdi      # 0xe513
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4de2
jmp 0x76b6
movb $0x1, %r15b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9054
movzbl %bpl, %esi
movzbl %r15b, %edx
movq %rbx, %rdi
callq 0x76d3
testb %al, %al
je 0x76b4
movq %rbx, %rdi
callq 0x9216
leaq 0x6c41(%rip), %rdi      # 0xe2e6
movq %rax, %rsi
xorl %eax, %eax
callq 0x5273
movb $0x1, %bpl
jmp 0x76b6
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6e16(%rip), %rdi      # 0xe4e4
jmp 0x75b9
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: write_buf
static bool write_buf(
		buffer_t *buf, bool const force, bool const newfname)
{
	const char *fname = buffer_fname(buf);
	if(!fname){
		ui_err("no filename");
		return false;
	}

	struct stat st;
	if(!force){
		if(stat(fname, &st) == 0){
			if(newfname && access(fname, F_OK) == 0){
				ui_err("file already exists");
				return false;
			}

			if(st.st_mtime > buf->mtime){
				ui_err("file modified externally");
				return false;
			}
		}else if(errno != ENOENT){
			ui_err("stat(%s): %s", fname, strerror(errno));
			return false;
		}
	}

	FILE *f = fopen(fname, "w");

	if(!f){
got_err:
		ui_err("%s: %s", fname, strerror(errno));
		if(f)
			fclose(f);
		return false;
	}

	if(buffer_write_file(buf, -1, f, buf->eol) != 0)
		goto got_err; /* file cleanup handled */

	if(fclose(f)){
		f = NULL;
		goto got_err;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
callq 0x9216
testq %rax, %rax
je 0x7737
movq %rax, %rbx
testb %r15b, %r15b
jne 0x7777
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4340
testl %eax, %eax
je 0x774c
callq 0x40a0
movl (%rax), %edi
cmpl $0x2, %edi
je 0x7777
callq 0x44e0
leaq 0x6e36(%rip), %rdi      # 0xe559
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4de2
jmp 0x77e7
leaq 0x6b83(%rip), %rdi      # 0xe2c1
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4de2
jmp 0x77e7
testb %bpl, %bpl
je 0x7763
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4420
testl %eax, %eax
je 0x77fc
movq 0x60(%rsp), %rax
cmpq 0x40(%r14), %rax
jle 0x7777
leaq 0x6dcb(%rip), %rdi      # 0xe540
jmp 0x773e
leaq 0x7210(%rip), %rsi      # 0xe98e
movq %rbx, %rdi
callq 0x4440
testq %rax, %rax
je 0x77b3
movq %rax, %r15
movzbl 0x38(%r14), %ecx
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rax, %rdx
callq 0x91ed
testl %eax, %eax
jne 0x77b6
movq %r15, %rdi
callq 0x4150
testl %eax, %eax
je 0x77f7
xorl %r15d, %r15d
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x6d5c(%rip), %rdi      # 0xe525
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4de2
testq %r15, %r15
je 0x77e7
movq %r15, %rdi
callq 0x4150
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
jmp 0x77e7
leaq 0x6d29(%rip), %rdi      # 0xe52c
jmp 0x773e
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_wa
bool c_wa(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	bool success = true;
	bool done_write = false;

	for(tab *tab = tabs_first(); tab; tab = tab->next){
		window *win;
		ITER_WINDOWS_FROM(win, tab->win){
			buffer_t *buf = win->buf;

			if(!force && !buf->modified)
				continue;

			bool subforce = false;
			if(!write_buf(buf, subforce, /*newfname:*/false)){
				tabs_set_cur(tab);
				tab_set_focus(tab, win);
				success = false;
			}else{
				done_write = true;
			}
		}
	}

	if(success){
		if(done_write)
			ui_status("saved all%s buffers", force ? "" : " modified");
		else
			ui_status("no modified buffers");

	}else{
		/* leave the error message emitted by write_buf() */
	}

	return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0x7827
movq (%rsi), %rsi
leaq 0x6a7a(%rip), %rdi      # 0xe29c
jmp 0x78f1
cmpl $0x1, %edi
jne 0x78e7
movl %edx, %ebx
callq 0xdbec
testq %rax, %rax
je 0x790b
movq %rax, %r14
movb $0x1, %bpl
xorl %r13d, %r13d
movq (%r14), %rdi
callq 0xd4d9
testq %rax, %rax
je 0x78ae
movq %rax, %r12
movq %r12, (%rsp)
movl %r13d, %r15d
movq (%r12), %rdi
testb %bl, %bl
jne 0x786e
cmpb $0x1, 0x39(%rdi)
jne 0x7893
xorl %esi, %esi
xorl %edx, %edx
callq 0x76d3
movb $0x1, %r13b
testb %al, %al
jne 0x7896
movq %r14, %rdi
callq 0xdbe4
movq %r14, %rdi
movq %r12, %rsi
callq 0xdb6b
xorl %ebp, %ebp
movl %r15d, %r13d
movq 0x58(%r12), %r12
testq %r12, %r12
jne 0x785d
movq (%rsp), %r12
movq 0x50(%r12), %r12
testq %r12, %r12
jne 0x7859
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x7849
testb $0x1, %bpl
je 0x791d
testb $0x1, %r13b
je 0x790b
leaq 0x6e7f(%rip), %rax      # 0xe749
leaq 0x6944(%rip), %rsi      # 0xe215
testb %bl, %bl
cmovneq %rax, %rsi
leaq 0x6a18(%rip), %rdi      # 0xe2f6
xorl %eax, %eax
callq 0x5273
jmp 0x7919
movq (%rsi), %rsi
leaq 0x69c6(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x69f8(%rip), %rdi      # 0xe30a
xorl %eax, %eax
callq 0x5273
movb $0x1, %bl
jmp 0x78fa
xorl %ebx, %ebx
jmp 0x78fa
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_x
bool c_x(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();

	if(argc > 2){
		ui_err("usage: %s [filename]", *argv);
		return false;
	}

	buffer_t *buf = buffers_cur();

	/* if no modifications, don't try to write
	 * this is done in vi and helps ZZ */
	if(argc == 1 && buf->fname && !buf->modified)
		return c_q(argc, argv, false, range);

	return c_w("w", argc > 1 ? argv[1] : "", false, range)
		&& c_q(1, (char *[]){ "" }, false, NULL);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rcx, %rcx
je 0x7938
movq (%rbx), %rsi
leaq 0x6966(%rip), %rdi      # 0xe29c
jmp 0x7949
movl %edi, %ebp
cmpl $0x3, %edi
jl 0x795b
movq (%rbx), %rsi
leaq 0x69d5(%rip), %rdi      # 0xe31e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0xdaf0
cmpl $0x2, %ebp
je 0x799b
leaq 0x6ddd(%rip), %rsi      # 0xe749
cmpl $0x1, %ebp
jne 0x799f
movq (%rax), %rax
cmpq $0x0, 0x30(%rax)
je 0x799f
cmpb $0x0, 0x39(%rax)
jne 0x799f
xorl %edi, %edi
movl $0x1, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x719e
movq 0x8(%rbx), %rsi
xorl %ebx, %ebx
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x74f5
testb %al, %al
je 0x7952
leaq 0x6d94(%rip), %rax      # 0xe749
movq %rsp, %rdx
movq %rax, (%rdx)
xorl %edi, %edi
movl $0x1, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x719e
movl %eax, %ebx
jmp 0x7952
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_xa
bool c_xa(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	for(tab *tab = tabs_first(); tab; tab = tab->next){
		window *win;
		ITER_WINDOWS_FROM(win, tab->win){
			buffer_t *buf = win->buf;

			if(!buf->modified)
				continue;

			if(!write_buf(buf, force, false)){
				tabs_set_cur(tab);
				tab_set_focus(tab, win);
				return false;
			}
		}
	}

	ui_run = UI_EXIT_0;

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0x79e8
movq (%rsi), %rsi
leaq 0x68b6(%rip), %rdi      # 0xe29c
jmp 0x7a5f
cmpl $0x1, %edi
jne 0x7a55
movl %edx, %ebp
callq 0xdbec
testq %rax, %rax
je 0x7a44
movq %rax, %rbx
movzbl %bpl, %ebp
movq (%rbx), %rdi
callq 0xd4d9
testq %rax, %rax
je 0x7a3b
movq %rax, %r14
movq %r14, %r15
movq (%r15), %rdi
cmpb $0x1, 0x39(%rdi)
jne 0x7a29
movl %ebp, %esi
xorl %edx, %edx
callq 0x76d3
testb %al, %al
je 0x7a75
movq 0x58(%r15), %r15
testq %r15, %r15
jne 0x7a13
movq 0x50(%r14), %r14
testq %r14, %r14
jne 0x7a10
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x7a00
leaq 0xe989(%rip), %rax      # 0x163d4
movl $0x1, (%rax)
movb $0x1, %bl
jmp 0x7a68
movq (%rsi), %rsi
leaq 0x6858(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xdbe4
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdb6b
xorl %ebx, %ebx
jmp 0x7a68
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_e
bool c_e(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();

	const char *fname;

	if(argc == 1){
		fname = NULL;
		if(!buffer_fname(buffers_cur())){
			ui_err("no filename");
			return false;
		}
	}else if(argc == 2){
		fname = argv[1];
	}else{
		if(buffers_modified_single(buffers_cur())){
			ui_err("buffer modified");
			return false;
		}

		if(!yesno("%d files given - open in vertical split? (y/N) ", argc - 1))
			return false;

		window *current = windows_cur();

		bool ret = c_split(
				neighbour_down,
				/*use current:*/true,
				argc,
				argv,
				/*force*/false,
				/*range*/NULL,
				/*allow_many:*/true);

		/* close current window */
		windows_set_cur(current);
		quit_common(false, 1, (char *[]){ "", NULL }, false, NULL);

		return ret;
	}

	return edit_common(fname, force);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
testq %rcx, %rcx
je 0x7abc
movq (%rbx), %rsi
leaq 0x67f4(%rip), %rdi      # 0xe29c
xorl %eax, %eax
callq 0x4de2
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %ebp
movl %edi, %r14d
cmpl $0x2, %edi
je 0x7ae6
cmpl $0x1, %r14d
jne 0x7afd
callq 0xdaf0
movq (%rax), %rdi
callq 0x9216
testq %rax, %rax
je 0x7b8c
xorl %edi, %edi
jmp 0x7aea
movq 0x8(%rbx), %rdi
movzbl %bpl, %esi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x735e
callq 0xdaf0
movq (%rax), %rdi
callq 0xd335
testb %al, %al
je 0x7b17
leaq 0x66fa(%rip), %rdi      # 0xe20f
jmp 0x7b93
leal -0x1(%r14), %esi
leaq 0x6811(%rip), %rdi      # 0xe333
xorl %eax, %eax
callq 0xc2c3
testb %al, %al
je 0x7aaf
callq 0xdaf0
movq %rax, %r15
movl $0x1, %edi
movl $0x1, %esi
movl %r14d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x7b9f
movl %eax, %ebx
movq %r15, %rdi
callq 0xdb04
leaq 0x6be5(%rip), %rax      # 0xe749
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq $0x0, 0x8(%rdx)
xorl %edi, %edi
movl $0x1, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x719e
movl %ebx, %eax
jmp 0x7ab1
leaq 0x672e(%rip), %rdi      # 0xe2c1
xorl %eax, %eax
callq 0x4de2
jmp 0x7aaf
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_split
static
bool c_split(
		const enum neighbour dir,
		bool const withcurrent,
		int argc, char **argv,
		bool force, struct range *range,
		const bool allow_many)
{
	RANGE_NO();

	if(!allow_many && argc > 2){
		ui_err("usage: %s [filename]", *argv);
		return false;
	}

	buffer_t *b;

	if(argc > 1){
		for(int i = 1; i < argc; i++){
			const char *err;
			buffer_new_fname(&b, argv[i], &err);

			if(err){
				ui_err("%s: %s", argv[i], err);

				/* edit new file */
				b = buffer_new();
				buffer_set_fname(b, argv[i]);
			}

			attach_buffer(b, dir, NULL);
		}

	}else if(withcurrent){
		window *cur = windows_cur();
		b = retain(cur->buf);
		attach_buffer(b, dir, /*copy pos from:*/cur);

	}else{
		b = buffer_new();
		attach_buffer(b, dir, NULL);
	}

	ui_redraw();
	ui_cur_changed();

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
testq %r8, %r8
je 0x7bc4
movq (%r14), %rsi
leaq 0x66dd(%rip), %rdi      # 0xe29c
jmp 0x7c4f
cmpl $0x3, %edx
setl %al
orb %r9b, %al
je 0x7c45
movl %edi, %ebx
cmpl $0x2, %edx
jl 0x7c69
movl %edx, %ebp
movl $0x1, %r13d
leaq 0x8(%rsp), %r15
leaq 0x10(%rsp), %r12
movq (%r14,%r13,8), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x90cd
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x7c2d
movq (%r14,%r13,8), %rsi
leaq 0x6915(%rip), %rdi      # 0xe525
xorl %eax, %eax
callq 0x4de2
callq 0x8f53
movq %rax, 0x8(%rsp)
movq (%r14,%r13,8), %rsi
movq %rax, %rdi
callq 0x9054
movq 0x8(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x85a2
incq %r13
cmpq %r13, %rbp
jne 0x7bec
jmp 0x7ca3
movq (%r14), %rsi
leaq 0x66cf(%rip), %rdi      # 0xe31e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %sil, %sil
je 0x7c8d
callq 0xdaf0
movq %rax, %r14
movq (%rax), %rdi
callq 0xcaf4
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl %ebx, %esi
movq %r14, %rdx
jmp 0x7c9e
callq 0x8f53
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x85a2
callq 0x4e77
callq 0x51ce
movb $0x1, %bl
jmp 0x7c58
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_ene
bool c_ene(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

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

	buffer_t *new = buffer_new();
	window_replace_buffer(windows_cur(), new);
	buffer_release(new);

	ui_cur_changed();
	ui_redraw();

	return true;
}

// Assembly:
pushq %rbx
testq %rcx, %rcx
je 0x7cc3
movq (%rsi), %rsi
leaq 0x65db(%rip), %rdi      # 0xe29c
jmp 0x7cf9
cmpl $0x1, %edi
jne 0x7cef
testb %dl, %dl
jne 0x7d06
callq 0xdaf0
movq (%rax), %rdi
callq 0xd335
testb %al, %al
je 0x7d06
leaq 0x652b(%rip), %rdi      # 0xe20f
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
jmp 0x7d02
movq (%rsi), %rsi
leaq 0x65be(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
popq %rbx
retq
callq 0x8f53
movq %rax, %rbx
callq 0xdaf0
movq %rax, %rdi
movq %rbx, %rsi
callq 0xd9ff
leaq 0x120f(%rip), %rsi      # 0x8f34
movq %rbx, %rdi
callq 0xcaff
callq 0x51ce
callq 0x4e77
movb $0x1, %bl
jmp 0x7d02
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_only
bool c_only(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	if(!force && buffers_modified_excluding(buffers_cur(), NULL)){
		ui_err("another buffer has changes");
		return false;
	}

	window *iter;
	size_t count = 0;
	ITER_WINDOWS(iter)
		count++;

	if(count == 1)
		return true;

	window *const anchor = windows_cur();
	windows_set_cur(window_next(anchor));
	window_evict(anchor);

	/* must iterate manually to avoid accessing free'd memory */
	iter = window_topleftmost(windows_cur());
	window *next_right;
	for(window *h = iter; h; h = next_right){
		next_right = h->neighbours.right;

		window *next_below;
		for(iter = h; iter; iter = next_below){
			next_below = iter->neighbours.below;
			window_free(iter);
		}
	}

	windows_set_cur(anchor);

	ui_cur_changed();
	ui_redraw();

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rcx, %rcx
je 0x7d51
movq (%rsi), %rsi
leaq 0x654d(%rip), %rdi      # 0xe29c
jmp 0x7d8a
cmpl $0x1, %edi
jne 0x7d80
testb %dl, %dl
jne 0x7d9b
callq 0xdaf0
movq (%rax), %rdi
xorl %esi, %esi
callq 0xd34f
testq %rax, %rax
je 0x7d9b
leaq 0x65ee(%rip), %rdi      # 0xe363
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
jmp 0x7d93
movq (%rsi), %rsi
leaq 0x652d(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0xdaf0
movq %rax, %rdi
callq 0xd4d9
testq %rax, %rax
je 0x7dcf
xorl %ecx, %ecx
movq %rax, %rdx
incq %rcx
movq 0x58(%rdx), %rdx
testq %rdx, %rdx
jne 0x7db2
movq 0x50(%rax), %rax
testq %rax, %rax
jne 0x7daf
movb $0x1, %bl
cmpq $0x1, %rcx
je 0x7d93
callq 0xdaf0
movq %rax, %rbx
movq %rax, %rdi
callq 0xd4b8
movq %rax, %rdi
callq 0xdb04
movq %rbx, %rdi
callq 0xd533
callq 0xdaf0
movq %rax, %rdi
callq 0xd4d9
testq %rax, %rax
je 0x7e21
movq %rax, %r14
movq %r14, %rdi
movq 0x50(%r14), %r14
movq 0x58(%rdi), %r15
callq 0xd806
movq %r15, %rdi
testq %r15, %r15
jne 0x7e0b
testq %r14, %r14
jne 0x7e04
movq %rbx, %rdi
callq 0xdb04
callq 0x51ce
callq 0x4e77
movb $0x1, %bl
jmp 0x7d93
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_all
bool c_all(int argc, char **argv, bool force, struct range *range)
{
	ARGV_NO();
	if(force){
		ui_err("usage: %s", *argv);
		return false;
	}

	if(!args_next_fname(false))
		ui_status("no remaining buffers");

	window *cur = windows_cur();
	for(;;){
		const char *fname = args_next_fname(true);
		if(!fname)
			break;

		buffer_t *buf;
		const char *err;
		buffer_new_fname(&buf, fname, &err);

		window *w = window_new(buf);
		buffer_release(buf);

		window_add_neighbour(cur, neighbour_down, w);

		cur = w;
	}

	ui_redraw();

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0x1, %edi
jne 0x8144
testb %dl, %dl
je 0x815c
movq (%rsi), %rsi
leaq 0x6169(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
jmp 0x81eb
xorl %edi, %edi
callq 0x47bc
testq %rax, %rax
jne 0x8176
leaq 0x6237(%rip), %rdi      # 0xe3a6
xorl %eax, %eax
callq 0x5273
callq 0xdaf0
movq %rax, %r15
movl $0x1, %edi
callq 0x47bc
testq %rax, %rax
je 0x81e4
movq %rsp, %rbx
leaq 0x8(%rsp), %r14
leaq 0xd98(%rip), %r12       # 0x8f34
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x90cd
movq (%rsp), %rdi
callq 0xd7c4
movq %rax, %r13
movq (%rsp), %rdi
movq %r12, %rsi
callq 0xcaff
movq %r15, %rdi
movl $0x1, %esi
movq %r13, %rdx
callq 0xd6b4
movl $0x1, %edi
callq 0x47bc
movq %r13, %r15
testq %rax, %rax
jne 0x819c
callq 0x4e77
movb $0x1, %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_tabe
bool c_tabe(int argc, char **argv, bool force, struct range *range)
{
	if(argc > 2){
		ui_err("usage: %s [path]", *argv);
		return false;
	}

	buffer_t *buf = buffer_new();

	window *win = window_new(buf);
	tab *tab = tab_new(win);
	buffer_release(buf);

	tab->next = tabs_cur()->next;
	tabs_cur()->next = tab;

	tabs_set_cur(tab);

	if(argc == 1){
		/* empty tab - fine */
	}else if(argc == 2){
		return edit_common(argv[1], force);
	}

	ui_redraw();
	ui_cur_changed();

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
cmpl $0x3, %edi
jl 0x8220
movq (%r14), %rsi
leaq 0x61a6(%rip), %rdi      # 0xe3bb
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4de2
jmp 0x8292
movl %edx, %ebx
movl %edi, %ebp
callq 0x8f53
movq %rax, %r15
movq %rax, %rdi
callq 0xd7c4
movq %rax, %rdi
callq 0xdb1c
movq %rax, %r12
leaq 0xcee(%rip), %rsi       # 0x8f34
movq %r15, %rdi
callq 0xcaff
callq 0xdbdc
movq 0x8(%rax), %rax
movq %rax, 0x8(%r12)
callq 0xdbdc
movq %r12, 0x8(%rax)
movq %r12, %rdi
callq 0xdbe4
cmpl $0x2, %ebp
jne 0x8286
movq 0x8(%r14), %rdi
movzbl %bl, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x735e
callq 0x4e77
callq 0x51ce
movb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/cmds.c
// Function: c_tabo
bool c_tabo(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	tab *const tab_current = tabs_cur();

	if(!force){
		for(tab *tab = tabs_first(); tab; tab = tab->next){
			if(tab == tab_current)
				continue;

			window *win;
			ITER_WINDOWS_FROM(win, tab->win){
				buffer_t *buf = win->buf;

				/* if we contain this buffer, then it's fine */
				if(tab_contains_buffer(tab_current, buf))
					continue;

				if(buf->modified){
					ui_err("other tab contains modified buffer");
					return false;
				}
			}
		}
	}

	tab_evict(tab_current);

	tab *t = tabs_first();
	while(t){
		tab *next = t->next;

		assert(t != tab_current);
		tab_free(t);

		t = next;
	}

	tabs_set_cur(tab_current);
	tabs_set_first(tab_current);

	ui_redraw();
	ui_cur_changed();

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0x82bc
movq (%rsi), %rsi
leaq 0x5fe5(%rip), %rdi      # 0xe29c
jmp 0x8384
cmpl $0x1, %edi
jne 0x837a
movl %edx, %ebp
callq 0xdbdc
movq %rax, %rbx
testb %bpl, %bpl
jne 0x8333
callq 0xdbec
testq %rax, %rax
je 0x8333
movq %rax, %r14
cmpq %rbx, %r14
je 0x832a
movq (%r14), %rdi
callq 0xd4d9
testq %rax, %rax
je 0x832a
movq %rax, %r15
movq %r15, %r13
movq (%r13), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xdba9
testb %al, %al
jne 0x8318
cmpb $0x0, 0x39(%r12)
jne 0x839c
movq 0x58(%r13), %r13
testq %r13, %r13
jne 0x82f9
movq 0x50(%r15), %r15
testq %r15, %r15
jne 0x82f6
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x82e1
movq %rbx, %rdi
callq 0xdb6f
callq 0xdbec
testq %rax, %rax
je 0x835e
movq %rax, %rdi
cmpq %rbx, %rdi
je 0x83ac
movq 0x8(%rdi), %r14
callq 0xdb37
movq %r14, %rdi
testq %r14, %r14
jne 0x8348
movq %rbx, %rdi
callq 0xdbe4
movq %rbx, %rdi
callq 0xdbf4
callq 0x4e77
callq 0x51ce
jmp 0x838b
movq (%rsi), %rsi
leaq 0x5f33(%rip), %rdi      # 0xe2b7
xorl %eax, %eax
callq 0x4de2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6029(%rip), %rdi      # 0xe3cc
xorl %eax, %eax
callq 0x4de2
jmp 0x838b
leaq 0x603c(%rip), %rdi      # 0xe3ef
leaq 0x6046(%rip), %rsi      # 0xe400
leaq 0x6046(%rip), %rcx      # 0xe407
movl $0x332, %edx            # imm = 0x332
callq 0x4210