	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FileSelector                   ## -- Begin function FileSelector
	.p2align	4, 0x90
_FileSelector:                          ## @FileSelector
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edi killed $edi def $rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	_config@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_IMAGE_VISIBLE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	%edx, %ecx
	notl	%ecx
	movq	_bg_filesel@GOTPCREL(%rip), %rax
	je	LBB0_2
## %bb.1:
	movq	(%rax), %rax
	orl	%edx, 24(%rax)
	jmp	LBB0_3
LBB0_2:
	movq	(%rax), %rax
	andl	%ecx, 24(%rax)
LBB0_3:
	movq	_FILETYPE_MAX@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edx
	testl	%edx, %edx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	jle	LBB0_7
## %bb.4:
	andl	%ecx, 216(%rax)
	movl	(%rdi), %edx
	cmpl	$2, %edx
	jl	LBB0_7
## %bb.5:
	leaq	240(%rax), %rcx
	movl	$1, %esi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edx
	notl	%edx
	andl	%edx, (%rcx)
	incq	%rsi
	movslq	(%rdi), %rdx
	addq	$24, %rcx
	cmpq	%rdx, %rsi
	jl	LBB0_6
LBB0_7:
	testl	%r8d, %r8d
	js	LBB0_11
## %bb.8:
	testl	%edx, %edx
	jle	LBB0_23
## %bb.9:
	movl	%edx, %edx
	leaq	-1(%rdx), %rsi
	movl	%edx, %ecx
	andl	$3, %ecx
	cmpq	$3, %rsi
	jae	LBB0_18
## %bb.10:
	xorl	%esi, %esi
	jmp	LBB0_20
LBB0_11:
	testl	%edx, %edx
	jle	LBB0_24
## %bb.12:
	movq	_Cart_png@GOTPCREL(%rip), %r9
	movq	(%r9), %rsi
	movq	(%rsi), %rsi
	movq	%rsi, 232(%rax)
	cmpl	$1, %edx
	je	LBB0_24
## %bb.13:
	movl	%edx, %r8d
	decq	%r8
	movl	$1, %esi
	cmpl	$2, %edx
	je	LBB0_16
## %bb.14:
	movq	%r8, %rdx
	andq	$-2, %rdx
	negq	%rdx
	movl	$1, %esi
	xorl	%edi, %edi
	movq	_bg_filesel@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	movq	(%r9), %rcx
	movq	(%rcx,%rsi,8), %rcx
	movq	%rcx, 256(%rax,%rdi)
	movq	(%rbx), %rax
	movq	(%r9), %rcx
	movq	8(%rcx,%rsi,8), %rcx
	movq	%rcx, 280(%rax,%rdi)
	addq	$48, %rdi
	leaq	(%rdx,%rsi), %rax
	addq	$2, %rax
	addq	$2, %rsi
	cmpq	$1, %rax
	jne	LBB0_15
LBB0_16:
	testb	$1, %r8b
	je	LBB0_24
## %bb.17:
	movq	_bg_filesel@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r9), %rcx
	movq	(%rcx,%rsi,8), %rcx
	leaq	(%rsi,%rsi,2), %rdx
	movq	%rcx, 232(%rax,%rdx,8)
	jmp	LBB0_24
LBB0_18:
	andl	$-4, %edx
	xorl	%edi, %edi
	movq	_bg_filesel@GOTPCREL(%rip), %rbx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	$0, 232(%rax,%rdi)
	movq	(%rbx), %rax
	movq	$0, 256(%rax,%rdi)
	movq	(%rbx), %rax
	movq	$0, 280(%rax,%rdi)
	movq	(%rbx), %rax
	movq	$0, 304(%rax,%rdi)
	addq	$4, %rsi
	movq	(%rbx), %rax
	addq	$96, %rdi
	cmpq	%rsi, %rdx
	jne	LBB0_19
LBB0_20:
	testq	%rcx, %rcx
	je	LBB0_23
## %bb.21:
	shlq	$3, %rsi
	leaq	(%rsi,%rsi,2), %rdx
	movq	_bg_filesel@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	$0, 232(%rax,%rdx)
	movq	(%rsi), %rax
	addq	$24, %rdx
	decq	%rcx
	jne	LBB0_22
LBB0_23:
	movq	_Cart_png@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%r8d, %rdx
	movq	(%rcx,%rdx,8), %rcx
	leal	9(%r8), %edx
	movslq	%edx, %rdx
	shlq	$3, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rcx, 16(%rax,%rdx)
	movl	(%r15), %eax
	movq	_bg_filesel@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orl	%eax, (%rcx,%rdx)
LBB0_24:
	movq	_menu_selector@GOTPCREL(%rip), %rdi
	callq	_GUI_InitMenu
	movq	_string_offset@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	%r12, %rax
	incq	%rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	$-1, %r14d
	movq	_selection@GOTPCREL(%rip), %r13
	jmp	LBB0_25
LBB0_61:                                ##   in Loop: Header=BB0_25 Depth=1
	testl	%edx, %edx
	movl	$0, %eax
	cmovlel	%eax, %edx
	movq	_offset@GOTPCREL(%rip), %rax
	movl	%edx, (%rax)
	.p2align	4, 0x90
LBB0_25:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_31 Depth 2
                                        ##     Child Loop BB0_36 Depth 2
                                        ##     Child Loop BB0_80 Depth 2
                                        ##     Child Loop BB0_84 Depth 2
	cmpl	(%r13), %r14d
	je	LBB0_43
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_bg_filesel@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movl	$200, %eax
	addq	%rax, %rdi
	callq	_gxTextureClose
	movl	(%r15), %edx
	movl	%edx, %esi
	notl	%esi
	movq	(%rbx), %rcx
	andl	%esi, 192(%rcx)
	movl	(%r13), %r14d
	movq	_string_offset@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_filelist@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	movslq	%r14d, %rbx
	movq	%rbx, %rdi
	shlq	$4, %rdi
	cmpq	$0, 8(%r9,%rdi)
	jne	LBB0_43
