LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: xstrverscasecmp
static int xstrverscasecmp(const char * const s1, const char * const s2)
{
	const uchar_t *p1 = (const uchar_t *)s1;
	const uchar_t *p2 = (const uchar_t *)s2;
	int state, diff;
	uchar_t c1, c2;

	/*
	 * Symbol(s)    0       [1-9]   others
	 * Transition   (10) 0  (01) d  (00) x
	 */
	static const uint8_t next_state[] = {
		/* state    x    d    0  */
		/* S_N */  S_N, S_I, S_Z,
		/* S_I */  S_N, S_I, S_I,
		/* S_F */  S_N, S_F, S_F,
		/* S_Z */  S_N, S_F, S_Z
	};

	alignas(max_align_t) static const int8_t result_type[] = {
		/* state   x/x  x/d  x/0  d/x  d/d  d/0  0/x  0/d  0/0  */

		/* S_N */  VCMP, VCMP, VCMP, VCMP, VLEN, VCMP, VCMP, VCMP, VCMP,
		/* S_I */  VCMP,   -1,   -1,    1, VLEN, VLEN,    1, VLEN, VLEN,
		/* S_F */  VCMP, VCMP, VCMP, VCMP, VCMP, VCMP, VCMP, VCMP, VCMP,
		/* S_Z */  VCMP,    1,    1,   -1, VCMP, VCMP,   -1, VCMP, VCMP
	};

	if (p1 == p2)
		return 0;

	c1 = TOUPPER(*p1);
	++p1;
	c2 = TOUPPER(*p2);
	++p2;

	/* Hint: '0' is a digit too.  */
	state = S_N + ((c1 == '0') + (xisdigit(c1) != 0));

	while ((diff = c1 - c2) == 0) {
		if (c1 == '\0')
			return diff;

		state = next_state[state];
		c1 = TOUPPER(*p1);
		++p1;
		c2 = TOUPPER(*p2);
		++p2;
		state += (c1 == '0') + (xisdigit(c1) != 0);
	}

	state = result_type[state * 3 + (((c2 == '0') + (xisdigit(c2) != 0)))]; // NOLINT

	switch (state) {
	case VCMP:
		return diff;
	case VLEN:
		while (xisdigit(*p1++))
			if (!xisdigit(*p2++))
				return 1;
		return xisdigit(*p2) ? -1 : diff;
	default:
		return state;
	}
}

