	.file	"extr_rgui.c_rgui_navigation_set.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rgui_navigation_set, @function
rgui_navigation_set:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	menu_entries_get_size@PLT
	mov	rbp, rax
	xor	eax, eax
	call	menu_navigation_get_selection@PLT
	test	rbx, rbx
	je	.L1
	xor	esi, esi
	mov	rdi, rbx
	mov	r13, rax
	call	rgui_scan_selected_entry_thumbnail@PLT
	mov	rdi, rbx
	call	rgui_update_menu_sublabel@PLT
	test	r12d, r12d
	je	.L1
	movsx	rax, DWORD PTR rgui_term_layout[rip]
	mov	edx, eax
	shr	edx, 31
	add	edx, eax
	sar	edx
	movsx	rdx, edx
	cmp	rdx, r13
	jbe	.L3
	mov	QWORD PTR [rsp], 0
.L4:
	mov	edi, DWORD PTR MENU_ENTRIES_CTL_SET_START[rip]
	mov	rsi, rsp
	call	menu_entries_ctl@PLT
	mov	rax, QWORD PTR [rsp]
	imul	rax, QWORD PTR FONT_HEIGHT_STRIDE[rip]
	mov	QWORD PTR [rbx], rax
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L16
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	rcx, rbp
	sub	rbp, rax
	mov	rax, r13
	sub	rcx, rdx
	sub	rax, rdx
	cmp	rcx, r13
	cmova	rbp, rax
	mov	QWORD PTR [rsp], rbp
	jmp	.L4
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rgui_navigation_set, .-rgui_navigation_set
	.comm	rgui_term_layout,4,4
	.comm	MENU_ENTRIES_CTL_SET_START,4,4
	.comm	FONT_HEIGHT_STRIDE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rgui.c_rgui_navigation_set.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rgui_navigation_set, %function
rgui_navigation_set:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L17
	sub	sp, sp, #12
	mov	r4, r0
	mov	r6, r1
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	menu_entries_get_size
	mov	r7, r0
	bl	menu_navigation_get_selection
	cmp	r4, #0
	beq	.L1
	mov	r1, #0
	mov	r5, r0
	mov	r0, r4
	bl	rgui_scan_selected_entry_thumbnail
	mov	r0, r4
	bl	rgui_update_menu_sublabel
	cmp	r6, #0
	beq	.L1
	ldr	r3, .L17+4
	ldr	r0, [r3]
	add	r3, r0, r0, lsr #31
	cmp	r5, r3, asr #1
	asr	r3, r3, #1
	movcc	r3, #0
	strcc	r3, [sp]
	bcc	.L4
	sub	r2, r7, r3
	cmp	r2, r5
	subhi	r0, r5, r3
	subls	r0, r7, r0
	str	r0, [sp]
.L4:
	ldr	r3, .L17+8
	mov	r1, sp
	ldr	r0, [r3]
	bl	menu_entries_ctl
	ldr	r2, .L17+12
	ldr	r3, [sp]
	ldr	r2, [r2]
	mul	r3, r2, r3
	str	r3, [r4]
.L1:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L16
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L16:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	rgui_term_layout
	.word	MENU_ENTRIES_CTL_SET_START
	.word	FONT_HEIGHT_STRIDE
	.size	rgui_navigation_set, .-rgui_navigation_set
	.comm	rgui_term_layout,4,4
	.comm	MENU_ENTRIES_CTL_SET_START,4,4
	.comm	FONT_HEIGHT_STRIDE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
