LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: get_input
static int get_input(const char *prompt)
{
	wint_t ch[1];

	if (prompt)
		printmsg(prompt);
	cleartimeout();

	get_wch(ch);

#ifdef KEY_RESIZE
	while (*ch == KEY_RESIZE) {
		if (prompt) {
			clearoldprompt();
			xlines = LINES;
			printmsg(prompt);
		}

		get_wch(ch);
	}
#endif
	settimeout();
	return (int)*ch;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1161d
movq %rbx, %rdi
callq 0xec60
movq 0x896c(%rip), %r15      # 0x19f90
movq (%r15), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4560
movq (%r15), %rdi
leaq 0x4(%rsp), %r14
movq %r14, %rsi
callq 0x48d0
cmpl $0x19a, (%r14)          # imm = 0x19A
jne 0x11689
leaq 0x4(%rsp), %r14
movq 0x897a(%rip), %r12      # 0x19fd0
testq %rbx, %rbx
je 0x11674
callq 0x13adc
movzwl (%r12), %eax
movw %ax, 0xa51c(%rip)       # 0x1bb88
movq %rbx, %rdi
callq 0xec60
movq (%r15), %rdi
movq %r14, %rsi
callq 0x48d0
cmpl $0x19a, 0x4(%rsp)       # imm = 0x19A
je 0x11656
movq (%r15), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x4560
movl 0x4(%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: set_smart_ctx
static void set_smart_ctx(int ctx, char *nextpath, char **path, char *file, char **lastname, char **lastdir)
{
	if (ctx == '+') /* Get smart context */
		ctx = (int)(get_free_ctx() + 1);

	if (ctx == 0 || ctx == cfg.curctx + 1) { /* Same context */
		clearfilter();
		xstrsncpy(*lastdir, *path, PATH_MAX);
		xstrsncpy(*path, nextpath, PATH_MAX);
	} else { /* New context */
		--ctx;
		/* Deactivate the new context and build from scratch */
		g_ctx[ctx].c_cfg.ctxactive = 0;
		DPRINTF_S(nextpath);
		savecurctx(nextpath, file, ctx);
		*path = g_ctx[ctx].c_path;
		*lastdir = g_ctx[ctx].c_last;
		*lastname = g_ctx[ctx].c_name;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movl 0x8e0b(%rip), %eax      # 0x1a4c8
shrl $0xd, %eax
andl $0x7, %eax
testl %edi, %edi
je 0x11704
leaq 0xa4c2(%rip), %r13      # 0x1bb90
cmpl $0x2b, %edi
jne 0x116fd
movl %eax, %edx
incl %edx
movl %edx, %edi
andl $0xfb, %edi
imulq $0x2138, %rdi, %rsi     # imm = 0x2138
testb $0x2, 0x2131(%rsi,%r13)
je 0x116fb
andl $0x1fb, %edx            # imm = 0x1FB
cmpl %eax, %edi
jne 0x116d5
incl %edi
leal 0x1(%rax), %edx
cmpl %edx, %edi
jne 0x11773
imulq $0x2138, %rax, %rax     # imm = 0x2138
leaq 0xa47e(%rip), %rdx      # 0x1bb90
movb 0x2101(%rax,%rdx), %cl
testb %cl, %cl
je 0x1172d
addq %rdx, %rax
addq $0x2100, %rax           # imm = 0x2100
movb %cl, 0x2f(%rax)
movb $0x0, 0x1(%rax)
movq (%r9), %r15
movq (%r14), %rsi
movl $0x1000, %ecx           # imm = 0x1000
movq %r15, %rdi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x1174f
movb $0x0, 0xfff(%r15)
movq (%r14), %r14
movl $0x1000, %ecx           # imm = 0x1000
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x117c5
movb $0x0, 0xfff(%r14)
jmp 0x117c5
decl %edi
movslq %edi, %rdx
imulq $0x2138, %rdx, %rbp     # imm = 0x2138
movq %r13, %rax
addq %rbp, %rax
movq %rax, (%rsp)
movq %rbx, %rdi
leaq 0x1000(,%r13), %rbx
addq %rbp, %rbx
andb $-0x3, 0x1131(%rbx)
movq %rcx, %rsi
movq %r8, %r15
movq %r9, %r12
callq 0x10b45
movq (%rsp), %rax
movq %rax, (%r14)
movq %rbx, (%r12)
leaq 0x2000(,%r13), %rax
addq %rbp, %rax
movq %rax, (%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: dentfind
static int dentfind(const char *fname, int n)
{
	for (int i = 0; i < n; ++i)
		if (xstrcmp(fname, pdents[i].name) == 0)
			return i;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %esi, %esi
jle 0x11af7
movq %rdi, %r14
movb (%rdi), %bpl
movq 0x1259e(%rip), %r15     # 0x24070
movl %esi, %r12d
xorl %ebx, %ebx
movq (%r15), %rsi
cmpb (%rsi), %bpl
jne 0x11aeb
movq %r14, %rdi
callq 0x44d0
testl %eax, %eax
je 0x11af9
incq %rbx
addq $0x30, %r15
cmpq %rbx, %r12
jne 0x11ad7
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: plugscript
static bool plugscript(const char *plugin, uchar_t flags)
{
	mkpath(plgpath, plugin, g_buf);
	if (!access(g_buf, X_OK)) {
		spawn(g_buf, NULL, NULL, NULL, flags);
		return TRUE;
	}

	return FALSE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %rsi
movq 0x9f8c(%rip), %rdi      # 0x1baa0
leaq 0x8c35(%rip), %r14      # 0x1a750
movq %r14, %rdx
callq 0x6d5c
movq %r14, %rdi
movl $0x1, %esi
callq 0x4710
movl %eax, %ebp
testl %eax, %eax
jne 0x11b4c
movzbl %bl, %r8d
leaq 0x8c0f(%rip), %rdi      # 0x1a750
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf3d1
testl %ebp, %ebp
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: startselection
static void startselection(void)
{
	if (!g_state.selmode) {
		g_state.selmode = 1;
		nselected = 0;

		if (selbufpos) {
			resetselind();
			writesel(NULL, 0);
			selbufpos = 0;
		}
	}
}

// Assembly:
movl 0x8995(%rip), %eax      # 0x1a524
btl $0x15, %eax
jb 0x11c07
orl $0x200000, %eax         # imm = 0x200000
movl %eax, 0x8984(%rip)      # 0x1a524
movl $0x0, 0x12702(%rip)     # 0x242ac
cmpl $0x0, 0x9ebf(%rip)      # 0x1ba70
je 0x11c07
pushq %rax
movslq 0x9fd1(%rip), %rcx      # 0x1bb8c
testq %rcx, %rcx
jle 0x11bf0
movq 0x124a9(%rip), %rax     # 0x24070
shlq $0x4, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
movq 0x20(%rax,%rdx), %rsi
btq $0x3c, %rsi
jae 0x11be7
btrq $0x3c, %rsi
movq %rsi, 0x20(%rax,%rdx)
addq $0x30, %rdx
cmpq %rdx, %rcx
jne 0x11bd1
xorl %edi, %edi
xorl %esi, %esi
callq 0xf7fd
movl $0x0, 0x9e6d(%rip)      # 0x1ba70
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: rmfromselbuf
static void rmfromselbuf(size_t len)
{
	char *found = findinsel(findselpos, len);
	if (!found)
		return;

	memmove(found, found + len, selbufpos - (found + len - pselbuf));
	selbufpos -= len;

	nselected ? writesel(pselbuf, selbufpos - 1) : clearselection();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x136a9(%rip), %rdi     # 0x252c0
movl %ebx, %esi
callq 0x131ca
testq %rax, %rax
je 0x11c66
movq %rbx, %rsi
addq %rax, %rsi
movl 0x9e40(%rip), %r14d     # 0x1ba70
movq 0x9e41(%rip), %r15      # 0x1ba78
movq %r14, %rdx
subq %rsi, %rdx
addq %r15, %rdx
movq %rax, %rdi
callq 0x46d0
subl %ebx, %r14d
movl %r14d, 0x9e1e(%rip)     # 0x1ba70
cmpl $0x0, 0x12653(%rip)     # 0x242ac
je 0x11c6c
decl %r14d
movq %r15, %rdi
movq %r14, %rsi
jmp 0x11c81
popq %rbx
popq %r14
popq %r15
retq
andb $-0x21, 0x88b3(%rip)    # 0x1a526
movl $0x0, 0x9df3(%rip)      # 0x1ba70
xorl %edi, %edi
xorl %esi, %esi
popq %rbx
popq %r14
popq %r15
jmp 0xf7fd
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: scanselforpath
static int scanselforpath(const char *path, bool getsize)
{
	if (!path[1]) { /* path should always be at least two bytes (including NULL) */
		g_sel[0] = '/';
		findselpos = pselbuf;
		return 1; /* Length of '/' is 1 */
	}

	size_t off = xstrsncpy(g_sel, path, PATH_MAX);

	g_sel[off - 1] = '/';
	/*
	 * We set findselpos only here. Directories can be listed in arbitrary order.
	 * This is the best best we can do for remembering position.
	 */
	findselpos = findinsel(NULL, off);

	if (getsize)
		return off;
	return (findselpos ? off : 0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x1(%rdi)
je 0x11d2e
movl %esi, %ebx
movq %rdi, %rsi
leaq 0x125e2(%rip), %rdi     # 0x242c0
xorl %r14d, %r14d
movl $0x1000, %ecx           # imm = 0x1000
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x11d00
movb $0x0, 0x135c6(%rip)     # 0x252bf
leaq 0x135c0(%rip), %rax     # 0x252c0
leaq 0x125b9(%rip), %rcx     # 0x242c0
movl %eax, %ebp
subl %ecx, %ebp
movb $0x2f, -0x1(%rax)
xorl %edi, %edi
movl %ebp, %esi
callq 0x131ca
testq %rax, %rax
cmovnel %ebp, %r14d
movq %rax, 0x1359a(%rip)     # 0x252c0
testb %bl, %bl
cmovnel %ebp, %r14d
jmp 0x11d49
movb $0x2f, 0x1258b(%rip)    # 0x242c0
movq 0x9d3c(%rip), %rax      # 0x1ba78
movq %rax, 0x1357d(%rip)     # 0x252c0
movl $0x1, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: get_cur_or_sel
static int get_cur_or_sel(void)
{
	bool sel = (selbufpos || !isselfileempty());

	/* Check both local buffer and selection file for external selection */
	if (sel && ndents) {
		/* If selection is preferred and we have a local selection, return selection.
		 * Always show the prompt in case of an external selection.
		 */
		if (cfg.prefersel && selbufpos)
			return 's';

		int choice = get_input(messages[MSG_CUR_SEL_OPTS]);

		return ((choice == 'c' || choice == 's') ? choice : 0);
	}

	if (sel)
		return 's';

	if (ndents)
		return 'c';

	return 0;
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movb $0x1, %al
cmpl $0x0, 0x9d0e(%rip)      # 0x1ba70
jne 0x11d86
movq 0x87bd(%rip), %rdi      # 0x1a528
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x4300
cmpl $-0x1, %eax
setne %cl
cmpq $0x0, 0x30(%rbx)
setne %al
andb %cl, %al
movl 0x9e00(%rip), %ecx      # 0x1bb8c
testl %ecx, %ecx
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x11dcc
testb $0x1, 0x872b(%rip)      # 0x1a4ca
je 0x11daf
movl $0x73, %eax
cmpl $0x0, 0x9cc3(%rip)      # 0x1ba70
jne 0x11de0
leaq 0x4169(%rip), %rdi      # 0x15f1f
callq 0x11605
movl %eax, %ecx
movl %eax, %edx
andl $-0x11, %edx
xorl %eax, %eax
cmpl $0x63, %edx
cmovel %ecx, %eax
jmp 0x11de0
testl %ecx, %ecx
movl $0x63, %edx
cmovel %ecx, %edx
testb %al, %al
movl $0x73, %eax
cmovel %edx, %eax
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: xrmfromsel
static void xrmfromsel(char *path, char *fpath)
{
#ifndef NOX11
	bool selected = TRUE;
#endif

	if ((pdents[cur].flags & DIR_OR_DIRLNK) && scanselforpath(fpath, FALSE))
		clearselection();
	else if (pdents[cur].flags & FILE_SELECTED) {
		--nselected;
		rmfromselbuf(mkpath(path, pdents[cur].name, g_sel));
	}
#ifndef NOX11
	else
		selected = FALSE;

	if (selected && cfg.x11)
		plugscript(utils[UTIL_CBCP], F_NOWAIT | F_NOTRACE);
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x12279(%rip), %rax     # 0x24070
movslq 0x1227a(%rip), %rcx     # 0x24078
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movq 0x20(%rax,%rdx), %rdx
btq $0x38, %rdx
jae 0x11e5e
xorl %r14d, %r14d
movq %rsi, %rdi
xorl %esi, %esi
callq 0x11cc8
testl %eax, %eax
je 0x11e43
movl %r14d, 0x12482(%rip)    # 0x242ac
movl %r14d, 0x9c3f(%rip)     # 0x1ba70
andb $-0x21, 0x86ee(%rip)    # 0x1a526
xorl %edi, %edi
xorl %esi, %esi
callq 0xf7fd
jmp 0x11e8e
movq 0x12226(%rip), %rax     # 0x24070
movslq 0x12227(%rip), %rcx     # 0x24078
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movq 0x20(%rax,%rdx), %rdx
btq $0x3c, %rdx
jae 0x11e97
decl 0x12441(%rip)           # 0x242ac
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rsi
leaq 0x12442(%rip), %rdx     # 0x242c0
movq %rbx, %rdi
callq 0x6d5c
movq %rax, %rdi
callq 0x11c08
testb $0x4, 0x8636(%rip)      # 0x1a4cb
jne 0x11e9f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3ff3(%rip), %rdi      # 0x15e99
movl $0x6, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11b04
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: copynextname
static void copynextname(char *lastname)
{
	if (cur) {
		cur += (cur != (ndents - 1)) ? 1 : -1;
		copycurname();
	} else
		lastname[0] = '\0';
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x121b7(%rip), %eax     # 0x24078
testl %eax, %eax
je 0x11f1f
movl 0x9cc1(%rip), %ecx      # 0x1bb8c
leal -0x1(%rcx), %edx
xorl %esi, %esi
cmpl %edx, %eax
setne %sil
leal (%rax,%rsi,2), %eax
decl %eax
movl %eax, 0x12197(%rip)     # 0x24078
cmpl $0x1, %ecx
jae 0x11eef
leaq 0x348b(%rip), %rsi      # 0x15378
jmp 0x11f04
movq 0x1217a(%rip), %rcx     # 0x24070
cltq
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq (%rcx,%rax), %rsi
movl $0x100, %ecx            # imm = 0x100
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x11f22
addq $0xff, %rbx
movb $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: selsafe
static bool selsafe(void)
{
	/* Fail if selection file path not generated */
	if (!selpath) {
		printmsg(messages[MSG_SEL_MISSING]);
		return FALSE;
	}

	/* Fail if selection file path isn't accessible */
	if (access(selpath, R_OK | W_OK) == -1) {
		errno == ENOENT ? printmsg(messages[MSG_0_SELECTED]) : printwarn(NULL);
		return FALSE;
	}

	return TRUE;
}

// Assembly:
pushq %rax
movq 0x85fc(%rip), %rdi      # 0x1a528
testq %rdi, %rdi
je 0x11f59
movl $0x6, %esi
callq 0x4710
movl %eax, %ecx
movb $0x1, %al
cmpl $-0x1, %ecx
jne 0x11f71
callq 0x40c0
movl (%rax), %edi
cmpl $0x2, %edi
jne 0x11f62
leaq 0x3f8e(%rip), %rdi      # 0x15ee5
jmp 0x11f6a
leaq 0x40de(%rip), %rdi      # 0x1603e
jmp 0x11f6a
callq 0x4870
movq %rax, %rdi
callq 0xec60
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: getreadline
static char *getreadline(const char *prompt)
{
	exitcurses();

	char *input = readline(prompt);

	refresh();

	if (input && input[0]) {
		add_history(input);
		xstrsncpy(g_buf, input, CMD_LEN_MAX);
		free(input);
		return g_buf;
	}

	free(input);
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4890
movq %rbx, %rdi
callq 0x43b0
movq %rax, %rbx
movq 0x7824(%rip), %rax      # 0x19f90
movq (%rax), %rdi
callq 0x4440
testq %rbx, %rbx
je 0x127b5
cmpb $0x0, (%rbx)
je 0x127b5
movq %rbx, %rdi
callq 0x41b0
leaq 0x7fc3(%rip), %r14      # 0x1a750
movl $0x1200, %ecx           # imm = 0x1200
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x127ab
movb $0x0, 0x91a4(%rip)      # 0x1b94f
movq %rbx, %rdi
callq 0x4090
jmp 0x127c0
movq %rbx, %rdi
callq 0x4090
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: get_archive_cmd
static char *get_archive_cmd(const char *archive)
{
	uchar_t i = 3;

	if (!g_state.usebsdtar && getutil(utils[UTIL_ATOOL]))
		i = 0;
	else if (getutil(utils[UTIL_BSDTAR]))
		i = 1;
	else if (is_suffix(archive, ".zip"))
		i = 2;
	// else tar

	return archive_cmd[i];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x1, 0x7d4e(%rip)      # 0x1a527
jne 0x127ff
leaq 0x3cbd(%rip), %rdi      # 0x1649f
leaq 0x366d(%rip), %rsi      # 0x15e56
xorl %r14d, %r14d
xorl %edx, %edx
xorl %ecx, %ecx
movl $0xc, %r8d
callq 0xf3d1
testl %eax, %eax
je 0x12838
leaq 0x3c99(%rip), %rdi      # 0x1649f
leaq 0x364f(%rip), %rsi      # 0x15e5c
xorl %edx, %edx
xorl %ecx, %ecx
movl $0xc, %r8d
callq 0xf3d1
testl %eax, %eax
je 0x12832
movq %rbx, %rdi
callq 0x13b0e
movzbl %al, %r14d
xorq $0x3, %r14
jmp 0x12838
movl $0x1, %r14d
leaq 0x2ec9(%rip), %rcx      # 0x15708
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: write_lastdir
static void write_lastdir(const char *curpath, const char *outfile)
{
	bool tilde = false, ok = false;
	if (!outfile)
		xstrsncpy(cfgpath + xstrlen(cfgpath), "/.lastd", 8);
	else
		tilde = convert_tilde(outfile, g_buf);

	int fd = open(outfile
			? (tilde ? g_buf : outfile)
			: cfgpath, O_CREAT | O_WRONLY | O_TRUNC, S_IWUSR | S_IRUSR);
	if (fd >= 0) {
		memcpy(g_buf, "cd ", 3);  // NOLINT
		ssize_t l = shell_escape(g_buf + 3, sizeof(g_buf) - 3, curpath);
		ok = l >= 0 && write(fd, g_buf, l + 3) == l + 3;
		close(fd);
	}
	if (!ok)
		errexit();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
testq %rsi, %rsi
je 0x128e0
movq %rsi, %r15
movq %rsi, %rdi
callq 0xece1
leaq 0x7e78(%rip), %rbx      # 0x1a750
testb %al, %al
cmoveq %r15, %rbx
jmp 0x128fe
movq 0x9081(%rip), %rbx      # 0x1b968
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4490
movabsq $0x647473616c2e2f, %rcx # imm = 0x647473616C2E2F
movq %rcx, (%rax)
movq %rbx, %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x46b0
testl %eax, %eax
js 0x12a09
movl %eax, %ebx
movb $0x20, 0x7e2f(%rip)     # 0x1a752
movw $0x6463, 0x7e24(%rip)   # imm = 0x6463
movq %r14, %rdi
xorl %esi, %esi
callq 0x4490
leaq 0x7e16(%rip), %rcx      # 0x1a753
cmpq %rcx, %r14
je 0x12a13
movb $0x27, 0x7e06(%rip)     # 0x1a753
cmpq %r14, %rax
je 0x129b8
subq %r14, %rax
cmpq $0x1, %rax
adcq $0x0, %rax
movl $0x1, %r15d
xorl %ecx, %ecx
leaq 0x7de4(%rip), %rdx      # 0x1a750
leaq -0x11f7(%r15), %rsi
cmpq $-0x11fd, %rsi          # imm = 0xEE03
jb 0x129f6
movb (%r14,%rcx), %sil
cmpb $0x27, %sil
jne 0x12995
movl $0x27275c27, 0x3(%r15,%rdx) # imm = 0x27275C27
addq $0x4, %r15
jmp 0x1299d
movb %sil, 0x3(%r15,%rdx)
incq %r15
incq %rcx
cmpq %rcx, %rax
jne 0x1296c
movw $0x27, 0x3(%r15,%rdx)
cmpq $-0x1, %r15
jl 0x12a02
incq %r15
jmp 0x129c7
movw $0x27, 0x7d93(%rip)     # 0x1a754
movl $0x2, %r15d
addq $0x3, %r15
leaq 0x7d7e(%rip), %rsi      # 0x1a750
movl %ebx, %edi
movq %r15, %rdx
callq 0x4210
movq %rax, %r14
movl %ebx, %edi
callq 0x43c0
cmpq %r15, %r14
jne 0x12a09
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x24, %ebp
callq 0x40c0
movl %ebp, (%rax)
movl %ebx, %edi
callq 0x43c0
movl $0xb36, %edi            # imm = 0xB36
callq 0xfcfe
movl $0x16, %ebp
jmp 0x129fb
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: dirwalk
static void dirwalk(char *path, int entnum, bool mountpoint)
{
	/* Loop till any core is free */
	while (active_threads == NUM_DU_THREADS);

	if (g_state.interrupt)
		return;

	pthread_mutex_lock(&running_mutex);
	int core = ffs(threadbmp) - 1;

	threadbmp &= ~(1 << core);
	++active_threads;
	pthread_mutex_unlock(&running_mutex);

	xstrsncpy(core_data[core].path, path, PATH_MAX);
	core_data[core].entnum = entnum;
	core_data[core].core = (ushort_t)core;
	core_data[core].mntpoint = mountpoint;

	pthread_t tid = 0;

	pthread_create(&tid, NULL, du_thread, (void *)&(core_data[core]));

	tolastln();
	addstr(xbasename(path));
	addstr(" [^C aborts]\n");
	refresh();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %r14d
movl 0x128d8(%rip), %eax     # 0x25308
cmpl $0x4, %eax
je 0x12a2a
testb $0x1, 0x7ae9(%rip)      # 0x1a525
jne 0x12b61
leaq 0x128c7(%rip), %rbx     # 0x25310
movq %rbx, %rdi
callq 0x48e0
movl 0x7a9d(%rip), %eax      # 0x1a4f4
bsfl %eax, %ecx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmovnel %ecx, %r15d
btrl %r15d, %eax
movl %eax, 0x7a86(%rip)      # 0x1a4f4
incl 0x12894(%rip)           # 0x25308
movq %rbx, %rdi
callq 0x4590
movq 0x12855(%rip), %r12     # 0x252d8
movslq %r15d, %r13
movq %r13, %rax
shlq $0xc, %rax
leaq (%rax,%r13,8), %rbx
leaq (%r12,%rbx), %r15
leaq 0x7cb4(%rip), %rsi      # 0x1a750
movl $0x1000, %ecx           # imm = 0x1000
movq %r15, %rdi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x12ab8
movb $0x0, 0xfff(%r15)
movl %r14d, 0x1000(%r12,%rbx)
movw %r13w, 0x1004(%r12,%rbx)
movb %bpl, 0x1006(%r12,%rbx)
movq %rsp, %rdi
movq $0x0, (%rdi)
leaq 0xe4(%rip), %rdx        # 0x12bc6
xorl %esi, %esi
movq %r15, %rcx
callq 0x46a0
movq 0x749d(%rip), %r15      # 0x19f90
movq (%r15), %rdi
movzwl 0x908b(%rip), %esi      # 0x1bb88
decl %esi
xorl %edx, %edx
callq 0x4070
movq (%r15), %r14
leaq 0x7c40(%rip), %rbx      # 0x1a750
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4490
subq %rbx, %rax
movq %rbx, %rdi
movl $0x2f, %esi
movq %rax, %rdx
callq 0x46f0
leaq 0x1(%rax), %rsi
testq %rax, %rax
cmoveq %rbx, %rsi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x41c0
movq (%r15), %rdi
leaq 0x37f8(%rip), %rsi      # 0x16347
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x41c0
movq (%r15), %rdi
callq 0x4440
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: test_set_bit
static bool test_set_bit(uint_t nr)
{
	nr &= HASH_BITS;

	pthread_mutex_lock(&hardlink_mutex);
	ullong_t *m = ihashbmp + (nr >> 6);

	if (*m & (1 << (nr & 63))) {
		pthread_mutex_unlock(&hardlink_mutex);
		return FALSE;
	}

	*m |= 1 << (nr & 63);
	pthread_mutex_unlock(&hardlink_mutex);

	return TRUE;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x127be(%rip), %rdi     # 0x25338
callq 0x48e0
movq 0x8f2a(%rip), %rax      # 0x1bab0
movl %ebx, %edx
shrl $0x6, %edx
movl $0x1, %esi
movl %ebx, %ecx
shll %cl, %esi
andl $0x3ffff, %edx          # imm = 0x3FFFF
movq (%rax,%rdx,8), %rcx
movslq %esi, %rsi
testq %rsi, %rcx
jne 0x12bb0
movq %rcx, %rdi
orq %rsi, %rdi
movq %rdi, (%rax,%rdx,8)
testq %rsi, %rcx
sete %bl
leaq 0x1277b(%rip), %rdi     # 0x25338
callq 0x4590
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: du_thread
static void *du_thread(void *p_data)
{
	thread_data *pdata = (thread_data *)p_data;
	char *path[2] = {pdata->path, NULL};
	ullong_t tfiles = 0;
	blkcnt_t tblocks = 0;
	struct stat *sb;
	FTS *tree = fts_open(path, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR, 0);
	FTSENT *node;

	while ((node = fts_read(tree))) {
		if (node->fts_info & FTS_D) {
			if (g_state.interrupt)
				break;
			continue;
		}

		sb = node->fts_statp;

		if (cfg.apparentsz) {
			if (sb->st_size && DU_TEST)
				tblocks += sb->st_size;
		} else if (sb->st_blocks && DU_TEST)
			tblocks += sb->st_blocks;

		++tfiles;
	}

	fts_close(tree);

	if (pdata->entnum >= 0)
		pdents[pdata->entnum].blocks = tblocks;

	if (!pdata->mntpoint) {
		core_blocks[pdata->core] += tblocks;
		core_files[pdata->core] += tfiles;
	} else
		core_files[pdata->core] += 1;

	pthread_mutex_lock(&running_mutex);
	threadbmp |= (1 << pdata->core);
	--active_threads;
	pthread_mutex_unlock(&running_mutex);

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
movq %rbx, (%rdi)
movq $0x0, 0x8(%rdi)
xorl %r12d, %r12d
movl $0x54, %esi
xorl %edx, %edx
callq 0x42c0
movq %rax, %r14
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x43d0
testq %rax, %rax
je 0x12c74
movq %rax, %r15
movzwl 0x62(%rax), %eax
movzwl %ax, %edx
testb $0x1, %dl
je 0x12c21
testb $0x1, 0x7908(%rip)      # 0x1a525
je 0x12bfa
jmp 0x12c74
movq 0x68(%r15), %rcx
testb $0x8, 0x789c(%rip)      # 0x1a4c8
jne 0x12c3b
cmpq $0x0, 0x40(%rcx)
je 0x12c68
leaq 0x40(%rcx), %rbp
jmp 0x12c46
cmpq $0x0, 0x30(%rcx)
je 0x12c68
leaq 0x30(%rcx), %rbp
testb $0x8, %dl
jne 0x12c51
testb $0x6, %al
jne 0x12c64
jmp 0x12c68
cmpq $0x2, 0x10(%rcx)
jb 0x12c64
movl 0x8(%rcx), %edi
callq 0x12b70
testb %al, %al
je 0x12c6d
addq (%rbp), %r12
incq %r13
jmp 0x12bfa
movzwl 0x62(%r15), %eax
jmp 0x12c4b
movq %r14, %rdi
callq 0x4480
movslq 0x1000(%rbx), %rax
testq %rax, %rax
js 0x12cbb
movq 0x113e1(%rip), %rcx     # 0x24070
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movabsq $0xffffffffff, %rdx     # imm = 0xFFFFFFFFFF
andq %r12, %rdx
movabsq $-0x10000000000, %rsi   # imm = 0xFFFFFF0000000000
andq 0x20(%rcx,%rax), %rsi
orq %rdx, %rsi
movq %rsi, 0x20(%rcx,%rax)
movzwl 0x1004(%rbx), %eax
movl $0x1, %ecx
cmpb $0x0, 0x1006(%rbx)
jne 0x12cde
movq 0x125f9(%rip), %rcx     # 0x252d0
addq %r12, (%rcx,%rax,8)
movq %r13, %rcx
movq 0x125fb(%rip), %rdx     # 0x252e0
addq %rcx, (%rdx,%rax,8)
leaq 0x12620(%rip), %r14     # 0x25310
movq %r14, %rdi
callq 0x48e0
movb 0x1004(%rbx), %cl
movl $0x1, %eax
shll %cl, %eax
orl %eax, 0x77e9(%rip)      # 0x1a4f4
decl 0x125f7(%rip)           # 0x25308
movq %r14, %rdi
callq 0x4590
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: findinsel
static char *findinsel(char *startpos, int len)
{
	if (!selbufpos)
		return FALSE;

	if (!startpos)
		startpos = pselbuf;

	char *found = startpos;
	size_t buflen = selbufpos - (startpos - pselbuf);

	while (1) {
		/* memmem(3): not specified in POSIX.1, but present on a number of other systems. */
		found = memmem(found, buflen - (found - startpos), g_sel, len);
		if (!found)
			return NULL;
		if (found == startpos || *(found - 1) == '\0')
			return found;
		found += len; /* We found g_sel as a substring of a path, move forward */
		if (found >= startpos + buflen)
			return NULL;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x8897(%rip), %r12d     # 0x1ba70
testq %r12, %r12
je 0x1322b
movq %rdi, %rbx
testq %rdi, %rdi
movq 0x888d(%rip), %rax      # 0x1ba78
cmoveq %rax, %rbx
addq %rax, %r12
movslq %esi, %r14
leaq 0x110c4(%rip), %r15     # 0x242c0
movq %rbx, %rax
movq %r12, %rsi
subq %rax, %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x4520
testq %rax, %rax
je 0x1322b
cmpq %rbx, %rax
je 0x1322d
cmpb $0x0, -0x1(%rax)
je 0x1322d
addq %r14, %rax
cmpq %r12, %rax
jb 0x131ff
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: print_time
static void print_time(const time_t *timep, const uchar_t flags)
{
	struct tm t;

	/* Highlight timestamp for entries 5 minutes young */
	if (flags & FILE_YOUNG)
		attron(A_REVERSE);

	localtime_r(timep, &t);
	printw("%s-%02d-%02d %02d:%02d",
		xitoa(t.tm_year + 1900), t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min);

	if (flags & FILE_YOUNG)
		attroff(A_REVERSE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl %esi, %ebx
movq %rdi, %r14
testb $0x40, %bl
je 0x132a6
movq 0x6cf9(%rip), %rax      # 0x19f90
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x4120
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4100
movl $0x76c, %edi            # imm = 0x76C
addl 0x14(%r15), %edi
callq 0x5f73
movl 0x10(%r15), %edx
incl %edx
movl 0xc(%r15), %ecx
movl 0x4(%r15), %r9d
movl 0x8(%r15), %r8d
leaq 0x308a(%rip), %rdi      # 0x16367
movq %rax, %rsi
xorl %eax, %eax
callq 0x45f0
testb $0x40, %bl
je 0x13302
movq 0x6c9d(%rip), %rax      # 0x19f90
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x4730
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: get_fs_info
static size_t get_fs_info(const char *path, uchar_t type)
{
	struct statvfs svb;

	if (statvfs(path, &svb) == -1)
		return 0;

	if (type == VFS_AVAIL)
		return (size_t)svb.f_bavail << ffs((int)(svb.f_frsize >> 1));

	if (type == VFS_USED)
		return ((size_t)svb.f_blocks - (size_t)svb.f_bfree) << ffs((int)(svb.f_frsize >> 1));

	return (size_t)svb.f_blocks << ffs((int)(svb.f_frsize >> 1)); /* VFS_SIZE */
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movl %esi, %ebx
movq %rsp, %rsi
callq 0x4900
cmpl $-0x1, %eax
je 0x13589
cmpb $0x1, %bl
je 0x1358d
movzbl %bl, %eax
testl %eax, %eax
jne 0x1359e
movq 0x8(%rsp), %rdx
movq 0x20(%rsp), %rax
jmp 0x135a8
xorl %eax, %eax
jmp 0x135bb
movq 0x10(%rsp), %rax
subq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdx
jmp 0x135a8
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rax
shrq %rdx
bsfl %edx, %ecx
incb %cl
testl %edx, %edx
movzbl %cl, %ecx
cmovel %edx, %ecx
shlq %cl, %rax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: getorderstr
static int getorderstr(char *sort)
{
	int i = 0;

	if (cfg.showhidden)
		sort[i++] = 'H';

	if (cfg.timeorder)
		sort[i++] = (cfg.timetype == T_MOD) ? 'M' : ((cfg.timetype == T_ACCESS) ? 'A' : 'C');
	else if (cfg.sizeorder)
		sort[i++] = 'S';
	else if (cfg.extnorder)
		sort[i++] = 'E';

	if (entrycmpfn == &reventrycmp)
		sort[i++] = 'R';

	if (namecmpfn == &xstrverscasecmp)
		sort[i++] = 'V';

	if (i)
		sort[i] = ' ';

	return i;
}

// Assembly:
movl 0x6f01(%rip), %ecx      # 0x1a4c8
xorl %eax, %eax
testb $0x40, %cl
je 0x135dc
movb $0x48, (%rdi)
movl $0x1, %eax
movl 0x6eec(%rip), %ecx      # 0x1a4c8
testb $0x2, %cl
jne 0x135f1
movb $0x53, %dl
testb $0x4, %cl
jne 0x1360d
movb $0x45, %dl
testb $0x20, %cl
jne 0x1360d
jmp 0x13614
shrl $0x1b, %ecx
andl $0x3, %ecx
setne %dl
addb %dl, %dl
orb $0x41, %dl
cmpl $0x2, %ecx
movzbl %dl, %ecx
movl $0x4d, %edx
cmovnel %ecx, %edx
movl %eax, %ecx
incl %eax
movb %dl, (%rdi,%rcx)
leaq -0x47e8(%rip), %rcx     # 0xee33
cmpq %rcx, 0x6ebe(%rip)      # 0x1a4e0
jne 0x1362c
movl %eax, %ecx
incl %eax
movb $0x52, (%rdi,%rcx)
leaq -0x4682(%rip), %rcx     # 0xefb1
cmpq %rcx, 0x6eae(%rip)      # 0x1a4e8
je 0x13643
testl %eax, %eax
jne 0x1364b
xorl %eax, %eax
retq
movl %eax, %ecx
incl %eax
movb $0x56, (%rdi,%rcx)
movl %eax, %ecx
movb $0x20, (%rdi,%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: setexports
static void setexports(const char *path)
{
	char dvar[] = "d0";
	char fvar[] = "f0";

	if (ndents) {
		setenv(envs[ENV_NCUR], pdents[cur].name, 1);
		xstrsncpy(g_ctx[cfg.curctx].c_name, pdents[cur].name, NAME_MAX + 1);
	} else if (g_ctx[cfg.curctx].c_name[0])
		g_ctx[cfg.curctx].c_name[0] = '\0';

	for (uchar_t i = 0; i < CTX_MAX; ++i) {
		if (g_ctx[i].c_cfg.ctxactive) {
			dvar[1] = fvar[1] = '1' + i;
			setenv(dvar, g_ctx[i].c_path, 1);

			if (g_ctx[i].c_name[0]) {
				mkpath(g_ctx[i].c_path, g_ctx[i].c_name, g_buf);
				setenv(fvar, g_buf, 1);
			}
		}
	}
	setenv("NNN_INCLUDE_HIDDEN", xitoa(cfg.showhidden), 1);
	setenv("NNN_PREFER_SELECTION", xitoa(cfg.prefersel), 1);
	setenv("PWD", path, 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
xorl %eax, %eax
movb %al, 0xe(%rsp)
movw $0x3064, 0xc(%rsp)      # imm = 0x3064
movb %al, 0xa(%rsp)
movw $0x3066, 0x8(%rsp)      # imm = 0x3066
cmpl $0x0, 0x8508(%rip)      # 0x1bb8c
je 0x13712
movq 0x109df(%rip), %rax     # 0x24070
movslq 0x109e0(%rip), %rcx     # 0x24078
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rsi
leaq 0x2727(%rip), %rdi      # 0x15dd2
movl $0x1, %edx
callq 0x4200
movl 0x6e0d(%rip), %eax      # 0x1a4c8
shrl $0xd, %eax
andl $0x7, %eax
imulq $0x2138, %rax, %rax     # imm = 0x2138
leaq 0x84c1(%rip), %rcx      # 0x1bb90
leaq (%rax,%rcx), %r14
addq $0x2000, %r14           # imm = 0x2000
movq 0x1098f(%rip), %rax     # 0x24070
movslq 0x10990(%rip), %rcx     # 0x24078
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rsi
movl $0x100, %ecx            # imm = 0x100
movq %r14, %rdi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x13742
movb $0x0, 0xff(%r14)
jmp 0x13742
movl 0x6db0(%rip), %eax      # 0x1a4c8
shrl $0xd, %eax
andl $0x7, %eax
imulq $0x2138, %rax, %rax     # imm = 0x2138
leaq 0x8464(%rip), %rcx      # 0x1bb90
cmpb $0x0, 0x2000(%rax,%rcx)
je 0x13742
addq %rcx, %rax
addq $0x2000, %rax           # imm = 0x2000
movb $0x0, (%rax)
movq $-0x4, %rbx
leaq 0xa440(%rip), %r14      # 0x1db90
leaq 0xc(%rsp), %r15
leaq 0x6ff4(%rip), %r12      # 0x1a750
leaq 0x8(%rsp), %r13
testb $0x2, 0x131(%r14)
je 0x137b1
leaq -0x2000(%r14), %rbp
leal 0x35(%rbx), %eax
movb %al, 0x9(%rsp)
movb %al, 0xd(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x4200
cmpb $0x0, (%r14)
je 0x137b1
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x6d5c
movq %r13, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x4200
addq $0x2138, %r14           # imm = 0x2138
incq %rbx
jne 0x13761
movl 0x6d05(%rip), %edi      # 0x1a4c8
shrl $0x6, %edi
andl $0x1, %edi
callq 0x5f73
leaq 0x2b01(%rip), %rdi      # 0x162d6
movq %rax, %rsi
movl $0x1, %edx
callq 0x4200
movl 0x6ce0(%rip), %edi      # 0x1a4c8
shrl $0x10, %edi
andl $0x1, %edi
callq 0x5f73
leaq 0x2aef(%rip), %rdi      # 0x162e9
movq %rax, %rsi
movl $0x1, %edx
callq 0x4200
leaq 0x1fbe(%rip), %rdi      # 0x157cc
movq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x4200
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: run_cmd_as_plugin
static void run_cmd_as_plugin(const char *file, uchar_t flags)
{
	size_t len;

	xstrsncpy(g_buf, file, PATH_MAX);

	len = xstrlen(g_buf);
	if (len > 1 && g_buf[len - 1] == '*') {
		flags &= ~F_CONFIRM; /* Skip user confirmation */
		g_buf[len - 1] = '\0'; /* Get rid of trailing no confirmation symbol */
		--len;
	}

	if (flags & F_PAGE)
		get_output(utils[UTIL_SH_EXEC], g_buf, NULL, -1, TRUE);
	else
		spawn(utils[UTIL_SH_EXEC], g_buf, NULL, NULL, flags);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %rsi
leaq 0x6f14(%rip), %r14      # 0x1a750
movl $0x1000, %ecx           # imm = 0x1000
movq %r14, %rdi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x13857
movb $0x0, 0x7ef8(%rip)      # 0x1b74f
movq %r14, %rdi
xorl %esi, %esi
callq 0x4490
subq %r14, %rax
cmpq $0x2, %rax
jb 0x1387b
cmpb $0x2a, -0x1(%rax,%r14)
jne 0x1387b
andb $-0x11, %bl
movb $0x0, -0x1(%rax,%r14)
testb %bl, %bl
js 0x138a1
movzbl %bl, %r8d
leaq 0x25ec(%rip), %rdi      # 0x15e76
leaq 0x6ebf(%rip), %rsi      # 0x1a750
xorl %edx, %edx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf3d1
leaq 0x25ce(%rip), %rdi      # 0x15e76
leaq 0x6ea1(%rip), %rsi      # 0x1a750
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x1, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11434
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: read_nointr
static ssize_t read_nointr(int fd, void *buf, size_t count)
{
	ssize_t len;

	do
		len = read(fd, buf, count);
	while (len == -1 && errno == EINTR);

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x6ca2(%rip), %r14      # 0x1a750
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4460
movq %rax, %r15
cmpq $-0x1, %rax
jne 0x13ace
callq 0x40c0
cmpl $0x4, (%rax)
je 0x13aae
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: is_suffix
static bool is_suffix(const char *restrict str, const char *restrict suffix)
{
	if (!str || !suffix)
		return FALSE;

	size_t lenstr = xstrlen(str);
	size_t lensuffix = xstrlen(suffix);

	if (lensuffix > lenstr)
		return FALSE;

	return (xstrcmp(str + (lenstr - lensuffix), suffix) == 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x13b66
movq %rdi, %rbx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x4490
movq %rax, %r14
subq %rbx, %r14
leaq 0x28c0(%rip), %r15      # 0x163f3
movq %r15, %rdi
xorl %esi, %esi
callq 0x4490
subq %r15, %rax
subq %rax, %r14
jb 0x13b68
cmpb $0x2e, (%rbx,%r14)
jne 0x13b66
addq %r14, %rbx
leaq 0x289d(%rip), %rsi      # 0x163f3
movq %rbx, %rdi
callq 0x44d0
testl %eax, %eax
sete %bpl
jmp 0x13b68
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: matches
static int matches(const char *fltr)
{
#ifdef PCRE2
	pcre2_code *pcre2x = NULL;

	/* Search filter */
	if (cfg.regex && setfilter(&pcre2x, fltr))
		return -1;

	ndents = fill(fltr, pcre2x);

	if (cfg.regex)
		pcre2_code_free(pcre2x);
#else
	regex_t re;

	/* Search filter */
	if (cfg.regex && setfilter(&re, fltr))
		return -1;

	ndents = fill(fltr, &re);

	if (cfg.regex)
		regfree(&re);
#endif

	ENTSORT(pdents, ndents, entrycmpfn);

	return ndents;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
testb $0x2, 0x6941(%rip)      # 0x1a4cb
je 0x13bae
movl 0x694a(%rip), %edx      # 0x1a4dc
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x4420
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x13cc7
leaq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, 0x8(%rsp)
movl 0x7fca(%rip), %ecx      # 0x1bb8c
testl %ecx, %ecx
jle 0x13c87
xorl %ebp, %ebp
movq %rsp, %rbx
movq 0x1049a(%rip), %rax     # 0x24070
movslq %ebp, %rcx
leaq (%rcx,%rcx,2), %r14
shlq $0x4, %r14
movq (%rax,%r14), %rsi
movq %rbx, %rdi
callq *0x68aa(%rip)           # 0x1a498
movl 0x7f98(%rip), %ecx      # 0x1bb8c
testl %eax, %eax
jne 0x13c7d
movslq %ecx, %rcx
decq %rcx
movl %ecx, 0x7f84(%rip)      # 0x1bb8c
cmpl %ecx, %ebp
jne 0x13c10
movl %ebp, %ecx
jmp 0x13c7d
movq 0x10459(%rip), %rax     # 0x24070
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movups (%rax,%r14), %xmm0
movups 0x10(%rax,%r14), %xmm1
movups 0x20(%rax,%r14), %xmm2
movaps %xmm2, 0x30(%rsp)
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movups (%rax,%rdx), %xmm0
movups 0x10(%rax,%rdx), %xmm1
movups 0x20(%rax,%rdx), %xmm2
movups %xmm2, 0x20(%rax,%r14)
movups %xmm1, 0x10(%rax,%r14)
movups %xmm0, (%rax,%r14)
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movaps 0x30(%rsp), %xmm2
movups %xmm2, 0x20(%rax,%rdx)
movups %xmm1, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
decl %ebp
incl %ebp
cmpl %ecx, %ebp
jl 0x13bcf
movl %ecx, 0x7eff(%rip)      # 0x1bb8c
testb $0x2, 0x6837(%rip)      # 0x1a4cb
je 0x13ca6
leaq 0x40(%rsp), %rdi
callq 0x42a0
movl 0x7ee6(%rip), %ecx      # 0x1bb8c
movq 0x103c3(%rip), %rdi     # 0x24070
movslq %ecx, %rsi
movq 0x6829(%rip), %rcx      # 0x1a4e0
movl $0x30, %edx
callq 0x4150
movl 0x7ec5(%rip), %eax      # 0x1bb8c
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: showfilter
static void showfilter(char *str)
{
	attron(COLOR_PAIR(cfg.curctx + 1));
	showfilterinfo();
	printmsg_nc(str);
	attroff(COLOR_PAIR(cfg.curctx + 1));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x62a5(%rip), %r12      # 0x19f90
movq (%r12), %rdi
movl 0x67d3(%rip), %esi      # 0x1a4c8
shrl $0x5, %esi
andl $0x700, %esi            # imm = 0x700
addl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x4120
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x135c1
movl %eax, %ebp
movl 0x679f(%rip), %eax      # 0x1a4c8
btl $0x11, %eax
jae 0x13dab
cmpl $0x0, 0x7e56(%rip)      # 0x1bb8c
je 0x13dab
movq 0x10331(%rip), %rax     # 0x24070
movslq 0x10332(%rip), %rcx     # 0x24078
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rdx
leaq 0x2572(%rip), %rdi      # 0x162cb
leaq 0x2737(%rip), %rsi      # 0x16497
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x11434
testb %al, %al
je 0x13da5
movq (%r12), %rdi
movzwl 0x7e0c(%rip), %esi      # 0x1bb88
addl $-0x2, %esi
movl $0x2, %edx
callq 0x4070
cmpl $-0x1, %eax
je 0x13e00
movq (%r12), %rdi
leaq 0x69b7(%rip), %rsi      # 0x1a750
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x41c0
jmp 0x13e00
movl 0x671d(%rip), %eax      # 0x1a4c8
movslq %ebp, %rcx
leaq (%rsp,%rcx), %rdi
movl $0x2f, %edx
subl %ecx, %edx
btl $0x19, %eax
leaq 0x26bb(%rip), %rax      # 0x1647f
leaq 0x26b0(%rip), %rcx      # 0x1647b
cmovaeq %rax, %rcx
movslq %edx, %rsi
movq 0x66f7(%rip), %rax      # 0x1a4d0
cmpq 0x61e8(%rip), %rax      # 0x19fc8
leaq 0x269e(%rip), %rax      # 0x16485
leaq 0x2695(%rip), %r8       # 0x16483
cmoveq %rax, %r8
leaq 0x2671(%rip), %rdx      # 0x1646a
xorl %eax, %eax
callq 0x4350
movq (%r12), %r14
movzwl 0x7d7d(%rip), %ebp      # 0x1bb88
addl $-0x2, %ebp
movzwl 0x10482(%rip), %r13d    # 0x24298
movq %rsp, %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x4490
addl %r13d, %r15d
subl %eax, %r15d
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x4070
cmpl $-0x1, %eax
je 0x13e4c
movq (%r12), %rdi
movq %rsp, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x41c0
movq (%r12), %rdi
movzwl 0x7d31(%rip), %esi      # 0x1bb88
decl %esi
xorl %edx, %edx
callq 0x4070
movq (%r12), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x41c0
movq (%r12), %rdi
callq 0x4840
movq (%r12), %rdi
movl 0x6644(%rip), %esi      # 0x1a4c8
shrl $0x5, %esi
andl $0x700, %esi            # imm = 0x700
addl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x4730
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: handle_alt_key
static int handle_alt_key(wint_t *wch)
{
	timeout(0);

	int r = get_wch(wch);

	if (r == ERR)
		*wch = ESC;
	cleartimeout();

	return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x60d9(%rip), %r14      # 0x19f90
movq (%r14), %rdi
xorl %esi, %esi
callq 0x4560
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x48d0
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x13ed9
movl $0x1b, (%rbx)
movq (%r14), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4560
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: entries_in_file
static uint_t entries_in_file(int fd, char *buf, size_t buflen, const char delim)
{
	ssize_t len;
	uint_t count = 0;

	while ((len = read(fd, buf, buflen)) > 0)
		while (len)
			count += (buf[--len] == delim);

	/* For all use cases 0 count is considered as error */
	return ((len < 0) ? 0 : ((delim != NUL_CHAR) ? count : ++count));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
callq 0x4460
xorl %ebp, %ebp
xorl %r13d, %r13d
testq %rax, %rax
jle 0x13f3b
xorl %ecx, %ecx
cmpb %bl, -0x1(%r15,%rax)
leaq -0x1(%rax), %rdx
sete %cl
addl %ecx, %r13d
movq %rdx, %rax
testq %rdx, %rdx
jne 0x13f12
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4460
jmp 0x13f0d
cmpb $0x1, %bl
adcl $0x0, %r13d
testq %rax, %rax
cmovel %r13d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: selbufrealloc
static void selbufrealloc(const size_t alloclen)
{
	if ((selbufpos + alloclen) > selbuflen) {
		selbuflen = ALIGN_UP(selbufpos + alloclen, PATH_MAX);
		pselbuf = xrealloc(pselbuf, selbuflen);
		if (!pselbuf)
			errexit();
	}
}

// Assembly:
pushq %rbx
movl 0x7a99(%rip), %esi      # 0x1ba70
addq %rdi, %rsi
movl 0x100ec(%rip), %eax     # 0x240cc
cmpq %rax, %rsi
jbe 0x14012
addl $0xfff, %esi            # imm = 0xFFF
andl $0xfffff000, %esi       # imm = 0xFFFFF000
movl %esi, 0x100d5(%rip)     # 0x240cc
movq 0x7a7a(%rip), %rbx      # 0x1ba78
movq %rbx, %rdi
callq 0x4640
testq %rax, %rax
je 0x14014
movq %rax, 0x7a66(%rip)      # 0x1ba78
popq %rbx
retq
movq %rbx, %rdi
callq 0x4090
movq $0x0, 0x7a51(%rip) # 0x1ba78
movl $0x674, %edi            # imm = 0x674
callq 0xfcfe
// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: confirm_force
static char confirm_force(bool selection, bool use_trash)
{
	char str[300];

	/* Count selection from file when nothing is selected */
	if (selection && (nselected == 0)) {
		int fd = open(selpath, O_RDONLY);

		if (fd != -1) {
			nselected = entries_in_file(fd, str, 300, NUL_CHAR);
			close(fd);
		} else {
			printwarn(NULL);
			return '\0';
		}
	}

	/* Note: ideally we should use utils[UTIL_RM_RF] instead of the "rm -rf" string */
	int r = snprintf(str, 20, "%s", use_trash ? utils[UTIL_GIO_TRASH] + 4 : "rm -rf");

	if (selection)
		snprintf(str + r, 280, " %d file(s)?", nselected);
	else
		snprintf(str + r, 280, " '%s'?", pdents[cur].name);

	r = get_input(str);

	if (r == ESC)
		return '\0'; /* cancel */
	if (r == 'y' || r == 'Y')
		return 'f'; /* forceful for rm */
	if (r == 'n' || r == 'N')
		return '\0'; /* cancel */
	return (use_trash ? '\0' : 'i'); /* interactive for rm */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl %esi, %ebx
movl %edi, %ebp
testl %edi, %edi
je 0x14088
cmpl $0x0, 0x10261(%rip)     # 0x242ac
jne 0x14088
movq 0x64d4(%rip), %rdi      # 0x1a528
xorl %esi, %esi
xorl %eax, %eax
callq 0x46b0
cmpl $-0x1, %eax
je 0x14132
movl %eax, %r14d
movq %rsp, %rsi
movl $0x12c, %edx            # imm = 0x12C
movl %eax, %edi
xorl %ecx, %ecx
callq 0x13eed
movl %eax, 0x1022c(%rip)     # 0x242ac
movl %r14d, %edi
callq 0x43c0
leaq 0x1e23(%rip), %rax      # 0x15eb2
leaq 0x24b8(%rip), %rcx      # 0x1654e
testb %bl, %bl
cmovneq %rax, %rcx
leaq 0x21d5(%rip), %rdx      # 0x16278
movq %rsp, %rdi
movl $0x14, %esi
xorl %eax, %eax
callq 0x4350
cltq
leaq (%rsp,%rax), %rdi
testb %bpl, %bpl
je 0x140d8
movl 0x101e9(%rip), %ecx     # 0x242ac
leaq 0x248b(%rip), %rdx      # 0x16555
movl $0x118, %esi            # imm = 0x118
xorl %eax, %eax
callq 0x4350
jmp 0x14105
movq 0xff91(%rip), %rax      # 0x24070
movslq 0xff92(%rip), %rcx      # 0x24078
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
leaq 0x2469(%rip), %rdx      # 0x16562
movl $0x118, %esi            # imm = 0x118
xorl %eax, %eax
callq 0x4350
movq %rsp, %rdi
callq 0x11605
cmpl $0x1b, %eax
je 0x14146
movl %eax, %ecx
andl $-0x21, %ecx
movb $0x66, %al
cmpl $0x59, %ecx
je 0x14148
xorl %edx, %edx
testb %bl, %bl
movl $0x69, %eax
cmovnel %edx, %eax
cmpl $0x4e, %ecx
cmovel %edx, %eax
jmp 0x14148
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
callq 0xec60
xorl %eax, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O3/motet-a[P]libforks/tests/kill_all.c
// Function: main
int main() {
  libforks_ServerConn conn;
  check(libforks_start(&conn) == libforks_OK);

  int socket_fd;

  check(libforks_fork(
    conn,
    NULL, // pid_ptr
    &socket_fd, // socket_fd_ptr
    NULL, // exit_fd_ptr
    child_main
  ) == libforks_OK);

  // is the child ready to receive the signal?
  char c;
  check(read(socket_fd, &c, 1) == 1);
  check(c == 'r');

  check(libforks_kill_all(conn, SIGUSR1) == libforks_OK);

  check(read(socket_fd, &c, 1) == 1);
  check(c == 's');

  check(libforks_stop(conn) == libforks_OK);
  return 0;
}

// Assembly:
subq $0x18, %rsp
leaq 0x10(%rsp), %rdi
callq 0x1873
testl %eax, %eax
jne 0x13b8
movq 0x10(%rsp), %rdi
leaq 0x12d(%rip), %r8        # 0x146b
leaq 0xc(%rsp), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2200
testl %eax, %eax
jne 0x13c9
movl 0xc(%rsp), %edi
leaq 0xb(%rsp), %rsi
movl $0x1, %edx
callq 0x10f0
cmpq $0x1, %rax
jne 0x13da
cmpb $0x72, 0xb(%rsp)
jne 0x13eb
movq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0x2400
testl %eax, %eax
jne 0x13fc
movl 0xc(%rsp), %edi
leaq 0xb(%rsp), %rsi
movl $0x1, %edx
callq 0x10f0
cmpq $0x1, %rax
jne 0x140d
cmpb $0x73, 0xb(%rsp)
jne 0x141e
movq 0x10(%rsp), %rdi
callq 0x23bb
testl %eax, %eax
jne 0x142f
xorl %eax, %eax
addq $0x18, %rsp
retq
leaq 0x1c45(%rip), %rdi      # 0x3004
movl $0x14, %esi
callq 0x1440
leaq 0x1c6a(%rip), %rdi      # 0x303a
movl $0x1e, %esi
callq 0x1440
leaq 0x1ca2(%rip), %rdi      # 0x3083
movl $0x22, %esi
callq 0x1440
leaq 0x1cad(%rip), %rdi      # 0x309f
movl $0x23, %esi
callq 0x1440
leaq 0x1ca5(%rip), %rdi      # 0x30a8
movl $0x25, %esi
callq 0x1440
leaq 0x1c6f(%rip), %rdi      # 0x3083
movl $0x27, %esi
callq 0x1440
leaq 0x1cb3(%rip), %rdi      # 0x30d8
movl $0x28, %esi
callq 0x1440
leaq 0x1cab(%rip), %rdi      # 0x30e1
movl $0x2a, %esi
callq 0x1440
// File: /workspace/github_c_makefile_star2_O3/motet-a[P]libforks/tests/kill_all.c
// Function: child_main
static void child_main(libforks_ServerConn conn, int socket_fd) {
  (void)conn;
  child_socket_fd = socket_fd;
  check(signal(SIGUSR1, child_handle_sigusr1) != SIG_ERR);
  check(write(socket_fd, "r", 1) == 1); // tell the parent process that we are ready
  sleep(999);
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl %esi, 0x4ca0(%rip)      # 0x6114
leaq 0x56(%rip), %rsi        # 0x14d1
movl $0xa, %edi
callq 0x1100
cmpq $-0x1, %rax
je 0x14af
leaq 0x2213(%rip), %rsi      # 0x36a5
movl $0x1, %edx
movl %ebx, %edi
callq 0x1080
cmpq $0x1, %rax
jne 0x14c0
movl $0x3e7, %edi            # imm = 0x3E7
popq %rbx
jmp 0x11e0
leaq 0x1c6a(%rip), %rdi      # 0x3120
movl $0xd, %esi
callq 0x1440
leaq 0x1c8a(%rip), %rdi      # 0x3151
movl $0xe, %esi
callq 0x1440