// File: /workspace/github_c_makefile_star2_O1/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 0x11c36
leaq 0x3729(%rip), %rax      # 0x15298
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x0, 0x8949(%rip)      # 0x1a4c8
js 0x11b95
movl 0xa005(%rip), %eax      # 0x1bb8c
decl %eax
cmpl %eax, 0x124e9(%rip)     # 0x24078
je 0x11e36
movl 0x124dd(%rip), %eax     # 0x24078
incl %eax
cltd
idivl 0x9fe8(%rip)            # 0x1bb8c
jmp 0x11e3b
movl 0x126f9(%rip), %eax     # 0x242a8
movzwl 0x9fd2(%rip), %ecx      # 0x1bb88
leal (%rax,%rcx), %edi
addl $-0x5, %edi
movl $0x1, %esi
callq 0x11031
movzwl 0x9fbb(%rip), %eax      # 0x1bb88
movl 0x126d5(%rip), %ecx     # 0x242a8
addl %ecx, %eax
addl $-0x5, %eax
movl %eax, 0x126ca(%rip)     # 0x242a8
jmp 0x11e36
movl 0x126bf(%rip), %edi     # 0x242a8
jmp 0x11e1a
cmpl $0x0, 0x88d3(%rip)      # 0x1a4c8
sets %cl
movl 0x1247a(%rip), %eax     # 0x24078
testl %eax, %eax
setne %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x11e36
movl 0x9f78(%rip), %ecx      # 0x1bb8c
addl %ecx, %eax
decl %eax
cltd
idivl %ecx
jmp 0x11e3b
xorl %edi, %edi
jmp 0x11c2c
movl 0x9f62(%rip), %edi      # 0x1bb8c
decl %edi
movl $0x1, %esi
jmp 0x11e3f
leaq 0x44e4(%rip), %rdi      # 0x16121
callq 0x11973
testl %eax, %eax
je 0x11e36
leal -0x61(%rax), %edx
leal -0x20(%rax), %ecx
cmpl $0x1a, %edx
cmovael %eax, %ecx
movq 0x12413(%rip), %rdx     # 0x24070
movslq 0x12414(%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 0x9ef9(%rip), %esi      # 0x1bb8c
cmpl %esi, %eax
jge 0x11e36
movslq %eax, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rdi, %rdx
addq $0x20, %rdx
cmpl $0x27, %ecx
jne 0x11cbc
testb $0x1, 0x7(%rdx)
je 0x11e38
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 0x11e38
incl %eax
addq $0x30, %rdx
cmpl %eax, %esi
jne 0x11cad
jmp 0x11e36
movl 0x125b7(%rip), %edi     # 0x242a8
movl $0x1, %esi
callq 0x11031
movzwl 0x9e86(%rip), %eax      # 0x1bb88
movl 0x125a0(%rip), %ecx     # 0x242a8
subl %eax, %ecx
addl $0x5, %ecx
movl %ecx, 0x12595(%rip)     # 0x242a8
jmp 0x11e36
movl 0x1258a(%rip), %eax     # 0x242a8
movzwl 0x9e63(%rip), %ecx      # 0x1bb88
leal (%rax,%rcx), %edi
addl $-0x5, %edi
movl $0x1, %esi
callq 0x11031
movzwl 0x9e4c(%rip), %eax      # 0x1bb88
addl $-0x4, %eax
sarl %eax
addl %eax, 0x12561(%rip)     # 0x242a8
jmp 0x11e36
movl 0x12326(%rip), %eax     # 0x24078
movl 0x9e34(%rip), %ecx      # 0x1bb8c
movq 0x12311(%rip), %rdx     # 0x24070
xorl %esi, %esi
movl %eax, %edi
incl %edi
cmpl %ecx, %edi
cmovgel %esi, %edi
cmpl %eax, %edi
je 0x11e36
movslq %edi, %r8
leaq (%r8,%r8,2), %r8
shlq $0x4, %r8
testb $0x40, 0x27(%rdx,%r8)
je 0x11d63
jmp 0x11e3d
leaq 0x4669(%rip), %rsi      # 0x163fa
xorl %edi, %edi
callq 0x122b4
movzbl 0x89b1(%rip), %eax      # 0x1a750
testl %eax, %eax
je 0x11e36
cmpl $0x2b, %eax
je 0x11dce
cmpl $0x2d, %eax
jne 0x11df4
leaq 0x8999(%rip), %rdi      # 0x1a751
callq 0x47b0
movl 0x122b5(%rip), %ecx     # 0x24078
subl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovgl %ecx, %eax
jmp 0x11e0e
leaq 0x897c(%rip), %rdi      # 0x1a751
callq 0x47b0
movl %eax, %ecx
addl 0x12296(%rip), %ecx     # 0x24078
movl %ecx, 0x12290(%rip)     # 0x24078
movl 0x9d9e(%rip), %eax      # 0x1bb8c
cmpl %eax, %ecx
jge 0x11e0c
jmp 0x11e14
leaq 0x8955(%rip), %rdi      # 0x1a750
callq 0x47b0
testl %eax, %eax
jle 0x11e36
cmpl 0x9d82(%rip), %eax      # 0x1bb8c
jg 0x11e36
decl %eax
movl %eax, 0x12264(%rip)     # 0x24078
movl 0x1225e(%rip), %edi     # 0x24078
movl $0x1, %esi
callq 0x11031
movzwl 0x9d5d(%rip), %eax      # 0x1bb88
addl $-0x4, %eax
sarl %eax
subl %eax, 0x12472(%rip)     # 0x242a8
popq %rax
retq
cltd
idivl %esi
movl %edx, %edi
xorl %esi, %esi
popq %rax
jmp 0x11031