LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/pos.c
// Function: point_sort_yx
void point_sort_yx(point_t *const a, point_t *const b)
{
	if(b->y < a->y){
		point_t tmp = *b;
		*b = *a;
		*a = tmp;
	}else if(b->y == a->y && b->x < a->x){
		int tmp = b->x;
		b->x = a->x;
		a->x = tmp;
	}
}

// Assembly:
movl 0x4(%rdi), %eax
cmpl %eax, 0x4(%rsi)
jge 0xca15
movq (%rsi), %rax
movq (%rdi), %rcx
movq %rcx, (%rsi)
movq %rax, (%rdi)
retq
jne 0xca23
movl (%rsi), %eax
movl (%rdi), %ecx
cmpl %ecx, %eax
jge 0xca23
movl %ecx, (%rsi)
movl %eax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/region.c
// Function: region_contains
bool region_contains(const region_t *re, int x, int y)
{
	region_t sorted = *re;
	point_sort_full(&sorted.begin, &sorted.end);

	const struct
	{
		bool x, y;
	} in = {
		sorted.begin.x <= x && x <= sorted.end.x,
		sorted.begin.y <= y && y <= sorted.end.y
	};

	switch(re->type){
		case REGION_LINE:
			return in.y;

		case REGION_COL:
			return in.y && in.x;

		case REGION_CHAR:
			if(!in.y)
				return false;

			if(re->begin.y == re->end.y)
				return in.x;

			sorted = *re;
			point_sort_y(&sorted.begin, &sorted.end);

			if(y == sorted.begin.y)
				return x >= sorted.begin.x;
			if(y == sorted.end.y)
				return x <= sorted.end.x;

			return true;
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r15
movl 0x10(%rdi), %eax
leaq 0x8(%rsp), %r14
movl %eax, 0x8(%r14)
movups (%rdi), %xmm0
movaps %xmm0, -0x8(%r14)
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xc9dd
cmpl %ebx, (%r12)
setle %cl
cmpl %ebx, 0x8(%r12)
setge %al
andb %cl, %al
cmpl %ebp, 0x4(%r12)
setle %dl
cmpl %ebp, 0xc(%r12)
setge %cl
andb %dl, %cl
movl 0x10(%r15), %edx
testl %edx, %edx
je 0xca96
cmpl $0x2, %edx
je 0xca92
cmpl $0x1, %edx
jne 0xcad3
andb %cl, %al
jmp 0xcad5
movl %ecx, %eax
jmp 0xcad5
testb %cl, %cl
je 0xcad3
movl 0x4(%r15), %ecx
cmpl 0xc(%r15), %ecx
je 0xcad5
movl 0x10(%r15), %eax
movq %rsp, %r12
movl %eax, 0x10(%r12)
movups (%r15), %xmm0
movaps %xmm0, (%r12)
movq %r12, %rdi
movq %r14, %rsi
callq 0xc9c8
cmpl %ebp, 0x4(%r12)
jne 0xcae2
cmpl %ebx, (%rsp)
setle %al
jmp 0xcad5
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
cmpl %ebp, 0xc(%rsp)
jne 0xcad5
cmpl %ebx, 0x8(%rsp)
setge %al
jmp 0xcad5
nop
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/range.c
// Function: parse_range_1
bool parse_range_1(
		char *range, char **end,
		int *out)
{
	bool handled = true;

	switch(*range){
		case '0' ... '9':
			/* go into 0-based */
			*out = strtol(range, &range, 10) - 1;
			break;

		case '.':
			*out = windows_cur()->ui_pos->y;
			range++;
			break;
		case '$':
			*out = buffer_nlines(buffers_cur());
			range++;
			break;
		/*case '\'': */

		default:
			/* don't touch range */
			handled = false;
			*out = windows_cur()->ui_pos->y;
			break;
	}

	for(;;){
		switch(*range){
			case '+':
			case '-':
			{
				const int dir = (*range == '+' ? 1 : -1);

				range++;
				int amt = isdigit(*range)
					? strtol(range, &range, 10)
					: 1;

				*out += dir * amt;

				handled = true;
				/* read more +/- */
				break;
			}
			default:
				*end = range;
				return handled;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %r12
movq %rdi, 0x8(%rsp)
movzbl (%rdi), %eax
leal -0x30(%rax), %ecx
cmpl $0xa, %ecx
movq %rsi, 0x10(%rsp)
jae 0xcbcc
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
movl $0xa, %edx
callq 0x4350
movq %rax, %r15
decl %r15d
movl %r15d, (%r14)
movb $0x1, %al
leaq 0x8(%rsp), %r12
movq 0x8(%rsp), %rbx
movzbl (%rbx), %ebp
cmpl $0x2d, %ebp
je 0xcb69
cmpl $0x2b, %ebp
jne 0xcbb3
leaq 0x1(%rbx), %r13
movq %r13, 0x8(%rsp)
callq 0x4540
movq (%rax), %rcx
movsbq 0x1(%rbx), %rdx
movl $0x1, %eax
testb $0x8, 0x1(%rcx,%rdx,2)
je 0xcb9e
movq %r13, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x4350
movl (%r14), %r15d
movl %eax, %ecx
negl %ecx
cmpb $0x2b, %bpl
cmovel %eax, %ecx
addl %ecx, %r15d
movl %r15d, (%r14)
movb $0x1, %al
jmp 0xcb57
movq 0x10(%rsp), %rcx
movq %rbx, (%rcx)
andb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x24, %eax
je 0xcbe8
cmpl $0x2e, %eax
jne 0xcc08
callq 0xdaf0
movq 0x30(%rax), %rax
movl 0x4(%rax), %r15d
movl %r15d, (%r14)
jmp 0xcbfb
callq 0xdaf0
movq (%rax), %rdi
callq 0x960e
movl %eax, %r15d
movl %eax, (%r14)
incq %r12
movq %r12, 0x8(%rsp)
jmp 0xcb50
callq 0xdaf0
movq 0x30(%rax), %rax
movl 0x4(%rax), %r15d
movl %r15d, (%r14)
xorl %eax, %eax
jmp 0xcb52
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/range.c
// Function: parse_range
enum range_parse parse_range(
		char *cmd, char **end,
		struct range *r)
{
	if(*cmd == '%'){
		r->start = 0;
		r->end = buffer_nlines(buffers_cur());
		*end = cmd + 1;
		return RANGE_PARSE_PASS;
	}

	if(!parse_range_1(cmd, end, &r->start))
		return RANGE_PARSE_NONE; /* no range */

	cmd = *end;
	if(*cmd == ','){
		cmd++;
		if(!parse_range_1(cmd, end, &r->end))
			return RANGE_PARSE_FAIL;
	}else{
		r->end = r->start;
	}

	return RANGE_PARSE_PASS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x25, (%rdi)
jne 0xcc55
movl $0x0, (%rbx)
callq 0xdaf0
movq (%rax), %rdi
callq 0x960e
movl %eax, 0x4(%rbx)
incq %r15
movq %r15, (%r14)
movl $0x2, %eax
jmp 0xcc90
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xcb08
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0xcc90
movq (%r14), %rdi
cmpb $0x2c, (%rdi)
jne 0xcc96
addq $0x4, %rbx
incq %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xcb08
movl %eax, %ecx
movl $0x1, %eax
testb %cl, %cl
jne 0xcc4e
popq %rbx
popq %r14
popq %r15
retq
movl (%rbx), %eax
movl %eax, 0x4(%rbx)
jmp 0xcc4e
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/parse_cmd.c
// Function: parse_cmd
void parse_cmd(char *cmd, int *pargc, char ***pargv, bool shellglob)
{
	int argc = *pargc;
	char **argv = *pargv;

	char *anchor, *p;
	p = anchor = cmd;
	while(*p){
		if(*p == '\\'){
			p++;
			continue;
		}
		if(!isspace(*p)){
			p++;
			continue;
		}

		*p++ = '\0';

		add_argv(&argv, &argc, &anchor, p, shellglob);
	}

	if(anchor != p)
		add_argv(&argv, &argc, &anchor, p, shellglob);

	*pargv = argv;
	*pargc = argc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq %rsi, 0x20(%rsp)
movl (%rsi), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %rdx, 0x18(%rsp)
movq (%rdx), %rax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
leaq 0x8(%rsp), %r13
movq %rdi, (%r13)
movzbl %cl, %ebp
movq %r14, %rbx
movzbl (%r14), %eax
cmpl $0x5c, %eax
je 0xcd2b
testl %eax, %eax
je 0xcd33
movsbq %al, %r15
callq 0x4540
movq (%rax), %rax
leaq 0x1(%rbx), %r14
testb $0x20, 0x1(%rax,%r15,2)
je 0xcce8
movb $0x0, (%rbx)
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
movq %r13, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0xcd7b
jmp 0xcce8
incq %rbx
movq %rbx, %r14
jmp 0xcce8
cmpq %rbx, 0x8(%rsp)
je 0xcd54
leaq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rcx
movl %ebp, %r8d
callq 0xcd7b
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movl 0x4(%rsp), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/parse_cmd.c
// Function: add_argv
static void add_argv(
		char ***pargv, int *pargc,
		char **panchor, char *current,
		bool shellglob)
{
#define argv (*pargv)
#define argc (*pargc)
#define anchor (*panchor)
	char *failbuf;

	glob_t globbed = { 0 };
	int argc_inc;
	char **argv_add;

	int flags = GLOB_MARK | GLOB_BRACE | GLOB_TILDE;

	if(shellglob && 0 == glob(anchor, flags, /*errfunc*/NULL, &globbed)){
		argc_inc = globbed.gl_pathc;
		argv_add = globbed.gl_pathv;
	}else{
		argc_inc = 1;
		argv_add = &failbuf;
		failbuf = anchor;
	}

	argv = urealloc(argv, (argc + argc_inc + 1) * sizeof *argv);
	for(int i = 0; i < argc_inc; i++)
		argv[argc + i] = ustrdup(argv_add[i]);

	argc += argc_inc;

	globfree(&globbed);

	anchor = current;
#undef argv
#undef argc
#undef anchor
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x50(%rsp)
testl %r8d, %r8d
je 0xcdd6
movq (%r14), %rdi
leaq 0x10(%rsp), %rcx
movl $0x1402, %esi           # imm = 0x1402
xorl %edx, %edx
callq 0x4490
testl %eax, %eax
je 0xce69
movq (%r14), %rax
leaq 0x60(%rsp), %rbp
movq %rax, (%rbp)
movl $0x1, %r13d
movq (%r12), %rdi
movl (%r15), %eax
addl %r13d, %eax
incl %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x584a
movq %rax, (%r12)
testl %r13d, %r13d
jle 0xce44
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r13d, %ebx
xorl %r14d, %r14d
movq (%rbp,%r14,8), %rdi
callq 0x585c
movq (%r12), %rdx
movslq (%r15), %rcx
leaq (%r14,%rcx), %rsi
movq %rax, (%rdx,%rsi,8)
incq %r14
cmpq %r14, %rbx
jne 0xce18
movq 0x8(%rsp), %rbx
movq (%rsp), %r14
jmp 0xce47
movl (%r15), %ecx
addl %r13d, %ecx
movl %ecx, (%r15)
leaq 0x10(%rsp), %rdi
callq 0x4050
movq %rbx, (%r14)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x10(%rsp), %r13d
movq 0x18(%rsp), %rbp
jmp 0xcde8
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/word.c
// Function: word_state
enum word_state word_state(
		const list_t *l, int x, bool big_words)
{
	if(l && 0 <= x && (unsigned)x < l->len_line){
		const char ch = l->line[x];

		if(isspace(ch))
			return W_SPACE;
		else if(big_words)
			return W_KEYWORD;
		else if(isalnum(ch) || ch == '_')
			return W_KEYWORD;
		return W_NON_KWORD;
	}

	return W_NONE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
testq %rdi, %rdi
sete %cl
testl %esi, %esi
sets %dl
xorl %eax, %eax
orb %cl, %dl
jne 0xd1b0
movl %esi, %ecx
cmpq %rcx, 0x8(%rdi)
jbe 0xd1b0
movq (%rdi), %rax
movsbq (%rax,%rcx), %r14
callq 0x4540
movq (%rax), %rax
movzwl (%rax,%r14,2), %ecx
movl %ecx, %edx
shrl $0xd, %edx
andl $0x1, %edx
orb %dl, %bl
movl $0x2, %eax
je 0xd19d
subl %edx, %eax
jmp 0xd1b0
xorl %edx, %edx
testb $0x8, %cl
sete %dl
cmpb $0x5f, %r14b
leal 0x2(%rdx,%rdx), %ecx
cmovnel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/word.c
// Function: word_seek
list_t *word_seek(
		list_t *l, int dir, point_t *to,
		enum word_state target, bool big_words)
{
	while((word_state(l, to->x, big_words) & target) == 0){
		const int y = to->y;

		l = list_advance_x(l, dir, &to->y, &to->x);

		if(!l)
			break;
		if(y != to->y)
			break; /* newlines are a fresh start */
	}
	return l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
leaq 0x4(%rdx), %r12
movzbl %r8b, %r13d
movl (%r14), %esi
movq %r15, %rdi
movl %r13d, %edx
callq 0xd154
testl %eax, 0x4(%rsp)
jne 0xd212
movl 0x4(%r14), %ebx
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0xabbf
testq %rax, %rax
je 0xd20f
movq %rax, %r15
cmpl (%r12), %ebx
je 0xd1d7
jmp 0xd212
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/word.c
// Function: word_seek_to_end
void word_seek_to_end(list_t *l, int dir, point_t *to, bool big_words)
{
	/* put us on the start/end of the word */
	const enum word_state st = word_state(l, to->x, big_words);

	if(st != W_NONE)
		while(word_state(l, to->x + dir, big_words) == st)
			to->x += dir;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movl %esi, %r14d
movq %rdi, %r15
movq %rdx, 0x10(%rsp)
movl (%rdx), %esi
movq %rsi, 0x8(%rsp)
movl %ecx, %edx
callq 0xd154
testl %eax, %eax
je 0xd29a
movl %eax, %ebp
movq 0x8(%rsp), %rax
leal (%rax,%r14), %r12d
movzbl %bl, %r13d
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0xd154
cmpl %ebp, %eax
jne 0xd29a
movq 0x8(%rsp), %rax
leal (%rax,%r14,2), %ebx
movq 0x10(%rsp), %rax
movl %r12d, (%rax)
addl %r14d, %r12d
movq %r15, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0xd154
addl %r14d, %ebx
cmpl %ebp, %eax
je 0xd27b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/buffers.c
// Function: buffers_find
buffer_t *buffers_find(const char *fname)
{
	if(!windows_cur()) /* called on startup */
		return 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 *thisfname = buffer_fname(buf);

			if(thisfname && !strcmp(thisfname, fname))
				return buf;
		}
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0xdaf0
testq %rax, %rax
je 0xd325
callq 0xdbec
testq %rax, %rax
je 0xd325
movq %rax, %r14
movq (%r14), %rdi
callq 0xd4d9
testq %rax, %rax
je 0xd314
movq %rax, %r15
movq %r15, %r13
movq (%r13), %r12
movq %r12, %rdi
callq 0x9216
testq %rax, %rax
je 0xd302
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42e0
testl %eax, %eax
je 0xd328
movq 0x58(%r13), %r13
testq %r13, %r13
jne 0xd2e2
movq 0x50(%r15), %r15
testq %r15, %r15
jne 0xd2df
movq 0x8(%r14), %r14
movl $0x0, %r12d
testq %r14, %r14
jne 0xd2cf
jmp 0xd328
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/buffers.c
// Function: buffers_modified_excluding
window *buffers_modified_excluding(buffer_t *excluding, tab **const ptab)
{
	if(ptab)
		*ptab = NULL;

	for(tab *tab = tabs_first(); tab; tab = tab->next){
		window *win;
		ITER_WINDOWS_FROM(win, tab->win){
			buffer_t *buf = win->buf;
			if(buf != excluding && buf->modified){
				if(ptab)
					*ptab = tab;
				return win;
			}
		}
	}

	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0xd366
movq $0x0, (%rbx)
callq 0xdbec
testq %rax, %rax
je 0xd3b3
movq %rax, %r15
movq (%r15), %rdi
callq 0xd4d9
testq %rax, %rax
je 0xd3aa
movq %rax, %rcx
movq (%rcx), %rdx
cmpq %r14, %rdx
je 0xd39b
movb 0x39(%rdx), %dl
testq %rbx, %rbx
je 0xd397
testb %dl, %dl
jne 0xd3b7
testb %dl, %dl
jne 0xd3ba
movq 0x58(%rcx), %rcx
testq %rcx, %rcx
jne 0xd383
movq 0x50(%rax), %rax
jmp 0xd37b
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xd373
xorl %ecx, %ecx
jmp 0xd3ba
movq %r15, (%rbx)
movq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/window.c
// Function: window_calc_rects
void window_calc_rects(
		window *topleft,
		const unsigned screentop,
		const unsigned screenwidth,
		const unsigned screenheight)
{
	unsigned nwins_h = 0;
	window *win_h;
	for(win_h = topleft; win_h; win_h = win_h->neighbours.right, nwins_h++);

	const unsigned nvlines = nwins_h + 1;
	const unsigned winspace_v = screenwidth - nvlines;
	unsigned winwidth = winspace_v / nwins_h;

	unsigned i_h;
	for(i_h = 0, win_h = topleft; win_h; win_h = win_h->neighbours.right, i_h++){
		unsigned nwins_v = 0;
		window *win_v;
		for(win_v = win_h; win_v; win_v = win_v->neighbours.below)
			nwins_v++;

		/* final win gets any left over cols */
		if(!win_h->neighbours.right)
			winwidth += winspace_v % nwins_h;

		const unsigned nhlines = nwins_v - 1;
		const unsigned winspace_h = screenheight - nhlines;
		const unsigned winheight = winspace_h / nwins_v;

		unsigned i_v;
		for(i_v = 0, win_v = win_h; win_v; win_v = win_v->neighbours.below, i_v++){
			rect_t r = {
				.x = i_h * (winwidth + 1),
				.y = i_v * (winheight + 1) + screentop,
				.w = winwidth,
				.h = winheight,
			};

			/* final win gets any left over lines */
			if(!win_v->neighbours.below)
				r.h += winspace_h % nwins_v;

			win_v->screen_coord = r;
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0xd4b7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %r11d, %r11d
movq %rdi, %rax
movq 0x50(%rax), %rax
incl %r11d
testq %rax, %rax
jne 0xd3dd
testq %rdi, %rdi
je 0xd4ad
movl %r11d, %r8d
notl %r8d
addl %edx, %r8d
xorl %r10d, %r10d
movl %r8d, %eax
xorl %edx, %edx
divl %r11d
movl %eax, %r9d
movl %r8d, %eax
xorl %edx, %edx
divl %r11d
movl %edx, %r8d
incl %ecx
movl %r9d, %eax
movq %rdi, %r11
xorl %ebx, %ebx
movq %rdi, %rdx
incl %ebx
movq 0x58(%rdx), %rdx
testq %rdx, %rdx
jne 0xd421
movq 0x50(%r11), %rdi
movq 0x58(%r11), %r14
leal (%r8,%rax), %r9d
testq %rdi, %rdi
cmovnel %eax, %r9d
movl %ecx, %eax
subl %ebx, %eax
xorl %edx, %edx
divl %ebx
leal 0x1(%r9), %ebx
imull %r10d, %ebx
testq %r14, %r14
je 0xd48a
leal 0x1(%rax), %r12d
xorl %r13d, %r13d
movl %esi, %ebp
movq %r14, %r15
movl %ebx, 0x10(%r11)
movl %ebp, 0x14(%r11)
movl %r9d, 0x18(%r11)
movl %eax, 0x1c(%r11)
incl %r13d
movl %r13d, %ebp
imull %r12d, %ebp
addl %esi, %ebp
movq 0x58(%r14), %r14
movq %r15, %r11
testq %r14, %r14
jne 0xd45d
jmp 0xd48f
movq %r11, %r15
movl %esi, %ebp
addl %eax, %edx
incl %r10d
movl %ebx, 0x10(%r15)
movl %ebp, 0x14(%r15)
movl %r9d, 0x18(%r15)
movl %edx, 0x1c(%r15)
testq %rdi, %rdi
jne 0xd416
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/window.c
// Function: window_next
window *window_next(window *cur)
{
#define RET_IF(x) if(x) return x
	RET_IF(cur->neighbours.below);
	RET_IF(cur->neighbours.above);
	RET_IF(cur->neighbours.right);
	RET_IF(cur->neighbours.left);
#undef RET_IF
	return NULL;
}

// Assembly:
movq 0x58(%rdi), %rax
testq %rax, %rax
je 0xd4c2
retq
movq 0x60(%rdi), %rax
testq %rax, %rax
jne 0xd4c1
movq 0x50(%rdi), %rax
testq %rax, %rax
jne 0xd4c1
movq 0x48(%rdi), %rax
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/window.c
// Function: window_toscreen
point_t window_toscreen(const window *win, point_t const *pt)
{
	list_t *l = list_seek(win->buf->head, win->ui_pos->y, 0);
	int xoff = 0;

	if(l && l->len_line > 0)
		for(int x = MIN((unsigned)win->ui_pos->x, l->len_line - 1);
				x >= 0;
				x--)
			xoff += nc_charlen(l->line[x]) - 1;

	return (point_t){
		win->screen_coord.x + pt->x - win->ui_start.x + xoff,
		win->screen_coord.y + pt->y - win->ui_start.y
	};
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x30(%rdi), %rcx
movq 0x8(%rax), %rdi
movl 0x4(%rcx), %esi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x9d35
testq %rax, %rax
je 0xd90b
movq %rax, %r12
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xd90b
movq 0x30(%rbx), %rcx
movl (%rcx), %ecx
decq %rax
cmpq %rcx, %rax
cmoval %ecx, %eax
testl %eax, %eax
js 0xd90b
movl %eax, %r13d
incq %r13
xorl %r15d, %r15d
movq (%r12), %rax
movsbl -0x1(%rax,%r13), %edi
callq 0x4b9f
addl %eax, %r15d
decl %r15d
decq %r13
jne 0xd8f1
addl 0x10(%rbx), %r15d
addl (%r14), %r15d
subl 0x8(%rbx), %r15d
movl 0x4(%r14), %eax
addl 0x14(%rbx), %eax
subl 0xc(%rbx), %eax
shlq $0x20, %rax
orq %rax, %r15
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/window.c
// Function: window_setmode
int window_setmode(window *win, enum buf_mode m)
{
	if(!m || (m & (m - 1))){
		return -1;
	}else{
		if(win->ui_mode & UI_INSERT_ANY)
			win->buf->prev_insert = *win->ui_pos;

		if(m & UI_VISUAL_ANY){
			if((win->ui_mode & UI_VISUAL_ANY) == 0){
				/* from non-visual to visual */
				*window_uipos_alt(win) = *win->ui_pos;
			}
		}else{
			/* from a visual, save state */
			win->buf->prev_visual.mode = win->ui_mode;

			win->buf->prev_visual.npos = *win->ui_pos;
			win->buf->prev_visual.vpos = *window_uipos_alt(win);
		}

		win->ui_mode = m;
		return 0;
	}
}

// Assembly:
leal -0x1(%rsi), %ecx
movl %esi, %edx
xorl %ecx, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %edx
jbe 0xd9ae
testb $0x6, 0x40(%rdi)
je 0xd958
movq (%rdi), %rax
movq 0x30(%rdi), %rcx
movq (%rcx), %rcx
movq %rcx, 0x24(%rax)
movl 0x40(%rdi), %eax
testb $0x38, %sil
je 0xd97f
testb $0x38, %al
jne 0xd9a9
movq 0x30(%rdi), %rax
leaq 0x28(%rdi), %rcx
xorl %edx, %edx
cmpq %rcx, %rax
setne %dl
movq (%rax), %rax
movq %rax, 0x20(%rdi,%rdx,8)
jmp 0xd9a9
movq (%rdi), %rcx
movl %eax, 0x20(%rcx)
movq 0x30(%rdi), %rax
movq (%rax), %rax
movq %rax, 0x10(%rcx)
leaq 0x28(%rdi), %rax
xorl %ecx, %ecx
cmpq %rax, 0x30(%rdi)
movq (%rdi), %rax
setne %cl
movq 0x20(%rdi,%rcx,8), %rcx
movq %rcx, 0x18(%rax)
movl %esi, 0x40(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/window.c
// Function: window_inschar
void window_inschar(window *win, char ch)
{
	if(win->ui_mode != UI_INSERT_COL || isnewline(ch)){
		/* can't col-insert a newline, revert */
		if(win->ui_mode == UI_INSERT_COL)
			window_setmode(win, UI_INSERT);

		buffer_inscolchar(win->buf, ch, 1, win->ui_pos);
	}else{
		buffer_inscolchar(win->buf, ch, win->buf->col_insert_height, win->ui_pos);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpl $0x4, 0x40(%rdi)
movsbl %sil, %ebx
jne 0xd9d7
cmpl $0xd, %ebx
je 0xd9ca
cmpl $0xa, %ebx
jne 0xd9f1
movq %r14, %rdi
movl $0x2, %esi
callq 0xd934
movq (%r14), %rdi
movq 0x30(%r14), %rcx
movl %ebx, %esi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x93a9
movq (%r14), %rdi
movq 0x30(%r14), %rcx
movl 0x48(%rdi), %edx
movl %ebx, %esi
jmp 0xd9e5
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/window.c
// Function: window_replace_fname
bool window_replace_fname(window *win, const char *fname, const char **const err)
{
	buffer_t *buf = NULL;
	buffer_new_fname(&buf, fname, err);

	if(!*err){
		window_replace_buffer(win, buf);
		buffer_release(buf);
	}

	return !*err;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq %rsp, %rdi
movq $0x0, (%rdi)
callq 0x90cd
cmpq $0x0, (%rbx)
je 0xda78
xorl %eax, %eax
jmp 0xda9b
movq (%rsp), %rsi
movq %r14, %rdi
callq 0xd9ff
movq (%rsp), %rdi
leaq -0x4b5b(%rip), %rsi     # 0x8f34
callq 0xcaff
cmpq $0x0, (%rbx)
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/window.c
// Function: window_reload_buffer
bool window_reload_buffer(window *win, const char **const err)
{
	const char *fname = buffer_fname(win->buf);
	if(!fname)
		return false;

	/* need to update the buffer's list, not the window,
	 * since there may be multiple windows with the old buffer */
	buffer_replace_fname(win->buf, fname, err);

	return !*err;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x9216
testq %rax, %rax
je 0xdad1
movq (%r14), %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x8f9a
cmpq $0x0, (%rbx)
sete %al
jmp 0xdad3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/tab.c
// Function: tab_free
void tab_free(tab *t)
{
	if(t->win){
		window_free(t->win);
		t->win = NULL;
	}

	if(t == tabs_first())
		tabs_set_first(t->next);

	free(t);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xdb4f
callq 0xd806
movq $0x0, (%rbx)
callq 0xdbec
cmpq %rbx, %rax
jne 0xdb62
movq 0x8(%rbx), %rdi
callq 0xdbf4
movq %rbx, %rdi
popq %rbx
jmp 0x4080
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/tab.c
// Function: tab_evict
void tab_evict(tab *t)
{
	tab *i;

	for(i = tabs_first(); i; i = i->next){
		if(i->next == t){
			i->next = t->next;
			break;
		}
	}

	t->next = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xdbec
testq %rax, %rax
je 0xdb91
movq %rax, %rcx
movq 0x8(%rax), %rax
cmpq %rbx, %rax
jne 0xdb78
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rcx)
movq $0x0, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/tab.c
// Function: tab_contains_buffer
bool tab_contains_buffer(tab *t, buffer_t *b)
{
	window *win;
	ITER_WINDOWS_FROM(win, t->win)
		if(win->buf == b)
			return true;

	return false;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0xd4d9
testq %rax, %rax
je 0xdbd5
movq %rax, %rcx
cmpq %rbx, (%rcx)
je 0xdbd1
movq 0x58(%rcx), %rcx
testq %rcx, %rcx
jne 0xdbbd
movq 0x50(%rax), %rax
jmp 0xdbb5
movb $0x1, %al
jmp 0xdbd7
xorl %eax, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/tabs.c
// Function: tabs_init
void tabs_init(enum init_args init_args, unsigned off)
{
	char *next = args_next_fname(true);

	if(next){
		const char *err = NULL;
		buffer_t *buf;

		if(!strcmp(next, "-")){
			buf = buffer_new_file_nofind(stdin);
			buf->modified = true; /* editing a stream */
			/* no filename */

			if(ferror(stdin))
				err = strerror(errno);

			freopen("/dev/tty", "r", stdin);
			/* if we can't open it we'll exit soon anyway */

		}else{
			buffer_new_fname(&buf, next, &err);
		}

		if(err)
			ui_err("\"%s\": %s", next, err);

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

		tabs_set_cur(tab);

		switch(init_args){
			case INIT_NONE:
				break;

			case INIT_VALL:
				load_argv(win_add_splitright);
				break;

			case INIT_HALL:
				load_argv(win_add_splittop);
				break;
		}

	}else{
		buffer_t *empty = buffer_new();

		window *win = window_new(empty);
		buffer_release(empty);

		tab *tab = tab_new(win);

		tabs_set_cur(tab);
	}

	tabs_set_first(tabs_cur());

	windows_cur()->ui_pos->y = off;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movl %edi, %ebp
movl $0x1, %edi
callq 0x47bc
testq %rax, %rax
je 0xdcea
movq %rax, %r14
movq $0x0, 0x10(%rsp)
cmpb $0x2d, (%rax)
jne 0xdc79
cmpb $0x0, 0x1(%r14)
je 0xdd52
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x90cd
movq (%r15), %r15
testq %r15, %r15
je 0xdcaa
leaq 0xddc(%rip), %rdi       # 0xea79
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4de2
movq 0x8(%rsp), %rdi
callq 0xd7c4
movq %rax, %rdi
callq 0xdb1c
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq -0x4d97(%rip), %rsi     # 0x8f34
callq 0xcaff
movq %r14, 0x8741(%rip)      # 0x16418
cmpl $0x1, %ebp
je 0xdd1d
cmpl $0x2, %ebp
jne 0xdd29
leaq 0x162(%rip), %rdi       # 0xde4a
jmp 0xdd24
callq 0x8f53
movq %rax, %r14
movq %rax, %rdi
callq 0xd7c4
movq %rax, %r15
leaq -0x4dd0(%rip), %rsi     # 0x8f34
movq %r14, %rdi
callq 0xcaff
movq %r15, %rdi
callq 0xdb1c
movq %rax, 0x86fd(%rip)      # 0x16418
jmp 0xdd30
leaq 0x119(%rip), %rdi       # 0xde3d
callq 0xddb3
movq 0x86e8(%rip), %rax      # 0x16418
movq %rax, 0x86e9(%rip)      # 0x16420
callq 0xdaf0
movq 0x30(%rax), %rax
movl %ebx, 0x4(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8247(%rip), %r13      # 0x15fa0
movq (%r13), %rdi
callq 0x9080
movq %rax, 0x8(%rsp)
movb $0x1, 0x39(%rax)
movq (%r13), %r12
movq %r12, %rdi
callq 0x40f0
testl %eax, %eax
je 0xdd95
callq 0x40a0
movl (%rax), %edi
callq 0x44e0
movq %rax, %r15
movq %rax, 0x10(%rsp)
movq (%r13), %r12
jmp 0xdd98
xorl %r15d, %r15d
leaq 0xcd1(%rip), %rdi       # 0xea70
leaq 0x647(%rip), %rsi       # 0xe3ed
movq %r12, %rdx
callq 0x4250
jmp 0xdc91
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/tabs.c
// Function: load_argv
static void load_argv(void onload(window *cur, window *new))
{
	window *prev_win = windows_cur();
	char *next;

	while((next = args_next_fname(true))){
		buffer_t *buf;
		const char *err;

		buffer_new_fname(&buf, next, &err);

		window *w = window_new(buf);

		buffer_release(buf);

		onload(prev_win, w);

		prev_win = w;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xdaf0
movq %rax, %r15
movl $0x1, %edi
callq 0x47bc
testq %rax, %rax
je 0xde2e
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r12
leaq -0x4eb8(%rip), %r13     # 0x8f34
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x90cd
movq 0x8(%rsp), %rdi
callq 0xd7c4
movq %rax, %rbp
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0xcaff
movq %r15, %rdi
movq %rbp, %rsi
callq *%rbx
movl $0x1, %edi
callq 0x47bc
movq %rbp, %r15
testq %rax, %rax
jne 0xddec
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/bobrippling[P]tim/ctags.c
// Function: ctag_search
bool ctag_search(const char *ident, struct ctag_result *tag)
{
	FILE *f = fopen("tags", "r");
	if(!f)
		return false;

	bool found = false;

	char buf[256];
	while(fgets(buf, sizeof buf, f)){
		char *end = strchr(buf, '\t');
		if(!end || !end[1])
			continue;
		*end = '\0';
		if(!strcmp(buf, ident)){
			char *fname = end + 1;
			end = strchr(end + 1, '\t');
			if(!end || !end[1])
				continue;
			*end = '\0';

			char *nl = strchr(end + 1, '\n');
			if(nl)
				*nl = '\0';

			tag->fname = ustrdup(fname);
			tag->line = ustrdup(end + 1);
			found = true;
			break;
		}
	}

	fclose(f);
	return found;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %r14
movq %rdi, %r15
leaq 0xbe8(%rip), %rdi       # 0xea82
leaq 0x54c(%rip), %rsi       # 0xe3ed
callq 0x4440
testq %rax, %rax
je 0xdf35
movq %rax, %rbx
movq %rsp, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rax, %rdx
callq 0x42c0
testq %rax, %rax
je 0xdf29
movq %rsp, %r12
movq %r12, %rdi
movl $0x9, %esi
callq 0x41c0
testq %rax, %rax
je 0xdf14
movq %rax, %r13
cmpb $0x0, 0x1(%rax)
je 0xdf14
movb $0x0, (%r13)
movq %r12, %rdi
movq %r15, %rsi
callq 0x42e0
testl %eax, %eax
jne 0xdf14
incq %r13
movq %r13, %rdi
movl $0x9, %esi
callq 0x41c0
testq %rax, %rax
je 0xdf14
cmpb $0x0, 0x1(%rax)
jne 0xdf4b
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdx
callq 0x42c0
testq %rax, %rax
jne 0xdeca
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x4150
jmp 0xdf37
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
incq %r15
movb $0x0, (%rax)
movq %r15, %rdi
movl $0xa, %esi
callq 0x41c0
testq %rax, %rax
je 0xdf69
movb $0x0, (%rax)
movq %r13, %rdi
callq 0x585c
movq %rax, (%r14)
movq %r15, %rdi
callq 0x585c
movq %rax, 0x8(%r14)
movb $0x1, %bpl
jmp 0xdf2b
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: validate_directory_path
static int validate_directory_path(const char *dir)
{
	struct stat fstat;

	if (stat(dir, &fstat) != 0) {
		fprintf(stderr, "xcrun: error: unable to validate path \'%s\' (%s)\n", dir, strerror(errno));
		return -1;
	}

	if (S_ISDIR(fstat.st_mode) == 0) {
		fprintf(stderr, "xcrun: error: \'%s\' is not a valid path\n", dir);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq %rsp, %rsi
callq 0x2150
testl %eax, %eax
jne 0x3a45
movl $0xf000, %ecx           # imm = 0xF000
andl 0x18(%rsp), %ecx
xorl %eax, %eax
cmpl $0x4000, %ecx           # imm = 0x4000
jne 0x3a4f
addq $0x90, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0x24b6
jmp 0x3a6a
movq 0x459a(%rip), %rax      # 0x7ff0
movq (%rax), %rdi
leaq 0x1ed8(%rip), %rsi      # 0x5938
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2130
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3a3c
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: stripext
static void stripext(char *dst, const char *src)
{
	int len;
	char *s;

	if ((s = strchr(src, '.')) != NULL)
		len = (s - src);
	else
		len = strlen(src);

	strncpy(dst, src, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x20b0
testq %rax, %rax
je 0x3a92
subq %rbx, %rax
jmp 0x3a9a
movq %rbx, %rdi
callq 0x20a0
movslq %eax, %rdx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2060
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: get_sdk_info
static sdk_config get_sdk_info(const char *path)
{
	sdk_config config;
	char info_path[PATH_MAX] = { 0 };

	sprintf(info_path, "%s/info.ini", path);

	if (ini_parse(info_path, sdk_cfg_handler, &config) != (-1))
		return config;

	fprintf(stderr, "xcrun: error: failed to retrieve sdk info from '\%s\'. (%s)\n", info_path, strerror(errno));

	exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
xorl %esi, %esi
callq 0x20d0
leaq 0x1eab(%rip), %rsi      # 0x5a06
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0x2ed(%rip), %rsi       # 0x3e5c
movq %r15, %rdi
movq %r14, %rdx
callq 0x29fd
cmpl $-0x1, %eax
je 0x3b8c
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rdi
callq 0x255a
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: get_toolchain_path
static char *get_toolchain_path(const char *name)
{
	char *devpath, *path;

	devpath = developer_dir;
	path = (char *)calloc(PATH_MAX, sizeof(char));

	if (devpath == NULL) {
		fprintf(stderr, "xcrun: error: failed to retrieve developer path, do you have it set?\n");
		goto failure;
	}

	sprintf(path, "%s/Toolchains/%s.toolchain", devpath, name);
	if (validate_directory_path(path) != (-1))
		return path;

	fprintf(stderr, "xcrun: error: \'%s\' is not a valid toolchain path.\n", path);

failure:
	free(path);
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1000, %edi           # imm = 0x1000
movl $0x1, %esi
callq 0x2110
movq %rax, %rbx
leaq 0x1eda(%rip), %rsi      # 0x5a8e
leaq 0x4795(%rip), %rdx      # 0x8350
movq %rax, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rdi
callq 0x3a12
cmpl $-0x1, %eax
je 0x3be0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2596
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: get_toolchain_info
static toolchain_config get_toolchain_info(const char *path)
{
	toolchain_config config;
	char info_path[PATH_MAX] = { 0 };

	sprintf(info_path, "%s/info.ini", path);

	if (ini_parse(info_path, toolchain_cfg_handler, &config) != (-1))
		return config;

	fprintf(stderr, "xcrun: error: failed to retrieve toolchain info from '\%s\'. (%s)\n", info_path, strerror(errno));

	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq 0x20d0
leaq 0x1df6(%rip), %rsi      # 0x5a06
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0x349(%rip), %rsi       # 0x3f6d
movq %rsp, %rdx
movq %r14, %rdi
callq 0x29fd
cmpl $-0x1, %eax
je 0x3c48
movq (%rsp), %rax
movq 0x8(%rsp), %rdx
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r14
retq
leaq 0x10(%rsp), %rdi
callq 0x25c5
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: get_target_triple
static char *get_target_triple(const char *current_sdk)
{
	char *triple, *default_arch, *deployment_target;

	if ((triple = getenv("TARGET_TRIPLE")) != NULL)
		return triple;

	triple = (char *)calloc(NAME_MAX, sizeof(char));

	if ((default_arch = strdup(get_sdk_info(get_sdk_path(current_sdk)).default_arch)) == NULL)
		return NULL;

	if ((deployment_target = strdup(get_sdk_info(get_sdk_path(current_sdk)).deployment_target)) == NULL)
		return NULL;

	parse_target_triple(triple, deployment_target, default_arch);

	return triple;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
leaq 0x1ebb(%rip), %rdi      # 0x5b1d
callq 0x2030
movq %rax, %rbx
testq %rax, %rax
jne 0x3dc4
movl $0xff, %edi
movl $0x1, %esi
callq 0x2110
movq %rax, %rbx
callq 0x3ae4
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3b30
movq 0x18(%r14), %rdi
callq 0x2200
testq %rax, %rax
je 0x3cf9
movq %rax, %r14
callq 0x3ae4
movq %rsp, %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x3b30
movq 0x20(%r15), %rdi
callq 0x2200
testq %rax, %rax
je 0x3cf9
movq %rax, %r15
leaq 0x1e55(%rip), %rsi      # 0x5b2b
movq %r14, %rdi
callq 0x2120
testl %eax, %eax
je 0x3d00
leaq 0x1e49(%rip), %rsi      # 0x5b32
movq %r14, %rdi
callq 0x2120
testl %eax, %eax
je 0x3d00
xorl %eax, %eax
jmp 0x3d02
xorl %ebx, %ebx
jmp 0x3dc4
movb $0x1, %al
xorl %ecx, %ecx
movl $0x1, %esi
xorl %edx, %edx
movsbl (%r15), %edi
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x3d33
cmpl $0x2, %esi
je 0x3d37
cmpl $0x1, %esi
jne 0x3d45
leal (%rcx,%rcx,4), %ecx
leal (%rdi,%rcx,2), %ecx
addl $-0x30, %ecx
movl $0x1, %esi
jmp 0x3d45
incl %esi
jmp 0x3d45
leal (%rdx,%rdx,4), %edx
leal (%rdi,%rdx,2), %edx
addl $-0x30, %edx
movl $0x2, %esi
incq %r15
testb %dil, %dil
jne 0x3d0b
addl $-0x2, %ecx
cmpl $0x9, %ecx
ja 0x3d6c
leaq 0x1300(%rip), %rsi      # 0x505c
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movl $0xe, %ecx
jmp 0x3db0
movl $0x9, %ecx
jmp 0x3db0
movl $0x11, %ecx
jmp 0x3db0
movl $0xd, %ecx
jmp 0x3db0
movl $0xf, %ecx
jmp 0x3db0
xorl %ecx, %ecx
cmpl $0x3, %edx
setl %cl
xorl $0xb, %ecx
jmp 0x3db0
movl $0xb, %ecx
jmp 0x3db0
movl $0xa, %ecx
jmp 0x3db0
addl $0x4, %edx
testb %al, %al
movl $0x10, %ecx
cmovnel %edx, %ecx
leaq 0x1d80(%rip), %rsi      # 0x5b37
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: default_cfg_handler
static int default_cfg_handler(void *user, const char *section, const char *name, const char *value)
{
	default_config *config = (default_config *)user;

	if (MATCH_INI_STON("SDK", "name"))
		config->sdk = strdup(value);
	else if (MATCH_INI_STON("TOOLCHAIN", "name"))
		config->toolchain = strdup(value);
	else
		return 0;

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x1bcb(%rip), %rsi      # 0x59b7
movq %r12, %rdi
callq 0x2120
testl %eax, %eax
jne 0x3e0b
leaq 0x1bbc(%rip), %rsi      # 0x59bb
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
je 0x3e41
leaq 0x1bae(%rip), %rsi      # 0x59c0
movq %r12, %rdi
callq 0x2120
xorl %ebp, %ebp
testl %eax, %eax
jne 0x3e51
leaq 0x1b94(%rip), %rsi      # 0x59bb
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
jne 0x3e51
movq %r14, %rdi
callq 0x2200
movq %rax, 0x8(%rbx)
jmp 0x3e4c
movq %r14, %rdi
callq 0x2200
movq %rax, (%rbx)
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: sdk_cfg_handler
static int sdk_cfg_handler(void *user, const char *section, const char *name, const char *value)
{
	sdk_config *config = (sdk_config *)user;

	if (MATCH_INI_STON("SDK", "name"))
		config->name = strdup(value);
	else if (MATCH_INI_STON("SDK", "version"))
		config->version = strdup(value);
	else if (MATCH_INI_STON("SDK", "toolchain"))
		config->toolchain = strdup(value);
	else if (MATCH_INI_STON("SDK", "default_arch"))
		config->default_arch = strdup(value);
	else if (MATCH_INI_STON("SDK", "iphoneos_deployment_target")) {
		ios_deployment_target_set = 1;
		macosx_deployment_target_set = 0;
		config->deployment_target = strdup(value);
	} else if (MATCH_INI_STON("SDK", "macosx_deployment_target")) {
		ios_deployment_target_set = 0;
		macosx_deployment_target_set = 1;
		config->deployment_target = strdup(value);
	} else
		return 0;

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x1b41(%rip), %rsi      # 0x59b7
movq %rax, %rdi
callq 0x2120
xorl %ebp, %ebp
testl %eax, %eax
jne 0x3f60
leaq 0x1b2c(%rip), %rsi      # 0x59bb
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
je 0x3f0a
leaq 0x1417(%rip), %rsi      # 0x52b9
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
je 0x3f17
leaq 0x1bea(%rip), %rsi      # 0x5a9f
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
je 0x3f25
leaq 0x1b85(%rip), %rsi      # 0x5a4d
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
je 0x3f33
leaq 0x1b7f(%rip), %rsi      # 0x5a5a
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
je 0x3f41
leaq 0x1b87(%rip), %rsi      # 0x5a75
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
jne 0x3f60
movb $0x0, 0x74c3(%rip)      # 0xb3c4
movb $0x1, 0x74c0(%rip)      # 0xb3c8
jmp 0x3f4f
movq %r14, %rdi
callq 0x2200
movq %rax, (%rbx)
jmp 0x3f5b
movq %r14, %rdi
callq 0x2200
movq %rax, 0x8(%rbx)
jmp 0x3f5b
movq %r14, %rdi
callq 0x2200
movq %rax, 0x10(%rbx)
jmp 0x3f5b
movq %r14, %rdi
callq 0x2200
movq %rax, 0x18(%rbx)
jmp 0x3f5b
movb $0x1, 0x747c(%rip)      # 0xb3c4
movb $0x0, 0x7479(%rip)      # 0xb3c8
movq %r14, %rdi
callq 0x2200
movq %rax, 0x20(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/xcrun.c
// Function: toolchain_cfg_handler
static int toolchain_cfg_handler(void *user, const char *section, const char *name, const char *value)
{
	toolchain_config *config = (toolchain_config *)user;

	if (MATCH_INI_STON("TOOLCHAIN", "name"))
		config->name = strdup(value);
	else if (MATCH_INI_STON("TOOLCHAIN", "version"))
		config->version = strdup(value);
	else
		return 0;

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x1a39(%rip), %rsi      # 0x59c0
movq %rax, %rdi
callq 0x2120
xorl %ebp, %ebp
testl %eax, %eax
jne 0x3fd9
leaq 0x1a1f(%rip), %rsi      # 0x59bb
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
je 0x3fc9
leaq 0x130a(%rip), %rsi      # 0x52b9
movq %r15, %rdi
callq 0x2120
testl %eax, %eax
jne 0x3fd9
movq %r14, %rdi
callq 0x2200
movq %rax, 0x8(%rbx)
jmp 0x3fd4
movq %r14, %rdi
callq 0x2200
movq %rax, (%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/chatziko-k08[P]lecture-code/tests/../modules/UsingHashTable/ADTMap.c
// Function: map_create
Map map_create(CompareFunc compare, DestroyFunc destroy_key, DestroyFunc destroy_value) {
	// Δεσμεύουμε κατάλληλα τον χώρο που χρειαζόμαστε για το hash table
	Map map = malloc(sizeof(*map));
	map->capacity = prime_sizes[0];
	map->array = malloc(map->capacity * sizeof(struct map_node));

	// Αρχικοποιούμε τους κόμβους που έχουμε σαν διαθέσιμους.
	for (int i = 0; i < map->capacity; i++)
		map->array[i].state = EMPTY;

	map->size = 0;
	map->deleted = 0;
	map->compare = compare;
	map->destroy_key = destroy_key;
	map->destroy_value = destroy_value;

	return map;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x38, %edi
callq 0x21a0
movq %rax, %r12
movslq 0x434a(%rip), %r13      # 0x9170
movl %r13d, 0x8(%rax)
leaq (,%r13,8), %rax
leaq (%rax,%rax,2), %rdi
callq 0x21a0
movq %rax, (%r12)
testq %r13, %r13
jle 0x4f4a
leal 0x3(%r13), %ecx
decq %r13
movq %r13, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %ecx
shlq $0x5, %rcx
leaq (%rcx,%rcx,2), %rcx
movdqa 0x2134(%rip), %xmm1     # 0x6fa0
movdqa 0x213c(%rip), %xmm2     # 0x6fb0
xorl %edx, %edx
movdqa 0x2142(%rip), %xmm3     # 0x6fc0
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x2142(%rip), %xmm5     # 0x6fd0
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x4ecb
movl $0x0, 0x10(%rax,%rdx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x4ee2
movl $0x0, 0x28(%rax,%rdx)
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %esi
testb $0x1, %sil
je 0x4f22
movl $0x0, 0x40(%rax,%rdx)
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x4f35
movl $0x0, 0x58(%rax,%rdx)
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x60, %rdx
cmpq %rdx, %rcx
jne 0x4e8e
movq $0x0, 0xc(%r12)
movq %r15, 0x18(%r12)
movq %r14, 0x28(%r12)
movq %rbx, 0x30(%r12)
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/chatziko-k08[P]lecture-code/tests/../modules/UsingHashTable/ADTMap.c
// Function: map_remove
bool map_remove(Map map, Pointer key) {
	MapNode node = map_find_node(map, key);
	if (node == MAP_EOF)
		return false;

	// destroy
	if (map->destroy_key != NULL)
		map->destroy_key(node->key);
	if (map->destroy_value != NULL)
		map->destroy_value(node->value);

	// θέτουμε ως "deleted", ώστε να μην διακόπτεται η αναζήτηση, αλλά ταυτόχρονα να γίνεται ομαλά η εισαγωγή
	node->state = DELETED;
	map->deleted++;
	map->size--;

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x5275
movq %rax, %r14
testq %rax, %rax
je 0x5267
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x523e
movq (%r14), %rdi
callq *%rax
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x524d
movq 0x8(%r14), %rdi
callq *%rax
movl $0x2, 0x10(%r14)
movq 0xc(%rbx), %xmm0
paddd 0x1d7e(%rip), %xmm0     # 0x6fe0
movq %xmm0, 0xc(%rbx)
testq %r14, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/chatziko-k08[P]lecture-code/tests/../modules/UsingHashTable/ADTMap.c
// Function: map_find_node
MapNode map_find_node(Map map, Pointer key) {
	// Διασχίζουμε τον πίνακα, ξεκινώντας από τη θέση που κάνει hash το key, και για όσο δε βρίσκουμε EMPTY
	for (uint pos = map->hash_function(key) % map->capacity;		// ξεκινώντας από τη θέση που κάνει hash το key
		map->array[pos].state != EMPTY;							// αν φτάσουμε σε EMPTY σταματάμε
		pos = (pos + 1) % map->capacity) {						// linear probing, γυρνώντας στην αρχή όταν φτάσουμε στη τέλος του πίνακα

		// Μόνο σε OCCUPIED θέσεις (όχι DELETED), ελέγχουμε αν το key είναι εδώ
		if (map->array[pos].state == OCCUPIED && map->compare(map->array[pos].key, key) == 0)
			return &map->array[pos];
	}

	return MAP_EOF;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq *0x20(%rbx)
movl 0x8(%rbx), %ecx
xorl %edx, %edx
divl %ecx
movq (%rbx), %rax
movl %edx, %r15d
leaq (%r15,%r15,2), %r12
movl 0x10(%rax,%r12,8), %edx
cmpl $0x1, %edx
je 0x52aa
testl %edx, %edx
jne 0x52be
jmp 0x52c6
leaq (%rax,%r12,8), %rax
movq (%rax), %rdi
movq %r14, %rsi
callq *0x18(%rbx)
testl %eax, %eax
je 0x52cb
movl 0x8(%rbx), %ecx
incl %r15d
movl %r15d, %eax
jmp 0x528c
xorl %r12d, %r12d
jmp 0x52d2
shlq $0x3, %r12
addq (%rbx), %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/chatziko-k08[P]lecture-code/tests/../modules/UsingHashTable/ADTMap.c
// Function: map_find
Pointer map_find(Map map, Pointer key) {
	MapNode node = map_find_node(map, key);
	if (node != MAP_EOF)
		return node->value;
	else
		return NULL;
}

// Assembly:
pushq %rax
callq 0x5275
testq %rax, %rax
je 0x52f2
movq 0x8(%rax), %rax
jmp 0x52f4
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/chatziko-k08[P]lecture-code/tests/../modules/UsingHashTable/ADTMap.c
// Function: map_destroy
void map_destroy(Map map) {
	for (int i = 0; i < map->capacity; i++) {
		if (map->array[i].state == OCCUPIED) {
			if (map->destroy_key != NULL)
				map->destroy_key(map->array[i].key);
			if (map->destroy_value != NULL)
				map->destroy_value(map->array[i].value);
		}
	}

	free(map->array);
	free(map);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x5359
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rbx), %rax
cmpl $0x1, 0x10(%rax,%r14)
jne 0x5349
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x5336
movq (%rax,%r14), %rdi
callq *%rcx
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x5349
movq (%rbx), %rcx
movq 0x8(%rcx,%r14), %rdi
callq *%rax
incq %r15
movslq 0x8(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r15
jl 0x531c
movq (%rbx), %rdi
callq 0x22a0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x22a0