	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function menu_loop_options
_menu_loop_options:                     ## @menu_loop_options
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_opt_entries@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_OPT_ENTRY_COUNT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_rom_loaded@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$131, %edx
	callq	_me_enable
	movl	(%rbx), %edi
	movl	(%r12), %esi
	movq	_config_slot@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_config_slot_current@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	cmpq	(%rdx), %rax
	setne	%cl
	movl	$135, %edx
	callq	_me_enable
	movl	(%rbx), %edi
	movl	(%r12), %esi
	callq	_me_count_enabled
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %r13d
	movl	_menu_loop_options.menu_sel(%rip), %edi
	cmpl	%eax, %edi
	jl	LBB0_2
## %bb.1:
	movl	%r13d, _menu_loop_options.menu_sel(%rip)
	movl	%r13d, %edi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_PBTN_DOWN@GOTPCREL(%rip), %r14
	callq	_draw_menu_options
	movq	(%r14), %rdi
	movq	_PBTN_UP@GOTPCREL(%rip), %rbx
	orq	(%rbx), %rdi
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	movq	_PBTN_PLAY@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	movq	_PBTN_STOP@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	movq	_PBTN_REW@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	callq	_in_menu_wait
	movq	%rax, %r15
	testq	%rax, (%rbx)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	_menu_loop_options.menu_sel(%rip), %eax
	leal	-1(%rax), %ecx
	testl	%eax, %eax
	cmovlel	%r13d, %ecx
	movl	%ecx, _menu_loop_options.menu_sel(%rip)
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	_menu_loop_options.menu_sel(%rip), %edx
	testq	%r15, (%r14)
	movq	_opt_entries@GOTPCREL(%rip), %rbx
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r13d, %edx
	jl	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%edx
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%edx, _menu_loop_options.menu_sel(%rip)
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %edi
	movl	(%r12), %esi
	callq	_me_index2id
	movl	%eax, %r14d
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orq	%rax, %rcx
	testq	%r15, %rcx
	je	LBB0_47
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %edi
	movl	(%r12), %esi
	xorl	%ecx, %ecx
	testq	%r15, %rax
	setne	%cl
	movl	%r14d, %edx
	callq	_me_process
	testl	%eax, %eax
	je	LBB0_11
LBB0_47:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PBTN_PLAY@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	je	LBB0_64
## %bb.48:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %edi
	movl	(%r12), %esi
	movl	%r14d, %edx
	movl	$1, %ecx
	callq	_me_process
	testl	%eax, %eax
	je	LBB0_49
LBB0_64:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PBTN_REW@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PBTN_STOP@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	testq	%r15, %rax
	jne	LBB0_66
## %bb.65:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	_menu_loop_options.menu_sel(%rip), %edi
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	leal	-128(%r14), %eax
	cmpl	$8, %eax
	movq	_state_slot@GOTPCREL(%rip), %rdx
	ja	LBB0_47
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_41:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andq	%r15, %rax
	cmpq	$1, %rax
	movl	$0, %eax
	sbbq	%rax, %rax
	orq	$1, %rax
	movq	_config_slot@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movl	$0, %ecx
	cmpq	$10, %rax
	jge	LBB0_43
## %bb.42:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rcx
LBB0_43:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	$9, %eax
	testq	%rcx, %rcx
	js	LBB0_45
## %bb.44:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, %rax
LBB0_45:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_config_slot@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	(%rbx), %edi
	movl	(%r12), %esi
	xorl	%ecx, %ecx
	movq	_config_slot_current@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	setne	%cl
	movl	$135, %edx
	callq	_me_enable
	movl	(%rbx), %edi
	movl	(%r12), %esi
	callq	_me_count_enabled
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %r13d
	cmpl	%eax, _menu_loop_options.menu_sel(%rip)
	jl	LBB0_47
## %bb.46:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, _menu_loop_options.menu_sel(%rip)
	jmp	LBB0_47
	.p2align	4, 0x90
LBB0_49:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	$-129, %r14d
	cmpl	$8, %r14d
	ja	LBB0_64