## %bb.27:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	js	LBB0_28
## %bb.34:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_DEFAULT_PATH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	_Cart_dir@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, %esi
	movq	(%rcx,%rsi,8), %rcx
	movq	(%r9,%rdi), %r8
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_sprintf
	jmp	LBB0_35
LBB0_28:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_FILETYPE_MAX@GOTPCREL(%rip), %r8
	cmpl	$0, (%r8)
	jle	LBB0_33
## %bb.29:                              ##   in Loop: Header=BB0_25 Depth=1
	andl	%esi, 216(%rcx)
	cmpl	$2, (%r8)
	jl	LBB0_32
## %bb.30:                              ##   in Loop: Header=BB0_25 Depth=1
	leaq	240(%rcx), %rdx
	movl	$1, %esi
	.p2align	4, 0x90
LBB0_31:                                ##   Parent Loop BB0_25 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r15), %edi
	notl	%edi
	andl	%edi, (%rdx)
	incq	%rsi
	movslq	(%r8), %rdi
	addq	$24, %rdx
	cmpq	%rdi, %rsi
	jl	LBB0_31
LBB0_32:                                ##   in Loop: Header=BB0_25 Depth=1
	movslq	(%r13), %rbx
	movl	(%r15), %edx
LBB0_33:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_history@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movslq	(%rsi,%rbx,4), %rsi
	leaq	(%rsi,%rsi,2), %rdi
	orl	%edx, 216(%rcx,%rdi,8)
	movq	_DEFAULT_PATH@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_Cart_dir@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	(%rcx,%rsi,8), %rcx
	movslq	(%r13), %rsi
	shlq	$4, %rsi
	movq	(%r9,%rsi), %r8
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_sprintf
	movl	$-1, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_35:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	%r12, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, %ecx
	decl	%eax
	addq	-80(%rbp), %rax                 ## 8-byte Folded Reload
	.p2align	4, 0x90
LBB0_36:                                ##   Parent Loop BB0_25 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	$2, %ecx
	jl	LBB0_39
## %bb.37:                              ##   in Loop: Header=BB0_36 Depth=2
	decq	%rax
	cmpb	$46, -1(%r12,%rcx)
	leaq	-1(%rcx), %rcx
	jne	LBB0_36
## %bb.38:                              ##   in Loop: Header=BB0_25 Depth=1
	movb	$0, (%rax)
LBB0_39:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcat
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_43
## %bb.40:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%rax, %rbx
	xorl	%edi, %edi
	movq	%rax, %rsi
	callq	_gxTextureOpenPNG
	movq	_bg_filesel@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, 200(%rcx)
	testq	%rax, %rax
	je	LBB0_42
## %bb.41:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	(%r15), %eax
	orl	%eax, 192(%rcx)
LBB0_42:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	%rbx, %rdi
	callq	_fclose
	.p2align	4, 0x90
LBB0_43:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_menu_selector@GOTPCREL(%rip), %rax
	cmpl	$-1, (%rax)
	je	LBB0_45
## %bb.44:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_action_select@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_48
	.p2align	4, 0x90
LBB0_45:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_filelist@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%r13), %rcx
	shlq	$4, %rcx
	cmpq	$0, 8(%rax,%rcx)
	movq	_action_select@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	je	LBB0_47
## %bb.46:                              ##   in Loop: Header=BB0_25 Depth=1
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_48
LBB0_47:                                ##   in Loop: Header=BB0_25 Depth=1
	leaq	L_.str.5(%rip), %rsi
	.p2align	4, 0x90
LBB0_48:                                ##   in Loop: Header=BB0_25 Depth=1
	callq	_strcpy
	movq	_menu_selector@GOTPCREL(%rip), %rdi
	callq	_GUI_DrawMenu
	xorl	%eax, %eax
	callq	_gxSetScreen
	movq	_m_input@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	movq	_PAD_BUTTON_DOWN@GOTPCREL(%rip), %rcx
	testw	%ax, (%rcx)
	je	LBB0_55
## %bb.49:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	(%r13), %ecx
	incl	%ecx
	movl	%ecx, (%r13)
	movq	_maxfiles@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_50
## %bb.51:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$0, (%r13)
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	LBB0_52
	.p2align	4, 0x90
LBB0_55:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_PAD_BUTTON_UP@GOTPCREL(%rip), %rcx
	testw	%ax, (%rcx)
	je	LBB0_62
## %bb.56:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	(%r13), %ecx
	leal	-1(%rcx), %eax
	movl	%eax, (%r13)
	testl	%ecx, %ecx
	jle	LBB0_58
## %bb.57:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	jmp	LBB0_59
	.p2align	4, 0x90
LBB0_50:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_52:                                ##   in Loop: Header=BB0_25 Depth=1
	subl	%eax, %ecx
	cmpl	$10, %ecx
	jl	LBB0_25
## %bb.53:                              ##   in Loop: Header=BB0_25 Depth=1
	addl	$10, %eax
LBB0_54:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_25
LBB0_62:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_PAD_BUTTON_LEFT@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %ecx
	movq	_PAD_TRIGGER_L@GOTPCREL(%rip), %rdx
	orw	(%rdx), %cx
	testw	%ax, %cx
	je	LBB0_68
## %bb.63:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_maxfiles@GOTPCREL(%rip), %rax
	cmpl	$10, (%rax)
	jl	LBB0_25
## %bb.64:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	(%r13), %eax
	leal	-10(%rax), %ecx
	movl	%ecx, (%r13)
	cmpl	$9, %eax
	jg	LBB0_66
## %bb.65:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$0, (%r13)
	jmp	LBB0_25
LBB0_58:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_maxfiles@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	-1(%rcx), %eax
	movl	%eax, (%r13)
	addl	$-10, %ecx
	movq	_offset@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
