LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xb627
movq %rax, %r14
testq %r12, %r12
je 0x71c7
movq %r14, %rdi
callq 0xb627
movq %rax, %rbx
callq 0xd170
movq (%rax), %r13
movq 0x8(%r13), %rdi
movl (%r12), %esi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x71fc
movq %rax, %r14
movl 0x4(%r12), %r15d
subl (%r12), %r15d
incl %r15d
movzbl (%rbx), %eax
cmpl $0x5c, %eax
je 0x7238
cmpl $0x21, %eax
je 0x7219
testl %eax, %eax
jne 0x725a
testb %bpl, %bpl
je 0x730f
movq %r13, %rdi
callq 0x8cc6
movq %rax, %rbx
jmp 0x725a
callq 0xd170
movq (%rax), %rbx
cmpb $0x0, (%r14)
je 0x7211
movq %rbx, %rdi
callq 0x8cc6
testq %rax, %rax
je 0x72bc
movq %rax, %rdi
movq %r14, %rsi
callq 0x42e0
testl %eax, %eax
setne %r15b
jmp 0x72bf
leaq 0x72d4(%rip), %rdi      # 0xe4d7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4c34
jmp 0x72fe
xorl %r15d, %r15d
jmp 0x72ca
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 0xb3ce
cmpb $0x21, 0x1(%rbx)
jne 0x725a
movq %rbx, %r12
incq %r12
movq %rbx, %rdi
callq 0x4170
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x4400
leaq 0x772d(%rip), %rsi      # 0xe98e
movq %rbx, %rdi
callq 0x4440
testq %rax, %rax
je 0x7298
pushq $0x1
popq %rcx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rdx
callq 0x9626
testl %eax, %eax
je 0x72f7
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x7289(%rip), %rdi      # 0xe51f
jmp 0x72ab
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x7268(%rip), %rdi      # 0xe513
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4c34
jmp 0x72fe
movb $0x1, %r15b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8b43
movzbl %bpl, %esi
movzbl %r15b, %edx
movq %rbx, %rdi
callq 0x731b
testb %al, %al
je 0x72fc
movq %rbx, %rdi
callq 0x8cc6
leaq 0x6ff9(%rip), %rdi      # 0xe2e6
movq %rax, %rsi
xorl %eax, %eax
callq 0x50b5
movb $0x1, %bpl
jmp 0x72fe
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x71ce(%rip), %rdi      # 0xe4e4
jmp 0x7203
// File: /workspace/github_c_makefile_star2_O2/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 0x8cc6
testq %rax, %rax
je 0x737f
movq %rax, %rbx
testb %r15b, %r15b
jne 0x73bf
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4340
testl %eax, %eax
je 0x7394
callq 0x40a0
movl (%rax), %edi
cmpl $0x2, %edi
je 0x73bf
callq 0x44e0
leaq 0x71ee(%rip), %rdi      # 0xe559
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4c34
jmp 0x742d
leaq 0x6f3b(%rip), %rdi      # 0xe2c1
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x4c34
jmp 0x742d
testb %bpl, %bpl
je 0x73ab
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4420
testl %eax, %eax
je 0x7442
movq 0x60(%rsp), %rax
cmpq 0x40(%r14), %rax
jle 0x73bf
leaq 0x7183(%rip), %rdi      # 0xe540
jmp 0x7386
leaq 0x75c8(%rip), %rsi      # 0xe98e
movq %rbx, %rdi
callq 0x4440
testq %rax, %rax
je 0x73f9
movq %rax, %r15
movzbl 0x38(%r14), %ecx
pushq $-0x1
popq %rsi
movq %r14, %rdi
movq %rax, %rdx
callq 0x8c9d
testl %eax, %eax
jne 0x73fc
movq %r15, %rdi
callq 0x4150
testl %eax, %eax
je 0x743d
xorl %r15d, %r15d
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
leaq 0x7116(%rip), %rdi      # 0xe525
xorl %ebp, %ebp
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4c34
testq %r15, %r15
je 0x742d
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 0x742d
leaq 0x70e3(%rip), %rdi      # 0xe52c
jmp 0x7386
// File: /workspace/github_c_makefile_star2_O2/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 0x746d
movq (%rsi), %rsi
leaq 0x6e34(%rip), %rdi      # 0xe29c
jmp 0x74f6
cmpl $0x1, %edi
jne 0x74ec
movl %edx, %ebx
movb $0x1, %r13b
xorl %ebp, %ebp
callq 0xd260
movq %rax, %r14
testq %r14, %r14
je 0x7510
movq (%r14), %rdi
callq 0xcb9a
movq %rax, %r15
testq %r15, %r15
je 0x74e6
movq %r15, %r12
testq %r12, %r12
je 0x74e0
movq (%r12), %rdi
testb %bl, %bl
jne 0x74b0
cmpb $0x1, 0x39(%rdi)
jne 0x74d5
xorl %esi, %esi
xorl %edx, %edx
callq 0x731b
movb $0x1, %cl
testb %al, %al
jne 0x74d7
movq %r14, %rdi
callq 0xd258
movq %r14, %rdi
movq %r12, %rsi
callq 0xd1e3
xorl %r13d, %r13d
movl %ebp, %ecx
movq 0x58(%r12), %r12
movl %ecx, %ebp
jmp 0x749d
movq 0x50(%r15), %r15
jmp 0x7495
movq 0x8(%r14), %r14
jmp 0x7481
movq (%rsi), %rsi
leaq 0x6dc1(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, %r13b
je 0x7540
testb $0x1, %bpl
je 0x7544
leaq 0x7226(%rip), %rax      # 0xe749
leaq 0x6ceb(%rip), %rsi      # 0xe215
testb %bl, %bl
cmovneq %rax, %rsi
leaq 0x6dbf(%rip), %rdi      # 0xe2f6
xorl %eax, %eax
callq 0x50b5
jmp 0x7552
xorl %ebx, %ebx
jmp 0x74ff
leaq 0x6dbf(%rip), %rdi      # 0xe30a
xorl %eax, %eax
callq 0x50b5
movb $0x1, %bl
jmp 0x74ff
// File: /workspace/github_c_makefile_star2_O2/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 0x756d
movq (%rbx), %rsi
leaq 0x6d31(%rip), %rdi      # 0xe29c
jmp 0x757e
movl %edi, %ebp
cmpl $0x3, %edi
jl 0x7590
movq (%rbx), %rsi
leaq 0x6da0(%rip), %rdi      # 0xe31e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0xd170
cmpl $0x2, %ebp
je 0x75cb
leaq 0x71a8(%rip), %rsi      # 0xe749
cmpl $0x1, %ebp
jne 0x75cf
movq (%rax), %rax
cmpq $0x0, 0x30(%rax)
je 0x75cf
cmpb $0x0, 0x39(%rax)
jne 0x75cf
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6de4
movq 0x8(%rbx), %rsi
xorl %ebx, %ebx
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x713f
testb %al, %al
je 0x7587
leaq 0x7164(%rip), %rax      # 0xe749
movq %rsp, %rsi
movq %rax, (%rsi)
pushq $0x1
popq %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6de4
movl %eax, %ebx
jmp 0x7587
// File: /workspace/github_c_makefile_star2_O2/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 0x7613
movq (%rsi), %rsi
leaq 0x6c8b(%rip), %rdi      # 0xe29c
jmp 0x7675
cmpl $0x1, %edi
jne 0x766b
movl %edx, %ebp
callq 0xd260
movq %rax, %rbx
movzbl %bpl, %ebp
testq %rbx, %rbx
je 0x76a2
movq (%rbx), %rdi
callq 0xcb9a
movq %rax, %r14
testq %r14, %r14
je 0x7665
movq %r14, %r15
testq %r15, %r15
je 0x765f
movq (%r15), %rdi
cmpb $0x1, 0x39(%rdi)
jne 0x7659
movl %ebp, %esi
xorl %edx, %edx
callq 0x731b
testb %al, %al
je 0x768b
movq 0x58(%r15), %r15
jmp 0x763e
movq 0x50(%r14), %r14
jmp 0x7636
movq 0x8(%rbx), %rbx
jmp 0x7626
movq (%rsi), %rsi
leaq 0x6c42(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xd258
movq %rbx, %rdi
movq %r15, %rsi
callq 0xd1e3
xorl %ebx, %ebx
jmp 0x767e
leaq 0xed2b(%rip), %rax      # 0x163d4
movl $0x1, (%rax)
movb $0x1, %bl
jmp 0x767e
// File: /workspace/github_c_makefile_star2_O2/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 0x76e3
movq (%rbx), %rsi
leaq 0x6bcd(%rip), %rdi      # 0xe29c
xorl %eax, %eax
callq 0x4c34
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 0x770d
cmpl $0x1, %r14d
jne 0x7724
callq 0xd170
movq (%rax), %rdi
callq 0x8cc6
testq %rax, %rax
je 0x77a7
xorl %edi, %edi
jmp 0x7711
movq 0x8(%rbx), %rdi
movzbl %bpl, %esi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6fb0
callq 0xd170
movq (%rax), %rdi
callq 0xca35
testb %al, %al
je 0x773e
leaq 0x6ad3(%rip), %rdi      # 0xe20f
jmp 0x77ae
leal -0x1(%r14), %esi
leaq 0x6bea(%rip), %rdi      # 0xe333
xorl %eax, %eax
callq 0xbab1
testb %al, %al
je 0x76d6
callq 0xd170
movq %rax, %r15
pushq $0x1
popq %rbp
movl %ebp, %edi
movl %ebp, %esi
movl %r14d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x77ba
movl %eax, %ebx
movq %r15, %rdi
callq 0xd184
leaq 0x6fc4(%rip), %rax      # 0xe749
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
andq $0x0, 0x8(%rdx)
xorl %edi, %edi
movl %ebp, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6df2
movl %ebx, %eax
jmp 0x76d8
leaq 0x6b13(%rip), %rdi      # 0xe2c1
xorl %eax, %eax
callq 0x4c34
jmp 0x76d6
// File: /workspace/github_c_makefile_star2_O2/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 0x77df
movq (%r14), %rsi
leaq 0x6ac2(%rip), %rdi      # 0xe29c
jmp 0x786c
cmpl $0x3, %edx
setl %al
orb %r9b, %al
je 0x7862
movl %edi, %ebx
cmpl $0x2, %edx
jl 0x7886
movl %edx, %ebp
pushq $0x1
popq %r13
leaq 0x8(%rsp), %r15
leaq 0x10(%rsp), %r12
cmpq %r13, %rbp
je 0x78c0
movq (%r14,%r13,8), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x8ba2
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x784f
movq (%r14,%r13,8), %rsi
leaq 0x6cf3(%rip), %rdi      # 0xe525
xorl %eax, %eax
callq 0x4c34
callq 0x8a57
movq %rax, 0x8(%rsp)
movq (%r14,%r13,8), %rsi
movq %rax, %rdi
callq 0x8b43
movq 0x8(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x813f
incq %r13
jmp 0x7805
movq (%r14), %rsi
leaq 0x6ab2(%rip), %rdi      # 0xe31e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %sil, %sil
je 0x78aa
callq 0xd170
movq %rax, %r14
movq (%rax), %rdi
callq 0xc254
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl %ebx, %esi
movq %r14, %rdx
jmp 0x78bb
callq 0x8a57
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x813f
callq 0x4cc7
callq 0x501c
movb $0x1, %bl
jmp 0x7875
// File: /workspace/github_c_makefile_star2_O2/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 0x78e0
movq (%rsi), %rsi
leaq 0x69be(%rip), %rdi      # 0xe29c
jmp 0x7916
cmpl $0x1, %edi
jne 0x790c
testb %dl, %dl
jne 0x7923
callq 0xd170
movq (%rax), %rdi
callq 0xca35
testb %al, %al
je 0x7923
leaq 0x690e(%rip), %rdi      # 0xe20f
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
jmp 0x791f
movq (%rsi), %rsi
leaq 0x69a1(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
popq %rbx
retq
callq 0x8a57
movq %rax, %rbx
callq 0xd170
movq %rax, %rdi
movq %rbx, %rsi
callq 0xd083
leaq 0x10f6(%rip), %rsi      # 0x8a38
movq %rbx, %rdi
callq 0xc25f
callq 0x501c
callq 0x4cc7
movb $0x1, %bl
jmp 0x791f
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0x7971
movq (%rsi), %rsi
leaq 0x692d(%rip), %rdi      # 0xe29c
jmp 0x79aa
cmpl $0x1, %edi
jne 0x79a0
testb %dl, %dl
jne 0x79c1
callq 0xd170
movq (%rax), %rdi
xorl %esi, %esi
callq 0xca4f
testq %rax, %rax
je 0x79c1
leaq 0x69ce(%rip), %rdi      # 0xe363
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
jmp 0x79b3
movq (%rsi), %rsi
leaq 0x690d(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0xd170
movq %rax, %rdi
callq 0xcb9a
xorl %ecx, %ecx
testq %rax, %rax
je 0x79ec
movq %rax, %rdx
testq %rdx, %rdx
je 0x79e6
incq %rcx
movq 0x58(%rdx), %rdx
jmp 0x79d8
movq 0x50(%rax), %rax
jmp 0x79d0
movb $0x1, %bl
cmpq $0x1, %rcx
je 0x79b3
callq 0xd170
movq %rax, %r14
movq %rax, %rdi
callq 0xcb79
movq %rax, %rdi
callq 0xd184
movq %r14, %rdi
callq 0xcbf4
callq 0xd170
movq %rax, %rdi
callq 0xcb9a
movq %rax, %rdi
testq %rdi, %rdi
je 0x7a45
movq 0x50(%rdi), %r15
testq %rdi, %rdi
je 0x7a40
movq 0x58(%rdi), %r12
callq 0xce94
movq %r12, %rdi
jmp 0x7a2d
movq %r15, %rdi
jmp 0x7a24
movq %r14, %rdi
callq 0xd184
callq 0x501c
callq 0x4cc7
jmp 0x79b3
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x1, %edi
jne 0x7d04
testb %dl, %dl
je 0x7d1c
movq (%rsi), %rsi
leaq 0x65a9(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
jmp 0x7d9f
xorl %edi, %edi
callq 0x465c
testq %rax, %rax
jne 0x7d36
leaq 0x6677(%rip), %rdi      # 0xe3a6
xorl %eax, %eax
callq 0x50b5
callq 0xd170
movq %rax, %r13
pushq $0x1
popq %rbx
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
leaq 0xce6(%rip), %r12       # 0x8a38
movl %ebx, %edi
callq 0x465c
testq %rax, %rax
je 0x7d98
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x8ba2
movq 0x8(%rsp), %rdi
callq 0xce57
movq %rax, %rbp
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0xc25f
movq %r13, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0xcd47
movq %rbp, %r13
jmp 0x7d52
callq 0x4cc7
movb $0x1, %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/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 0x7dd5
movq (%r14), %rsi
leaq 0x65f1(%rip), %rdi      # 0xe3bb
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
jmp 0x7e47
movl %edx, %ebx
movl %edi, %ebp
callq 0x8a57
movq %rax, %r15
movq %rax, %rdi
callq 0xce57
movq %rax, %rdi
callq 0xd19c
movq %rax, %r12
leaq 0xc3d(%rip), %rsi       # 0x8a38
movq %r15, %rdi
callq 0xc25f
callq 0xd250
movq 0x8(%rax), %rax
movq %rax, 0x8(%r12)
callq 0xd250
movq %r12, 0x8(%rax)
movq %r12, %rdi
callq 0xd258
cmpl $0x2, %ebp
jne 0x7e3b
movq 0x8(%r14), %rdi
movzbl %bl, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6fb0
callq 0x4cc7
callq 0x501c
movb $0x1, %bl
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7e6e
movq (%rsi), %rsi
leaq 0x6430(%rip), %rdi      # 0xe29c
jmp 0x7eb8
cmpl $0x1, %edi
jne 0x7eae
movl %edx, %ebp
callq 0xd250
movq %rax, %rbx
testb %bpl, %bpl
je 0x7eec
movq %rbx, %rdi
callq 0xd1e7
callq 0xd260
movq %rax, %rdi
testq %rdi, %rdi
je 0x7ed0
cmpq %rbx, %rdi
je 0x7f56
movq 0x8(%rdi), %r14
callq 0xd1b2
movq %r14, %rdi
jmp 0x7e92
movq (%rsi), %rsi
leaq 0x63ff(%rip), %rdi      # 0xe2b7
xorl %eax, %eax
callq 0x4c34
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0xd258
movq %rbx, %rdi
callq 0xd268
callq 0x4cc7
callq 0x501c
jmp 0x7ebf
callq 0xd260
movq %rax, %r14
testq %r14, %r14
je 0x7e82
cmpq %rbx, %r14
je 0x7f3d
movq (%r14), %rdi
callq 0xcb9a
movq %rax, %r15
testq %r15, %r15
je 0x7f3d
movq %r15, %r13
testq %r13, %r13
je 0x7f37
movq (%r13), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd21e
testb %al, %al
jne 0x7f31
cmpb $0x0, 0x39(%r12)
jne 0x7f43
movq 0x58(%r13), %r13
jmp 0x7f11
movq 0x50(%r15), %r15
jmp 0x7f09
movq 0x8(%r14), %r14
jmp 0x7ef4
leaq 0x6482(%rip), %rdi      # 0xe3cc
xorl %eax, %eax
callq 0x4c34
jmp 0x7ebf
leaq 0x6492(%rip), %rdi      # 0xe3ef
leaq 0x649c(%rip), %rsi      # 0xe400
leaq 0x649c(%rip), %rcx      # 0xe407
movl $0x332, %edx            # imm = 0x332
callq 0x4210
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_run
bool c_run(char *cmd, char *rest, bool force, struct range *range)
{
	if(range){
		/* filter */
		buffer_t *buf = buffers_cur();

		int err = list_filter(
				&buf->head,
				&(region_t){
					.type = REGION_LINE,
					.begin.y = range->start,
					.end.y = range->end,
				},
				rest);

		const int eno = errno;

		ui_redraw();

		if(err){
			ui_err("filter: %s", strerror(eno));
			return false;
		}

		return true;
	}

	int r = shellout(rest);

	if(r){
		ui_err("command returned %d", r);
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
testq %rcx, %rcx
je 0x7fea
movq %rcx, %r14
callq 0xd170
movq (%rax), %rdi
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
movl (%r14), %eax
movl %eax, 0x4(%rsi)
andl $0x0, 0x8(%rsi)
addq $0x8, %rdi
movl 0x4(%r14), %eax
movl %eax, 0xc(%rsi)
movl $0x2, 0x10(%rsi)
movq %rbx, %rdx
callq 0xa00b
movl %eax, %ebp
callq 0x40a0
movl (%rax), %ebx
callq 0x4cc7
testl %ebp, %ebp
je 0x800a
movl %ebx, %edi
callq 0x44e0
leaq 0x62a2(%rip), %rdi      # 0xe27e
xorl %ebx, %ebx
movq %rax, %rsi
xorl %eax, %eax
callq 0x4c34
jmp 0x800c
movq %rbx, %rdi
callq 0xb38e
testl %eax, %eax
je 0x800a
leaq 0x643c(%rip), %rdi      # 0xe439
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x4c34
jmp 0x800c
movb $0x1, %bl
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_ls
bool c_ls(int argc, char **argv, bool force, struct range *range)
{
	RANGE_NO();
	ARGV_NO();

	buffer_t *b = buffer_new();
	attach_buffer(b, neighbour_down, NULL);

	list_t *files = NULL, *latest = NULL;

	for(tab *tab = tabs_first(); tab; tab = tab->next){
		window *win;
		ITER_WINDOWS_FROM(win, tab->win){
			buffer_t *buf = win->buf;
			const char *fname = buffer_fname(buf);
			if(fname){
				if(list_contains(files, fname))
					continue;

				list_t *new = list_new(NULL);
				new->line = ustrdup(fname);
				new->len_line = strlen(new->line);
				new->len_malloc = new->len_line + 1;

				files = list_append(files, latest, new);
				latest = new;
			}
		}
	}

	buffer_replace_list(b, files);

	ui_redraw();
	ui_cur_changed();

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rcx, %rcx
je 0x8039
movq (%rsi), %rsi
leaq 0x6268(%rip), %rdi      # 0xe29c
jmp 0x810a
cmpl $0x1, %edi
jne 0x8100
callq 0x8a57
xorl %ebx, %ebx
pushq $0x1
popq %rsi
movq %rax, 0x8(%rsp)
movq %rax, %rdi
xorl %edx, %edx
callq 0x813f
callq 0xd260
xorl %r12d, %r12d
testq %rax, %rax
je 0x8124
movq %rax, 0x10(%rsp)
movq (%rax), %rdi
callq 0xcb9a
movq %rax, %r15
testq %r15, %r15
je 0x80f2
movq %r15, %r13
testq %r13, %r13
je 0x80ec
movq (%r13), %rdi
callq 0x8cc6
testq %rax, %rax
je 0x80e6
movq %rax, %rbp
movq %r12, %rdi
movq %rax, %rsi
callq 0xa639
testq %rax, %rax
jne 0x80e6
xorl %edi, %edi
callq 0x9280
movq %rax, %r14
movq %rbp, %rdi
callq 0x5672
movq %rax, (%r14)
movq %rax, %rdi
callq 0x4170
movq %rax, 0x8(%r14)
incq %rax
movq %rax, 0x10(%r14)
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x9a44
movq %rax, %r12
movq %r14, %rbx
movq 0x58(%r13), %r13
jmp 0x8084
movq 0x50(%r15), %r15
jmp 0x807c
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
jmp 0x8063
movq (%rsi), %rsi
leaq 0x61ad(%rip), %rdi      # 0xe2b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x8a7d
callq 0x4cc7
callq 0x501c
movb $0x1, %bl
jmp 0x8113
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: attach_buffer
static void attach_buffer(
		buffer_t *buf,
		const enum neighbour dir,
		window *const copy_pos_from)
{
	window *w = window_new(buf);
	buffer_release(buf);

	window_add_neighbour(windows_cur(), dir, w);
	windows_set_cur(w);

	if(copy_pos_from){
		*w->ui_pos = *copy_pos_from->ui_pos;

		w->ui_start = copy_pos_from->ui_start;
		if(neighbour_is_vertical(dir)){
			int diff = (w->ui_pos->y - w->ui_start.y) / 2;

			copy_pos_from->ui_start.y += diff;
			w->ui_start.y += diff;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
callq 0xce57
movq %rax, %r14
leaq 0x8db(%rip), %rsi       # 0x8a38
movq %r15, %rdi
callq 0xc25f
callq 0xd170
movq %rax, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xcd47
movq %r14, %rdi
callq 0xd184
testq %rbx, %rbx
je 0x81bd
movq 0x30(%r14), %rax
movq 0x30(%rbx), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r14)
movl %ebp, %edi
callq 0xcd40
testb %al, %al
je 0x81bd
movq 0x30(%r14), %rax
movl 0x4(%rax), %eax
subl 0xc(%r14), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
addl %eax, 0xc(%rbx)
addl %eax, 0xc(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_p
bool c_p(int argc, char **argv, bool force, struct range *range)
{
	ARGV_NO();

	window *win = windows_cur();

	struct range rng;
	RANGE_DEFAULT(range, rng, win);

	buffer_t *const b = win->buf;

	list_t *l = list_seek(b->head, range->start, false);
	for(int i = range->start; i <= range->end; i++){
		ui_print(l ? l->line : "", l ? l->len_line : 0);
		if(l)
			l = l->next;
	}

	ui_want_return();

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
cmpl $0x1, %edi
jne 0x8255
movq %rcx, %r14
callq 0xd170
movq %rax, %r15
testq %r14, %r14
jne 0x81fe
movq 0x30(%r15), %rax
movl 0x4(%rax), %eax
leaq 0x8(%rsp), %r14
movl %eax, 0x4(%r14)
movl %eax, (%r14)
movq %r14, %rdi
callq 0xc3f2
movq (%r15), %rax
movq 0x8(%rax), %rdi
movl (%r14), %esi
xorl %edx, %edx
callq 0x9737
movq %rax, %r12
movl (%r14), %ebp
leaq 0x6525(%rip), %r15      # 0xe749
cmpl 0x4(%r14), %ebp
jg 0x8268
testq %r12, %r12
je 0x8244
movq (%r12), %rdi
movq 0x8(%r12), %rsi
callq 0x5601
movq 0x18(%r12), %r12
jmp 0x8251
movq %r15, %rdi
xorl %esi, %esi
callq 0x5601
xorl %r12d, %r12d
incl %ebp
jmp 0x8224
movq (%rsi), %rsi
leaq 0x6058(%rip), %rdi      # 0xe2b7
xorl %eax, %eax
callq 0x4c34
jmp 0x826d
callq 0x563f
cmpl $0x1, %ebx
sete %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: copy_move_common
static bool copy_move_common(
		int argc, char **argv,
		struct range **const range,
		struct range *const range_store,
		int *const out_addr)
{
	if(argc != 2){
		ui_err("Usage: %s address", *argv);
		return false;
	}

	char *addr_end;
	if(!parse_range_1(argv[1], &addr_end, out_addr) || *addr_end){
		ui_err("bad address: \"%s\"", argv[1]);
		return false;
	}

	window *win = windows_cur();

	RANGE_DEFAULT(*range, *range_store, win);

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
cmpl $0x2, %edi
jne 0x8417
movq %rcx, %rbx
movq %rdx, %r14
movq 0x8(%r15), %rdi
leaq 0x8(%rsp), %rsi
movq %r8, %rdx
callq 0xc268
testb %al, %al
je 0x840a
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
je 0x8436
movq 0x8(%r15), %rsi
leaq 0x6178(%rip), %rdi      # 0xe58d
jmp 0x8421
movq (%r15), %rsi
leaq 0x605d(%rip), %rdi      # 0xe47e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0xd170
movq (%r14), %rdi
testq %rdi, %rdi
jne 0x8455
movq 0x30(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, 0x4(%rbx)
movl %eax, (%rbx)
movq %rbx, (%r14)
movq %rbx, %rdi
callq 0xc3f2
movb $0x1, %bl
jmp 0x842a
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_t
bool c_t(int argc, char **argv, bool force, struct range *range)
{
	if(argc != 2){
		ui_err("Usage: %s address", *argv);
		return false;
	}

	struct range range_store;
	int lno;
	if(!copy_move_common(argc, argv, &range, &range_store, &lno))
		return false;

	buffer_t *const b = windows_cur()->buf;

	list_t *landing = list_seek(b->head, lno, false);
	if(!landing)
		NO_LINE(lno);

	/* copy the range */
	list_t *start = list_seek(b->head, range->start, false);
	if(!start)
		NO_LINE(range->start);

	list_t *end = list_seek(b->head, range->end, false);
	if(!end)
		NO_LINE(range->end);

	list_t *copied;
	/* break the bottom link temporarily for the copy */
	{
		list_t *after = end->next;
		end->next = NULL;

		copied = list_copy_deep(start, NULL);
		end->next = after;
	}

	if(lno == -1){
		/* special case - head */
		list_t *head = b->head;

		b->head = copied;
		list_t *i;
		for(i = b->head; i->next; i = i->next);

		i->next = head;
		if(head)
			head->prev = i;

	}else{
		list_t *next = landing->next;
		landing->next = copied;
		copied->prev = landing;

		list_t *i;
		for(i = landing; i->next; i = i->next);
		i->next = next;
		if(next)
			next->prev = i;
	}

	b->modified = true;

	ui_redraw();
	ui_cur_changed();

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rcx, 0x10(%rsp)
cmpl $0x2, %edi
jne 0x8529
pushq $0x2
popq %rdi
leaq 0x10(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0xc(%rsp), %r8
callq 0x83d4
testb %al, %al
je 0x853e
callq 0xd170
movq (%rax), %r12
movq 0x8(%r12), %rdi
movl 0xc(%rsp), %esi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x8542
movq %rax, %rbx
movq 0x8(%r12), %rdi
movq 0x10(%rsp), %r13
movl (%r13), %esi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x8548
movq %rax, %r14
movq 0x8(%r12), %rdi
movl 0x4(%r13), %esi
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x854e
movq %rax, %r15
movq 0x18(%rax), %r13
andq $0x0, 0x18(%rax)
movq %r14, %rdi
xorl %esi, %esi
callq 0x9292
movq %r13, 0x18(%r15)
cmpl $-0x1, 0xc(%rsp)
je 0x8564
movq 0x18(%rbx), %rcx
movq %rax, 0x18(%rbx)
movq %rbx, 0x20(%rax)
movq %rbx, %rdx
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x851b
jmp 0x857a
movq (%rsi), %rsi
leaq 0x5f4b(%rip), %rdi      # 0xe47e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
jmp 0x8599
xorl %ebx, %ebx
jmp 0x8599
movl 0xc(%rsp), %esi
jmp 0x8552
movl (%r13), %esi
jmp 0x8552
movl 0x4(%r13), %esi
leaq 0x5f15(%rip), %rdi      # 0xe46e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4c34
jmp 0x8599
movq 0x8(%r12), %rcx
movq %rax, 0x8(%r12)
movq %rax, %rdx
movq 0x18(%rax), %rax
testq %rax, %rax
jne 0x856e
movq %rcx, 0x18(%rdx)
testq %rcx, %rcx
je 0x8587
movq %rdx, 0x20(%rcx)
movb $0x1, 0x39(%r12)
callq 0x4cc7
callq 0x501c
movb $0x1, %bl
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: command_bufaction
static void command_bufaction(
		struct range *range, buffer_action_f *buf_fn, int end_add)
{
	window *win = windows_cur();

	struct range range_store;
	RANGE_DEFAULT(range, range_store, win);

	range->end += end_add;

	buffer_t *const b = win->buf;

	buf_fn(
			b,
			&(region_t){
				.begin.y = range->start,
				.end.y = range->end,
				.type = REGION_LINE
			},
			&(point_t){});

	*win->ui_pos = (point_t){ .y = range->end - end_add };

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
callq 0xd170
movq %rax, %r12
testq %r15, %r15
jne 0x8614
movq 0x30(%r12), %rax
movl 0x4(%rax), %eax
leaq 0xc(%rsp), %r15
movl %eax, 0x4(%r15)
movl %eax, (%r15)
movq %r15, %rdi
callq 0xc3f2
movl 0x4(%r15), %eax
addl %ebx, %eax
movl %eax, 0x4(%r15)
movq (%r12), %rdi
leaq 0x14(%rsp), %rsi
andl $0x0, (%rsi)
movl (%r15), %ecx
movl %ecx, 0x4(%rsi)
andl $0x0, 0x8(%rsi)
movl %eax, 0xc(%rsi)
movl $0x2, 0x10(%rsi)
leaq 0x4(%rsp), %rdx
andq $0x0, (%rdx)
callq *%r14
movq 0x30(%r12), %rax
movl 0x4(%r15), %ecx
subl %ebx, %ecx
andl $0x0, (%rax)
movl %ecx, 0x4(%rax)
callq 0x4cc7
callq 0x501c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_j
bool c_j(int argc, char **argv, bool force, struct range *range)
{
	ARGV_NO();

	if(range && range->start != range->end){
		/* :2j means :2,3j
		 * otherwise, we have :5,6j, in which case we want to say :5,5j */
		range->end--;
	}

	command_bufaction(range, buffer_joinregion_space.fn, 1);

	return true;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
cmpl $0x1, %edi
jne 0x86a9
testq %rcx, %rcx
je 0x8692
movl 0x4(%rcx), %eax
cmpl %eax, (%rcx)
je 0x8692
decl %eax
movl %eax, 0x4(%rcx)
leaq 0xdce7(%rip), %rax      # 0x16380
movq (%rax), %rsi
pushq $0x1
popq %rdx
movq %rcx, %rdi
callq 0x85e0
jmp 0x86ba
movq (%rsi), %rsi
leaq 0x5c04(%rip), %rdi      # 0xe2b7
xorl %eax, %eax
callq 0x4c34
cmpl $0x1, %ebx
sete %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: c_norm
bool c_norm(char *cmd, char *normcmd, bool force, struct range *range)
{
	enum io mode = IO_MAP; /* normal mode mappings */
	if(force)
		mode = IO_NOMAP;

	window *win = windows_cur();

	struct range rng;
	RANGE_DEFAULT(range, rng, win);

	size_t normcmdlen = strlen(normcmd);

	for(int n = range->start;
			n <= range->end;
			n++)
	{
		*win->ui_pos = (point_t){ .y = n };

		size_t const io_empty = io_bufsz();

		/* end with an escape */
		io_ungetch(K_ESC, false);

		/* don't io_map() here - may be in insert mode
		 * when we actually execute */
		for(size_t i = normcmdlen; i > 0; i--)
			io_ungetch(normcmd[i - 1], false);

		do{
			/* run the commands while the buffer is on this line */
			ui_normal_1(/*repeat:*/&(unsigned){ 0 }, mode);
		}while(io_bufsz() > io_empty);
	}

	ui_redraw();
	ui_cur_changed();

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movl %edx, %r15d
movq %rsi, %rbx
pushq $0x2
popq %rbp
callq 0xd170
movq %rax, 0x8(%rsp)
testq %r12, %r12
jne 0x894f
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movl 0x4(%rax), %eax
leaq 0x20(%rsp), %r12
movl %eax, 0x4(%r12)
movl %eax, (%r12)
subl %r15d, %ebp
movq %r12, %rdi
callq 0xc3f2
movq %rbx, %rdi
callq 0x4170
movq %rax, 0x10(%rsp)
movl (%r12), %r14d
leaq 0x4(%rsp), %r13
movq %r12, 0x18(%rsp)
cmpl 0x4(%r12), %r14d
jg 0x89e0
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
andl $0x0, (%rax)
movl %r14d, 0x4(%rax)
callq 0xbba8
movq %rax, %r15
pushq $0x1b
popq %rdi
xorl %esi, %esi
callq 0xbcd8
movq 0x10(%rsp), %rax
movq %rax, %r12
subq $0x1, %r12
jb 0x89bd
movsbl -0x1(%rbx,%rax), %edi
xorl %esi, %esi
callq 0xbcd8
movq %r12, %rax
jmp 0x89a6
andl $0x0, 0x4(%rsp)
movq %r13, %rdi
movl %ebp, %esi
callq 0x5236
callq 0xbba8
cmpq %r15, %rax
ja 0x89bd
incl %r14d
movq 0x18(%rsp), %r12
jmp 0x8975
callq 0x4cc7
callq 0x501c
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/cmds.c
// Function: cmd_dispatch
bool cmd_dispatch(
		const cmd_t *cmd_f,
		int argc, char **argv,
		bool force, struct range *range)
{
	force ^= cmd_f->inverse;

	return cmd_f->single_arg
		? cmd_f->f_arg1(argv[0], argv[1], force, range)
		: cmd_f->f_argv(argc, argv, force, range);
}

// Assembly:
movb 0x11(%rdi), %r10b
movq 0x8(%rdi), %r9
cmpb $0x1, 0x10(%rdi)
jne 0x8a20
xorl %eax, %eax
cmpb %cl, %r10b
setne %al
movq (%rdx), %rdi
movq 0x8(%rdx), %rsi
movl %eax, %edx
movq %r8, %rcx
jmpq *%r9
xorl %eax, %eax
cmpb %cl, %r10b
setne %al
movl %esi, %edi
movq %rdx, %rsi
movl %eax, %edx
movq %r8, %rcx
jmpq *%r9
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_new
buffer_t *buffer_new()
{
	buffer_t *b = umalloc(sizeof *b);

	retain_init(b);

	b->head = list_new(NULL);
	b->eol = true; /* default to nice eol */
	return b;
}

// Assembly:
pushq %rbx
pushq $0x50
popq %rdi
callq 0x5648
movq %rax, %rbx
movl $0x1, (%rax)
xorl %edi, %edi
callq 0x9280
movq %rax, 0x8(%rbx)
movb $0x1, 0x38(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_replace_fname
void buffer_replace_fname(
		buffer_t *const b, const char *fname,
		const char **const err)
{
	*err = NULL;

	FILE *f = fopen(fname, "r");
	if(!f){
err:
		*err = strerror(errno);
		return;
	}

	if(!buffer_replace_file(b, f)){
		fclose(f);
		goto err;
	}
	fclose(f);

	buffer_set_fname(b, fname);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
andq $0x0, (%rdx)
leaq 0x5935(%rip), %rsi      # 0xe3ed
movq %r14, %rdi
callq 0x4440
testq %rax, %rax
je 0x8af4
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x8b0c
movl %eax, %ebp
movq %r12, %rdi
callq 0x4150
testl %ebp, %ebp
je 0x8af4
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8b43
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
movq %rax, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_replace_file
static int buffer_replace_file(buffer_t *b, FILE *f)
{
	list_t *l = list_new_file(f, &b->eol);

	if(!l)
		return 0;

	buffer_replace_list(b, l);

	b->mtime = time(NULL);

	return 1;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x38(%rdi), %rsi
movq %rax, %rdi
callq 0x92df
testq %rax, %rax
je 0x8b3f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8a7d
xorl %edi, %edi
callq 0x4370
movq %rax, 0x40(%rbx)
pushq $0x1
popq %rax
jmp 0x8b41
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_new_fname
void buffer_new_fname(
		buffer_t **pb, const char *fname,
		const char **const err)
{
	*err = NULL;

	/* look for an existing buffer first */
	buffer_t *b = buffers_find(fname);

	if(b){
		*pb = retain(b);
		return;
	}

	FILE *f = fopen(fname, "r");
	if(!f){
got_err:
		*err = strerror(errno);
		b = buffer_new();
		b->modified = false; /* editing a non-existant file, etc */
		goto fin;
	}

	b = buffer_new_file_nofind(f);
	fclose(f);

	if(!b){
		if(errno == EISDIR){
			DIR *d = opendir(fname);
			if(!d)
				goto got_err;

			list_t *l = list_from_dir(d);

			const int save_errno = errno;
			closedir(d);
			errno = save_errno;

			if(!l)
				goto got_err;

			b = buffer_new();
			buffer_replace_list(b, l);
		}else{
			goto got_err;
		}
	}

fin:
	buffer_set_fname(b, fname);
	*pb = b;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, (%rdx)
movq %rsi, %rdi
callq 0xc9b8
testq %rax, %rax
je 0x8bd7
movq %rax, %rdi
callq 0xc254
movq %rax, %r12
jmp 0x8c88
leaq 0x580f(%rip), %rsi      # 0xe3ed
movq %r14, %rdi
callq 0x4440
testq %rax, %rax
je 0x8c5d
movq %rax, %r13
movq %rax, %rdi
callq 0x8b6f
movq %rax, %r12
movq %r13, %rdi
callq 0x4150
testq %r12, %r12
jne 0x8c7d
callq 0x40a0
movq %rax, %r12
cmpl $0x15, (%rax)
jne 0x8c65
movq %r14, %rdi
callq 0x4160
testq %rax, %rax
je 0x8c65
movq %rax, %rbp
movq %rax, %rdi
callq 0x94a3
movq %rax, (%rsp)
movl (%r12), %r13d
movq %rbp, %rdi
callq 0x4290
movl %r13d, (%r12)
movq (%rsp), %r13
testq %r13, %r13
je 0x8c65
callq 0x8a57
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x8a7d
jmp 0x8c7d
callq 0x40a0
movq %rax, %r12
movl (%r12), %edi
callq 0x44e0
movq %rax, (%r15)
callq 0x8a57
movq %rax, %r12
movb $0x0, 0x39(%rax)
movq %r12, %rdi
movq %r14, %rsi
callq 0x8b43
movq %r12, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_write_file
int buffer_write_file(buffer_t *b, int n, FILE *f, bool eol)
{
	int r = list_write_file(b->head, n, f, eol);
	b->mtime = time(NULL);
	b->modified = false;
	return r;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x9626
movl %eax, %ebp
xorl %edi, %edi
callq 0x4370
movq %rax, 0x40(%rbx)
movb $0x0, 0x39(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_last_indent_line
static list_t *buffer_last_indent_line(buffer_t *buf, int y)
{
	list_t *l = list_seek(buf->head, y, false);

	if(!l)
		return NULL;

	/* scan backwards until we hit a non-empty line */
	while(l->prev){
		l = l->prev;
		if(!isallspace(l->line, l->len_line))
			return l;
	}

	return NULL;
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rdi
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x9737
testq %rax, %rax
je 0x8d1e
movq %rax, %rbx
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
je 0x8d1c
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0xb5cc
testb %al, %al
jne 0x8d01
jmp 0x8d1e
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: list_count_indent
static int list_count_indent(list_t *l)
{
	int indent = 0;

	/* count indent */
	for(unsigned i = 0; i < l->len_line; i++, indent++)
		if(!isspace(l->line[i]))
			break;

	/* if it ends with a '{', increase indent */
	if(l->len_line > 0 && l->line[l->len_line - 1] == '{')
		indent++;

	return indent;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
xorl %ebx, %ebx
cmpq %rbx, %r15
jbe 0x8d52
callq 0x4540
movq (%rax), %rcx
movq (%r14), %rax
movsbq (%rax,%rbx), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x8d5a
incq %rbx
jmp 0x8d31
testq %r15, %r15
je 0x8d67
movq (%r14), %rax
xorl %ecx, %ecx
cmpb $0x7b, -0x1(%rax,%r15)
sete %cl
addl %ecx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_inschar_at
void buffer_inschar_at(buffer_t *buf, char ch, int *x, int *y)
{
	bool indent = false;
	bool inschar = true;

	switch(ch){
		case CTRL_AND('?'):
		case CTRL_AND('H'):
		case 127:
			if(*x > 0)
				buffer_delchar(buf, x, y);
			inschar = false;
			break;

		case '}':
			/* if we've just started a new line, this unindents */
			buffer_unindent_empty(buf, x, *y);
			indent = false;
			break;

		case '\n':
			indent = true;
	}

	if(inschar){
		list_inschar(buf->head, x, y, ch, /*autogap*/0);
		if(indent)
			buffer_smartindent(buf, x, *y);
	}

	buf->modified = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x8, %esi
je 0x8d9b
movl %esi, %ebp
cmpl $0xa, %esi
je 0x8db5
cmpl $0x7f, %ebp
je 0x8d9b
cmpl $0x7d, %ebp
je 0x8dda
cmpl $0x1f, %ebp
jne 0x8e16
cmpl $0x0, (%r14)
jle 0x8e2c
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8e39
jmp 0x8e2c
movq 0x8(%rbx), %rdi
pushq $0xa
popq %rcx
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x98d7
movl (%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8ccb
jmp 0x8e2c
movl (%r15), %esi
testl %esi, %esi
je 0x8e16
movq %rbx, %rdi
callq 0x8ceb
testq %rax, %rax
je 0x8e16
movq %rax, %r12
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8e16
movslq (%r14), %rsi
callq 0xb5cc
testb %al, %al
je 0x8e16
movq %r12, %rdi
callq 0x8d23
testl %eax, %eax
je 0x8e16
decl %eax
movl %eax, (%r14)
movq 0x8(%rbx), %rdi
movsbl %bpl, %ecx
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x98d7
movb $0x1, 0x39(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_inscolchar
void buffer_inscolchar(
		buffer_t *buf, char ch, unsigned ncols,
		point_t *const ui_pos)
{
	for(int i = ncols - 1; i >= 0; i--){
		int y = ui_pos->y + i;
		int x = ui_pos->x;
		int *px = &x;
		int *py = &y;

		/* update x and y in the last case */
		if(i == 0){
			px = &ui_pos->x;
			py = &ui_pos->y;
		}

		buffer_inschar_at(buf, ch, px, py);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, %r14
leaq 0x4(%rcx), %r12
decl %ebp
leaq 0x4(%rsp), %r13
movsbl %sil, %r15d
testl %ebp, %ebp
js 0x8e9e
movl 0x4(%rbx), %eax
addl %ebp, %eax
movl %eax, 0x4(%rsp)
movl (%rbx), %eax
subl $0x1, %ebp
movq %rsp, %rdx
cmovbq %rbx, %rdx
movl %eax, (%rsp)
movq %r13, %rcx
cmovbq %r12, %rcx
movq %r14, %rdi
movl %r15d, %esi
callq 0x8d6f
jmp 0x8e6e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/bobrippling[P]tim/buffer.c
// Function: buffer_delregion_f
static
void buffer_delregion_f(buffer_t *buf, const region_t *region, point_t *out)
{
	list_t *del = list_delregion(&buf->head, region);

	if(del){
		release(yank_push(yank_new(del, region->type)), yank_free);

		buf->modified = true;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x9a81
testq %rax, %rax
je 0x8eec
movl 0x10(%r14), %esi
movq %rax, %rdi
callq 0xbdd8
movq %rax, %rdi
callq 0xbe3d
leaq 0x2f48(%rip), %rsi      # 0xbe28
movq %rax, %rdi
callq 0xc25f
movb $0x1, 0x39(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq