// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $-0x4, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xa, %eax
ja 0x1171c
movq -0x28(%rbp), %rax
leaq 0x9ec1(%rip), %rcx      # 0x1b2ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0xf096(%rip), %eax      # 0x204d0
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x11455
movl 0x18f30(%rip), %eax     # 0x2a378
movl 0x10a3e(%rip), %ecx     # 0x21e8c
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x1146e
movl 0x18f1d(%rip), %eax     # 0x2a378
addl $0x1, %eax
cltd
idivl 0x10a27(%rip)           # 0x21e8c
movl %edx, %edi
xorl %esi, %esi
callq 0x10360
jmp 0x118f5
movl 0xf057(%rip), %eax      # 0x204d0
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x1148a
cmpl $0x0, 0x18ef0(%rip)     # 0x2a378
je 0x114a9
movl 0x18ee8(%rip), %eax     # 0x2a378
addl 0x109f6(%rip), %eax     # 0x21e8c
subl $0x1, %eax
cltd
idivl 0x109ec(%rip)           # 0x21e8c
movl %edx, %edi
xorl %esi, %esi
callq 0x10360
jmp 0x118f5
movl 0x190f4(%rip), %edi     # 0x2a5a8
movzwl 0x109cd(%rip), %eax     # 0x21e88
subl $0x4, %eax
subl $0x1, %eax
addl %eax, %edi
movl $0x1, %esi
callq 0x10360
movzwl 0x109b4(%rip), %eax     # 0x21e88
subl $0x4, %eax
subl $0x1, %eax
addl 0x190c8(%rip), %eax     # 0x2a5a8
movl %eax, 0x190c2(%rip)     # 0x2a5a8
jmp 0x118f5
movl 0x190b7(%rip), %edi     # 0x2a5a8
movzwl 0x10990(%rip), %eax     # 0x21e88
subl $0x4, %eax
subl $0x1, %eax
addl %eax, %edi
movl $0x1, %esi
callq 0x10360
movzwl 0x10977(%rip), %eax     # 0x21e88
subl $0x4, %eax
sarl %eax
addl 0x1908c(%rip), %eax     # 0x2a5a8
movl %eax, 0x19086(%rip)     # 0x2a5a8
jmp 0x118f5
movl 0x1907b(%rip), %edi     # 0x2a5a8
movl $0x1, %esi
callq 0x10360
movzwl 0x1094a(%rip), %ecx     # 0x21e88
subl $0x4, %ecx
subl $0x1, %ecx
movl 0x1905e(%rip), %eax     # 0x2a5a8
subl %ecx, %eax
movl %eax, 0x19056(%rip)     # 0x2a5a8
jmp 0x118f5
movl 0x1904b(%rip), %edi     # 0x2a5a8
movl $0x1, %esi
callq 0x10360
movzwl 0x1091a(%rip), %ecx     # 0x21e88
subl $0x4, %ecx
sarl %ecx
movl 0x1902f(%rip), %eax     # 0x2a5a8
subl %ecx, %eax
movl %eax, 0x19027(%rip)     # 0x2a5a8
jmp 0x118f5
xorl %eax, %eax
movl %eax, %edi
leaq 0xb202(%rip), %rsi      # 0x1c793
callq 0x144a0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x115aa
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x115af
jmp 0x118f5
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x115ed
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
callq 0x47c0
movl %eax, %ecx
movl 0x18da8(%rip), %eax     # 0x2a378
subl %ecx, %eax
movl %eax, 0x18da0(%rip)     # 0x2a378
cmpl $0x0, 0x18d99(%rip)     # 0x2a378
jge 0x115eb
movl $0x0, 0x18d8d(%rip)     # 0x2a378
jmp 0x11661
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x11631
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
callq 0x47c0
addl 0x18d6c(%rip), %eax     # 0x2a378
movl %eax, 0x18d66(%rip)     # 0x2a378
movl 0x18d60(%rip), %eax     # 0x2a378
cmpl 0x1086e(%rip), %eax     # 0x21e8c
jl 0x1162f
movl 0x10866(%rip), %eax     # 0x21e8c
subl $0x1, %eax
movl %eax, 0x18d49(%rip)     # 0x2a378
jmp 0x1165f
movq -0x10(%rbp), %rdi
callq 0x47c0
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jl 0x1164e
movl -0x14(%rbp), %eax
cmpl 0x10840(%rip), %eax     # 0x21e8c
jle 0x11653
jmp 0x118f5
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, 0x18d19(%rip)     # 0x2a378
jmp 0x11661
movl 0x18d11(%rip), %edi     # 0x2a378
movl $0x1, %esi
callq 0x10360
movzwl 0x10810(%rip), %ecx     # 0x21e88
subl $0x4, %ecx
sarl %ecx
movl 0x18f25(%rip), %eax     # 0x2a5a8
subl %ecx, %eax
movl %eax, 0x18f1d(%rip)     # 0x2a5a8
jmp 0x118f5
xorl %edi, %edi
movl $0x1, %esi
callq 0x10360
jmp 0x118f5
movl 0x107e5(%rip), %edi     # 0x21e8c
subl $0x1, %edi
movl $0x1, %esi
callq 0x10360
jmp 0x118f5
movl 0x18cb9(%rip), %eax     # 0x2a378
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl 0x107bb(%rip), %eax     # 0x21e8c
jl 0x116da
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0x18c95(%rip), %eax     # 0x2a378
jne 0x116e7
jmp 0x11717
movq 0x18c82(%rip), %rax     # 0x2a370
movslq -0x18(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
shrq $0x38, %rax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x11715
movl -0x18(%rbp), %edi
xorl %esi, %esi
callq 0x10360
jmp 0x11717
jmp 0x116c2
jmp 0x118f5
movq 0xe46d(%rip), %rdi      # 0x1fb90
callq 0x10dc0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x11736
jmp 0x118f5
cmpl $0x61, -0x1c(%rbp)
jl 0x11750
cmpl $0x7a, -0x1c(%rbp)
jg 0x11750
movl -0x1c(%rbp), %eax
subl $0x61, %eax
addl $0x41, %eax
movl %eax, -0x2c(%rbp)
jmp 0x11756
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x30(%rbp)
movq 0x18c07(%rip), %rax     # 0x2a370
movslq 0x18c08(%rip), %rcx     # 0x2a378
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x117c8
movq 0x18be7(%rip), %rax     # 0x2a370
movslq 0x18be8(%rip), %rcx     # 0x2a378
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x7a, %eax
jg 0x117c8
movq 0x18bc7(%rip), %rax     # 0x2a370
movslq 0x18bc8(%rip), %rcx     # 0x2a378
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
subl $0x61, %eax
addl $0x41, %eax
movl %eax, -0x34(%rbp)
jmp 0x117e6
movq 0x18ba1(%rip), %rax     # 0x2a370
movslq 0x18ba2(%rip), %rcx     # 0x2a378
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
cmpl %ecx, %eax
jne 0x117fe
movl 0x18b82(%rip), %eax     # 0x2a378
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x11805
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0x11805
movl -0x38(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0x10678(%rip), %eax     # 0x21e8c
jge 0x118f3
cmpl $0x27, -0x1c(%rbp)
jne 0x11846
movq 0x18b49(%rip), %rax     # 0x2a370
movslq -0x20(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
shrq $0x38, %rax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x118ce
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq 0x18b1d(%rip), %rax     # 0x2a370
movslq -0x20(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x118a9
movq 0x18b00(%rip), %rax     # 0x2a370
movslq -0x20(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x7a, %eax
jg 0x118a9
movq 0x18ae3(%rip), %rax     # 0x2a370
movslq -0x20(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
subl $0x61, %eax
addl $0x41, %eax
movl %eax, -0x40(%rbp)
jmp 0x118c4
movq 0x18ac0(%rip), %rax     # 0x2a370
movslq -0x20(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
movl -0x40(%rbp), %ecx
cmpl %ecx, %eax
jne 0x118e3
movl -0x20(%rbp), %eax
cltd
idivl 0x105b4(%rip)           # 0x21e8c
movl %edx, %edi
xorl %esi, %esi
callq 0x10360
jmp 0x118f3
jmp 0x118e5
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1180b
jmp 0x118f5
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)