LBB0_59:                                ##   in Loop: Header=BB0_25 Depth=1
	leal	-10(%rcx), %edx
	cmpl	%ecx, %eax
	cmovgel	%ecx, %edx
	jl	LBB0_61
## %bb.60:                              ##   in Loop: Header=BB0_25 Depth=1
	testl	%edx, %edx
	jns	LBB0_25
	jmp	LBB0_61
LBB0_68:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_PAD_BUTTON_RIGHT@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %ecx
	movq	_PAD_TRIGGER_R@GOTPCREL(%rip), %rdx
	orw	(%rdx), %cx
	testw	%ax, %cx
	je	LBB0_75
## %bb.69:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_maxfiles@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$10, %eax
	jl	LBB0_25
## %bb.70:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	(%r13), %edx
	leal	10(%rdx), %ecx
	movl	%ecx, (%r13)
	cmpl	%eax, %ecx
	jge	LBB0_71
## %bb.73:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %edx
	jl	LBB0_25
## %bb.74:                              ##   in Loop: Header=BB0_25 Depth=1
	addl	$10, %ecx
	addl	$-10, %eax
	cmpl	%eax, %ecx
	cmovll	%ecx, %eax
	jmp	LBB0_72
LBB0_66:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jge	LBB0_25
## %bb.67:                              ##   in Loop: Header=BB0_25 Depth=1
	cmpl	$11, %eax
	movl	$10, %ecx
	cmovll	%ecx, %eax
	addl	$-10, %eax
	jmp	LBB0_54
LBB0_75:                                ##   in Loop: Header=BB0_25 Depth=1
	xorl	%ebx, %ebx
	movq	_PAD_TRIGGER_Z@GOTPCREL(%rip), %rcx
	testw	%ax, (%rcx)
	jne	LBB0_93
## %bb.76:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_PAD_BUTTON_B@GOTPCREL(%rip), %rcx
	testw	%ax, (%rcx)
	je	LBB0_88
## %bb.77:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_string_offset@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_prev_folder@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	$1, %edi
	callq	_UpdateDirectory
	testq	%rax, %rax
	je	LBB0_93
## %bb.78:                              ##   in Loop: Header=BB0_25 Depth=1
	xorl	%eax, %eax
	callq	_ParseDirectory
	movl	%eax, %ecx
	movq	_maxfiles@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	movq	_offset@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$0, (%r13)
	movl	$-1, %r14d
	testl	%ecx, %ecx
	jle	LBB0_25
## %bb.79:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_filelist@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_prev_folder@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r14d
	addq	$8, %r15
	xorl	%ebx, %ebx
	jmp	LBB0_80
	.p2align	4, 0x90
LBB0_86:                                ##   in Loop: Header=BB0_80 Depth=2
	incq	%rbx
	addq	$16, %r15
	cmpq	%rbx, %r14
	je	LBB0_87
LBB0_80:                                ##   Parent Loop BB0_25 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	$0, (%r15)
	je	LBB0_86
## %bb.81:                              ##   in Loop: Header=BB0_80 Depth=2
	movq	-8(%r15), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_strcmp
	testl	%eax, %eax
	jne	LBB0_86
## %bb.82:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	%ebx, (%r13)
	movl	$-1, %r14d
	cmpl	$10, %ebx
	movq	_IMAGE_VISIBLE@GOTPCREL(%rip), %r15
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	jl	LBB0_25
## %bb.83:                              ##   in Loop: Header=BB0_25 Depth=1
	addl	$-10, %edx
	movl	$10, %eax
	.p2align	4, 0x90
LBB0_84:                                ##   Parent Loop BB0_25 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%edx, %eax
	movl	%eax, %ecx
	cmovgel	%edx, %ecx
	leal	10(%rcx), %eax
	cmpl	%ebx, %eax
	jle	LBB0_84
## %bb.85:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	movl	$-1, %r14d
	jmp	LBB0_25
LBB0_71:                                ##   in Loop: Header=BB0_25 Depth=1
	leal	-1(%rax), %ecx
	movl	%ecx, (%r13)
	addl	$-10, %eax
LBB0_72:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_offset@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_25
LBB0_88:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_PAD_BUTTON_A@GOTPCREL(%rip), %rcx
	testw	%ax, (%rcx)
	je	LBB0_25
## %bb.89:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_string_offset@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_menu_selector@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	cmpl	4(%rcx), %eax
	jge	LBB0_25
## %bb.90:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	_filelist@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%r13), %rdi
	movq	%rdi, %rcx
	shlq	$4, %rcx
	cmpq	$0, 8(%rax,%rcx)
	je	LBB0_92
## %bb.91:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	(%rax,%rcx), %rsi
	xorl	%edi, %edi
	callq	_UpdateDirectory
	xorl	%eax, %eax
	callq	_ParseDirectory
	movq	_maxfiles@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_offset@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$0, (%r13)
	movl	$-1, %r14d
	jmp	LBB0_25
LBB0_87:                                ##   in Loop: Header=BB0_25 Depth=1
	movl	$-1, %r14d
	movq	_IMAGE_VISIBLE@GOTPCREL(%rip), %r15
	jmp	LBB0_25
LBB0_92:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_LoadFile
	movl	%eax, %ebx
LBB0_93:
	movq	_menu_selector@GOTPCREL(%rip), %rdi
	callq	_GUI_DeleteMenu
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_95
## %bb.94:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_95:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPATHLEN,4,2                 ## @MAXPATHLEN
	.comm	_menu_selector,16,3             ## @menu_selector
	.comm	_config,8,3                     ## @config
	.comm	_IMAGE_VISIBLE,4,2              ## @IMAGE_VISIBLE
	.comm	_bg_filesel,8,3                 ## @bg_filesel
	.comm	_FILETYPE_MAX,4,2               ## @FILETYPE_MAX
	.comm	_Cart_png,8,3                   ## @Cart_png
	.comm	_string_offset,8,3              ## @string_offset
	.comm	_selection,4,2                  ## @selection
	.comm	_filelist,8,3                   ## @filelist
	.comm	_history,8,3                    ## @history
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/snaps/%s/%s"

	.comm	_DEFAULT_PATH,8,3               ## @DEFAULT_PATH
	.comm	_Cart_dir,8,3                   ## @Cart_dir
L_.str.1:                               ## @.str.1
	.asciz	".png"

L_.str.2:                               ## @.str.2
	.asciz	"rb"

	.comm	_action_select,4,2              ## @action_select
L_.str.3:                               ## @.str.3
	.space	1

L_.str.4:                               ## @.str.4
	.asciz	"Open Directory"

L_.str.5:                               ## @.str.5
	.asciz	"Load File"

	.comm	_m_input,32,3                   ## @m_input
	.comm	_PAD_BUTTON_DOWN,2,1            ## @PAD_BUTTON_DOWN
	.comm	_maxfiles,4,2                   ## @maxfiles
	.comm	_offset,4,2                     ## @offset
	.comm	_PAD_BUTTON_UP,2,1              ## @PAD_BUTTON_UP
	.comm	_PAD_TRIGGER_L,2,1              ## @PAD_TRIGGER_L
	.comm	_PAD_BUTTON_LEFT,2,1            ## @PAD_BUTTON_LEFT
	.comm	_PAD_TRIGGER_R,2,1              ## @PAD_TRIGGER_R
	.comm	_PAD_BUTTON_RIGHT,2,1           ## @PAD_BUTTON_RIGHT
	.comm	_PAD_TRIGGER_Z,2,1              ## @PAD_TRIGGER_Z
	.comm	_PAD_BUTTON_B,2,1               ## @PAD_BUTTON_B
	.comm	_prev_folder,8,3                ## @prev_folder
	.comm	_PAD_BUTTON_A,2,1               ## @PAD_BUTTON_A
	.comm	_BUTTON_VISIBLE,4,2             ## @BUTTON_VISIBLE
	.comm	_SYS_POWEROFF,4,2               ## @SYS_POWEROFF
	.comm	_Shutdown,8,3                   ## @Shutdown
	.comm	_w_pointer,8,3                  ## @w_pointer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FileSelector                   ; -- Begin function FileSelector
	.p2align	2
_FileSelector:                          ; @FileSelector
	.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
	sub	sp, sp, #16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
Lloh8:
	adrp	x8, _config@GOTPAGE