// Assembly:
xorl %eax, %eax
cmpq %rsi, %rdi
je 0xd9e0
movzbl (%rdi), %edx
leal -0x61(%rdx), %ecx
leal -0x20(%rdx), %r8d
cmpb $0x1a, %cl
movzbl %r8b, %ecx
cmovael %edx, %ecx
movzbl (%rsi), %edx
leal -0x61(%rdx), %r8d
leal -0x20(%rdx), %r9d
cmpb $0x1a, %r8b
movzbl %r9b, %r10d
cmovael %edx, %r10d
movzbl %cl, %edx
xorl %r9d, %r9d
cmpb $0x30, %dl
sete %r9b
addl $-0x30, %edx
cmpl $0xa, %edx
adcl $0x0, %r9d
incq %rdi
leaq 0x5d2d(%rip), %rdx      # 0x13650
movzbl %cl, %r8d
movzbl %r10b, %r10d
subl %r10d, %r8d
jne 0xd991
testb %cl, %cl
je 0xd9e0
incq %rsi
movl %r9d, %ecx
movzbl (%rcx,%rdx), %r8d
movzbl (%rdi), %r9d
leal -0x61(%r9), %ecx
leal -0x20(%r9), %r10d
cmpb $0x1a, %cl
movzbl %r10b, %ecx
cmovael %r9d, %ecx
movzbl (%rsi), %r9d
leal -0x61(%r9), %r10d
leal -0x20(%r9), %r11d
cmpb $0x1a, %r10b
movzbl %r11b, %r10d
cmovael %r9d, %r10d
movzbl %cl, %r11d
xorl %r9d, %r9d
cmpb $0x30, %r11b
sete %r9b
addl $-0x30, %r11d
cmpl $0xa, %r11d
adcl %r8d, %r9d
incq %rdi
jmp 0xd923
leal (%r9,%r9,2), %eax
xorl %ecx, %ecx
cmpl $0x30, %r10d
sete %cl
addl $-0x30, %r10d
cmpl $0xa, %r10d
adcq %rax, %rcx
leaq 0x5cb0(%rip), %rax      # 0x13660
movzbl (%rcx,%rax), %eax
cmpl $0x2, %eax
je 0xd9f6
cmpl $0x3, %eax
jne 0xd9e1
pushq $0x1
popq %rcx
pushq $0x1
popq %rax
movzbl -0x1(%rdi,%rcx), %edx
addl $-0x30, %edx
cmpl $0x9, %edx
ja 0xd9e5
movzbl (%rsi,%rcx), %edx
addl $-0x30, %edx
incq %rcx
cmpl $0xa, %edx
jb 0xd9c4
retq
movsbl %al, %eax
retq
movzbl (%rsi,%rcx), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
pushq $-0x1
popq %rax
cmovbl %eax, %r8d
movl %r8d, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: xstricmp
static int xstricmp(const char * const s1, const char * const s2)
{
	char *p1, *p2;

	long long v1 = strtoll(s1, &p1, 10);
	long long v2 = strtoll(s2, &p2, 10);

	/* Check if at least 1 string is numeric */
	if (s1 != p1 || s2 != p2) {
		/* Handle both pure numeric */
		if (s1 != p1 && s2 != p2) {
			if (v2 > v1)
				return -1;

			if (v1 > v2)
				return 1;
		}

		/* Only first string non-numeric */
		if (s1 == p1)
			return 1;

		/* Only second string non-numeric */
		if (s2 == p2)
			return -1;
	}

	/* Handle 1. all non-numeric and 2. both same numeric value cases */
#ifndef NOLC
	return strcoll(s1, s2);
#else
	return strcasecmp(s1, s2);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
pushq $0xa
popq %rbp
movq %r12, %rsi
movl %ebp, %edx
callq 0x44f0
movq %rax, %r15
leaq 0x8(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x44f0
movq (%r12), %rcx
movq %rcx, %rsi
xorq %rbx, %rsi
movq (%r13), %rdx
movq %rdx, %rdi
xorq %r14, %rdi
orq %rsi, %rdi
jne 0xda67
movq %rbx, %rdi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4630
cmpq %r14, %rdx
sete %dl
cmpq %rbx, %rcx
sete %sil
orb %dl, %sil
je 0xda8a
xorl %eax, %eax
cmpq %rbx, %rcx
sete %al
leal -0x1(,%rax,2), %eax
jmp 0xda98
cmpq %r15, %rax
jle 0xda93
pushq $-0x1
jmp 0xda97
jge 0xda4e
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: writesel
static void writesel(const char *buf, const size_t buflen)
{
	if (!selpath)
		return;

	int fd = open(selpath, O_CREAT | O_WRONLY | O_TRUNC, S_IWUSR | S_IRUSR);

	if (fd != -1) {
		if (write(fd, buf, buflen) != (ssize_t)buflen)
			printwarn(NULL);
		close(fd);
	} else
		printwarn(NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
movq 0xb460(%rip), %rdi      # 0x19528
testq %rdi, %rdi
je 0xe11a
movq %rsi, %r14
movl $0x241, %esi            # imm = 0x241
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x46b0
cmpl $-0x1, %eax
je 0xe120
movl %eax, %ebx
movl %eax, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4210
cmpq %r14, %rax
je 0xe10e
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
callq 0xd5b9
movl %ebx, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x43c0
popq %rbx
popq %r14
popq %r15
retq
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xd5b9
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: enable_signals
static void enable_signals(void)
{
	struct sigaction dfl_act = {.sa_handler = SIG_DFL};

	sigaction(SIGHUP, &dfl_act, NULL);
	sigaction(SIGINT, &dfl_act, NULL);
	sigaction(SIGQUIT, &dfl_act, NULL);
	sigaction(SIGTSTP, &dfl_act, NULL);
	sigaction(SIGWINCH, &dfl_act, NULL);
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq 0x8(%rsp), %rbx
movl $0x98, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4380
pushq $0x1
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4170
pushq $0x2
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4170
pushq $0x3
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4170
pushq $0x14
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4170
pushq $0x1c
popq %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4170
addq $0xa0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: dentfree
static void dentfree(void)
{
	free(pnamebuf);
	free(pdents);
	free(mark);

	/* Thread data cleanup */
	free(core_blocks);
	free(core_data);
	free(core_files);
}

// Assembly:
pushq %rax
movq 0x150f9(%rip), %rdi     # 0x232a0
callq 0x4090
movq 0x14ebd(%rip), %rdi     # 0x23070
callq 0x4090
movq 0x150f1(%rip), %rdi     # 0x232b0
callq 0x4090
movq 0x16105(%rip), %rdi     # 0x242d0
callq 0x4090
movq 0x16101(%rip), %rdi     # 0x242d8
callq 0x4090
movq 0x160fd(%rip), %rdi     # 0x242e0
popq %rax
jmp 0x4090
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: printerr
static void printerr(int linenum)
{
	exitcurses();
	perror(xitoa(linenum));
	if (!g_state.picker && selpath)
		unlink(selpath);
	free(pselbuf);
	exit(1);
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x4890
movl %ebx, %edi
callq 0x5d9b
movq %rax, %rdi
callq 0x4740
testb $0x10, 0xafb2(%rip)     # 0x19525
sete %al
movq 0xafab(%rip), %rdi      # 0x19528
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xe58f
callq 0x40d0
movq 0xc4e2(%rip), %rdi      # 0x1aa78
callq 0x4090
pushq $0x1
popq %rdi
callq 0x4800
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: savecurctx
static void savecurctx(char *path, char *curname, int nextctx)
{
	settings tmpcfg = cfg;
	context *ctxr = &g_ctx[nextctx];

	/* Save current context */
	if (curname)
		xstrsncpy(g_ctx[tmpcfg.curctx].c_name, curname, NAME_MAX + 1);
	else
		g_ctx[tmpcfg.curctx].c_name[0] = '\0';

	g_ctx[tmpcfg.curctx].c_cfg = tmpcfg;

	if (ctxr->c_cfg.ctxactive) { /* Switch to saved context */
		tmpcfg = ctxr->c_cfg;
		/* Skip ordering an open context */
		if (order) {
			cfgsort[CTX_MAX] = cfgsort[nextctx];
			cfgsort[nextctx] = '0';
		}
	} else { /* Set up a new context from current context */
		ctxr->c_cfg.ctxactive = 1;
		xstrsncpy(ctxr->c_path, path, PATH_MAX);
		ctxr->c_last[0] = ctxr->c_name[0] = ctxr->c_fltr[0] = ctxr->c_fltr[1] = '\0';
		ctxr->c_cfg = tmpcfg;
		/* If already in an ordered dir, clear ordering for the new context and let it order */
		if (cfgsort[cfg.curctx] == 'z')
			cfgsort[nextctx] = 'z';
	}

	tmpcfg.curctx = nextctx;
	setcfg(tmpcfg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r15
movl 0xa2a9(%rip), %ebp      # 0x194c8
movslq %edx, %rax
movq %rax, (%rsp)
imulq $0x2138, %rax, %r14     # imm = 0x2138
leaq 0xb95c(%rip), %rax      # 0x1ab90
addq %rax, %r14
movl %ebp, %r13d
shrl $0xd, %r13d
andl $0x7, %r13d
imulq $0x2138, %r13, %r12     # imm = 0x2138
leaq (%r12,%rax), %rdi
addq $0x2000, %rdi           # imm = 0x2000
testq %rsi, %rsi
je 0xf26c
movl $0x100, %edx            # imm = 0x100
callq 0x6016
leaq 0xb926(%rip), %rax      # 0x1ab90
jmp 0xf26f
movb $0x0, (%rdi)
movl %ebp, 0x2130(%r12,%rax)
movl 0x2130(%r14), %edi
btl $0x9, %edi
jb 0xf2dc
orl $0x200, %edi            # imm = 0x200
movl %edi, 0x2130(%r14)
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movq %r15, %rsi
callq 0x6016
andw $0x0, 0x2100(%r14)
xorl %eax, %eax
movb %al, 0x2000(%r14)
movb %al, 0x1000(%r14)
movl %ebp, 0x2130(%r14)
leaq 0x13dfd(%rip), %rax     # 0x230c5
cmpb $0x7a, (%r13,%rax)
jne 0xf2d8
movq (%rsp), %rcx
movb $0x7a, (%rcx,%rax)
movl %ebp, %edi
jmp 0xf2fe
cmpq $0x0, 0xa3a4(%rip)      # 0x19688
je 0xf2fe
leaq 0x13dd8(%rip), %rax     # 0x230c5
movq (%rsp), %rdx
movb (%rdx,%rax), %cl
movb %cl, 0x13dcf(%rip)      # 0x230c9
movb $0x30, (%rdx,%rax)
shll $0xd, %ebx
movzwl %bx, %eax
andl $0xffff1fff, %edi       # imm = 0xFFFF1FFF
orl %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10bee
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: visit_parent
static char *visit_parent(char *path, char *newpath, int *presel)
{
	char *dir;

	/* There is no going back */
	if (istopdir(path)) {
		/* Continue in type-to-nav mode, if enabled */
		if (cfg.filtermode && presel)
			*presel = FILTER;
		return NULL;
	}

	/* Use a copy as xdirname() may change the string passed */
	if (newpath)
		xstrsncpy(newpath, path, PATH_MAX);
	else
		newpath = path;

	dir = xdirname(newpath);
	if (chdir(dir) == -1) {
		printwarn(presel);
		return NULL;
	}

	return dir;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
cmpb $0x0, 0x1(%rdi)
jne 0xf352
cmpb $0x2f, (%rsi)
jne 0xf352
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xf398
movl 0xa183(%rip), %eax      # 0x194c8
andl $0x1, %eax
je 0xf398
movl $0x2f, (%rbx)
jmp 0xf395
testq %r14, %r14
je 0xf366
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
callq 0x6016
jmp 0xf369
movq %rsi, %r14
movq %r14, %rdi
callq 0x6985
movq %r14, %rdi
callq 0x42d0
cmpl $-0x1, %eax
jne 0xf398
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
movq %rbx, %rsi
callq 0xd6e9
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: cdprep
static bool cdprep(char *lastdir, char *lastname, char *path, char *newpath)
{
	if (lastname)
		lastname[0] =  '\0';

	/* Save last working directory */
	xstrsncpy(lastdir, path, PATH_MAX);

	/* Save the newly opted dir in path */
	xstrsncpy(path, newpath, PATH_MAX);
	DPRINTF_S(path);

	clearfilter();
	return cfg.filtermode;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
testq %rsi, %rsi
je 0xf3b5
movb $0x0, (%rsi)
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rsi
callq 0x6016
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6016
callq 0xf4b1
movb 0xa0eb(%rip), %al       # 0x194c8
andb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: move_cursor
static void move_cursor(int target, int ignore_scrolloff)
{
	target = MAX(0, MIN(ndents - 1, target));
	last_curscroll = curscroll;
	last = cur;
	cur = target;

	if (!ignore_scrolloff) {
		int delta = target - last;
		int scrolloff = MIN(SCROLLOFF, ONSCREEN >> 1);

		/*
		 * When ignore_scrolloff is 1, the cursor can jump into the scrolloff
		 * margin area, but when ignore_scrolloff is 0, act like a boa
		 * constrictor and squeeze the cursor towards the middle region of the
		 * screen by allowing it to move inward and disallowing it to move
		 * outward (deeper into the scrolloff margin area).
		 */
		if (((cur < (curscroll + scrolloff)) && delta < 0)
		    || ((cur > (curscroll + ONSCREEN - scrolloff - 1)) && delta > 0))
			curscroll += delta;
	}
	curscroll = MIN(curscroll, MIN(cur, ndents - ONSCREEN));
	curscroll = MAX(curscroll, MAX(cur - (ONSCREEN - 1), 0));

#ifndef NOFIFO
	if (!g_state.fifomode)
		notify_fifo(FALSE); /* Send hovered path to NNN_FIFO */
#endif
}

// Assembly:
movl 0xb79f(%rip), %eax      # 0x1ab8c
leal -0x1(%rax), %ecx
cmpl %edi, %ecx
cmovll %ecx, %edi
xorl %ecx, %ecx
testl %edi, %edi
cmovlel %ecx, %edi
movl 0x13ea6(%rip), %edx     # 0x232a8
movl %edx, 0x14ee0(%rip)     # 0x242e8
movl 0x13c69(%rip), %r10d    # 0x23078
movl %r10d, 0x14f4a(%rip)    # 0x24360
movl %edi, 0x13c5c(%rip)     # 0x23078
movzwl 0xb764(%rip), %r8d      # 0x1ab88
testl %esi, %esi
jne 0xf47a
pushq %rbx
leal -0x4(%r8), %r9d
movl %r9d, %esi
sarl %esi
cmpl $0x3, %esi
movl $0x3, %r11d
cmovll %esi, %r11d
leal (%r11,%rdx), %esi
cmpl %esi, %edi
setl %bl
movl %edi, %esi
subl %r10d, %esi
sets %r10b
testb %r10b, %bl
popq %rbx
jne 0xf476
addl %edx, %r9d
notl %r11d
addl %r9d, %r11d
cmpl %r11d, %edi
setg %r9b
testl %esi, %esi
setg %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0xf47a
addl %edx, %esi
movl %esi, %edx
subl %r8d, %eax
addl $0x4, %eax
cmpl %eax, %edi
cmovll %edi, %eax
cmpl %eax, %edx
cmovll %edx, %eax
subl %r8d, %edi
addl $0x5, %edi
cmpl %eax, %edi
cmovlel %eax, %edi
testl %edi, %edi
cmovgl %edi, %ecx
movl %ecx, 0x13e08(%rip)     # 0x232a8
testb $0x20, 0xa07d(%rip)     # 0x19524
jne 0xf4b0
xorl %edi, %edi
jmp 0xd442
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: clearfilter
static void clearfilter(void)
{
	char * const fltr = g_ctx[cfg.curctx].c_fltr;

	if (fltr[1]) {
		fltr[REGEX_MAX - 1] = fltr[1];
		fltr[1] = '\0';
	}
}

// Assembly:
movl 0xa011(%rip), %eax      # 0x194c8
shrl $0xd, %eax
andl $0x7, %eax
imulq $0x2138, %rax, %rax     # imm = 0x2138
leaq 0xb6c5(%rip), %rdx      # 0x1ab90
movb 0x2101(%rax,%rdx), %cl
testb %cl, %cl
je 0xf4e6
addq %rdx, %rax
addq $0x2100, %rax           # imm = 0x2100
movb %cl, 0x2f(%rax)
movb $0x0, 0x1(%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: appendfpath
static void appendfpath(const char *path, const size_t len)
{
	if ((selbufpos >= selbuflen) || ((len + 3) > (selbuflen - selbufpos))) {
		selbuflen += PATH_MAX;
		pselbuf = xrealloc(pselbuf, selbuflen);
		if (!pselbuf)
			errexit();
	}

	selbufpos += xstrsncpy(pselbuf + selbufpos, path, len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0xb175(%rip), %r15d     # 0x1aa70
movl 0x137cb(%rip), %esi     # 0x230cc
cmpl %r15d, %esi
jbe 0xf914
leaq 0x3(%rbx), %rax
movl %esi, %ecx
subl %r15d, %ecx
cmpq %rcx, %rax
jbe 0xf945
addl $0x1000, %esi           # imm = 0x1000
movl %esi, 0x137ac(%rip)     # 0x230cc
movq 0xb151(%rip), %rdi      # 0x1aa78
callq 0xd572
movq %rax, %rdi
movq %rax, 0xb142(%rip)      # 0x1aa78
testq %rax, %rax
jne 0xf94c
movl $0x668, %edi            # imm = 0x668
callq 0xe555
movq 0xb12c(%rip), %rdi      # 0x1aa78
addq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6016
addl %r15d, %eax
movl %eax, 0xb10d(%rip)      # 0x1aa70
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xfb2d
movq %rbx, %rdi
callq 0xd5b9
movq 0x945c(%rip), %r15      # 0x18f90
movq (%r15), %rdi
pushq $-0x1
popq %rsi
callq 0x4560
leaq 0x4(%rsp), %r14
movq 0x9485(%rip), %r12      # 0x18fd0
movq (%r15), %rdi
movq %r14, %rsi
callq 0x48d0
cmpl $0x19a, 0x4(%rsp)       # imm = 0x19A
jne 0xfb80
testq %rbx, %rbx
je 0xfb4b
callq 0x11b0f
movzwl (%r12), %eax
movw %ax, 0xb012(%rip)       # 0x1ab88
movq %rbx, %rdi
callq 0xd5b9
jmp 0xfb4b
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_O2/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
subq $0x18, %rsp
movq %r9, %r15
movq %rdx, %rbx
movq %rsi, %r14
testl %edi, %edi
je 0xfbdf
movq %r8, %r12
movq %rcx, %r13
cmpl $0x2b, %edi
jne 0xfbcd
callq 0x11ad3
movzbl %al, %edi
incl %edi
movl 0x98f5(%rip), %eax      # 0x194c8
shrl $0xd, %eax
andl $0x7, %eax
incl %eax
cmpl %eax, %edi
jne 0xfc12
callq 0xf4b1
movq (%r15), %rdi
movq (%rbx), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x6016
movq (%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6016
decl %edi
movslq %edi, %rdx
imulq $0x2138, %rdx, %rbp     # imm = 0x2138
leaq 0xaf6b(%rip), %rax      # 0x1ab90
leaq (%rax,%rbp), %rcx
movq %rcx, 0x8(%rsp)
movq %r12, 0x10(%rsp)
leaq (%rax,%rbp), %r12
addq $0x1000, %r12           # imm = 0x1000
andb $-0x3, 0x1131(%r12)
movq %r14, %rdi
movq %r13, %rsi
callq 0xf209
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
movq %r12, (%r15)
leaq 0xaf2c(%rip), %rax      # 0x1ab90
addq %rbp, %rax
addq $0x2000, %rax           # imm = 0x2000
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %r15
movq 0x13109(%rip), %r12     # 0x23070
xorl %ebx, %ebx
testl %esi, %esi
cmovlel %ebx, %r14d
xorl %r13d, %r13d
cmpq %r13, %r14
je 0xff9a
movb (%r15), %al
movq (%r12), %rsi
cmpb (%rsi), %al
jne 0xff8e
movq %r15, %rdi
callq 0x44d0
testl %eax, %eax
je 0xff97
incq %r13
addq $0x30, %r12
jmp 0xff72
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xaacb(%rip), %rdi      # 0x1aaa0
leaq 0x9774(%rip), %r14      # 0x19750
movq %r14, %rdx
callq 0x6a9f
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x4710
movl %eax, %ebp
testl %eax, %eax
jne 0x1000b
movzbl %bl, %r8d
leaq 0x9750(%rip), %rdi      # 0x19750
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xdcb4
testl %ebp, %ebp
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: clearselection
static void clearselection(void)
{
	nselected = 0;
	selbufpos = 0;
	g_state.selmode = 0;
	writesel(NULL, 0);
}

// Assembly:
andl $0x0, 0x13290(%rip)     # 0x232ac
andl $0x0, 0xaa4d(%rip)      # 0x1aa70
andb $-0x21, 0x94fc(%rip)    # 0x19526
xorl %edi, %edi
xorl %esi, %esi
jmp 0xe0b9
// File: /workspace/github_c_makefile_star2_O2/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 0x94c4(%rip), %eax      # 0x19524
btl $0x15, %eax
jb 0x1009b
andl $0x0, 0x1323f(%rip)     # 0x232ac
orl $0x200000, %eax         # imm = 0x200000
movl %eax, 0x94ac(%rip)      # 0x19524
cmpl $0x0, 0xa9f1(%rip)      # 0x1aa70
je 0x1009b
pushq %rax
callq 0x10112
xorl %edi, %edi
xorl %esi, %esi
callq 0xe0b9
andl $0x0, 0xa9d9(%rip)      # 0x1aa70
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x14215(%rip), %rdi     # 0x242c0
movl %ebx, %esi
callq 0x11432
testq %rax, %rax
je 0x10102
movq %rbx, %rsi
addq %rax, %rsi
movl 0xa9ac(%rip), %r14d     # 0x1aa70
movq 0xa9ad(%rip), %r15      # 0x1aa78
movq %r14, %rdx
subq %rsi, %rdx
addq %r15, %rdx
movq %rax, %rdi
callq 0x46d0
subl %ebx, %r14d
movl %r14d, 0xa98a(%rip)     # 0x1aa70
cmpl $0x0, 0x131bf(%rip)     # 0x232ac
je 0x10108
decl %r14d
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe0b9
popq %rbx
popq %r14
popq %r15
retq
popq %rbx
popq %r14
popq %r15
jmp 0x10015
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
cmpb $0x0, 0x1(%rdi)
je 0x10190
movl %esi, %ebx
movq %rdi, %rsi
leaq 0x13162(%rip), %r14     # 0x232c0
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
callq 0x6016
movq %rax, %r15
movb $0x2f, -0x1(%rax,%r14)
xorl %r14d, %r14d
xorl %edi, %edi
movl %r15d, %esi
callq 0x11432
testq %rax, %rax
cmovnel %r15d, %r14d
testb %bl, %bl
cmovnel %r15d, %r14d
jmp 0x101a2
movb $0x2f, 0x13129(%rip)    # 0x232c0
pushq $0x1
popq %r14
movq 0xa8d6(%rip), %rax      # 0x1aa78
movq %rax, 0x14117(%rip)     # 0x242c0
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rax
movb $0x1, %al
cmpl $0x0, 0xa8b4(%rip)      # 0x1aa70
jne 0x101c5
callq 0x11829
xorb $0x1, %al
movl 0xa9c1(%rip), %ecx      # 0x1ab8c
testl %ecx, %ecx
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x101ee
testb $0x1, 0x92ec(%rip)      # 0x194ca
je 0x10200
cmpl $0x0, 0xa889(%rip)      # 0x1aa70
je 0x10200
pushq $0x73
popq %rax
jmp 0x1021b
testl %ecx, %ecx
pushq $0x63
popq %rdx
cmovel %ecx, %edx
testb %al, %al
pushq $0x73
popq %rax
cmovel %edx, %eax
jmp 0x1021b
leaq 0x3cfc(%rip), %rdi      # 0x13f03
callq 0xfb15
movl %eax, %ecx
movl %eax, %edx
andl $-0x11, %edx
xorl %eax, %eax
cmpl $0x63, %edx
cmovel %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movl 0x12e55(%rip), %eax     # 0x23078
testl %eax, %eax
je 0x10251
movl 0xa95f(%rip), %ecx      # 0x1ab8c
leal -0x1(%rcx), %edx
xorl %esi, %esi
cmpl %edx, %eax
setne %sil
leal (%rax,%rsi,2), %eax
decl %eax
movl %eax, 0x12e35(%rip)     # 0x23078
cmpl $0x1, %ecx
jae 0x10255
leaq 0x3129(%rip), %rsi      # 0x13378
jmp 0x10266
movb $0x0, (%rdi)
retq
movq 0x12e14(%rip), %rcx     # 0x23070
cltq
imulq $0x30, %rax, %rax
movq (%rcx,%rax), %rsi
movl $0x100, %edx            # imm = 0x100
jmp 0x6016
// File: /workspace/github_c_makefile_star2_O2/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 0x92b0(%rip), %rdi      # 0x19528
testq %rdi, %rdi
je 0x102a3
pushq $0x6
popq %rsi
callq 0x4710
movl %eax, %ecx
movb $0x1, %al
cmpl $-0x1, %ecx
jne 0x102bb
callq 0x40c0
movl (%rax), %edi
cmpl $0x2, %edi
jne 0x102ac
leaq 0x3c28(%rip), %rdi      # 0x13ec9
jmp 0x102b4
leaq 0x3d78(%rip), %rdi      # 0x14022
jmp 0x102b4
callq 0x4870
movq %rax, %rdi
callq 0xd5b9
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x84f2(%rip), %rax      # 0x18f90
movq (%rax), %rdi
callq 0x4440
testq %rbx, %rbx
je 0x10ad9
cmpb $0x0, (%rbx)
je 0x10ad9
movq %rbx, %rdi
callq 0x41b0
leaq 0x8c91(%rip), %r14      # 0x19750
movl $0x1200, %edx           # imm = 0x1200
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6016
movq %rbx, %rdi
callq 0x4090
jmp 0x10ae4
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_O2/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 %rbx
movq %rdi, %rbx
testb $0x1, 0x8a0c(%rip)      # 0x19527
jne 0x10b31
leaq 0x3316(%rip), %rdi      # 0x13e3a
callq 0xffa6
testb %al, %al
je 0x10b31
xorl %eax, %eax
jmp 0x10b55
leaq 0x3308(%rip), %rdi      # 0x13e40
callq 0xffa6
testb %al, %al
je 0x10b46
pushq $0x1
popq %rax
jmp 0x10b55
movq %rbx, %rdi
callq 0x11b39
movzbl %al, %eax
xorq $0x3, %rax
leaq 0x2bac(%rip), %rcx      # 0x13708
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: get_cwd_entry
static char *get_cwd_entry(const char *restrict cwdpath, char *entrypath, size_t *tokenlen)
{
	size_t len = xstrlen(cwdpath);
	char *end;

	if (!is_prefix(entrypath, cwdpath, len))
		return NULL;

	entrypath += len + 1; /* Add 1 for trailing / */
	end = strchr(entrypath, '/');
	if (end)
		*tokenlen = end - entrypath;
	else
		*tokenlen = xstrlen(entrypath);
	DPRINTF_U(*tokenlen);

	return entrypath;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
callq 0x5d70
movq %rax, %r15
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x6951
testb %al, %al
je 0x10bab
addq %r15, %r14
incq %r14
pushq $0x2f
popq %rsi
movq %r14, %rdi
callq 0x4310
testq %rax, %rax
je 0x10bb0
subq %r14, %rax
jmp 0x10bb8
xorl %r14d, %r14d
jmp 0x10bbb
movq %r14, %rdi
callq 0x5d70
movq %rax, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: printkeys
static void printkeys(kv *kvarr, char *buf, uchar_t max)
{
	uchar_t i = 0;

	for (; i < max && kvarr[i].key; ++i) {
		buf[i << 1] = ' ';
		buf[(i << 1) + 1] = kvarr[i].key;
	}

	buf[i << 1] = '\0';
}

// Assembly:
movl %edx, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x10be9
cmpl $0x0, (%rdi,%rcx,8)
je 0x10be9
movb $0x20, (%rsi,%rcx,2)
movb (%rdi,%rcx,8), %dl
movb %dl, 0x1(%rsi,%rcx,2)
incq %rcx
jmp 0x10bce
movb $0x0, (%rsi,%rcx,2)
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: setcfg
static void setcfg(settings newcfg)
{
	cfg = newcfg;
	/* Synchronize the global function pointers to match the new cfg. */
	entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
	namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
	filterfn = cfg.regex ? &visible_re : &visible_str;
}

// Assembly:
btl $0xa, %edi
leaq -0x3458(%rip), %rax     # 0xd7a1
leaq -0x3489(%rip), %rcx     # 0xd777
cmovaeq %rax, %rcx
btl $0xb, %edi
leaq -0x3215(%rip), %rax     # 0xd9fa
leaq -0x334a(%rip), %rdx     # 0xd8cc
cmovaeq %rax, %rdx
movl %edi, 0x88a8(%rip)      # 0x194c8
movq %rcx, 0x88b9(%rip)      # 0x194e0
movq %rdx, 0x88ba(%rip)      # 0x194e8
btl $0x19, %edi
leaq -0x36e4(%rip), %rax     # 0xd555
leaq -0xaec0(%rip), %rcx     # 0x5d80
cmovaeq %rax, %rcx
movq %rcx, 0x884d(%rip)      # 0x19498
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1366b(%rip), %eax     # 0x24308
cmpl $0x4, %eax
je 0x10c97
testb $0x1, 0x887c(%rip)      # 0x19525
jne 0x10d97
leaq 0x1365a(%rip), %r15     # 0x24310
movq %r15, %rdi
callq 0x48e0
movl 0x8830(%rip), %eax      # 0x194f4
bsfl %eax, %r12d
pushq $-0x1
popq %rcx
cmovel %ecx, %r12d
btrl %r12d, %eax
movl %eax, 0x881b(%rip)      # 0x194f4
incl 0x13629(%rip)           # 0x24308
movq %r15, %rdi
callq 0x4590
movq 0x135ea(%rip), %r13     # 0x242d8
movslq %r12d, %rbx
imulq $0x1008, %rbx, %r15     # imm = 0x1008
leaq (%r15,%r13), %r12
leaq 0x8a4d(%rip), %rsi      # 0x19750
movl $0x1000, %edx           # imm = 0x1000
movq %r12, %rdi
callq 0x6016
movl %r14d, 0x1000(%r13,%r15)
movw %bx, 0x1004(%r13,%r15)
movb %bpl, 0x1006(%r13,%r15)
movq %rsp, %rdi
andq $0x0, (%rdi)
leaq 0xc3(%rip), %rdx        # 0x10dfa
xorl %esi, %esi
movq %r12, %rcx
callq 0x46a0
movq 0x8248(%rip), %r12      # 0x18f90
movq (%r12), %rdi
movzwl 0x9e35(%rip), %esi      # 0x1ab88
decl %esi
xorl %edx, %edx
callq 0x4070
movq (%r12), %r14
leaq 0x89e9(%rip), %rdi      # 0x19750
callq 0x695e
movq %r14, %rdi
movq %rax, %rsi
pushq $-0x1
popq %rbx
movl %ebx, %edx
callq 0x41c0
movq (%r12), %rdi
leaq 0x35a4(%rip), %rsi      # 0x1432b
movl %ebx, %edx
callq 0x41c0
movq (%r12), %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_O2/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 0x13588(%rip), %rdi     # 0x24338
callq 0x48e0
movq 0x9cf4(%rip), %rax      # 0x1aab0
movl %ebx, %edx
shrl $0x6, %edx
pushq $0x1
popq %rsi
movl %ebx, %ecx
shll %cl, %esi
andl $0x3ffff, %edx          # imm = 0x3FFFF
movq (%rax,%rdx,8), %rcx
movslq %esi, %rsi
testq %rsi, %rcx
jne 0x10de4
movq %rcx, %rdi
orq %rsi, %rdi
movq %rdi, (%rax,%rdx,8)
testq %rsi, %rcx
sete %bl
leaq 0x13547(%rip), %rdi     # 0x24338
callq 0x4590
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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)
andq $0x0, 0x8(%rdi)
xorl %r12d, %r12d
pushq $0x54
popq %rsi
xorl %edx, %edx
callq 0x42c0
movq %rax, %r14
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x43d0
testq %rax, %rax
je 0x10ea3
movq %rax, %r15
movzwl 0x62(%rax), %eax
movzwl %ax, %edx
testb $0x1, %dl
je 0x10e50
testb $0x1, 0x86d9(%rip)      # 0x19525
je 0x10e29
jmp 0x10ea3
movq 0x68(%r15), %rcx
testb $0x8, 0x866d(%rip)      # 0x194c8
jne 0x10e6a
cmpq $0x0, 0x40(%rcx)
je 0x10e97
leaq 0x40(%rcx), %rbp
jmp 0x10e75
cmpq $0x0, 0x30(%rcx)
je 0x10e97
leaq 0x30(%rcx), %rbp
testb $0x8, %dl
jne 0x10e80
testb $0x6, %al
jne 0x10e93
jmp 0x10e97
cmpq $0x2, 0x10(%rcx)
jb 0x10e93
movl 0x8(%rcx), %edi
callq 0x10da6
testb %al, %al
je 0x10e9c
addq (%rbp), %r12
incq %r13
jmp 0x10e29
movzwl 0x62(%r15), %eax
jmp 0x10e7a
movq %r14, %rdi
callq 0x4480
movslq 0x1000(%rbx), %rax
testq %rax, %rax
js 0x10ee6
movq 0x121b2(%rip), %rcx     # 0x23070
imulq $0x30, %rax, %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
cmpb $0x0, 0x1006(%rbx)
je 0x10efc
pushq $0x1
popq %r13
jmp 0x10f07
movq 0x133cd(%rip), %rcx     # 0x242d0
addq %r12, (%rcx,%rax,8)
movq 0x133d2(%rip), %rcx     # 0x242e0
addq %r13, (%rcx,%rax,8)
leaq 0x133f7(%rip), %r14     # 0x24310
movq %r14, %rdi
callq 0x48e0
movb 0x1004(%rbx), %cl
pushq $0x1
popq %rax
shll %cl, %eax
orl %eax, 0x85c2(%rip)      # 0x194f4
decl 0x133d0(%rip)           # 0x24308
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_O2/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 0x962f(%rip), %r12d     # 0x1aa70
testq %r12, %r12
je 0x11493
movq %rdi, %rbx
testq %rdi, %rdi
movq 0x9625(%rip), %rax      # 0x1aa78
cmoveq %rax, %rbx
addq %rax, %r12
movslq %esi, %r14
leaq 0x11e5c(%rip), %r15     # 0x232c0
movq %rbx, %rax
movq %r12, %rsi
subq %rax, %rsi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x4520
testq %rax, %rax
je 0x11493
cmpq %rbx, %rax
je 0x11495
cmpb $0x0, -0x1(%rax)
je 0x11495
addq %r14, %rax
cmpq %r12, %rax
jb 0x11467
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1150e
movq 0x7a91(%rip), %rax      # 0x18f90
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 0x5d9b
movl 0x10(%r15), %edx
incl %edx
movl 0xc(%r15), %ecx
movl 0x4(%r15), %r9d
movl 0x8(%r15), %r8d
leaq 0x2e06(%rip), %rdi      # 0x1434b
movq %rax, %rsi
xorl %eax, %eax
callq 0x45f0
testb $0x40, %bl
je 0x1156a
movq 0x7a35(%rip), %rax      # 0x18f90
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_O2/jarun[P]nnn/src/nnn.c
// Function: coolsize
static char *coolsize(off_t size)
{
	const char * const U = "BKMGTPEZY";
	static char size_buf[12]; /* Buffer to hold human readable size */
	off_t rem = 0;
	size_t ret;
	int i = 0;

	while (size >= 1024) {
		rem = size & (0x3FF); /* 1024 - 1 = 0x3FF */
		size >>= 10;
		++i;
	}

	if (i == 1) {
		rem = (rem * 1000) >> 10;
		rem /= 10;
		size = get_size(size, &rem, 10);
	} else if (i == 2) {
		rem = (rem * 1000) >> 10;
		size = get_size(size, &rem, 100);
	} else if (i > 2) {
		rem = (rem * 10000) >> 10;
		size = get_size(size, &rem, 1000);
	}

	if (i > 0 && i < 6 && rem) {
		ret = xstrsncpy(size_buf, xitoa(size), 12);
		size_buf[ret - 1] = '.';

		char *frac = xitoa(rem);
		size_t toprint = i > 3 ? 3 : i;
		size_t len = xstrlen(frac);

		if (len < toprint) {
			size_buf[ret] = size_buf[ret + 1] = size_buf[ret + 2] = '0';
			xstrsncpy(size_buf + ret + (toprint - len), frac, len + 1);
		} else
			xstrsncpy(size_buf + ret, frac, toprint + 1);

		ret += toprint;
	} else {
		ret = xstrsncpy(size_buf, size ? xitoa(size) : "0", 12);
		--ret;
	}

	size_buf[ret] = U[i];
	size_buf[ret + 1] = '\0';

	return size_buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %r12d, %r12d
xorl %eax, %eax
cmpq $0x400, %rdi            # imm = 0x400
jl 0x1159f
movl %edi, %eax
andl $0x3ff, %eax            # imm = 0x3FF
shrq $0xa, %rdi
incq %r12
jmp 0x11586
movq %rax, 0x8(%rsp)
cmpl $0x2, %r12d
je 0x115cc
cmpl $0x1, %r12d
jne 0x11677
imull $0x3e8, %eax, %eax      # imm = 0x3E8
movl $0x2800, %ecx           # imm = 0x2800
xorl %edx, %edx
divl %ecx
movq %rax, 0x8(%rsp)
pushq $0xa
jmp 0x115de
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
shrq $0xa, %rax
movq %rax, 0x8(%rsp)
pushq $0x64
popq %rdx
leaq 0x8(%rsp), %rsi
callq 0x116fb
movq %rax, %rdi
leal -0x1(%r12), %eax
cmpl $0x5, %eax
setb %al
movq 0x8(%rsp), %r15
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x11668
callq 0x5d9b
leaq 0x12d4f(%rip), %r14     # 0x24364
pushq $0xc
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x6016
movq %rax, %rbx
movb $0x2e, -0x1(%rax,%r14)
movl %r15d, %edi
callq 0x5d9b
movq %rax, %r15
cmpl $0x3, %r12d
pushq $0x3
popq %r13
cmovbl %r12d, %r13d
movq %rax, %rdi
callq 0x5d70
movq %r13, %rdi
subq %rax, %rdi
jbe 0x1169b
movb $0x30, 0x2(%rbx,%r14)
addq %r14, %rdi
addq %rbx, %rdi
movw $0x3030, (%rbx,%r14)    # imm = 0x3030
jmp 0x116a4
testq %rdi, %rdi
je 0x116b7
callq 0x5d9b
movq %rax, %rsi
jmp 0x116be
cmpl $0x3, %r12d
jb 0x115ec
imulq $0x2710, %rax, %rax     # imm = 0x2710
shrq $0xa, %rax
movq %rax, 0x8(%rsp)
movl $0x3e8, %edx            # imm = 0x3E8
jmp 0x115df
addq %rbx, %r14
movq %r13, %rax
movq %r14, %rdi
incq %rax
movq %r15, %rsi
movq %rax, %rdx
callq 0x6016
addq %r13, %rbx
jmp 0x116d3
leaq 0x2cb0(%rip), %rsi      # 0x1436e
leaq 0x12c9f(%rip), %rdi     # 0x24364
pushq $0xc
popq %rdx
callq 0x6016
movq %rax, %rbx
decq %rbx
leaq 0x2c88(%rip), %rax      # 0x14362
movb (%r12,%rax), %al
leaq 0x12c7f(%rip), %rcx     # 0x24364
movb %al, (%rbx,%rcx)
movb $0x0, 0x1(%rbx,%rcx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: get_size
static off_t get_size(off_t size, off_t *pval, int comp)
{
	off_t rem = *pval;
	off_t quo = rem / 10;

	if ((rem - (quo * 10)) >= 5) {
		rem = quo + 1;
		if (rem == comp) {
			++size;
			rem = 0;
		}
	} else
		rem = quo;

	*pval = rem;
	return size;
}

// Assembly:
movl %edx, %ecx
movq (%rsi), %r8
pushq $0xa
popq %r9
movq %r8, %rax
cqto
idivq %r9
imulq $-0xa, %rax, %rdx
addq %r8, %rdx
cmpq $0x5, %rdx
jl 0x11731
incq %rax
movl %ecx, %ecx
xorl %edx, %edx
xorl %r8d, %r8d
cmpq %rcx, %rax
sete %r8b
cmoveq %rdx, %rax
addq %r8, %rdi
movq %rax, (%rsi)
movq %rdi, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11764
cmpb $0x1, %bl
je 0x11768
movzbl %bl, %eax
testl %eax, %eax
jne 0x11779
movq 0x8(%rsp), %rdx
movq 0x20(%rsp), %rax
jmp 0x11783
xorl %eax, %eax
jmp 0x11796
movq 0x10(%rsp), %rax
subq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdx
jmp 0x11783
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_O2/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 0x7d26(%rip), %ecx      # 0x194c8
xorl %eax, %eax
testb $0x40, %cl
je 0x117b5
movb $0x48, (%rdi)
pushq $0x1
popq %rax
movl 0x7d13(%rip), %ecx      # 0x194c8
testb $0x2, %cl
jne 0x117ca
movb $0x53, %dl
testb $0x4, %cl
jne 0x117e4
movb $0x45, %dl
testb $0x20, %cl
jne 0x117e4
jmp 0x117eb
shrl $0x1b, %ecx
andl $0x3, %ecx
setne %dl
addb %dl, %dl
orb $0x41, %dl
cmpl $0x2, %ecx
movzbl %dl, %ecx
pushq $0x4d
popq %rdx
cmovnel %ecx, %edx
movl %eax, %ecx
incl %eax
movb %dl, (%rdi,%rcx)
leaq -0x407b(%rip), %rcx     # 0xd777
cmpq %rcx, 0x7ce7(%rip)      # 0x194e0
jne 0x11803
movl %eax, %ecx
incl %eax
movb $0x52, (%rdi,%rcx)
leaq -0x3f3e(%rip), %rcx     # 0xd8cc
cmpq %rcx, 0x7cd7(%rip)      # 0x194e8
je 0x1181a
testl %eax, %eax
jne 0x11822
xorl %eax, %eax
retq
movl %eax, %ecx
incl %eax
movb $0x56, (%rdi,%rcx)
movl %eax, %ecx
movb $0x20, (%rdi,%rcx)
retq