## %bb.50:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	LJTI0_1(%rip), %rcx
	movslq	(%rcx,%r14,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_63:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_cd_menu_loop_options
	movq	_engineState@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PGS_ReloadRom@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_64
	jmp	LBB0_67
LBB0_51:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_amenu_loop_options
	jmp	LBB0_64
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_PsndRate@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andq	%r15, %rsi
	je	LBB0_26
## %bb.22:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$44100, %edi                    ## imm = 0xAC44
	jne	LBB0_26
## %bb.23:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testb	$8, %al
	jne	LBB0_31
## %bb.24:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_PsndRate@GOTPCREL(%rip), %rcx
	movl	$11025, (%rcx)                  ## imm = 0x2B11
	orl	$8, %eax
LBB0_25:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PicoOpt@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_47
LBB0_38:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rdx), %eax
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rcx
	testq	%r15, (%rcx)
	je	LBB0_40
## %bb.39:                              ##   in Loop: Header=BB0_2 Depth=1
	leal	1(%rax), %ecx
	cmpl	$9, %eax
	movl	$0, %eax
	cmovgel	%eax, %ecx
	movl	%ecx, (%rdx)
	jmp	LBB0_47
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rdx
	testq	%r15, (%rdx)
	je	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	testb	$16, %cl
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %edx
	andl	$128, %edx
	jne	LBB0_47
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	andl	$-17, %ecx
	movq	_PicoOpt@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	orl	$128, %eax
	jmp	LBB0_17
LBB0_32:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	andq	%r15, %rdi
	callq	_region_prevnext
	jmp	LBB0_47
LBB0_33:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$9, %ecx
	andl	$1, %ecx
	movl	%eax, %edx
	shrl	$10, %edx
	andl	$2, %edx
	orl	%ecx, %edx
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	andq	%r15, %rsi
	xorl	%ecx, %ecx
	negq	%rsi
	sbbl	%ecx, %ecx
	orl	$1, %ecx
	addl	%edx, %ecx
	cmpl	$3, %ecx
	jl	LBB0_35
## %bb.34:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$3, %ecx
LBB0_35:                                ##   in Loop: Header=BB0_2 Depth=1
	testl	%ecx, %ecx
	jg	LBB0_37
## %bb.36:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ecx, %ecx
LBB0_37:                                ##   in Loop: Header=BB0_2 Depth=1
	andl	$-2561, %eax                    ## imm = 0xF5FF
	movl	%ecx, %edx
	shll	$10, %edx
	shll	$9, %ecx
	orl	%edx, %ecx
	andl	$2560, %ecx                     ## imm = 0xA00
	orl	%eax, %ecx
	movq	_currentConfig@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	jmp	LBB0_47
LBB0_26:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	je	LBB0_31
## %bb.27:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$11025, %edi                    ## imm = 0x2B11
	jne	LBB0_31
## %bb.28:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testb	$8, %al
	je	LBB0_31
## %bb.29:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_PicoAHW@GOTPCREL(%rip), %rcx
	testb	$1, (%rcx)
	jne	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_PsndRate@GOTPCREL(%rip), %rcx
	movl	$44100, (%rcx)                  ## imm = 0xAC44
	andl	$-9, %eax
	jmp	LBB0_25
LBB0_31:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_sndrate_prevnext
	movq	_PsndRate@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_47
LBB0_40:                                ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rax), %ecx
	testl	%eax, %eax
	movl	$9, %eax
	cmovlel	%eax, %ecx
	movl	%ecx, (%rdx)
	jmp	LBB0_47
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	testb	$16, %cl
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %edx
	andl	$128, %edx
	je	LBB0_47
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	orl	$16, %ecx
	movq	_PicoOpt@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	andl	$-129, %eax
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_currentConfig@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_47
LBB0_66:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_menu_options_save
LBB0_67:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_56:
	xorl	%eax, %eax
	callq	_menu_options_save
	movl	$1, %r14d
	movl	$1, %edi
	callq	_emu_WriteConfig
	movq	_menuErrorMsg@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testl	%eax, %eax
	je	LBB0_58
## %bb.57:
	leaq	L_.str(%rip), %rsi
	callq	_strcpy
	jmp	LBB0_67
LBB0_52:
	xorl	%eax, %eax
	callq	_menu_options_save
	xorl	%edi, %edi
	callq	_emu_WriteConfig
	movq	_menuErrorMsg@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testl	%eax, %eax
	je	LBB0_55
## %bb.53:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_54
LBB0_59:
	movl	$1, %r14d
	movl	$1, %edi
	movl	$1, %esi
	callq	_emu_ReadConfig
	testl	%eax, %eax
	jne	LBB0_61