Lloh9:
	ldr	x8, [x8, _config@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x25, _IMAGE_VISIBLE@GOTPAGE
Lloh12:
	ldr	x25, [x25, _IMAGE_VISIBLE@GOTPAGEOFF]
	ldr	w10, [x25]
Lloh13:
	adrp	x20, _bg_filesel@GOTPAGE
Lloh14:
	ldr	x20, [x20, _bg_filesel@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20]
	ldr	w9, [x8, #24]
	orr	w9, w9, w10
	b	LBB0_3
LBB0_2:
	ldr	x8, [x20]
	ldr	w9, [x8, #24]
	bic	w9, w9, w10
LBB0_3:
	str	w9, [x8, #24]
Lloh15:
	adrp	x27, _FILETYPE_MAX@GOTPAGE
Lloh16:
	ldr	x27, [x27, _FILETYPE_MAX@GOTPAGEOFF]
	ldr	w9, [x27]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.4:
	ldr	w9, [x8, #216]
	bic	w9, w9, w10
	str	w9, [x8, #216]
	ldr	w9, [x27]
	cmp	w9, #2
	b.lt	LBB0_7
; %bb.5:
	add	x10, x8, #240
	mov	w11, #1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x25]
	ldr	w12, [x10]
	bic	w9, w12, w9
	str	w9, [x10], #24
	add	x11, x11, #1
	ldrsw	x9, [x27]
	cmp	x11, x9
	b.lt	LBB0_6
LBB0_7:
	stur	w0, [x29, #-92]                 ; 4-byte Folded Spill
	cmp	w9, #1
	tbnz	w0, #31, LBB0_82
; %bb.8:
	b.lt	LBB0_11
; %bb.9:
	mov	x10, #0
	mov	w11, #24
	umull	x9, w9, w11
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x10
	str	xzr, [x8, #232]
	ldr	x8, [x20]
	add	x10, x10, #24
	cmp	x9, x10
	b.ne	LBB0_10
LBB0_11:
Lloh17:
	adrp	x9, _Cart_png@GOTPAGE
Lloh18:
	ldr	x9, [x9, _Cart_png@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	ldr	x9, [x9, w0, sxtw #3]
	mov	w10, #24
	smull	x10, w0, w10
	add	x10, x10, #216
	add	x8, x8, x10
	str	x9, [x8, #16]
	ldr	w8, [x25]
	ldr	x9, [x20]
	ldr	w11, [x9, x10]
	orr	w8, w11, w8
	str	w8, [x9, x10]
LBB0_12:
Lloh20:
	adrp	x21, _menu_selector@GOTPAGE
Lloh21:
	ldr	x21, [x21, _menu_selector@GOTPAGEOFF]
	mov	x0, x21
	bl	_GUI_InitMenu
Lloh22:
	adrp	x22, _string_offset@GOTPAGE
Lloh23:
	ldr	x22, [x22, _string_offset@GOTPAGEOFF]
Lloh24:
	adrp	x23, _selection@GOTPAGE
Lloh25:
	ldr	x23, [x23, _selection@GOTPAGEOFF]
	mov	w26, #-1
	str	xzr, [x22]
Lloh26:
	adrp	x24, _offset@GOTPAGE
Lloh27:
	ldr	x24, [x24, _offset@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	str	w8, [x24]
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_21 Depth 2
                                        ;     Child Loop BB0_25 Depth 2
                                        ;     Child Loop BB0_67 Depth 2
                                        ;     Child Loop BB0_71 Depth 2
	ldr	w8, [x23]
	cmp	w26, w8
	b.eq	LBB0_33
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x20]
	add	x0, x8, #200
	bl	_gxTextureClose
	ldr	w10, [x25]
	ldr	x9, [x20]
	ldr	w8, [x9, #192]
	bic	w8, w8, w10
	str	w8, [x9, #192]
	ldr	w26, [x23]
	str	xzr, [x22]
Lloh28:
	adrp	x8, _filelist@GOTPAGE
Lloh29:
	ldr	x8, [x8, _filelist@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	add	x11, x8, w26, sxtw #4
	ldr	x11, [x11, #8]
	cbnz	x11, LBB0_33
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	sxtw	x11, w26
	ldur	w12, [x29, #-92]                ; 4-byte Folded Reload
	tbnz	w12, #31, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh31:
	adrp	x9, _DEFAULT_PATH@GOTPAGE
Lloh32:
	ldr	x9, [x9, _DEFAULT_PATH@GOTPAGEOFF]
Lloh33:
	ldr	x2, [x9]
Lloh34:
	adrp	x9, _Cart_dir@GOTPAGE
Lloh35:
	ldr	x9, [x9, _Cart_dir@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	ldr	x3, [x9, w12, uxtw #3]
	lsl	x9, x11, #4
	ldr	x4, [x8, x9]
	mov	x0, x19
Lloh37:
	adrp	x1, l_.str@PAGE
Lloh38:
	add	x1, x1, l_.str@PAGEOFF
	bl	_sprintf
	b	LBB0_24
LBB0_18:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w12, [x27]
	cmp	w12, #1
	b.lt	LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w11, [x9, #216]
	bic	w10, w11, w10
	str	w10, [x9, #216]
	ldr	w10, [x27]
	cmp	w10, #2
	b.lt	LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x10, x9, #240
	mov	w11, #1
LBB0_21:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w12, [x25]
	ldr	w13, [x10]
	bic	w12, w13, w12
	str	w12, [x10], #24
	add	x11, x11, #1
	ldrsw	x12, [x27]
	cmp	x11, x12
	b.lt	LBB0_21
LBB0_22:                                ;   in Loop: Header=BB0_14 Depth=1
	ldrsw	x11, [x23]
	ldr	w10, [x25]
LBB0_23:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh39:
	adrp	x12, _history@GOTPAGE
Lloh40:
	ldr	x12, [x12, _history@GOTPAGEOFF]
Lloh41:
	ldr	x12, [x12]
	ldrsw	x11, [x12, x11, lsl #2]
	mov	w12, #24
	madd	x9, x11, x12, x9
	ldr	w12, [x9, #216]
	orr	w10, w12, w10
	str	w10, [x9, #216]
Lloh42:
	adrp	x9, _DEFAULT_PATH@GOTPAGE
Lloh43:
	ldr	x9, [x9, _DEFAULT_PATH@GOTPAGEOFF]
Lloh44:
	ldr	x2, [x9]
Lloh45:
	adrp	x9, _Cart_dir@GOTPAGE
Lloh46:
	ldr	x9, [x9, _Cart_dir@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	ldr	x3, [x9, x11, lsl #3]
	ldrsw	x9, [x23]
	lsl	x9, x9, #4
	ldr	x4, [x8, x9]
	mov	x0, x19
Lloh48:
	adrp	x1, l_.str@PAGE
Lloh49:
	add	x1, x1, l_.str@PAGEOFF
	bl	_sprintf
	mov	w8, #-1
	stur	w8, [x29, #-92]                 ; 4-byte Folded Spill
LBB0_24:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x19
	bl	_strlen
	mov	w9, w0
	sub	w8, w0, #1
	add	x8, x8, #1
LBB0_25:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w9, #2
	b.lt	LBB0_28
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=2
	add	x10, x19, x9
	sub	x9, x9, #1
	ldurb	w10, [x10, #-1]
	sub	x8, x8, #1
	cmp	w10, #46
	b.ne	LBB0_25
; %bb.27:                               ;   in Loop: Header=BB0_14 Depth=1
	strb	wzr, [x19, x8]
LBB0_28:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x19
Lloh50:
	adrp	x1, l_.str.1@PAGE
Lloh51:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcat
	mov	x0, x19
Lloh52:
	adrp	x1, l_.str.2@PAGE
Lloh53:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_32
; %bb.29:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x22, x0
	mov	w0, #0
	mov	x1, x22
	bl	_gxTextureOpenPNG
	ldr	x8, [x20]
	str	x0, [x8, #200]
	cbz	x0, LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [x25]
	ldr	w10, [x8, #192]
	orr	w9, w10, w9
	str	w9, [x8, #192]
LBB0_31:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x22
	bl	_fclose
LBB0_32:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh54:
	adrp	x22, _string_offset@GOTPAGE
Lloh55:
	ldr	x22, [x22, _string_offset@GOTPAGEOFF]
LBB0_33:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x21]
	cmn	w8, #1
	b.eq	LBB0_35
; %bb.34:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh56:
	adrp	x8, _action_select@GOTPAGE
Lloh57:
	ldr	x8, [x8, _action_select@GOTPAGEOFF]
Lloh58:
	ldr	w0, [x8]
Lloh59:
	adrp	x1, l_.str.3@PAGE
Lloh60:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_38
LBB0_35:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh61:
	adrp	x8, _filelist@GOTPAGE
Lloh62:
	ldr	x8, [x8, _filelist@GOTPAGEOFF]
Lloh63:
	ldr	x8, [x8]
	ldrsw	x9, [x23]
	add	x8, x8, x9, lsl #4
	ldr	x8, [x8, #8]
Lloh64:
	adrp	x9, _action_select@GOTPAGE
Lloh65:
	ldr	x9, [x9, _action_select@GOTPAGEOFF]
Lloh66:
	ldr	w0, [x9]
	cbz	x8, LBB0_37
; %bb.36:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh67:
	adrp	x1, l_.str.4@PAGE
Lloh68:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_38
LBB0_37:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh69:
	adrp	x1, l_.str.5@PAGE
Lloh70:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_38:                                ;   in Loop: Header=BB0_14 Depth=1
	bl	_strcpy
	mov	x0, x21
	bl	_GUI_DrawMenu
	bl	_gxSetScreen
Lloh71:
	adrp	x8, _m_input@GOTPAGE
Lloh72:
	ldr	x8, [x8, _m_input@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh73:
	adrp	x9, _PAD_BUTTON_DOWN@GOTPAGE
Lloh74:
	ldr	x9, [x9, _PAD_BUTTON_DOWN@GOTPAGEOFF]
	ldrh	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_41
; %bb.39:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x23]
	add	w8, w8, #1
	str	w8, [x23]
Lloh75:
	adrp	x9, _maxfiles@GOTPAGE
Lloh76:
	ldr	x9, [x9, _maxfiles@GOTPAGEOFF]
Lloh77:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_44
; %bb.40:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	w9, #0
	mov	w8, #0
	str	wzr, [x24]
	str	wzr, [x23]
	b	LBB0_45
LBB0_41:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh78:
	adrp	x9, _PAD_BUTTON_UP@GOTPAGE
Lloh79:
	ldr	x9, [x9, _PAD_BUTTON_UP@GOTPAGEOFF]
	ldrh	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_47
; %bb.42:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x23]
	subs	w8, w8, #1
	str	w8, [x23]
	b.lt	LBB0_51
; %bb.43:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [x24]
	b	LBB0_52
LBB0_44:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [x24]
LBB0_45:                                ;   in Loop: Header=BB0_14 Depth=1
	sub	w8, w8, w9
	cmp	w8, #10
	b.lt	LBB0_14
; %bb.46:                               ;   in Loop: Header=BB0_14 Depth=1
	add	w8, w9, #10
	str	w8, [x24]
	b	LBB0_14
LBB0_47:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh80:
	adrp	x9, _PAD_TRIGGER_L@GOTPAGE
Lloh81:
	ldr	x9, [x9, _PAD_TRIGGER_L@GOTPAGEOFF]
	ldrh	w9, [x9]
Lloh82:
	adrp	x10, _PAD_BUTTON_LEFT@GOTPAGE
Lloh83:
	ldr	x10, [x10, _PAD_BUTTON_LEFT@GOTPAGEOFF]
	ldrh	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_54
; %bb.48:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh84:
	adrp	x8, _maxfiles@GOTPAGE
Lloh85:
	ldr	x8, [x8, _maxfiles@GOTPAGEOFF]
Lloh86:
	ldr	w8, [x8]
	cmp	w8, #10
	b.lt	LBB0_14
; %bb.49:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x23]
	sub	w9, w8, #10
	str	w9, [x23]
	cmp	w8, #9
	b.gt	LBB0_59
; %bb.50:                               ;   in Loop: Header=BB0_14 Depth=1
	str	wzr, [x24]
	str	wzr, [x23]
	b	LBB0_14
LBB0_51:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh87:
	adrp	x8, _maxfiles@GOTPAGE
Lloh88:
	ldr	x8, [x8, _maxfiles@GOTPAGEOFF]
Lloh89:
	ldr	w9, [x8]
	sub	w8, w9, #1
	str	w8, [x23]
	sub	w9, w9, #10
	str	w9, [x24]
LBB0_52:                                ;   in Loop: Header=BB0_14 Depth=1
	sub	w10, w9, #10
	cmp	w8, w9
	csel	w8, w10, w9, lt
	b.lt	LBB0_13
; %bb.53:                               ;   in Loop: Header=BB0_14 Depth=1
	tbz	w8, #31, LBB0_14
	b	LBB0_13
LBB0_54:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh90:
	adrp	x9, _PAD_TRIGGER_R@GOTPAGE
Lloh91:
	ldr	x9, [x9, _PAD_TRIGGER_R@GOTPAGEOFF]
	ldrh	w9, [x9]
Lloh92:
	adrp	x10, _PAD_BUTTON_RIGHT@GOTPAGE
Lloh93:
	ldr	x10, [x10, _PAD_BUTTON_RIGHT@GOTPAGEOFF]
	ldrh	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_61
; %bb.55:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh94:
	adrp	x8, _maxfiles@GOTPAGE
Lloh95:
	ldr	x8, [x8, _maxfiles@GOTPAGEOFF]
Lloh96:
	ldr	w9, [x8]
	subs	w8, w9, #10
	b.lt	LBB0_14
; %bb.56:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w10, [x23]
	add	w11, w10, #10
	str	w11, [x23]
	cmp	w11, w9
	b.ge	LBB0_73
; %bb.57:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [x24]
	cmp	w10, w9
	b.lt	LBB0_14
; %bb.58:                               ;   in Loop: Header=BB0_14 Depth=1
	add	w9, w9, #10
	cmp	w9, w8
	csel	w8, w9, w8, lt
	str	w8, [x24]
	b	LBB0_14
LBB0_59:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x24]
	cmp	w9, w8
	b.ge	LBB0_14
; %bb.60:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w8, #10
	mov	w9, #10
	csel	w8, w8, w9, gt
	sub	w8, w8, #10
	str	w8, [x24]
	b	LBB0_14
LBB0_61:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh97:
	adrp	x9, _PAD_TRIGGER_Z@GOTPAGE
Lloh98:
	ldr	x9, [x9, _PAD_TRIGGER_Z@GOTPAGEOFF]
	ldrh	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_79
; %bb.62:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh99:
	adrp	x9, _PAD_BUTTON_B@GOTPAGE
Lloh100:
	ldr	x9, [x9, _PAD_BUTTON_B@GOTPAGEOFF]
	ldrh	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_74
; %bb.63:                               ;   in Loop: Header=BB0_14 Depth=1
	str	xzr, [x22]
Lloh101:
	adrp	x8, _prev_folder@GOTPAGE
Lloh102:
	ldr	x8, [x8, _prev_folder@GOTPAGEOFF]
Lloh103:
	ldr	x1, [x8]
	mov	w0, #1
	bl	_UpdateDirectory
	cbz	x0, LBB0_79
; %bb.64:                               ;   in Loop: Header=BB0_14 Depth=1
	bl	_ParseDirectory
Lloh104:
	adrp	x8, _maxfiles@GOTPAGE
Lloh105:
	ldr	x8, [x8, _maxfiles@GOTPAGEOFF]
Lloh106:
	str	w0, [x8]
	str	wzr, [x24]
	str	wzr, [x23]
	mov	w26, #-1
	cmp	w0, #1
	b.lt	LBB0_14
; %bb.65:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x28, #0
Lloh107:
	adrp	x8, _filelist@GOTPAGE
Lloh108:
	ldr	x8, [x8, _filelist@GOTPAGEOFF]
Lloh109:
	ldr	x8, [x8]
Lloh110:
	adrp	x9, _prev_folder@GOTPAGE
Lloh111:
	ldr	x9, [x9, _prev_folder@GOTPAGEOFF]
Lloh112:
	ldr	x22, [x9]
	stur	w0, [x29, #-96]                 ; 4-byte Folded Spill
	mov	w20, w0
	add	x27, x8, #8
	b	LBB0_67
LBB0_66:                                ;   in Loop: Header=BB0_67 Depth=2
	add	x28, x28, #1
	add	x27, x27, #16
	mov	w26, #-1
	cmp	x20, x28
	b.eq	LBB0_78
LBB0_67:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x27]
	cbz	x8, LBB0_66
; %bb.68:                               ;   in Loop: Header=BB0_67 Depth=2
	ldur	x1, [x27, #-8]
	mov	x0, x22
	bl	_strcmp
	cbnz	w0, LBB0_66
; %bb.69:                               ;   in Loop: Header=BB0_14 Depth=1
	str	w28, [x23]
	mov	w26, #-1
	cmp	w28, #10
Lloh113:
	adrp	x20, _bg_filesel@GOTPAGE
Lloh114:
	ldr	x20, [x20, _bg_filesel@GOTPAGEOFF]
Lloh115:
	adrp	x27, _FILETYPE_MAX@GOTPAGE
Lloh116:
	ldr	x27, [x27, _FILETYPE_MAX@GOTPAGEOFF]
Lloh117:
	adrp	x22, _string_offset@GOTPAGE
Lloh118:
	ldr	x22, [x22, _string_offset@GOTPAGEOFF]
	ldur	w8, [x29, #-96]                 ; 4-byte Folded Reload
	b.lt	LBB0_14
; %bb.70:                               ;   in Loop: Header=BB0_14 Depth=1
	sub	w8, w8, #10
	mov	w9, #10
LBB0_71:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w9, w8
	csel	w10, w9, w8, lt
	add	w9, w10, #10
	cmp	w9, w28
	b.le	LBB0_71
; %bb.72:                               ;   in Loop: Header=BB0_14 Depth=1
	str	w10, [x24]
	mov	w26, #-1
	b	LBB0_14
LBB0_73:                                ;   in Loop: Header=BB0_14 Depth=1
	sub	w9, w9, #1
	str	w9, [x23]
	str	w8, [x24]
	b	LBB0_14
LBB0_74:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh119:
	adrp	x9, _PAD_BUTTON_A@GOTPAGE
Lloh120:
	ldr	x9, [x9, _PAD_BUTTON_A@GOTPAGEOFF]
	ldrh	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.75:                               ;   in Loop: Header=BB0_14 Depth=1
	str	xzr, [x22]
	ldp	w8, w9, [x21]
	cmp	w8, w9
	b.ge	LBB0_14
; %bb.76:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh121:
	adrp	x8, _filelist@GOTPAGE
Lloh122:
	ldr	x8, [x8, _filelist@GOTPAGEOFF]
Lloh123:
	ldr	x8, [x8]
	ldrsw	x0, [x23]
	add	x9, x8, x0, lsl #4
	ldr	x9, [x9, #8]
	cbz	x9, LBB0_86
; %bb.77:                               ;   in Loop: Header=BB0_14 Depth=1
	lsl	x9, x0, #4
	ldr	x1, [x8, x9]
	mov	w0, #0
	bl	_UpdateDirectory
	bl	_ParseDirectory
Lloh124:
	adrp	x8, _maxfiles@GOTPAGE
Lloh125:
	ldr	x8, [x8, _maxfiles@GOTPAGEOFF]
Lloh126:
	str	w0, [x8]
	str	wzr, [x24]
	str	wzr, [x23]
	mov	w26, #-1
	b	LBB0_14
LBB0_78:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh127:
	adrp	x20, _bg_filesel@GOTPAGE
Lloh128:
	ldr	x20, [x20, _bg_filesel@GOTPAGEOFF]
Lloh129:
	adrp	x27, _FILETYPE_MAX@GOTPAGE
Lloh130:
	ldr	x27, [x27, _FILETYPE_MAX@GOTPAGEOFF]
Lloh131:
	adrp	x22, _string_offset@GOTPAGE
Lloh132:
	ldr	x22, [x22, _string_offset@GOTPAGEOFF]
	b	LBB0_14
LBB0_79:
	mov	w19, #0
LBB0_80:
Lloh133:
	adrp	x0, _menu_selector@GOTPAGE
Lloh134:
	ldr	x0, [x0, _menu_selector@GOTPAGEOFF]
	bl	_GUI_DeleteMenu
	ldur	x8, [x29, #-88]
Lloh135:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh136:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh137:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_87
; %bb.81:
	mov	x0, x19
	sub	sp, x29, #80
	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_82:
	b.lt	LBB0_12
; %bb.83:
Lloh138:
	adrp	x10, _Cart_png@GOTPAGE
Lloh139:
	ldr	x10, [x10, _Cart_png@GOTPAGEOFF]
	ldr	x11, [x10]
	ldr	x11, [x11]
	str	x11, [x8, #232]
	cmp	w9, #1
	b.eq	LBB0_12
; %bb.84:
	mov	w8, w9
	mov	w9, #1
	mov	w11, #256
LBB0_85:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x10]
	ldr	x12, [x12, x9, lsl #3]
	ldr	x13, [x20]
	str	x12, [x13, x11]
	add	x9, x9, #1
	add	x11, x11, #24
	cmp	x8, x9
	b.ne	LBB0_85
	b	LBB0_12
LBB0_86:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_LoadFile
	mov	x19, x0
	b	LBB0_80
LBB0_87:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh54, Lloh55
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpAdd	Lloh67, Lloh68
	.loh AdrpAdd	Lloh69, Lloh70
	.loh AdrpLdrGot	Lloh73, Lloh74
	.loh AdrpLdrGot	Lloh71, Lloh72
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGot	Lloh78, Lloh79
	.loh AdrpLdrGot	Lloh82, Lloh83
	.loh AdrpLdrGot	Lloh80, Lloh81
	.loh AdrpLdrGotLdr	Lloh84, Lloh85, Lloh86
	.loh AdrpLdrGotLdr	Lloh87, Lloh88, Lloh89
	.loh AdrpLdrGot	Lloh92, Lloh93
	.loh AdrpLdrGot	Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh94, Lloh95, Lloh96
	.loh AdrpLdrGot	Lloh97, Lloh98
	.loh AdrpLdrGot	Lloh99, Lloh100
	.loh AdrpLdrGotLdr	Lloh101, Lloh102, Lloh103
	.loh AdrpLdrGotStr	Lloh104, Lloh105, Lloh106
	.loh AdrpLdrGotLdr	Lloh110, Lloh111, Lloh112
	.loh AdrpLdrGotLdr	Lloh107, Lloh108, Lloh109
	.loh AdrpLdrGot	Lloh117, Lloh118
	.loh AdrpLdrGot	Lloh115, Lloh116
	.loh AdrpLdrGot	Lloh113, Lloh114
	.loh AdrpLdrGot	Lloh119, Lloh120
	.loh AdrpLdrGotLdr	Lloh121, Lloh122, Lloh123
	.loh AdrpLdrGotStr	Lloh124, Lloh125, Lloh126
	.loh AdrpLdrGot	Lloh131, Lloh132
	.loh AdrpLdrGot	Lloh129, Lloh130
	.loh AdrpLdrGot	Lloh127, Lloh128
	.loh AdrpLdrGotLdr	Lloh135, Lloh136, Lloh137
	.loh AdrpLdrGot	Lloh133, Lloh134
	.loh AdrpLdrGot	Lloh138, Lloh139
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPATHLEN,4,2                 ; @MAXPATHLEN
	.comm	_menu_selector,16,3             ; @menu_selector
	.comm	_config,8,3                     ; @config
	.comm	_IMAGE_VISIBLE,4,2              ; @IMAGE_VISIBLE
	.comm	_bg_filesel,8,3                 ; @bg_filesel
	.comm	_FILETYPE_MAX,4,2               ; @FILETYPE_MAX
	.comm	_Cart_png,8,3                   ; @Cart_png
	.comm	_string_offset,8,3              ; @string_offset
	.comm	_selection,4,2                  ; @selection
	.comm	_filelist,8,3                   ; @filelist
	.comm	_history,8,3                    ; @history
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/snaps/%s/%s"

	.comm	_DEFAULT_PATH,8,3               ; @DEFAULT_PATH
	.comm	_Cart_dir,8,3                   ; @Cart_dir
l_.str.1:                               ; @.str.1
	.asciz	".png"

l_.str.2:                               ; @.str.2
	.asciz	"rb"

	.comm	_action_select,4,2              ; @action_select
l_.str.3:                               ; @.str.3
	.space	1

l_.str.4:                               ; @.str.4
	.asciz	"Open Directory"

l_.str.5:                               ; @.str.5
	.asciz	"Load File"

	.comm	_m_input,32,3                   ; @m_input
	.comm	_PAD_BUTTON_DOWN,2,1            ; @PAD_BUTTON_DOWN
	.comm	_maxfiles,4,2                   ; @maxfiles
	.comm	_offset,4,2                     ; @offset
	.comm	_PAD_BUTTON_UP,2,1              ; @PAD_BUTTON_UP
	.comm	_PAD_TRIGGER_L,2,1              ; @PAD_TRIGGER_L
	.comm	_PAD_BUTTON_LEFT,2,1            ; @PAD_BUTTON_LEFT
	.comm	_PAD_TRIGGER_R,2,1              ; @PAD_TRIGGER_R
	.comm	_PAD_BUTTON_RIGHT,2,1           ; @PAD_BUTTON_RIGHT
	.comm	_PAD_TRIGGER_Z,2,1              ; @PAD_TRIGGER_Z
	.comm	_PAD_BUTTON_B,2,1               ; @PAD_BUTTON_B
	.comm	_prev_folder,8,3                ; @prev_folder
	.comm	_PAD_BUTTON_A,2,1               ; @PAD_BUTTON_A
	.comm	_BUTTON_VISIBLE,4,2             ; @BUTTON_VISIBLE
	.comm	_SYS_POWEROFF,4,2               ; @SYS_POWEROFF
	.comm	_Shutdown,8,3                   ; @Shutdown
	.comm	_w_pointer,8,3                  ; @w_pointer
.subsections_via_symbols
