	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function patches_menu_loop
_patches_menu_loop:                     ## @patches_menu_loop
	.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
	xorl	%ebx, %ebx
	movq	_PBTN_UP@GOTPCREL(%rip), %r14
	movq	_PBTN_R@GOTPCREL(%rip), %r15
	movq	_PBTN_PLAY@GOTPCREL(%rip), %r12
	movq	_PBTN_STOP@GOTPCREL(%rip), %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_PicoPatches@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%ebx, %rdx
	xorl	%esi, %esi
	cmpl	$0, (%rcx,%rdx,4)
	sete	%sil
	movl	%esi, (%rcx,%rdx,4)
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	testq	%rax, (%r13)
	jne	LBB0_16
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_draw_patchlist
	movq	_PBTN_DOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	orq	(%r14), %rdi
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	movq	_PBTN_L@GOTPCREL(%rip), %rax
	orq	(%rax), %rdi
	orq	(%r15), %rdi
	orq	(%r12), %rdi
	orq	(%r13), %rdi
	callq	_in_menu_wait
	movq	_PicoPatchCount@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	testl	%ebx, %ebx
	jg	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	testq	%rax, (%r14)
	jne	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%ecx, %ebx
	jl	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	leal	-1(%rbx), %edx
	testq	%rax, (%r14)
	je	LBB0_5
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%edx, %ebx
	cmpl	%ecx, %ebx
	jge	LBB0_7
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rbx), %edx
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_PBTN_DOWN@GOTPCREL(%rip), %rsi
	testq	%rax, (%rsi)
	cmovel	%ebx, %edx
	movq	_PBTN_L@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rdi
	movq	_PBTN_LEFT@GOTPCREL(%rip), %rsi
	orq	(%rsi), %rdi
	movl	%edx, %esi
	cmpl	$11, %edx
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$10, %esi
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	addl	$-10, %esi
	testq	%rax, %rdi
	cmovel	%edx, %esi
	movq	(%r15), %rdx
	movq	_PBTN_RIGHT@GOTPCREL(%rip), %rdi
	orq	(%rdi), %rdx
	leal	10(%rsi), %ebx
	cmpl	%ecx, %ebx
	jl	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	testq	%rax, %rdx
	cmovel	%esi, %ebx
	testq	%rax, (%r12)
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%ecx, %ebx
	jl	LBB0_14
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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_L,8,3                     ## @PBTN_L
	.comm	_PBTN_R,8,3                     ## @PBTN_R
	.comm	_PBTN_PLAY,8,3                  ## @PBTN_PLAY
	.comm	_PBTN_STOP,8,3                  ## @PBTN_STOP
	.comm	_PicoPatchCount,4,2             ## @PicoPatchCount
	.comm	_PicoPatches,8,3                ## @PicoPatches
	.no_dead_strip	_patches_menu_loop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function patches_menu_loop
_patches_menu_loop:                     ; @patches_menu_loop
	.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
	mov	w19, #0
Lloh0:
	adrp	x20, _PBTN_UP@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PBTN_UP@GOTPAGEOFF]
Lloh2:
	adrp	x21, _PBTN_DOWN@GOTPAGE
Lloh3:
	ldr	x21, [x21, _PBTN_DOWN@GOTPAGEOFF]
Lloh4:
	adrp	x22, _PBTN_LEFT@GOTPAGE
Lloh5:
	ldr	x22, [x22, _PBTN_LEFT@GOTPAGEOFF]
Lloh6:
	adrp	x23, _PBTN_RIGHT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _PBTN_RIGHT@GOTPAGEOFF]
Lloh8:
	adrp	x24, _PBTN_L@GOTPAGE
Lloh9:
	ldr	x24, [x24, _PBTN_L@GOTPAGEOFF]
Lloh10:
	adrp	x25, _PBTN_R@GOTPAGE
Lloh11:
	ldr	x25, [x25, _PBTN_R@GOTPAGEOFF]
Lloh12:
	adrp	x26, _PBTN_PLAY@GOTPAGE
Lloh13:
	ldr	x26, [x26, _PBTN_PLAY@GOTPAGEOFF]
Lloh14:
	adrp	x27, _PBTN_STOP@GOTPAGE
Lloh15:
	ldr	x27, [x27, _PBTN_STOP@GOTPAGEOFF]
	mov	w28, #10
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
Lloh16:
	adrp	x8, _PicoPatches@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PicoPatches@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	sbfiz	x9, x19, #2, #32
	ldr	w10, [x8, x9]
	cmp	w10, #0
	cset	w10, eq
	str	w10, [x8, x9]
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x27]
	tst	x8, x0
	b.ne	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_draw_patchlist
	ldr	x8, [x20]
	ldr	x9, [x21]
	orr	x8, x9, x8
	ldr	x9, [x22]
	orr	x8, x8, x9
	ldr	x9, [x23]
	orr	x8, x8, x9
	ldr	x9, [x24]
	orr	x8, x8, x9
	ldr	x9, [x25]
	orr	x8, x8, x9
	ldr	x9, [x26]
	orr	x8, x8, x9
	ldr	x9, [x27]
	orr	x0, x8, x9
	bl	_in_menu_wait
	ldr	x9, [x20]
	subs	w10, w19, #1
Lloh19:
	adrp	x8, _PicoPatchCount@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PicoPatchCount@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	csel	w10, w8, w10, lt
	tst	x9, x0
	csel	w9, w19, w10, eq
	ldr	x10, [x21]
	cmp	w9, w8
	csinc	w11, wzr, w9, ge
	tst	x10, x0
	csel	w9, w9, w11, eq
	ldr	x10, [x22]
	ldr	x11, [x24]
	orr	x10, x11, x10
	cmp	w9, #10
	csel	w11, w9, w28, gt
	sub	w11, w11, #10
	tst	x10, x0
	csel	w9, w9, w11, eq
	ldr	x10, [x23]
	ldr	x11, [x25]
	orr	x10, x11, x10
	add	w11, w9, #10
	cmp	w11, w8
	csel	w11, w11, w8, lt
	tst	x10, x0
	csel	w19, w9, w11, eq
	ldr	x9, [x26]
	tst	x9, x0
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w19, w8
	b.lt	LBB0_1
LBB0_5:
	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
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.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_L,8,3                     ; @PBTN_L
	.comm	_PBTN_R,8,3                     ; @PBTN_R
	.comm	_PBTN_PLAY,8,3                  ; @PBTN_PLAY
	.comm	_PBTN_STOP,8,3                  ; @PBTN_STOP
	.comm	_PicoPatchCount,4,2             ; @PicoPatchCount
	.comm	_PicoPatches,8,3                ; @PicoPatches
	.no_dead_strip	_patches_menu_loop
.subsections_via_symbols