## %bb.60:
	xorl	%edi, %edi
	movl	$1, %esi
	callq	_emu_ReadConfig
	testl	%eax, %eax
	je	LBB0_62
LBB0_61:
	movq	_menuErrorMsg@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcpy
	jmp	LBB0_67
LBB0_58:
	leaq	L_.str.1(%rip), %rsi
	callq	_strcpy
	jmp	LBB0_67
LBB0_55:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_54
LBB0_62:
	movq	_menuErrorMsg@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_54:
	callq	_strcpy
	movl	$1, %r14d
	jmp	LBB0_67
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_21, LBB0_21-LJTI0_0
.set L0_0_set_47, LBB0_47-LJTI0_0
.set L0_0_set_38, LBB0_38-LJTI0_0
.set L0_0_set_41, LBB0_41-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_32, LBB0_32-LJTI0_0
.set L0_0_set_33, LBB0_33-LJTI0_0
LJTI0_0:
	.long	L0_0_set_21
	.long	L0_0_set_47
	.long	L0_0_set_38
	.long	L0_0_set_41
	.long	L0_0_set_41
	.long	L0_0_set_13
	.long	L0_0_set_32
	.long	L0_0_set_41
	.long	L0_0_set_33
.set L0_1_set_63, LBB0_63-LJTI0_1
.set L0_1_set_64, LBB0_64-LJTI0_1
.set L0_1_set_56, LBB0_56-LJTI0_1
.set L0_1_set_52, LBB0_52-LJTI0_1
.set L0_1_set_59, LBB0_59-LJTI0_1
.set L0_1_set_51, LBB0_51-LJTI0_1
LJTI0_1:
	.long	L0_1_set_63
	.long	L0_1_set_64
	.long	L0_1_set_56
	.long	L0_1_set_52
	.long	L0_1_set_64
	.long	L0_1_set_64
	.long	L0_1_set_59
	.long	L0_1_set_64
	.long	L0_1_set_51
	.end_data_region
                                        ## -- End function
.zerofill __DATA,__bss,_menu_loop_options.menu_sel,4,2 ## @menu_loop_options.menu_sel
	.comm	_opt_entries,4,2                ## @opt_entries
	.comm	_OPT_ENTRY_COUNT,4,2            ## @OPT_ENTRY_COUNT
	.comm	_rom_loaded,4,2                 ## @rom_loaded
	.comm	_config_slot,8,3                ## @config_slot
	.comm	_config_slot_current,8,3        ## @config_slot_current
	.comm	_PBTN_UP,8,3                    ## @PBTN_UP
	.comm	_PBTN_DOWN,8,3                  ## @PBTN_DOWN
	.comm	_PBTN_LEFT,8,3                  ## @PBTN_LEFT
	.comm	_PBTN_RIGHT,8,3                 ## @PBTN_RIGHT
	.comm	_PBTN_PLAY,8,3                  ## @PBTN_PLAY
	.comm	_PBTN_STOP,8,3                  ## @PBTN_STOP
	.comm	_PBTN_REW,8,3                   ## @PBTN_REW
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_currentConfig,4,2              ## @currentConfig
	.comm	_PsndRate,4,2                   ## @PsndRate
	.comm	_PicoAHW,4,2                    ## @PicoAHW
	.comm	_state_slot,4,2                 ## @state_slot
	.comm	_engineState,4,2                ## @engineState
	.comm	_PGS_ReloadRom,4,2              ## @PGS_ReloadRom
	.comm	_menuErrorMsg,4,2               ## @menuErrorMsg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"config saved"

L_.str.1:                               ## @.str.1
	.asciz	"failed to write config"

L_.str.2:                               ## @.str.2
	.asciz	"config loaded"

