// File: /workspace/github_c_makefile_star2_O3/jarun[P]nnn/src/nnn.c
// Function: handle_screen_move
static void handle_screen_move(enum action sel)
{
	switch (sel) {
	case SEL_NEXT:
		if (cfg.rollover || (cur != ndents - 1))
			move_cursor((cur + 1) % ndents, 0);
		break;
	case SEL_PREV:
		if (cfg.rollover || cur)
			move_cursor((cur + ndents - 1) % ndents, 0);
		break;
	case SEL_PGDN:
		move_cursor(curscroll + (ONSCREEN - 1), 1);
		curscroll += ONSCREEN - 1;
		break;
	case SEL_CTRL_D:
		move_cursor(curscroll + (ONSCREEN - 1), 1);
		curscroll += ONSCREEN >> 1;
		break;
	case SEL_PGUP:
		move_cursor(curscroll, 1);
		curscroll -= ONSCREEN - 1;
		break;
	case SEL_CTRL_U:
		move_cursor(curscroll, 1);
		curscroll -= ONSCREEN >> 1;
		break;
	case SEL_JUMP:
	{
		char *input = xreadline(NULL, "jump (+n/-n/n): ");

		if (!input || !*input)
			break;
		if (input[0] == '-') {
			cur -= atoi(input + 1);
			if (cur < 0)
				cur = 0;
		} else if (input[0] == '+') {
			cur += atoi(input + 1);
			if (cur >= ndents)
				cur = ndents - 1;
		} else {
			int index = atoi(input);

			if ((index < 1) || (index > ndents))
				break;
			cur = index - 1;
		}
		move_cursor(cur, 1);
		curscroll -= ONSCREEN >> 1;
		break;
	}
	case SEL_HOME:
		move_cursor(0, 1);
		break;
	case SEL_END:
		move_cursor(ndents - 1, 1);
		break;
	case SEL_YOUNG:
	{
		for (int r = cur;;) {
			if (++r >= ndents)
				r = 0;
			if (r == cur)
				break;
			if (pdents[r].flags & FILE_YOUNG) {
				move_cursor(r, 0);
				break;
			}
		}
		break;
	}
	default: /* case SEL_FIRST */
	{
		int c = get_input(messages[MSG_FIRST]);

		if (!c)
			break;

		c = TOUPPER(c);

		int r = (c == TOUPPER(*pdents[cur].name)) ? (cur + 1) : 0;

		for (; r < ndents; ++r) {
			if (((c == '\'') && !(pdents[r].flags & DIR_OR_DIRLNK))
			    || (c == TOUPPER(*pdents[r].name))) {
				move_cursor((r) % ndents, 0);
				break;
			}
		}
		break;
	}
	}
}

