	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rgui_navigation_set
_rgui_navigation_set:                   ## @rgui_navigation_set
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_menu_entries_get_size
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_menu_navigation_get_selection
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.1:
	movq	%rax, %r15
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_rgui_scan_selected_entry_thumbnail
	movq	%rbx, %rdi
	callq	_rgui_update_menu_sublabel
	testl	%r12d, %r12d
	je	LBB0_8
## %bb.2:
	movq	_rgui_term_layout@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movslq	%ecx, %rdx
	movq	%r15, %rcx
	subq	%rdx, %rcx
	jae	LBB0_4
## %bb.3:
	movq	$0, -40(%rbp)
	jmp	LBB0_7
LBB0_4:
	movq	%r14, %rsi
	subq	%rdx, %rsi
	cmpq	%rsi, %r15
	jae	LBB0_6
## %bb.5:
	movq	%rcx, -40(%rbp)
	jmp	LBB0_7
LBB0_6:
	subq	%rax, %r14
	movq	%r14, -40(%rbp)
LBB0_7:
	movq	_MENU_ENTRIES_CTL_SET_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-40(%rbp), %rsi
	callq	_menu_entries_ctl
	movq	_FONT_HEIGHT_STRIDE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	imulq	-40(%rbp), %rax
	movq	%rax, (%rbx)
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rgui_term_layout,4,2           ## @rgui_term_layout
	.comm	_MENU_ENTRIES_CTL_SET_START,4,2 ## @MENU_ENTRIES_CTL_SET_START
	.comm	_FONT_HEIGHT_STRIDE,8,3         ## @FONT_HEIGHT_STRIDE
	.no_dead_strip	_rgui_navigation_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rgui_navigation_set
_rgui_navigation_set:                   ; @rgui_navigation_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x22, x1
	mov	x19, x0
	bl	_menu_entries_get_size
	mov	x20, x0
	bl	_menu_navigation_get_selection
	cbz	x19, LBB0_8
; %bb.1:
	mov	x21, x0
	mov	x0, x19
	mov	w1, #0
	bl	_rgui_scan_selected_entry_thumbnail
	mov	x0, x19
	bl	_rgui_update_menu_sublabel
	cbz	w22, LBB0_8
; %bb.2:
Lloh0:
	adrp	x8, _rgui_term_layout@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rgui_term_layout@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	cmp	w8, #0
	cinc	w9, w8, lt
	sbfx	x10, x9, #1, #31
	subs	x9, x21, x10
	b.hs	LBB0_4
; %bb.3:
	str	xzr, [sp, #8]
	b	LBB0_7
LBB0_4:
	sub	x10, x20, x10
	cmp	x21, x10
	b.hs	LBB0_6
; %bb.5:
	str	x9, [sp, #8]
	b	LBB0_7
LBB0_6:
	sub	x8, x20, x8
	str	x8, [sp, #8]
LBB0_7:
Lloh3:
	adrp	x8, _MENU_ENTRIES_CTL_SET_START@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MENU_ENTRIES_CTL_SET_START@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_menu_entries_ctl
	ldr	x8, [sp, #8]
Lloh6:
	adrp	x9, _FONT_HEIGHT_STRIDE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FONT_HEIGHT_STRIDE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	mul	x8, x9, x8
	str	x8, [x19]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_rgui_term_layout,4,2           ; @rgui_term_layout
	.comm	_MENU_ENTRIES_CTL_SET_START,4,2 ; @MENU_ENTRIES_CTL_SET_START
	.comm	_FONT_HEIGHT_STRIDE,8,3         ; @FONT_HEIGHT_STRIDE
	.no_dead_strip	_rgui_navigation_set
.subsections_via_symbols