L_.str.3:                               ## @.str.3
	.asciz	"failed to load config"

	.no_dead_strip	_menu_loop_options
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function menu_loop_options
_menu_loop_options:                     ; @menu_loop_options
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x21, _opt_entries@GOTPAGE
Lloh1:
	ldr	x21, [x21, _opt_entries@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x22, _OPT_ENTRY_COUNT@GOTPAGE
Lloh3:
	ldr	x22, [x22, _OPT_ENTRY_COUNT@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh4:
	adrp	x8, _rom_loaded@GOTPAGE
Lloh5:
	ldr	x8, [x8, _rom_loaded@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	w2, #131
	bl	_me_enable
	ldr	w0, [x21]
	ldr	w1, [x22]
Lloh7:
	adrp	x8, _config_slot@GOTPAGE
Lloh8:
	ldr	x8, [x8, _config_slot@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _config_slot_current@GOTPAGE
Lloh11:
	ldr	x9, [x9, _config_slot_current@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w3, ne
	mov	w2, #135
	bl	_me_enable
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_me_count_enabled
	mov	x8, x0
	sub	w23, w0, #1
	adrp	x25, _menu_loop_options.menu_sel@PAGE
	ldr	w0, [x25, _menu_loop_options.menu_sel@PAGEOFF]
	cmp	w0, w8
	b.lt	LBB0_2
; %bb.1:
	str	w23, [x25, _menu_loop_options.menu_sel@PAGEOFF]
	mov	x0, x23
LBB0_2:
Lloh13:
	adrp	x28, _PBTN_LEFT@GOTPAGE
Lloh14:
	ldr	x28, [x28, _PBTN_LEFT@GOTPAGEOFF]
Lloh15:
	adrp	x24, _PBTN_RIGHT@GOTPAGE
Lloh16:
	ldr	x24, [x24, _PBTN_RIGHT@GOTPAGEOFF]
Lloh17:
	adrp	x26, _PBTN_STOP@GOTPAGE
Lloh18:
	ldr	x26, [x26, _PBTN_STOP@GOTPAGEOFF]
Lloh19:
	adrp	x27, _PBTN_REW@GOTPAGE
Lloh20:
	ldr	x27, [x27, _PBTN_REW@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	bl	_draw_menu_options
Lloh21:
	adrp	x20, _PBTN_UP@GOTPAGE
Lloh22:
	ldr	x20, [x20, _PBTN_UP@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh23:
	adrp	x9, _PBTN_DOWN@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PBTN_DOWN@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	orr	x8, x9, x8
	ldr	x9, [x28]
	orr	x8, x8, x9
	ldr	x9, [x24]
	orr	x8, x8, x9
Lloh26:
	adrp	x9, _PBTN_PLAY@GOTPAGE
Lloh27:
	ldr	x9, [x9, _PBTN_PLAY@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	orr	x8, x8, x9
	ldr	x9, [x26]
	orr	x8, x8, x9
	ldr	x9, [x27]
	orr	x0, x8, x9
	bl	_in_menu_wait
	mov	x19, x0
	ldr	x8, [x20]
	tst	x8, x0
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x25, _menu_loop_options.menu_sel@PAGEOFF]
	subs	w8, w8, #1
	csel	w8, w23, w8, lt
	str	w8, [x25, _menu_loop_options.menu_sel@PAGEOFF]
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh29:
	adrp	x8, _PBTN_DOWN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PBTN_DOWN@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	ldr	w2, [x25, _menu_loop_options.menu_sel@PAGEOFF]
	tst	x8, x19
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w2, w23
	csinc	w2, wzr, w2, ge
	str	w2, [x25, _menu_loop_options.menu_sel@PAGEOFF]
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_me_index2id
	mov	x20, x0
	ldr	x9, [x28]
	ldr	x8, [x24]
	orr	x9, x8, x9
	tst	x9, x19
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	ldr	w1, [x22]
	tst	x8, x19
	cset	w3, ne
	mov	x2, x20
	bl	_me_process
	cbz	w0, LBB0_13
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh32:
	adrp	x8, _PBTN_PLAY@GOTPAGE
Lloh33:
	ldr	x8, [x8, _PBTN_PLAY@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	tst	x8, x19
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	ldr	w1, [x22]
	mov	x2, x20
	mov	w3, #1
	bl	_me_process
	cbz	w0, LBB0_17
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x26]
	ldr	x9, [x27]
	orr	x8, x9, x8
	tst	x8, x19
	b.ne	LBB0_44
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x25, _menu_loop_options.menu_sel@PAGEOFF]
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w8, w20, #128
	cmp	w8, #8
	b.hi	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh35:
	adrp	x11, lJTI0_0@PAGE
Lloh36:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x9, LBB0_9
	ldrb	w10, [x11, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24]
Lloh37:
	adrp	x11, _config_slot@GOTPAGE
Lloh38:
	ldr	x11, [x11, _config_slot@GOTPAGEOFF]
	ldr	x9, [x11]
	sub	x10, x9, #1
	tst	x8, x19
	csinc	x8, x10, x9, eq
	cmp	x8, #9
	csel	x8, xzr, x8, gt
	cmp	x8, #0
	mov	w9, #9
	csel	x8, x9, x8, lt
	str	x8, [x11]
	ldr	w0, [x21]
	ldr	w1, [x22]
Lloh39:
	adrp	x9, _config_slot_current@GOTPAGE
Lloh40:
	ldr	x9, [x9, _config_slot_current@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w3, ne
	mov	w2, #135
	bl	_me_enable
	ldr	w0, [x21]
	ldr	w1, [x22]
	bl	_me_count_enabled
	sub	w23, w0, #1
	ldr	w8, [x25, _menu_loop_options.menu_sel@PAGEOFF]
	cmp	w8, w0
	b.lt	LBB0_9
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	str	w23, [x25, _menu_loop_options.menu_sel@PAGEOFF]
	b	LBB0_9
LBB0_17:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w8, w20, #129
	cmp	w8, #8
	b.hi	LBB0_11
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh42:
	adrp	x11, lJTI0_1@PAGE
Lloh43:
	add	x11, x11, lJTI0_1@PAGEOFF
	adr	x9, LBB0_11
	ldrb	w10, [x11, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_19:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_cd_menu_loop_options
Lloh44:
	adrp	x8, _engineState@GOTPAGE
Lloh45:
	ldr	x8, [x8, _engineState@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
Lloh47:
	adrp	x9, _PGS_ReloadRom@GOTPAGE
Lloh48:
	ldr	x9, [x9, _PGS_ReloadRom@GOTPAGEOFF]
Lloh49:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
	b	LBB0_45
LBB0_20:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_amenu_loop_options
	b	LBB0_11
LBB0_21:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24]
	and	x1, x8, x19
Lloh50:
	adrp	x8, _PsndRate@GOTPAGE
Lloh51:
	ldr	x8, [x8, _PsndRate@GOTPAGEOFF]
Lloh52:
	ldr	w0, [x8]
	cmp	x1, #0
	mov	w8, #44100
	ccmp	w0, w8, #0, ne
	b.eq	LBB0_35
; %bb.22:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x28]
	tst	x8, x19
	b.eq	LBB0_38
; %bb.23:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w8, #11025
	cmp	w0, w8
	b.ne	LBB0_38
; %bb.24:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh53:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh54:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh55:
	ldr	w8, [x8]
	tbz	w8, #3, LBB0_38
; %bb.25:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh56:
	adrp	x9, _PicoAHW@GOTPAGE
Lloh57:
	ldr	x9, [x9, _PicoAHW@GOTPAGEOFF]
	ldrb	w9, [x9]
	tbnz	w9, #0, LBB0_38
; %bb.26:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w9, #44100
Lloh58:
	adrp	x10, _PsndRate@GOTPAGE
Lloh59:
	ldr	x10, [x10, _PsndRate@GOTPAGEOFF]
Lloh60:
	str	w9, [x10]
	and	w8, w8, #0xfffffff7
	b	LBB0_37
LBB0_27:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x24]
Lloh61:
	adrp	x10, _state_slot@GOTPAGE
Lloh62:
	ldr	x10, [x10, _state_slot@GOTPAGEOFF]
	ldr	w8, [x10]
	tst	x9, x19
	b.eq	LBB0_39
; %bb.28:                               ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, #8
	csinc	w8, wzr, w8, gt
	str	w8, [x10]
	b	LBB0_9
LBB0_29:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [x28]
Lloh63:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh64:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh65:
	ldr	w9, [x8]
Lloh66:
	adrp	x8, _currentConfig@GOTPAGE
Lloh67:
	ldr	x8, [x8, _currentConfig@GOTPAGEOFF]
Lloh68:
	ldr	w8, [x8]
	tst	x10, x19
	b.eq	LBB0_40
; %bb.30:                               ;   in Loop: Header=BB0_3 Depth=1
	tbnz	w9, #4, LBB0_32
; %bb.31:                               ;   in Loop: Header=BB0_3 Depth=1
	tbnz	w8, #7, LBB0_9
LBB0_32:                                ;   in Loop: Header=BB0_3 Depth=1
	and	w9, w9, #0xffffffef
Lloh69:
	adrp	x10, _PicoOpt@GOTPAGE
Lloh70:
	ldr	x10, [x10, _PicoOpt@GOTPAGEOFF]
Lloh71:
	str	w9, [x10]
	orr	w8, w8, #0x80
	b	LBB0_43
LBB0_33:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x24]
	and	x0, x8, x19
	bl	_region_prevnext
	b	LBB0_9
LBB0_34:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh72:
	adrp	x12, _currentConfig@GOTPAGE
Lloh73:
	ldr	x12, [x12, _currentConfig@GOTPAGEOFF]
	ldr	w8, [x12]
	lsr	w9, w8, #10
	and	w9, w9, #0x2
	bfxil	w9, w8, #9, #1
	ldr	x10, [x28]
	sub	w11, w9, #1
	tst	x10, x19
	csinc	w9, w11, w9, ne
	cmp	w9, #3
	mov	w10, #3
	csel	w9, w9, w10, lt
	cmp	w9, #0
	csel	w9, w9, wzr, gt
	mov	w10, #-2561
	and	w8, w8, w10
	lsl	w10, w9, #10
	orr	w9, w10, w9, lsl #9
	mov	w10, #2560
	and	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x12]
	b	LBB0_9
LBB0_35:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh74:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh75:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh76:
	ldr	w8, [x8]
	tbnz	w8, #3, LBB0_38
; %bb.36:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	w9, #11025
Lloh77:
	adrp	x10, _PsndRate@GOTPAGE
Lloh78:
	ldr	x10, [x10, _PsndRate@GOTPAGEOFF]
Lloh79:
	str	w9, [x10]
	orr	w8, w8, #0x8
LBB0_37:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh80:
	adrp	x9, _PicoOpt@GOTPAGE
Lloh81:
	ldr	x9, [x9, _PicoOpt@GOTPAGEOFF]
Lloh82:
	str	w8, [x9]
	b	LBB0_9
LBB0_38:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_sndrate_prevnext
Lloh83:
	adrp	x8, _PsndRate@GOTPAGE
Lloh84:
	ldr	x8, [x8, _PsndRate@GOTPAGEOFF]
Lloh85:
	str	w0, [x8]
	b	LBB0_9
LBB0_39:                                ;   in Loop: Header=BB0_3 Depth=1
	subs	w8, w8, #1
	mov	w9, #9
	csel	w8, w9, w8, lt
	str	w8, [x10]
	b	LBB0_9
LBB0_40:                                ;   in Loop: Header=BB0_3 Depth=1
	tbz	w9, #4, LBB0_42
; %bb.41:                               ;   in Loop: Header=BB0_3 Depth=1
	tbz	w8, #7, LBB0_9
LBB0_42:                                ;   in Loop: Header=BB0_3 Depth=1
	orr	w9, w9, #0x10
Lloh86:
	adrp	x10, _PicoOpt@GOTPAGE
Lloh87:
	ldr	x10, [x10, _PicoOpt@GOTPAGEOFF]
Lloh88:
	str	w9, [x10]
	and	w8, w8, #0xffffff7f
LBB0_43:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh89:
	adrp	x9, _currentConfig@GOTPAGE
Lloh90:
	ldr	x9, [x9, _currentConfig@GOTPAGEOFF]
Lloh91:
	str	w8, [x9]
	b	LBB0_9
LBB0_44:
	bl	_menu_options_save
LBB0_45:
	mov	w0, #0
LBB0_46:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_47:
	bl	_menu_options_save
	mov	w0, #1
	b	LBB0_49
LBB0_48:
	bl	_menu_options_save
	mov	w0, #0
LBB0_49:
	bl	_emu_WriteConfig
	mov	x8, x0
Lloh92:
	adrp	x9, _menuErrorMsg@GOTPAGE
Lloh93:
	ldr	x9, [x9, _menuErrorMsg@GOTPAGEOFF]
Lloh94:
	ldr	w0, [x9]
	cbz	w8, LBB0_54
; %bb.50:
Lloh95:
	adrp	x1, l_.str@PAGE
Lloh96:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_55
LBB0_51:
	mov	w0, #1
	mov	w1, #1
	bl	_emu_ReadConfig
	cbnz	w0, LBB0_53
; %bb.52:
	mov	w1, #1
	bl	_emu_ReadConfig
	cbz	w0, LBB0_56
LBB0_53:
Lloh97:
	adrp	x8, _menuErrorMsg@GOTPAGE
Lloh98:
	ldr	x8, [x8, _menuErrorMsg@GOTPAGEOFF]
Lloh99:
	ldr	w0, [x8]
Lloh100:
	adrp	x1, l_.str.2@PAGE
Lloh101:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_55
LBB0_54:
Lloh102:
	adrp	x1, l_.str.1@PAGE
Lloh103:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_55:
	bl	_strcpy
	mov	w0, #1
	b	LBB0_46
LBB0_56:
Lloh104:
	adrp	x8, _menuErrorMsg@GOTPAGE
Lloh105:
	ldr	x8, [x8, _menuErrorMsg@GOTPAGEOFF]
Lloh106:
	ldr	w0, [x8]
Lloh107:
	adrp	x1, l_.str.3@PAGE
Lloh108:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_55
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGot	Lloh56, Lloh57
	.loh AdrpLdrGotStr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGot	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotStr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpLdrGotStr	Lloh77, Lloh78, Lloh79
	.loh AdrpLdrGotStr	Lloh80, Lloh81, Lloh82
	.loh AdrpLdrGotStr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGotStr	Lloh86, Lloh87, Lloh88
	.loh AdrpLdrGotStr	Lloh89, Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh92, Lloh93, Lloh94
	.loh AdrpAdd	Lloh95, Lloh96
	.loh AdrpAdd	Lloh100, Lloh101
	.loh AdrpLdrGotLdr	Lloh97, Lloh98, Lloh99
	.loh AdrpAdd	Lloh102, Lloh103
	.loh AdrpAdd	Lloh107, Lloh108
	.loh AdrpLdrGotLdr	Lloh104, Lloh105, Lloh106
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_21-LBB0_9)>>2
	.byte	(LBB0_9-LBB0_9)>>2
	.byte	(LBB0_27-LBB0_9)>>2
	.byte	(LBB0_15-LBB0_9)>>2
	.byte	(LBB0_15-LBB0_9)>>2
	.byte	(LBB0_29-LBB0_9)>>2
	.byte	(LBB0_33-LBB0_9)>>2
	.byte	(LBB0_15-LBB0_9)>>2
	.byte	(LBB0_34-LBB0_9)>>2
lJTI0_1:
	.byte	(LBB0_19-LBB0_11)>>2
	.byte	(LBB0_11-LBB0_11)>>2
	.byte	(LBB0_47-LBB0_11)>>2
	.byte	(LBB0_48-LBB0_11)>>2
	.byte	(LBB0_11-LBB0_11)>>2
	.byte	(LBB0_11-LBB0_11)>>2
	.byte	(LBB0_51-LBB0_11)>>2
	.byte	(LBB0_11-LBB0_11)>>2
	.byte	(LBB0_20-LBB0_11)>>2
                                        ; -- End function
.zerofill __DATA,__bss,_menu_loop_options.menu_sel,4,2 ; @menu_loop_options.menu_sel
	.comm	_opt_entries,4,2                ; @opt_entries
	.comm	_OPT_ENTRY_COUNT,4,2            ; @OPT_ENTRY_COUNT
	.comm	_rom_loaded,4,2                 ; @rom_loaded
	.comm	_config_slot,8,3                ; @config_slot
	.comm	_config_slot_current,8,3        ; @config_slot_current
	.comm	_PBTN_UP,8,3                    ; @PBTN_UP
	.comm	_PBTN_DOWN,8,3                  ; @PBTN_DOWN
	.comm	_PBTN_LEFT,8,3                  ; @PBTN_LEFT
	.comm	_PBTN_RIGHT,8,3                 ; @PBTN_RIGHT
	.comm	_PBTN_PLAY,8,3                  ; @PBTN_PLAY
	.comm	_PBTN_STOP,8,3                  ; @PBTN_STOP
	.comm	_PBTN_REW,8,3                   ; @PBTN_REW
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_currentConfig,4,2              ; @currentConfig
	.comm	_PsndRate,4,2                   ; @PsndRate
	.comm	_PicoAHW,4,2                    ; @PicoAHW
	.comm	_state_slot,4,2                 ; @state_slot
	.comm	_engineState,4,2                ; @engineState
	.comm	_PGS_ReloadRom,4,2              ; @PGS_ReloadRom
	.comm	_menuErrorMsg,4,2               ; @menuErrorMsg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"config saved"

l_.str.1:                               ; @.str.1
	.asciz	"failed to write config"

l_.str.2:                               ; @.str.2
	.asciz	"config loaded"

l_.str.3:                               ; @.str.3
	.asciz	"failed to load config"

	.no_dead_strip	_menu_loop_options
.subsections_via_symbols