// Assembly:
pushq %rax
addl $-0x4, %edi
cmpl $0xa, %edi
ja 0x118ac
leaq 0x3ab0(%rip), %rax      # 0x15298
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x0, 0x8cd0(%rip)      # 0x1a4c8
setns %dl
movl 0x12877(%rip), %eax     # 0x24078
movl 0xa385(%rip), %ecx      # 0x1bb8c
leal -0x1(%rcx), %esi
cmpl %esi, %eax
sete %sil
testb %sil, %dl
jne 0x11aaf
incl %eax
jmp 0x1188c
movl 0x12a85(%rip), %eax     # 0x242a8
movzwl 0xa35e(%rip), %ecx      # 0x1bb88
leal (%rax,%rcx), %edi
addl $-0x5, %edi
movl $0x1, %esi
callq 0x10e3c
movzwl 0xa347(%rip), %eax      # 0x1bb88
movl 0x12a61(%rip), %ecx     # 0x242a8
addl %ecx, %eax
addl $-0x5, %eax
movl %eax, 0x12a56(%rip)     # 0x242a8
jmp 0x11aaf
movl 0x12a4b(%rip), %edi     # 0x242a8
jmp 0x11a93
cmpl $0x0, 0x8c5f(%rip)      # 0x1a4c8
sets %cl
movl 0x12806(%rip), %eax     # 0x24078
testl %eax, %eax
setne %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x11aaf
movl 0xa304(%rip), %ecx      # 0x1bb8c
addl %ecx, %eax
decl %eax
cltd
idivl %ecx
movl %edx, %edi
jmp 0x119fb
xorl %edi, %edi
jmp 0x118a2
movl 0xa2ec(%rip), %edi      # 0x1bb8c
decl %edi
movl $0x1, %esi
jmp 0x119fd
leaq 0x4888(%rip), %rdi      # 0x1613b
callq 0x11605
testl %eax, %eax
je 0x11aaf
leal -0x61(%rax), %edx
leal -0x20(%rax), %ecx
cmpl $0x1a, %edx
cmovael %eax, %ecx
movq 0x1279d(%rip), %rdx     # 0x24070
movslq 0x1279e(%rip), %rax     # 0x24078
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
movq (%rdx,%rsi), %rsi
movsbl (%rsi), %esi
leal -0x61(%rsi), %edi
leal -0x20(%rsi), %r8d
cmpb $0x1a, %dil
cmovael %esi, %r8d
leal 0x1(%rax), %esi
xorl %eax, %eax
cmpl %r8d, %ecx
cmovel %esi, %eax
movl 0xa283(%rip), %esi      # 0x1bb8c
cmpl %esi, %eax
jge 0x11aaf
movslq %eax, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rdi, %rdx
addq $0x20, %rdx
cmpl $0x27, %ecx
jne 0x11932
testb $0x1, 0x7(%rdx)
je 0x11ab1
movq -0x20(%rdx), %rdi
movsbl (%rdi), %edi
leal -0x61(%rdi), %r8d
leal -0x20(%rdi), %r9d
cmpb $0x1a, %r8b
cmovael %edi, %r9d
cmpl %r9d, %ecx
je 0x11ab1
incl %eax
addq $0x30, %rdx
cmpl %eax, %esi
jne 0x11923
jmp 0x11aaf
movl 0x12941(%rip), %edi     # 0x242a8
movl $0x1, %esi
callq 0x10e3c
movzwl 0xa210(%rip), %eax      # 0x1bb88
movl 0x1292a(%rip), %ecx     # 0x242a8
subl %eax, %ecx
addl $0x5, %ecx
movl %ecx, 0x1291f(%rip)     # 0x242a8
jmp 0x11aaf
movl 0x12914(%rip), %eax     # 0x242a8
movzwl 0xa1ed(%rip), %ecx      # 0x1bb88
leal (%rax,%rcx), %edi
addl $-0x5, %edi
movl $0x1, %esi
callq 0x10e3c
movzwl 0xa1d6(%rip), %eax      # 0x1bb88
addl $-0x4, %eax
sarl %eax
addl %eax, 0x128eb(%rip)     # 0x242a8
jmp 0x11aaf
movl 0x126b0(%rip), %eax     # 0x24078
movl 0xa1be(%rip), %ecx      # 0x1bb8c
movq 0x1269b(%rip), %rdx     # 0x24070
xorl %esi, %esi
movl %eax, %edi
incl %edi
cmpl %ecx, %edi
cmovgel %esi, %edi
cmpl %eax, %edi
je 0x11aaf
movslq %edi, %r8
leaq (%r8,%r8,2), %r8
shlq $0x4, %r8
testb $0x40, 0x27(%rdx,%r8)
je 0x119d9
xorl %esi, %esi
popq %rax
jmp 0x10e3c
leaq 0x4a0a(%rip), %rsi      # 0x16414
xorl %edi, %edi
callq 0x11f73
movzbl 0x8d38(%rip), %eax      # 0x1a750
testl %eax, %eax
je 0x11aaf
cmpl $0x2b, %eax
je 0x11a47
cmpl $0x2d, %eax
jne 0x11a71
leaq 0x8d20(%rip), %rdi      # 0x1a751
callq 0x47b0
movl 0x1263c(%rip), %ecx     # 0x24078
subl %eax, %ecx
xorl %edi, %edi
testl %ecx, %ecx
cmovgl %ecx, %edi
jmp 0x11a8d
leaq 0x8d03(%rip), %rdi      # 0x1a751
callq 0x47b0
movl %eax, %edi
addl 0x1261d(%rip), %edi     # 0x24078
movl %edi, 0x12617(%rip)     # 0x24078
movl 0xa125(%rip), %eax      # 0x1bb8c
cmpl %eax, %edi
jl 0x11a93
decl %eax
movl %eax, %edi
jmp 0x11a8d
leaq 0x8cd8(%rip), %rdi      # 0x1a750
callq 0x47b0
testl %eax, %eax
jle 0x11aaf
movl %eax, %edi
cmpl 0xa103(%rip), %eax      # 0x1bb8c
jg 0x11aaf
decl %edi
movl %edi, 0x125e5(%rip)     # 0x24078
movl $0x1, %esi
callq 0x10e3c
movzwl 0xa0e4(%rip), %eax      # 0x1bb88
addl $-0x4, %eax
sarl %eax
subl %eax, 0x127f9(%rip)     # 0x242a8
popq %rax
retq
cltd
idivl %esi
jmp 0x1188f