LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: insert_file
int insert_file(char *fn, int modflag)
{
	FILE *fp;
	size_t len;
	struct stat sb;

	if (stat(fn, &sb) < 0) return msg("Failed to find file \"%s\".", fn);
	if (MAX_SIZE_T < sb.st_size) msg("File \"%s\" is too big to load.", fn);

	if (curbp->b_egap - curbp->b_gap < sb.st_size * sizeof (char_t) && !growgap(curbp, sb.st_size))
		return (FALSE);
	if ((fp = fopen(fn, "r")) == NULL) return msg("Failed to open file \"%s\".", fn);

	curbp->b_point = movegap(curbp, curbp->b_point);
	curbp->b_gap += len = fread(curbp->b_gap, sizeof (char), (size_t) sb.st_size, fp);

	if (fclose(fp) != 0) return msg("Failed to close file \"%s\".", fn);
	curbp->b_flags &= (modflag ? B_MODIFIED : ~B_MODIFIED);
	msg("File \"%s\" %ld bytes read.", fn, len);
	return (TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
callq 0x21c0
testl %eax, %eax
js 0x2889
movq 0xa2f8(%rip), %rdi      # 0xcaf8
movq 0x38(%rdi), %rax
subq 0x30(%rdi), %rax
movq 0x38(%rsp), %r14
cmpq %r14, %rax
jae 0x2822
movq %r14, %rsi
callq 0x25aa
testl %eax, %eax
je 0x28e5
leaq 0x4e7e(%rip), %rsi      # 0x76a7
movq %rbx, %rdi
callq 0x2270
testq %rax, %rax
je 0x2892
movq %rax, %r15
movq 0xa2b8(%rip), %rdi      # 0xcaf8
movq 0x8(%rdi), %rsi
callq 0x2688
movq 0xa2a8(%rip), %rcx      # 0xcaf8
movq %rax, 0x8(%rcx)
movq 0x30(%rcx), %rdi
pushq $0x1
popq %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x2080
movq %rax, %r14
movq 0xa288(%rip), %rax      # 0xcaf8
addq %r14, 0x30(%rax)
movq %r15, %rdi
callq 0x20d0
testl %eax, %eax
je 0x28b5
leaq 0x4845(%rip), %rdi      # 0x70cc
jmp 0x2899
leaq 0x4822(%rip), %rdi      # 0x70b2
jmp 0x2899
leaq 0x47c9(%rip), %rdi      # 0x7062
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x24c3
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
movl $0xfe, %eax
pushq $0x1
popq %rbp
cmovnel %ebp, %eax
movq 0xa22f(%rip), %rcx      # 0xcaf8
andb %al, 0x14d(%rcx)
leaq 0x4811(%rip), %rdi      # 0x70e7
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x24c3
jmp 0x28a5
xorl %ebp, %ebp
jmp 0x28a5
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: get_key
char_t *get_key(keymap_t *keys, keymap_t **key_return)
{
	keymap_t *k;
	int submatch;
	static char_t buffer[K_BUFFER_LENGTH];
	static char_t *record = buffer;

	*key_return = NULL;

	/* if recorded bytes remain, return next recorded byte. */
	if (*record != '\0') {
		*key_return = NULL;
		return record++;
	}
	/* reset record buffer. */
	record = buffer;

	do {
		assert(K_BUFFER_LENGTH > record - buffer);
		/* read and record one byte. */
		*record++ = (unsigned)getch();
		*record = '\0';

		/* if recorded bytes match any multi-byte sequence... */
		for (k = keys, submatch = 0; k != NULL; k = k->k_next) {
			char_t *p, *q;

			if (k->k_func == NULL) continue;
			assert(k->k_bytes != NULL);

			for (p = buffer, q = (char_t *)k->k_bytes; *p == *q; ++p, ++q) {
			        /* an exact match */
				if (*q == '\0' && *p == '\0') {
	    				record = buffer;
					*record = '\0';
					*key_return = k;
					return record; /* empty string */
				}
			}
			/* record bytes match part of a command sequence */
			if (*p == '\0' && *q != '\0') {
				submatch = 1;
			}
		}
	} while (submatch);
	/* nothing matched, return recorded bytes. */
	record = buffer;
	return (record++);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
andq $0x0, (%rsi)
movq 0x98c4(%rip), %rbx      # 0xc1c0
cmpb $0x0, (%rbx)
je 0x2911
leaq 0x1(%rbx), %rax
movq %rax, 0x98b4(%rip)      # 0xc1c0
jmp 0x29b0
movq %rsi, %r14
movq %rdi, %r15
leaq 0xa1e2(%rip), %rbx      # 0xcb00
movq %rbx, 0x989b(%rip)      # 0xc1c0
movq 0x96a4(%rip), %r12      # 0xbfd0
pushq $0x1
popq %rbp
movq (%r12), %rdi
callq 0x20c0
movq 0x9881(%rip), %rcx      # 0xc1c0
leaq 0x1(%rcx), %rdx
movq %rdx, 0x9876(%rip)      # 0xc1c0
movb %al, (%rcx)
movb $0x0, 0x1(%rcx)
movq %r15, %rax
xorl %ecx, %ecx
testq %rax, %rax
je 0x298f
cmpq $0x0, 0x40(%rax)
je 0x2989
xorl %edx, %edx
movb (%rdx,%rbx), %sil
movb 0xd(%rax,%rdx), %dil
cmpb %dil, %sil
jne 0x297b
testb %sil, %sil
je 0x299f
incq %rdx
jmp 0x2963
testb %dil, %dil
movl %ebp, %edx
cmovel %ecx, %edx
testb %sil, %sil
cmovel %edx, %ecx
movq 0x48(%rax), %rax
jmp 0x2955
testl %ecx, %ecx
jne 0x292f
leaq 0xa167(%rip), %rax      # 0xcb01
jmp 0x2905
movq %rbx, 0x981a(%rip)      # 0xc1c0
movb $0x0, 0xa153(%rip)      # 0xcb00
movq %rax, (%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: lnstart
point_t lnstart(buffer_t *bp, register point_t off)
{
	register char_t *p;
	do
		p = ptr(bp, --off);
	while (bp->b_buf < p && *p != '\n');
	return (bp->b_buf < p ? ++off : 0);
}

// Assembly:
movq 0x20(%rdi), %rcx
leaq -0x1(%rcx), %rdx
xorl %eax, %eax
testq %rsi, %rsi
jle 0x2a07
leaq (%rdx,%rsi), %r8
movq 0x30(%rdi), %r9
cmpq %r9, %r8
jae 0x29dd
xorl %r8d, %r8d
jmp 0x29e4
movq 0x38(%rdi), %r8
subq %r9, %r8
leaq (%r8,%rsi), %r9
addq %rdx, %r9
cmpq %r9, %rcx
jae 0x2a07
addq %rdx, %r8
leaq -0x1(%rsi), %r9
cmpb $0xa, (%r8,%rsi)
movq %r9, %rsi
jne 0x29c6
incq %r9
movq %r9, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: segstart
point_t segstart(buffer_t *bp, point_t start, point_t finish)
{
	char_t *p;
	int c = 0;
	point_t scan = start;

	while (scan < finish) {
		p = ptr(bp, scan);
		if (*p == '\n') {
			c = 0;
			start = scan+1;
		} else if (COLS <= c) {
			c = 0;
			start = scan;
		}
		++scan;
		c += *p == '\t' ? 8 - (c & 7) : 1;
	}
	return (c < COLS ? start : finish);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rax
movq 0x95ca(%rip), %rcx      # 0xbfe0
movl (%rcx), %ecx
xorl %edx, %edx
movl $0x8, %r8d
movl $0x1, %r9d
movq %rsi, %r10
cmpq %rax, %r10
jge 0x2a87
movq 0x20(%rdi), %r11
testq %r10, %r10
js 0x2a55
leaq (%r11,%r10), %rbx
movq 0x30(%rdi), %r14
cmpq %r14, %rbx
jae 0x2a48
xorl %ebx, %ebx
jmp 0x2a4f
movq 0x38(%rdi), %rbx
subq %r14, %rbx
addq %r10, %rbx
addq %rbx, %r11
xorl %ebx, %ebx
cmpl %edx, %ecx
jg 0x2a60
movq %r10, %rsi
xorl %edx, %edx
movb (%r11), %r11b
incq %r10
cmpb $0xa, %r11b
cmoveq %r10, %rsi
cmovel %ebx, %edx
movl %edx, %ebx
andl $0x7, %ebx
movl %r8d, %ebp
subl %ebx, %ebp
cmpb $0x9, %r11b
cmovnel %r9d, %ebp
addl %ebp, %edx
jmp 0x2a29
cmpl %ecx, %edx
cmovlq %rsi, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: segnext
point_t segnext(buffer_t *bp, point_t start, point_t finish)
{
	char_t *p;
	int c = 0;

	point_t scan = segstart(bp, start, finish);
	for (;;) {
		p = ptr(bp, scan);
		if (bp->b_ebuf <= p || COLS <= c)
			break;
		++scan;
		if (*p == '\n')
			break;
		c += *p == '\t' ? 8 - (c & 7) : 1;
	}
	return (p < bp->b_ebuf ? scan : pos(bp, bp->b_ebuf));
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2a08
movq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rcx
movq 0x9534(%rip), %rsi      # 0xbfe0
movl (%rsi), %esi
xorl %edi, %edi
pushq $0x8
popq %r8
pushq $0x1
popq %r9
movq %rdx, %r10
testq %rax, %rax
js 0x2adf
leaq (%rdx,%rax), %r10
movq 0x30(%rbx), %r11
cmpq %r11, %r10
jae 0x2ad2
xorl %r10d, %r10d
jmp 0x2ad9
movq 0x38(%rbx), %r10
subq %r11, %r10
addq %rax, %r10
addq %rdx, %r10
cmpq %r10, %rcx
jbe 0x2b0d
cmpl %edi, %esi
jle 0x2b0d
movb (%r10), %r10b
cmpb $0xa, %r10b
je 0x2b1f
movl %edi, %r11d
andl $0x7, %r11d
movl %r8d, %ebp
subl %r11d, %ebp
cmpb $0x9, %r10b
cmovnel %r9d, %ebp
addl %ebp, %edi
incq %rax
jmp 0x2ab8
cmpq %r10, %rcx
ja 0x2b34
movq 0x38(%rbx), %rsi
cmpq %rcx, %rsi
jbe 0x2b24
xorl %eax, %eax
jmp 0x2b2b
incq %rax
jmp 0x2b34
movq 0x30(%rbx), %rax
subq %rsi, %rax
subq %rdx, %rcx
addq %rax, %rcx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: upup
point_t upup(buffer_t *bp, point_t off)
{
	point_t curr = lnstart(bp, off);
	point_t seg = segstart(bp, curr, off);
	if (curr < seg)
		off = segstart(bp, curr, seg-1);
	else
		off = segstart(bp, lnstart(bp,curr-1), curr-1);
	return (off);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
callq 0x29bc
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2a08
cmpq %rax, %r14
jge 0x2b6f
decq %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
jmp 0x2b86
decq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29bc
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x2a08
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: lncolumn
point_t lncolumn(buffer_t *bp, point_t offset, int column)
{
	int c = 0;
	char_t *p;
	while ((p = ptr(bp, offset)) < bp->b_ebuf && *p != '\n' && c < column) {
		c += *p == '\t' ? 8 - (c & 7) : 1;
		++offset;
	}
	return (offset);
}

// Assembly:
pushq %rbp
pushq %rbx
movq %rsi, %rax
movq 0x20(%rdi), %rcx
movq 0x28(%rdi), %rsi
xorl %r8d, %r8d
movl $0x8, %r9d
movl $0x1, %r10d
movq %rcx, %r11
testq %rax, %rax
js 0x2bf7
leaq (%rcx,%rax), %r11
movq 0x30(%rdi), %rbx
cmpq %rbx, %r11
jae 0x2bea
xorl %r11d, %r11d
jmp 0x2bf1
movq 0x38(%rdi), %r11
subq %rbx, %r11
addq %rax, %r11
addq %rcx, %r11
cmpq %rsi, %r11
jae 0x2c25
movb (%r11), %r11b
cmpb $0xa, %r11b
je 0x2c25
cmpl %edx, %r8d
jge 0x2c25
movl %r8d, %ebx
andl $0x7, %ebx
movl %r9d, %ebp
subl %ebx, %ebp
cmpb $0x9, %r11b
cmovnel %r10d, %ebp
addl %ebp, %r8d
incq %rax
jmp 0x2bd0
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: modeline
void modeline(buffer_t *bp)
{
	int i;
	char mch;
	
	standout();
	move(bp->w_top + bp->w_rows, 0);
	mch = ((bp->b_flags & B_MODIFIED) ? '*' : '=');
	sprintf(temp, "=%c " E_LABEL " == %s ", mch, bp->b_fname);
	addstr(temp);

	for (i = strlen(temp) + 1; i <= COLS; i++)
		addch('=');
	standend();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x9396(%rip), %r12      # 0xbfd0
movq (%r12), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0x2040
movq (%r12), %rdi
movsbl 0x40(%r14), %eax
movsbl 0x41(%r14), %esi
addl %eax, %esi
xorl %edx, %edx
callq 0x2280
testb $0x1, 0x14d(%r14)
pushq $0x3d
popq %rbx
pushq $0x2a
popq %rdx
cmovel %ebx, %edx
addq $0x4c, %r14
leaq 0x9f85(%rip), %r15      # 0xcc00
leaq 0x447f(%rip), %rsi      # 0x7101
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r12), %rdi
pushq $-0x1
popq %rdx
movq %r15, %rsi
callq 0x2310
movq %r15, %rdi
callq 0x20e0
movq %rax, %r14
incl %r14d
movq 0x932d(%rip), %r15      # 0xbfe0
movq (%r12), %rdi
cmpl (%r15), %r14d
jg 0x2cc8
movl %ebx, %esi
callq 0x22a0
incl %r14d
jmp 0x2cb3
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: dispmsg
void dispmsg()
{
	move(MSGLINE, 0);
	if (msgflag) {
		addstr(msgline);
		msgflag = FALSE;
	}
	clrtoeol();
}

// Assembly:
pushq %rbx
movq 0x92ee(%rip), %rbx      # 0xbfd0
movq (%rbx), %rdi
movq 0x92fc(%rip), %rax      # 0xbfe8
movl (%rax), %esi
decl %esi
xorl %edx, %edx
callq 0x2280
cmpl $0x0, 0x9df2(%rip)      # 0xcaf0
je 0x2d19
movq (%rbx), %rdi
leaq 0x9be6(%rip), %rsi      # 0xc8f0
pushq $-0x1
popq %rdx
callq 0x2310
andl $0x0, 0x9dd7(%rip)      # 0xcaf0
movq (%rbx), %rdi
popq %rbx
jmp 0x2290
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: pgdown
void pgdown()
{
	curbp->b_page = curbp->b_point = upup(curbp, curbp->b_epage);
	while (0 < curbp->b_row--)
		down();
	curbp->b_epage = pos(curbp, curbp->b_ebuf);
}

// Assembly:
pushq %rbx
movq 0x99e0(%rip), %rbx      # 0xcaf8
movq 0x18(%rbx), %rsi
movq %rbx, %rdi
callq 0x2b3b
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movl 0x44(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x44(%rbx)
testl %eax, %eax
jle 0x3147
callq 0x306e
movq 0x99b3(%rip), %rbx      # 0xcaf8
jmp 0x312c
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %rax
movq 0x38(%rbx), %rsi
cmpq %rax, %rsi
jbe 0x315c
xorl %edx, %edx
jmp 0x3163
movq 0x30(%rbx), %rdx
subq %rsi, %rdx
subq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: pgup
void pgup()
{
	int i = curbp->w_rows;
	while (0 < --i) {
		curbp->b_page = upup(curbp, curbp->b_page);
		up();
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x997f(%rip), %rax      # 0xcaf8
movsbl 0x41(%rax), %ebp
cmpl $0x2, %ebp
jl 0x31a2
decl %ebp
movq 0x996d(%rip), %rbx      # 0xcaf8
movq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0x2b3b
movq %rax, 0x10(%rbx)
callq 0x3046
jmp 0x317d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: insert
void insert()
{
	assert(curbp->b_gap <= curbp->b_egap);
	if (curbp->b_gap == curbp->b_egap && !growgap(curbp, CHUNK)) return;
	curbp->b_point = movegap(curbp, curbp->b_point);
	*curbp->b_gap++ = *input == '\r' ? '\n' : *input;
	curbp->b_point = pos(curbp, curbp->b_egap);
	curbp->b_flags |= B_MODIFIED;
}

// Assembly:
pushq %rax
movq 0x9947(%rip), %rdi      # 0xcaf8
movq 0x30(%rdi), %rax
cmpq 0x38(%rdi), %rax
jne 0x31d0
movl $0x1fa0, %esi           # imm = 0x1FA0
callq 0x25aa
testl %eax, %eax
je 0x321e
movq 0x9928(%rip), %rdi      # 0xcaf8
movq 0x8(%rdi), %rsi
callq 0x2688
movq 0x9918(%rip), %rcx      # 0xcaf8
movq %rax, 0x8(%rcx)
movq 0x9c1d(%rip), %rax      # 0xce08
movzbl (%rax), %eax
cmpb $0xd, %al
pushq $0xa
popq %rdx
cmovnel %eax, %edx
movq 0x30(%rcx), %rax
leaq 0x1(%rax), %rsi
movq %rsi, 0x30(%rcx)
movb %dl, (%rax)
movq 0x98ed(%rip), %rax      # 0xcaf8
movq 0x30(%rax), %rcx
subq 0x20(%rax), %rcx
movq %rcx, 0x8(%rax)
orb $0x1, 0x14d(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: backspace
void backspace()
{
	curbp->b_point = movegap(curbp, curbp->b_point);
	if (curbp->b_buf < curbp->b_gap) {
		--curbp->b_gap;
		curbp->b_flags |= B_MODIFIED;
	}
	curbp->b_point = pos(curbp, curbp->b_egap);
}

// Assembly:
pushq %rax
movq 0x98d0(%rip), %rdi      # 0xcaf8
movq 0x8(%rdi), %rsi
callq 0x2688
movq 0x98c0(%rip), %rax      # 0xcaf8
movq 0x20(%rax), %rcx
movq 0x30(%rax), %rdx
cmpq %rdx, %rcx
jae 0x3253
decq %rdx
movq %rdx, 0x30(%rax)
orb $0x1, 0x14d(%rax)
subq %rcx, %rdx
movq %rdx, 0x8(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: delete
void delete()
{
	curbp->b_point = movegap(curbp, curbp->b_point);
	if (curbp->b_egap < curbp->b_ebuf) {
		curbp->b_point = pos(curbp, ++curbp->b_egap);
		curbp->b_flags |= B_MODIFIED;
	}
}

// Assembly:
pushq %rax
movq 0x9894(%rip), %rdi      # 0xcaf8
movq 0x8(%rdi), %rsi
callq 0x2688
movq 0x9884(%rip), %rcx      # 0xcaf8
movq %rax, 0x8(%rcx)
movq 0x38(%rcx), %rax
cmpq 0x28(%rcx), %rax
jae 0x329c
incq %rax
movq %rax, 0x38(%rcx)
movq 0x30(%rcx), %rax
subq 0x20(%rcx), %rax
movq %rax, 0x8(%rcx)
orb $0x1, 0x14d(%rcx)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: insert_string
void insert_string(char *str)
{
	int len = (str == NULL) ? 0 : strlen(str);

	if (len <= 0) {
		msg("nothing to insert");
	} else if (len < curbp->b_egap - curbp->b_gap || growgap(curbp, len)) {
		curbp->b_point = movegap(curbp, curbp->b_point);
		memcpy(curbp->b_gap, str, len * sizeof (char_t));
		curbp->b_gap += len;
		curbp->b_point = pos(curbp, curbp->b_egap);
		curbp->b_flags |= B_MODIFIED;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x34e2
movq %rdi, %r14
callq 0x20e0
movq %rax, %rbx
testl %ebx, %ebx
jle 0x34e2
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movq 0x967f(%rip), %rdi      # 0xcaf8
movq 0x38(%rdi), %rax
subq 0x30(%rdi), %rax
cmpq %rbx, %rax
jg 0x3499
movq %rbx, %rsi
callq 0x25aa
testl %eax, %eax
je 0x34da
movq 0x965f(%rip), %rdi      # 0xcaf8
movq 0x8(%rdi), %rsi
callq 0x2688
movq 0x964f(%rip), %rcx      # 0xcaf8
movq %rax, 0x8(%rcx)
movq 0x30(%rcx), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21e0
movq 0x9635(%rip), %rax      # 0xcaf8
addq 0x30(%rax), %rbx
movq %rbx, 0x30(%rax)
subq 0x20(%rax), %rbx
movq %rbx, 0x8(%rax)
orb $0x1, 0x14d(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3c7a(%rip), %rdi      # 0x7163
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x24c3
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: search_forward
point_t search_forward(buffer_t *bp, point_t start_p, char *stext)
{
	point_t end_p = pos(bp, bp->b_ebuf);
	point_t p,pp;
	char* s;

	if (0 == strlen(stext)) return start_p;

	for (p=start_p; p < end_p; p++) {
		for (s=stext, pp=p; *s == *(ptr(bp, pp)) && *s !='\0' && pp < end_p; s++, pp++)
			;
		if (*s == '\0') return pp;
	}
	return -1;
}

// Assembly:
movq %rsi, %rax
movq 0x28(%rdi), %r9
movq 0x38(%rdi), %rcx
cmpq %r9, %rcx
jbe 0x35f0
xorl %esi, %esi
jmp 0x35f7
movq 0x30(%rdi), %rsi
subq %rcx, %rsi
cmpb $0x0, (%rdx)
je 0x3696
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x20(%rdi), %r8
subq %r8, %r9
addq %r9, %rsi
leaq 0x1(%rax), %r10
movabsq $-0x1, %r9
xorl %r11d, %r11d
cmpq %rsi, %rax
jge 0x3689
movq %r10, %rbx
movq %rax, %r14
movq %rdx, %r15
movq %r8, %r12
testq %r14, %r14
js 0x3653
leaq (%r8,%r14), %r13
movq 0x30(%rdi), %rbp
movq %rcx, %r12
subq %rbp, %r12
cmpq %rbp, %r13
cmovbq %r11, %r12
addq %r13, %r12
movsbl (%r15), %ebp
movzbl (%r12), %r12d
cmpl %r12d, %ebp
jne 0x3676
testb %bpl, %bpl
je 0x3676
cmpq %rsi, %r14
jge 0x3676
incq %r15
incq %r14
incq %rbx
jmp 0x3633
incq %rax
incq %r10
testb %bpl, %bpl
jne 0x3625
decq %rbx
movq %rbx, %rax
jmp 0x368c
movq %r9, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: new_key
keymap_t *new_key(char *name, char *bytes)
{
	keymap_t *kp = (keymap_t *)malloc(sizeof(keymap_t));
	assert(kp != NULL);

 	strncpy(kp->k_name, name, MAX_KNAME);
	strncpy(kp->k_bytes, bytes, MAX_KBYTES);
	kp->k_name[MAX_KNAME] ='\0';
	kp->k_bytes[MAX_KBYTES] ='\0';
	kp->k_func = user_func;
	strcpy(kp->k_funcname, E_NOT_BOUND);
	kp->k_next = NULL;
	return kp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x50
popq %rdi
callq 0x21f0
movq %rax, %r15
pushq $0xc
popq %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2070
leaq 0xd(%r15), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2070
xorl %eax, %eax
movb %al, 0xc(%r15)
movb %al, 0x19(%r15)
leaq 0x2e(%rip), %rax        # 0x3722
movq %rax, 0x40(%r15)
movabsq $0x756f6220746f6e3c, %rax # imm = 0x756F6220746F6E3C
movq %rax, 0x1a(%r15)
movl $0x3e646e, 0x22(%r15)   # imm = 0x3E646E
andq $0x0, 0x48(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: user_func
void user_func()
{
	char *output;
	assert(key_return != NULL);
	if (0 == strcmp(key_return->k_funcname, E_NOT_BOUND)) {
		msg(E_NOT_BOUND);
		return;
	}

	reset_output_stream();
	output = call_lisp(key_return->k_funcname);

	/* show errors on message line */
	if (NULL != strstr(output, "error:")) {
		char buf[81];
		strncpy(buf, output, 80);
		buf[80] ='\0';
		msg(buf);
	}	
	reset_output_stream();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq 0x96e8(%rip), %rdi      # 0xce18
addq $0x1a, %rdi
leaq 0x3a3a(%rip), %rsi      # 0x7175
callq 0x2190
testl %eax, %eax
je 0x37a1
xorl %eax, %eax
callq 0x6cbf
movq 0x96c6(%rip), %rdi      # 0xce18
addq $0x1a, %rdi
callq 0x6f41
movq %rax, %rbx
leaq 0x3a4a(%rip), %rsi      # 0x71af
movq %rax, %rdi
callq 0x2330
testq %rax, %rax
je 0x3792
movq %rsp, %r14
pushq $0x50
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2070
movb $0x0, 0x50(%r14)
movq %r14, %rdi
xorl %eax, %eax
callq 0x24c3
xorl %eax, %eax
callq 0x6cbf
addq $0x58, %rsp
popq %rbx
popq %r14
retq
leaq 0x39cd(%rip), %rdi      # 0x7175
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
jmp 0x24c3
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: create_keys
void create_keys()
{
	char ch;
	char ctrx_map[] = "c-x c-|";
	char ctrl_map[] = "c-|";
	char esc_map[] = "esc-|";
	char ctrx_bytes[] = "\x18\x01";
	char ctrl_bytes[] = "\x01";
	char esc_bytes[] = "\x1B\x61";

	assert(khead == NULL);
	khead = ktail = new_key("c-space", "\x00");

	/* control-a to z */
	for (ch = 1; ch <= 26; ch++) {
		if (ch == 9 || ch == 10 || ch == 24) continue;  /* skip tab, linefeed, ctrl-x */
		ctrl_map[2] = ch + 96;   /* ASCII a is 97 */
		ctrl_bytes[0] = ch;
		make_key(ctrl_map, ctrl_bytes);
	}

	/* esc-a to z */
	for (ch = 1; ch <= 26; ch++) {
		esc_map[4] = ch + 96;
		esc_bytes[1] = ch + 96;
		make_key(esc_map, esc_bytes);
	}

	/* control-x control-a to z */
	for (ch = 1; ch <= 26; ch++) {
		ctrx_map[6] = ch + 96;
		ctrx_bytes[1] = ch;
		make_key(ctrx_map, ctrx_bytes);
	}

	make_key("c-x ?", "\x18\x3F");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movabsq $0x7c2d6320782d63, %rax # imm = 0x7C2D6320782D63
movq %rax, 0x20(%rsp)
leaq 0x1c(%rsp), %rbx
movl $0x7c2d63, (%rbx)       # imm = 0x7C2D63
movw $0x7c, 0x18(%rsp)
movl $0x2d637365, 0x14(%rsp) # imm = 0x2D637365
xorl %eax, %eax
movb %al, 0x10(%rsp)
movw $0x118, 0xe(%rsp)       # imm = 0x118
leaq 0x12(%rsp), %r14
movw $0x1, (%r14)
movb %al, 0xc(%rsp)
movw $0x611b, 0xa(%rsp)      # imm = 0x611B
leaq 0x3960(%rip), %rdi      # 0x718d
leaq 0x3be3(%rip), %rsi      # 0x7417
callq 0x36a9
movq %rax, 0x9098(%rip)      # 0xc8d8
movq %rax, 0x9089(%rip)      # 0xc8d0
movb $0x61, %r15b
leal -0x60(%r15), %eax
movzbl %al, %ecx
leal -0x9(%rcx), %edx
cmpl $0x2, %edx
jb 0x3877
cmpl $0x18, %ecx
je 0x3877
cmpl $0x1b, %ecx
je 0x387c
movb %r15b, 0x1e(%rsp)
movb %al, 0x12(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x37b6
incb %r15b
jmp 0x384a
movb $0x1, %bpl
movb $0x1a, %r15b
leaq 0x14(%rsp), %rbx
leaq 0xa(%rsp), %r14
subb $0x1, %r15b
jb 0x38ae
movl %ebp, %eax
orb $0x60, %al
movb %al, 0x18(%rsp)
movb %al, 0xb(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x37b6
incb %bpl
jmp 0x388c
movb $0x1, %bpl
movb $0x1a, %r15b
leaq 0x20(%rsp), %rbx
leaq 0xe(%rsp), %r14
subb $0x1, %r15b
jb 0x38e1
movl %ebp, %eax
orb $0x60, %al
movb %al, 0x26(%rsp)
movb %bpl, 0xf(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x37b6
incb %bpl
jmp 0x38be
leaq 0x38ad(%rip), %rdi      # 0x7195
leaq 0x38ac(%rip), %rsi      # 0x719b
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x37b6
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: set_key_internal
int set_key_internal(char *name, char *funcname, char *bytes, void (*func)(void))
{
	keymap_t *kp;
	
	for (kp = khead; kp->k_next != NULL; kp = kp->k_next) {
		if (0 == strcmp(kp->k_name, name)) {
			strncpy(kp->k_funcname, funcname, MAX_KFUNC);
			kp->k_funcname[MAX_KFUNC] ='\0';
			if (func != NULL)  /* dont set if its a user_func */
				kp->k_func = func;
			return 1;
		}
	}

	/* not found, create it and add onto the tail */
	if (func != NULL) {
		kp = new_key(name, bytes);
		strncpy(kp->k_funcname, funcname, MAX_KFUNC);
		kp->k_funcname[MAX_KFUNC] ='\0';
		kp->k_func = func;
		ktail->k_next = kp;
		ktail = kp;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r13
movq 0x8fb4(%rip), %rbp      # 0xc8d0
movq %rbp, %r15
movq 0x48(%rbp), %rbp
testq %rbp, %rbp
je 0x3959
movq %r15, %rdi
movq %r13, %rsi
callq 0x2190
testl %eax, %eax
jne 0x391c
leaq 0x1a(%r15), %rdi
pushq $0x1e
popq %rdx
movq %r14, %rsi
callq 0x2070
movb $0x0, 0x38(%r15)
pushq $0x1
popq %rax
testq %rbx, %rbx
je 0x399d
movq %rbx, 0x40(%r15)
jmp 0x399d
testq %rbx, %rbx
je 0x399b
movq %r13, %rdi
movq %r12, %rsi
callq 0x36a9
movq %rax, %r15
leaq 0x1a(%rax), %rdi
pushq $0x1e
popq %rdx
movq %r14, %rsi
callq 0x2070
movb $0x0, 0x38(%r15)
movq %rbx, 0x40(%r15)
movq 0x8f4d(%rip), %rax      # 0xc8d8
movq %r15, 0x48(%rax)
movq %r15, 0x8f42(%rip)      # 0xc8d8
pushq $0x1
popq %rax
jmp 0x399d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: eval_block
void eval_block()
{
	char *output;

	if (curbp->b_mark == NOMARK || curbp->b_mark >= curbp->b_point) {
		msg("no block defined");
		return;
	}

	copy_cut(FALSE, FALSE);
	assert(scrap != NULL);
	assert(strlen(scrap) > 0);

	reset_output_stream();
	output = call_lisp((char *)scrap);
	insert_string("\n");
	insert_string(output);
	reset_output_stream();
}

// Assembly:
movq 0x9137(%rip), %rax      # 0xcaf8
movq (%rax), %rcx
cmpq $-0x1, %rcx
je 0x3a0c
cmpq 0x8(%rax), %rcx
jge 0x3a0c
pushq %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x32d3
xorl %eax, %eax
callq 0x6cbf
movq 0x8f00(%rip), %rdi      # 0xc8e8
callq 0x6f41
movq %rax, %rbx
leaq 0x3646(%rip), %rdi      # 0x703d
callq 0x3450
movq %rbx, %rdi
callq 0x3450
xorl %eax, %eax
popq %rbx
jmp 0x6cbf
leaq 0x378b(%rip), %rdi      # 0x719e
xorl %eax, %eax
jmp 0x24c3
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: load_config
void load_config()
{
	char fname[300];
	char *output;
	int fd;

	reset_output_stream();
	(void)snprintf(fname, 300, "%s/%s", getenv("HOME"), E_INITFILE);

	if ((fd = open(fname, O_RDONLY)) == -1)
		fatal("failed to open " E_INITFILE " in HOME directory");

	reset_output_stream();
	output = load_file(fd);
	assert(output != NULL);
	close(fd);

	/* all exceptions start with the word error: */
	if (NULL != strstr(output, "error:"))
		fatal(output);
	reset_output_stream();
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
xorl %eax, %eax
callq 0x6cbf
leaq 0x378b(%rip), %rdi      # 0x71bc
callq 0x2030
leaq 0x3779(%rip), %rdx      # 0x71b6
leaq 0x377d(%rip), %r8       # 0x71c1
movq %rsp, %rbx
movl $0x12c, %esi            # imm = 0x12C
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2120
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2260
cmpl $-0x1, %eax
je 0x3aa8
movl %eax, %ebp
xorl %eax, %eax
callq 0x6cbf
movl %ebp, %edi
callq 0x5d25
movq %rax, %rbx
movl %ebp, %edi
callq 0x2150
leaq 0x3724(%rip), %rsi      # 0x71af
movq %rbx, %rdi
callq 0x2330
testq %rax, %rax
jne 0x3ab4
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %rbp
jmp 0x6cbf
leaq 0x371a(%rip), %rdi      # 0x71c9
callq 0x248e
movq %rbx, %rdi
callq 0x248e
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/zepl.c
// Function: main
int main(int argc, char **argv)
{
	if (argc != 2) fatal("usage: " E_NAME " filename\n");

	setup_keys();
	(void)init_lisp();
	load_config();
	initscr();	
	raw();
	noecho();
	
	curbp = new_buffer();
	(void)insert_file(argv[1], FALSE);
	/* Save filename irregardless of load() success. */
	strncpy(curbp->b_fname, argv[1], MAX_FNAME);
	curbp->b_fname[MAX_FNAME] = '\0'; /* force truncation */

	if (!growgap(curbp, CHUNK)) fatal("Failed to allocate required memory.\n");

	while (!done) {
		display();
		input = get_key(khead, &key_return);

		if (key_return != NULL) {
			(key_return->k_func)();
		} else {
			/* allow TAB and NEWLINE, any other control char is 'Not Bound' */
			if (*input > 31 || *input == 10 || *input == 9)
				insert();
                        else {
				fflush(stdin);
				msg(E_NOT_BOUND);
			}
		}
	}

	noraw();
	endwin();
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x2, %edi
jne 0x3ff7
movq %rsi, %rbx
callq 0x3abc
callq 0x6e71
callq 0x3a1a
callq 0x2130
callq 0x21b0
callq 0x20f0
callq 0x244c
movq %rax, 0x8bcb(%rip)      # 0xcaf8
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x27d5
movq 0x8bb9(%rip), %r14      # 0xcaf8
leaq 0x4c(%r14), %rdi
movq 0x8(%rbx), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2070
movb $0x0, 0x14c(%r14)
movl $0x1fa0, %esi           # imm = 0x1FA0
movq %r14, %rdi
callq 0x25aa
testl %eax, %eax
je 0x4003
leaq 0x8ea3(%rip), %rbx      # 0xce18
movq 0x804c(%rip), %r15      # 0xbfc8
leaq 0x31f2(%rip), %r14      # 0x7175
cmpl $0x0, 0x8e76(%rip)      # 0xce00
jne 0x3fe5
callq 0x2d22
movq 0x8938(%rip), %rdi      # 0xc8d0
movq %rbx, %rsi
callq 0x28e9
movq %rax, 0x8e61(%rip)      # 0xce08
movq 0x8e6a(%rip), %rcx      # 0xce18
testq %rcx, %rcx
je 0x3fb8
callq *0x40(%rcx)
jmp 0x3f83
movb (%rax), %al
cmpb $0x20, %al
setb %cl
addb $-0x9, %al
cmpb $0x2, %al
setae %al
testb %al, %cl
jne 0x3fd1
callq 0x31a9
jmp 0x3f83
movq (%r15), %rdi
callq 0x2200
movq %r14, %rdi
xorl %eax, %eax
callq 0x24c3
jmp 0x3f83
callq 0x21a0
callq 0x22e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3403(%rip), %rdi      # 0x7401
callq 0x248e
leaq 0x3010(%rip), %rdi      # 0x701a
callq 0x248e
nop
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: writeFmt
void writeFmt(Stream *stream, char *format, ...)
{
    static char buf[WRITE_FMT_BUFSIZ];
    int nbytes;

    va_list args;
    va_start(args, format);
    nbytes = vsnprintf(buf, WRITE_FMT_BUFSIZ, format, args);
    va_end(args);

    switch (stream->type) {
    case STREAM_TYPE_FILE:
	nbytes = write(stream->fd, buf, nbytes);
	return;

    case STREAM_TYPE_STRING:
    default:
	writeString(buf, stream);
	return;
    }
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x40f3
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0x8d46(%rip), %rdi      # 0xce60
movl $0x800, %esi            # imm = 0x800
movq %r10, %rdx
callq 0x20a0
cmpl $0x1, (%rbx)
jne 0x4140
movl 0x10(%rbx), %edi
movslq %eax, %rdx
leaq 0x8d27(%rip), %rsi      # 0xce60
callq 0x20b0
jmp 0x414f
leaq 0x8d19(%rip), %rdi      # 0xce60
movq %rbx, %rsi
callq 0x4010
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: exceptionWithObject
void exceptionWithObject(Object * object, char *format, ...)
{
	static char buf[WRITE_FMT_BUFSIZ];
	
	writeString("error: ", &ostream);

	if (object) {
		writeObject(object, true, &ostream);
		writeChar(' ', &ostream);
	}

	va_list args;
	va_start(args, format);
	vsnprintf(buf, WRITE_FMT_BUFSIZ, format, args);
	va_end(args);

	writeString(buf, &ostream);
	writeChar('\n', &ostream);

	longjmp(exceptionEnv, 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x41e7
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
leaq 0x329a(%rip), %rdi      # 0x7488
leaq 0x7fdb(%rip), %rsi      # 0xc1d0
callq 0x4010
testq %r14, %r14
je 0x421f
leaq 0x7fca(%rip), %r15      # 0xc1d0
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x4287
pushq $0x20
popq %rdi
movq %r15, %rsi
callq 0x4158
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0x9415(%rip), %r14      # 0xd660
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdi
movq %rbx, %rdx
callq 0x20a0
leaq 0x7f6e(%rip), %rbx      # 0xc1d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4010
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x4158
leaq 0x9be1(%rip), %rdi      # 0xde60
pushq $0x1
popq %rsi
callq 0x2230
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: gcMoveObject
Object *gcMoveObject(Object * object)
{
	// skip object if it is not within from-space (i.e. on the stack)
	if (object < (Object *) memory->fromSpace || object >= (Object *) ((char *)memory->fromSpace + memory->fromOffset))
		return object;

	// if the object has already been moved, return its new location
	if (object->type == (Type) - 1)
		return object->forward;

	// copy object to to-space
	Object *forward = (Object *) ((char *)memory->toSpace + memory->toOffset);
	memcpy(forward, object, object->size);
	memory->toOffset += object->size;

	// mark object as moved and set forwarding pointer
	object->type = (Type) - 1;
	object->forward = forward;

	return object->forward;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x9aee(%rip), %rax      # 0xdf78
cmpq %rdi, %rax
ja 0x44db
addq 0x9ad2(%rip), %rax      # 0xdf68
cmpq %rbx, %rax
jbe 0x44db
cmpl $-0x1, (%rbx)
je 0x44d7
movq 0x9ac9(%rip), %r15      # 0xdf70
movq 0x9ad2(%rip), %r14      # 0xdf80
addq %r15, %r14
movq 0x8(%rbx), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21e0
addq 0x8(%rbx), %r15
movq %r15, 0x9aa5(%rip)      # 0xdf70
orl $-0x1, (%rbx)
movq %r14, 0x10(%rbx)
movq %r14, %rbx
jmp 0x44db
movq 0x10(%rbx), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: gc
void gc(GC_PARAM)
{
	memory->toOffset = 0;

	// move symbols and root objects
	symbols = gcMoveObject(symbols);

	for (Object * object = GC_ROOTS; object != nil; object = object->cdr)
		object->car = gcMoveObject(object->car);

	// iterate over objects in to-space and move all objects they reference
	for (Object * object = memory->toSpace; object < (Object *) ((char *)memory->toSpace + memory->toOffset); object = (Object *) ((char *)object + object->size)) {

		switch (object->type) {
		case TYPE_NUMBER:
		case TYPE_STRING:
		case TYPE_SYMBOL:
		case TYPE_PRIMITIVE:
			break;
		case TYPE_CONS:
			object->car = gcMoveObject(object->car);
			object->cdr = gcMoveObject(object->cdr);
			break;
		case TYPE_LAMBDA:
		case TYPE_MACRO:
			object->params = gcMoveObject(object->params);
			object->body = gcMoveObject(object->body);
			object->env = gcMoveObject(object->env);
			break;
		case TYPE_ENV:
			object->parent = gcMoveObject(object->parent);
			object->vars = gcMoveObject(object->vars);
			object->vals = gcMoveObject(object->vals);
			break;
		}
	}

	// swap from- and to-space
	void *swap = memory->fromSpace;
	memory->fromSpace = memory->toSpace;
	memory->toSpace = swap;
	memory->fromOffset = memory->toOffset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, 0x9a76(%rip)      # 0xdf70
movq 0x9a27(%rip), %rdi      # 0xdf28
callq 0x447b
movq %rax, 0x9a1b(%rip)      # 0xdf28
cmpq 0x7cf4(%rip), %rbx      # 0xc208
je 0x4529
movq 0x10(%rbx), %rdi
callq 0x447b
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rbx
jmp 0x450d
movq 0x9a50(%rip), %rax      # 0xdf80
pushq $0x18
popq %rbx
pushq $0x10
popq %r14
pushq $0x20
popq %r15
movq %rax, %r12
movq 0x9a2b(%rip), %rcx      # 0xdf70
leaq (%rax,%rcx), %rdx
cmpq %rdx, %r12
jae 0x45a7
movl (%r12), %eax
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
jb 0x456a
movq %r14, %rbp
movq %rbx, %r13
cmpl $0x3, %eax
je 0x457f
cmpl $0x7, %eax
jne 0x4599
movq 0x10(%r12), %rdi
callq 0x447b
movq %rax, 0x10(%r12)
movq %rbx, %rbp
movq %r15, %r13
movq (%r12,%rbp), %rdi
callq 0x447b
movq %rax, (%r12,%rbp)
movq (%r12,%r13), %rdi
callq 0x447b
movq %rax, (%r12,%r13)
addq 0x8(%r12), %r12
movq 0x99db(%rip), %rax      # 0xdf80
jmp 0x453e
movq 0x99ca(%rip), %rdx      # 0xdf78
movq %rax, 0x99c3(%rip)      # 0xdf78
movq %rdx, 0x99c4(%rip)      # 0xdf80
movq %rcx, 0x99a5(%rip)      # 0xdf68
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: memoryAllocObject
Object *memoryAllocObject(Type type, size_t size, GC_PARAM)
{
	size = memoryAlign(size, sizeof(void *));

	// allocate from- and to-space
	if (!memory->fromSpace) {
		if (!(memory->fromSpace = mmap(NULL, memory->capacity * 2, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)))
			exception("mmap() failed, %s", strerror(errno));

		memory->toSpace = (char *)memory->fromSpace + memory->capacity;
	}
	// run garbage collection if capacity exceeded
	if (memory->fromOffset + size >= memory->capacity)
		gc(GC_ROOTS);
	if (memory->fromOffset + size >= memory->capacity)
		exception("out of memory, %lu bytes", (unsigned long)size);

	// allocate object in from-space
	Object *object = (Object *) ((char *)memory->fromSpace + memory->fromOffset);
	object->type = type;
	object->size = size;
	memory->fromOffset += size;

	return object;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
cmpq $0x0, 0x9984(%rip)      # 0xdf78
jne 0x4628
pushq $0x3
popq %rdx
pushq $0x22
popq %rcx
pushq $-0x1
popq %r8
movl $0x40000, %esi          # imm = 0x40000
xorl %edi, %edi
xorl %r9d, %r9d
callq 0x2100
movq %rax, 0x9962(%rip)      # 0xdf78
testq %rax, %rax
je 0x468d
addq $0x20000, %rax          # imm = 0x20000
movq %rax, 0x9958(%rip)      # 0xdf80
addq $0x7, %rbx
andq $-0x8, %rbx
movq 0x9931(%rip), %rcx      # 0xdf68
leaq (%rcx,%rbx), %rdx
cmpq $0x20000, %rdx          # imm = 0x20000
jb 0x4660
movq %r14, %rdi
callq 0x44e4
movq 0x9915(%rip), %rcx      # 0xdf68
leaq (%rcx,%rbx), %rdx
cmpq $0x20000, %rdx          # imm = 0x20000
jae 0x467f
movq 0x9911(%rip), %rsi      # 0xdf78
leaq (%rsi,%rcx), %rax
movl %ebp, (%rsi,%rcx)
movq %rbx, 0x8(%rsi,%rcx)
movq %rdx, 0x98ee(%rip)      # 0xdf68
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2e1c(%rip), %rsi      # 0x74a2
xorl %edi, %edi
movq %rbx, %rdx
jmp 0x46a5
callq 0x2060
movl (%rax), %edi
callq 0x2300
leaq 0x2df0(%rip), %rsi      # 0x7490
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x4186
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: newStringWithLength
Object *newStringWithLength(char *string, size_t length, GC_PARAM)
{
	int nEscapes = 0;

	for (int i = 1; i < length; ++i)
		if (string[i - 1] == '\\' && strchr("\\\"trn", string[i]))
			++i, ++nEscapes;

	Object *object = newObjectWithString(TYPE_STRING,
					     length - nEscapes + 1, GC_ROOTS);

	for (int r = 1, w = 0; r <= length; ++r) {
		if (string[r - 1] == '\\' && r < length) {
			switch (string[r]) {
			case '\\':
				object->string[w++] = '\\';
				r++;
				break;
			case '"':
				object->string[w++] = '"';
				r++;
				break;
			case 't':
				object->string[w++] = '\t';
				r++;
				break;
			case 'r':
				object->string[w++] = '\r';
				r++;
				break;
			case 'n':
				object->string[w++] = '\n';
				r++;
				break;
			default:
				object->string[w++] = '\\';
				break;
			}
		} else
			object->string[w++] = string[r - 1];
	}

	object->string[length - nEscapes] = '\0';
	return object;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
pushq $0x1
popq %r15
leaq 0x2d8e(%rip), %r12      # 0x74bb
pushq $0x6
popq %r13
movslq %r15d, %rax
cmpq %rbx, %rax
jae 0x4760
cmpb $0x5c, -0x1(%r14,%rax)
jne 0x475b
movsbl (%r14,%rax), %esi
movq %r12, %rdi
movq %r13, %rdx
callq 0x2160
testq %rax, %rax
je 0x475b
incl %r15d
incl %ebp
incl %r15d
jmp 0x4731
movslq %ebp, %rax
movq %rbx, %r12
subq %rax, %r12
leaq 0x1(%r12), %rsi
pushq $0x1
popq %rbp
movl %ebp, %edi
movq (%rsp), %rdx
callq 0x46f8
movq %rax, %rcx
addq $0x10, %rcx
movslq %ebp, %rdx
cmpq %rbx, %rdx
ja 0x47ec
movb -0x1(%r14,%rdx), %sil
cmpb $0x5c, %sil
setne %dil
cmpq %rbx, %rdx
setae %r8b
orb %dil, %r8b
jne 0x47c7
movzbl (%r14,%rdx), %edx
cmpl $0x22, %edx
je 0x47e0
cmpl $0x74, %edx
je 0x47cc
cmpl $0x6e, %edx
je 0x47d6
cmpl $0x72, %edx
je 0x47d1
cmpl $0x5c, %edx
jne 0x47db
movb $0x5c, (%rcx)
jmp 0x47e3
movb %sil, (%rcx)
jmp 0x47e5
movb $0x9, (%rcx)
jmp 0x47e3
movb $0xd, (%rcx)
jmp 0x47e3
movb $0xa, (%rcx)
jmp 0x47e3
movb $0x5c, (%rcx)
jmp 0x47e5
movb $0x22, (%rcx)
incl %ebp
incl %ebp
incq %rcx
jmp 0x4783
movb $0x0, 0x10(%rax,%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: newCons
Object *newCons(Object ** car, Object ** cdr, GC_PARAM)
{
	Object *object = newObject(TYPE_CONS, GC_ROOTS);
	object->car = *car;
	object->cdr = *cdr;
	return object;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x3
popq %rdi
movq %rdx, %rsi
callq 0x46ac
movq (%r14), %rcx
movq %rcx, 0x10(%rax)
movq (%rbx), %rcx
movq %rcx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: newSymbolWithLength
Object *newSymbolWithLength(char *string, size_t length, GC_PARAM)
{
	for (Object * object = symbols; object != nil; object = object->cdr)
		if (memcmp(object->car->string, string, length) == 0 && object->car->string[length] == '\0')
			return object->car;

	GC_TRACE(gcObject, newObjectWithString(TYPE_SYMBOL, length + 1, GC_ROOTS));
	memcpy((*gcObject)->string, string, length);
	(*gcObject)->string[length] = '\0';

	symbols = newCons(gcObject, &symbols, GC_ROOTS);

	return *gcObject;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x96b8(%rip), %rbp      # 0xdf28
movq 0x7991(%rip), %r15      # 0xc208
movq (%rbp), %rbp
cmpq %r15, %rbp
je 0x48a9
movq 0x10(%rbp), %r12
leaq 0x10(%r12), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2210
testl %eax, %eax
jne 0x48a3
cmpb $0x0, (%r13,%rbx)
je 0x4914
addq $0x18, %rbp
jmp 0x4877
leaq 0x20(%rsp), %r12
movl $0x3, -0x10(%r12)
andq $0x0, -0x8(%r12)
leaq 0x1(%rbx), %rsi
pushq $0x2
popq %rdi
movq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x46f8
movq %rax, %r13
movq %rax, (%r12)
movq %r15, 0x8(%r12)
leaq 0x10(%rax), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21e0
movb $0x0, 0x10(%r13,%rbx)
leaq 0x962f(%rip), %rsi      # 0xdf28
leaq 0x10(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rdx
callq 0x4825
movq %rax, 0x9618(%rip)      # 0xdf28
movq 0x10(%rbx), %r12
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: newObjectWithClosure
Object *newObjectWithClosure(Type type, Object ** params, Object ** body, Object ** env, GC_PARAM)
{
	Object *list;

	for (list = *params; list->type == TYPE_CONS; list = list->cdr) {
		if (list->car->type != TYPE_SYMBOL)
			exceptionWithObject(list->car, "is not a symbol");
		if (list->car == nil || list->car == t)
			exceptionWithObject(list->car, "cannot be used as a parameter");
	}

	if (list != nil && list->type != TYPE_SYMBOL)
		exceptionWithObject(list, "is not a symbol");

	Object *object = newObject(type, GC_ROOTS);
	object->params = *params;
	object->body = *body;
	object->env = *env;
	return object;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %eax
movq 0x78a7(%rip), %rdx      # 0xc208
movq 0x78a8(%rip), %rsi      # 0xc210
movq %r15, %rdi
movq (%rdi), %rdi
movl (%rdi), %ecx
cmpl $0x3, %ecx
jne 0x498e
movq 0x10(%rdi), %rcx
cmpl $0x2, (%rcx)
jne 0x49c3
cmpq %rdx, %rcx
je 0x49cc
cmpq %rsi, %rcx
je 0x49cc
addq $0x18, %rdi
jmp 0x496b
cmpq %rdx, %rdi
sete %dl
cmpl $0x2, %ecx
sete %cl
orb %dl, %cl
je 0x49dd
movl %eax, %edi
movq %r8, %rsi
callq 0x46ac
movq (%r15), %rcx
movq %rcx, 0x10(%rax)
movq (%r14), %rcx
movq %rcx, 0x18(%rax)
movq (%rbx), %rcx
movq %rcx, 0x20(%rax)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2af7(%rip), %rsi      # 0x74c1
jmp 0x49d3
leaq 0x2afe(%rip), %rsi      # 0x74d1
movq %rcx, %rdi
xorl %eax, %eax
callq 0x4186
leaq 0x2add(%rip), %rsi      # 0x74c1
jmp 0x49d6
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: newPrimitive
Object *newPrimitive(int primitive, char *name, GC_PARAM)
{
	Object *object = newObject(TYPE_PRIMITIVE, GC_ROOTS);
	object->primitive = primitive;
	object->name = name;
	return object;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x6
popq %rdi
movq %rdx, %rsi
callq 0x46ac
movl %ebp, 0x10(%rax)
movq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: newEnv
Object *newEnv(Object ** func, Object ** vals, GC_PARAM)
{
	Object *object = newObject(TYPE_ENV, GC_ROOTS);

	if ((*func) == nil)
		object->parent = object->vars = object->vals = nil;
	else {
		Object *param = (*func)->params, *val = *vals;

		for (int nArgs = 0;; param = param->cdr, val = val->cdr, ++nArgs) {
			if (param == nil && val == nil)
				break;
			else if (param != nil && param->type == TYPE_SYMBOL)
				break;
			else if (val != nil && val->type != TYPE_CONS)
				exceptionWithObject(val, "is not a list");
			else if (param == nil && val != nil)
				exceptionWithObject(*func, "expects at most %d arguments", nArgs);
			else if (param != nil && val == nil) {
				for (; param->type == TYPE_CONS; param = param->cdr, ++nArgs);
				exceptionWithObject(*func, "expects at least %d arguments", nArgs);
			}
		}

		object->parent = (*func)->env;
		object->vars = (*func)->params;
		object->vals = *vals;
	}

	return object;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x7
popq %rdi
movq %rdx, %rsi
callq 0x46ac
movq (%r14), %rdi
movq 0x77ba(%rip), %r8       # 0xc208
cmpq %r8, %rdi
je 0x4adb
leaq 0x10(%rdi), %rsi
xorl %edx, %edx
movq %rbx, %rcx
movq (%rcx), %rcx
movq (%rsi), %rsi
movq %rsi, %r9
xorq %r8, %r9
movq %rcx, %r10
xorq %r8, %r10
orq %r9, %r10
je 0x4abf
cmpq %r8, %rsi
je 0x4a8c
movl (%rsi), %r9d
cmpl $0x2, %r9d
je 0x4abf
cmpq %r8, %rcx
jne 0x4a91
jmp 0x4ab0
cmpq %r8, %rcx
je 0x4a9b
cmpl $0x3, (%rcx)
jne 0x4afd
cmpq %r8, %rsi
je 0x4aef
addq $0x18, %rsi
addq $0x18, %rcx
incl %edx
jmp 0x4a60
movq 0x18(%rsi), %rsi
incl %edx
movl (%rsi), %r9d
cmpl $0x3, %r9d
je 0x4aa7
leaq 0x2a5d(%rip), %rsi      # 0x751a
jmp 0x4af6
movq 0x20(%rdi), %rcx
movq %rcx, 0x10(%rax)
movq (%r14), %rcx
movq 0x10(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq (%rbx), %rcx
movq %rcx, 0x20(%rax)
jmp 0x4ae7
movq %r8, 0x20(%rax)
movq %r8, 0x18(%rax)
movq %r8, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2a07(%rip), %rsi      # 0x74fd
xorl %eax, %eax
callq 0x4186
leaq 0x29eb(%rip), %rsi      # 0x74ef
movq %rcx, %rdi
xorl %eax, %eax
callq 0x4186
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: streamSeek
Stream *streamSeek(Stream * stream, int offset)
{
	if (offset < 0 && -offset >= stream->offset)
		stream->offset = 0;
	else
		stream->offset += offset;
	return stream;
}

// Assembly:
movq %rdi, %rax
testl %esi, %esi
js 0x4cd8
movq 0x28(%rax), %rcx
jmp 0x4ce5
movl %esi, %edx
negl %edx
movq 0x28(%rax), %rcx
cmpq %rdx, %rcx
jle 0x4cf0
movslq %esi, %rdx
addq %rcx, %rdx
movq %rdx, 0x28(%rax)
retq
andq $0x0, 0x28(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: streamPeek
int streamPeek(Stream * stream)
{
	int ch = streamGetc(stream);
	if (ch != EOF)
		streamSeek(stream, -1);
	return ch;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4b0e
cmpl $-0x1, %eax
je 0x4d1a
movq 0x28(%rbx), %rcx
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq $0x2, %rcx
cmovgeq %rdx, %rsi
movq %rsi, 0x28(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: readNext
int readNext(Stream * stream)
{
	for (;;) {
		int ch = streamGetc(stream);
		if (ch == ';')
			while ((ch = streamGetc(stream)) != EOF && ch != '\n');
		if (isspace(ch))
			continue;
		return ch;
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x4b0e
movl %eax, %ebp
cmpl $0x3b, %eax
jne 0x4d45
movq %rbx, %rdi
callq 0x4b0e
movl %eax, %ebp
cmpl $0xa, %eax
je 0x4d45
cmpl $-0x1, %ebp
jne 0x4d31
callq 0x2340
movq (%rax), %rax
movslq %ebp, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x4d22
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hughbarney[P]zepl/lisp.c
// Function: peekNext
int peekNext(Stream * stream)
{
	int ch = readNext(stream);
	if (ch != EOF)
		streamSeek(stream, -1);
	return ch;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4d1c
cmpl $-0x1, %eax
je 0x4d84
movq 0x28(%rbx), %rcx
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq $0x2, %rcx
cmovgeq %rdx, %rsi
movq %rsi, 0x28(%rbx)
popq %rbx
retq