	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_slot_load                      ## -- Begin function slot_load
	.p2align	4, 0x90
_slot_load:                             ## @slot_load
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %ebx
	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
	testl	%ebx, %ebx
	jle	LBB0_1
## %bb.13:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edx
	callq	_GUI_MsgBoxOpen
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.14:
	movq	_rominfo@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leal	-1(%rbx), %ecx
	leaq	L_.str.10(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_sprintf
	jmp	LBB0_17
LBB0_1:
	movq	_sram@GOTPCREL(%rip), %rax
	cmpl	$0, 12(%rax)
	je	LBB0_2
## %bb.15:
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edx
	callq	_GUI_MsgBoxOpen
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.16:
	movq	_rominfo@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.11(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_sprintf
LBB0_17:
	movq	_CARD_WORKAREA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SysArea@GOTPCREL(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_memset
	leaq	L_.str.12(%rip), %rdi
	leaq	L_.str.13(%rip), %rsi
	callq	_CARD_Init
	decl	%r15d
	movl	%r15d, %edi
	callq	_CardMount
	testl	%eax, %eax
	je	LBB0_18
## %bb.19:
	movq	$0, -128(%rbp)
	leaq	-128(%rbp), %rsi
	movl	%r15d, %edi
	callq	_CARD_GetSectorSize
	cmpq	$0, -128(%rbp)
	je	LBB0_20
## %bb.22:
	leaq	-136(%rbp), %rdx
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_CARD_Open
	testl	%eax, %eax
	je	LBB0_24
## %bb.23:
	leaq	L_.str.16(%rip), %rsi
	jmp	LBB0_21
LBB0_4:
	movq	_DEFAULT_PATH@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_rom_filename@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leal	-1(%rbx), %r8d
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_sprintf
	jmp	LBB0_6
LBB0_18:
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.14(%rip), %rsi
	callq	_GUI_WaitPrompt
	jmp	LBB0_44
LBB0_2:
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_3
LBB0_20:
	leaq	L_.str.15(%rip), %rsi
LBB0_21:
	xorl	%r13d, %r13d
	leaq	-112(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_sprintf
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	callq	_GUI_WaitPrompt
	movl	%r15d, %edi
	callq	_CARD_Unmount
	jmp	LBB0_44
LBB0_5:
	movq	_DEFAULT_PATH@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_rom_filename@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	L_.str.6(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_sprintf
LBB0_6:
	leaq	L_.str.7(%rip), %rsi
	movq	%r12, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r12
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%r12, %rdi
	callq	_ftell
	movq	%rax, %r14
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movl	$32, %edi
	movq	%r14, %rsi
	callq	_memalign
	testq	%rax, %rax
	je	LBB0_46
## %bb.9:
	movq	%rax, %r15
	movq	%rbx, -144(%rbp)                ## 8-byte Spill
	movq	_CHUNKSIZE@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	xorl	%ebx, %ebx
	cmpq	%rsi, %r14
	jbe	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx,4), %rdi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	_fread
	movq	(%r13), %rsi
	addq	%rsi, %rbx
	subq	%rsi, %r14
	cmpq	%rsi, %r14
	ja	LBB0_10
LBB0_12:
	movq	%r14, -120(%rbp)
	leaq	(%r15,%rbx,4), %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	movq	%r12, %rcx
	callq	_fread
	movq	%r12, %rdi
	callq	_fclose
	cmpl	$0, -144(%rbp)                  ## 4-byte Folded Reload
	jle	LBB0_42
LBB0_40:
	movq	%r15, %rdi
	callq	_state_load
	testq	%rax, %rax
	jg	LBB0_43
## %bb.41:
	movq	%r15, %rdi
	callq	_free
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.17(%rip), %rsi
	jmp	LBB0_3
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.8(%rip), %rsi
LBB0_3:
	callq	_GUI_WaitPrompt
	xorl	%r13d, %r13d
	jmp	LBB0_44
LBB0_24:
	movq	-136(%rbp), %r13
	movq	%r13, -120(%rbp)
	movq	-128(%rbp), %rcx
	movq	%r13, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_25
## %bb.26:
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	LBB0_29
LBB0_28:
	incq	%rax
	imulq	%rcx, %rax
	movq	%rax, -120(%rbp)
	movq	%rax, %r13
LBB0_29:
	movl	$32, %edi
	movq	%r13, %rsi
	callq	_memalign
	testq	%rax, %rax
	je	LBB0_30
## %bb.31:
	movq	%rax, %r12
	movq	%rbx, -144(%rbp)                ## 8-byte Spill
	testq	%r13, %r13
	je	LBB0_32
## %bb.33:
	movq	-128(%rbp), %rdx
	xorl	%ebx, %ebx
	leaq	-136(%rbp), %r14
	.p2align	4, 0x90
LBB0_34:                                ## =>This Inner Loop Header: Depth=1
	leaq	(%r12,%rbx,4), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	_CARD_Read
	movq	-128(%rbp), %rdx
	addq	%rdx, %rbx
	subq	%rdx, %r13
	movq	%r13, -120(%rbp)
	jne	LBB0_34
## %bb.35:
	addq	$-2116, %rbx                    ## imm = 0xF7BC
	jmp	LBB0_36
LBB0_46:
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.9(%rip), %rsi
	callq	_GUI_WaitPrompt
	movq	%r12, %rdi
	callq	_fclose
	jmp	LBB0_44
LBB0_25:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
                                        ## kill: def $eax killed $eax def $rax
	testq	%rdx, %rdx
	jne	LBB0_28
	jmp	LBB0_29
LBB0_30:
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.9(%rip), %rsi
	callq	_GUI_WaitPrompt
	leaq	-136(%rbp), %rdi
	callq	_CARD_Close
	movl	%r15d, %edi
	callq	_CARD_Unmount
	xorl	%r13d, %r13d
	jmp	LBB0_44
LBB0_32:
	movq	$-2116, %rbx                    ## imm = 0xF7BC
LBB0_36:
	leaq	-136(%rbp), %rdi
	callq	_CARD_Close
	movl	%r15d, %edi
	callq	_CARD_Unmount
	leaq	8448(%r12), %rsi
	leaq	-120(%rbp), %rdi
	movl	$4, %edx
	callq	_memcpy
	movq	-120(%rbp), %rsi
	movl	$32, %edi
	callq	_memalign
	testq	%rax, %rax
	je	LBB0_37
## %bb.38:
	movq	%rax, %r15
	movq	%r12, %rdx
	addq	$8464, %rdx                     ## imm = 0x2110
	leaq	-120(%rbp), %rsi
	movq	%rax, %rdi
	movq	%rbx, %rcx
	callq	_uncompress
	movq	%r12, %rdi
	callq	_free
	cmpl	$0, -144(%rbp)                  ## 4-byte Folded Reload
	jg	LBB0_40
LBB0_42:
	movq	_sram@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	%r15, %rsi
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_memcpy
	movq	(%rbx), %rsi
	xorl	%edi, %edi
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_crc32
	movl	%eax, 8(%rbx)
LBB0_43:
	movq	%r15, %rdi
	callq	_free
	xorl	%eax, %eax
	callq	_GUI_MsgBoxClose
	movl	$1, %r13d
LBB0_44:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_45
## %bb.47:
	movl	%r13d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_37:
	movq	%r12, %rdi
	callq	_free
	leaq	L_.str.2(%rip), %rdi
	leaq	L_.str.9(%rip), %rsi
	jmp	LBB0_3
LBB0_45:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPATHLEN,4,2                 ## @MAXPATHLEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Information"

L_.str.1:                               ## @.str.1
	.asciz	"Loading State ..."

	.comm	_sram,16,3                      ## @sram
L_.str.2:                               ## @.str.2
	.asciz	"Error"

L_.str.3:                               ## @.str.3
	.asciz	"Backup RAM is disabled !"

L_.str.4:                               ## @.str.4
	.asciz	"Loading Backup RAM ..."

L_.str.5:                               ## @.str.5
	.asciz	"%s/saves/%s.gp%d"

	.comm	_DEFAULT_PATH,8,3               ## @DEFAULT_PATH
	.comm	_rom_filename,8,3               ## @rom_filename
L_.str.6:                               ## @.str.6
	.asciz	"%s/saves/%s.srm"

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

L_.str.8:                               ## @.str.8
	.asciz	"Unable to open file !"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.9:                               ## @.str.9
	.asciz	"Unable to allocate memory !"

	.comm	_CHUNKSIZE,8,3                  ## @CHUNKSIZE
L_.str.10:                              ## @.str.10
	.asciz	"MD-%04X.gp%d"

	.comm	_rominfo,4,2                    ## @rominfo
L_.str.11:                              ## @.str.11
	.asciz	"MD-%04X.srm"

	.comm	_SysArea,4,2                    ## @SysArea
	.comm	_CARD_WORKAREA,4,2              ## @CARD_WORKAREA
L_.str.12:                              ## @.str.12
	.asciz	"GENP"

L_.str.13:                              ## @.str.13
	.asciz	"00"

L_.str.14:                              ## @.str.14
	.asciz	"Unable to mount memory card"

L_.str.15:                              ## @.str.15
	.asciz	"Invalid sector size (%d)"

L_.str.16:                              ## @.str.16
	.asciz	"Unable to open file (%d)"

L_.str.17:                              ## @.str.17
	.asciz	"Invalid state file !"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_slot_load                      ; -- Begin function slot_load
	.p2align	2
_slot_load:                             ; @slot_load
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #96
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
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	x21, x9, x8
	mov	sp, x21
	cmp	w0, #0
	b.le	LBB0_3
; %bb.1:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #1
	bl	_GUI_MsgBoxOpen
	cbz	w20, LBB0_10
; %bb.2:
Lloh12:
	adrp	x8, _rominfo@GOTPAGE
Lloh13:
	ldr	x8, [x8, _rominfo@GOTPAGEOFF]
	sub	w9, w19, #1
Lloh14:
	ldr	w8, [x8]
	stp	x8, x9, [sp, #-16]!
Lloh15:
	adrp	x1, l_.str.10@PAGE
Lloh16:
	add	x1, x1, l_.str.10@PAGEOFF
	b	LBB0_6
LBB0_3:
Lloh17:
	adrp	x8, _sram@GOTPAGE
Lloh18:
	ldr	x8, [x8, _sram@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8, #12]
	cbz	w8, LBB0_12
; %bb.4:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w2, #1
	bl	_GUI_MsgBoxOpen
	cbz	w20, LBB0_16
; %bb.5:
Lloh24:
	adrp	x8, _rominfo@GOTPAGE
Lloh25:
	ldr	x8, [x8, _rominfo@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	x8, [sp, #-16]!
Lloh27:
	adrp	x1, l_.str.11@PAGE
Lloh28:
	add	x1, x1, l_.str.11@PAGEOFF
LBB0_6:
	mov	x0, x21
	bl	_sprintf
	add	sp, sp, #16
Lloh29:
	adrp	x8, _CARD_WORKAREA@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CARD_WORKAREA@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
Lloh32:
	adrp	x0, _SysArea@GOTPAGE
Lloh33:
	ldr	x0, [x0, _SysArea@GOTPAGEOFF]
	mov	w1, #0
	bl	_memset
Lloh34:
	adrp	x0, l_.str.12@PAGE
Lloh35:
	add	x0, x0, l_.str.12@PAGEOFF
Lloh36:
	adrp	x1, l_.str.13@PAGE
Lloh37:
	add	x1, x1, l_.str.13@PAGEOFF
	bl	_CARD_Init
	sub	w20, w20, #1
	mov	x0, x20
	bl	_CardMount
	cbz	w0, LBB0_11
; %bb.7:
	stur	xzr, [x29, #-136]
	sub	x1, x29, #136
	mov	x0, x20
	bl	_CARD_GetSectorSize
                                        ; kill: def $w0 killed $w0 def $x0
	ldur	x8, [x29, #-136]
	cbz	x8, LBB0_13
; %bb.8:
	sub	x2, x29, #144
	mov	x0, x20
	mov	x1, x21
	bl	_CARD_Open
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_23
; %bb.9:
	str	x0, [sp, #-16]!
Lloh38:
	adrp	x1, l_.str.16@PAGE
Lloh39:
	add	x1, x1, l_.str.16@PAGEOFF
	b	LBB0_14
LBB0_10:
Lloh40:
	adrp	x8, _DEFAULT_PATH@GOTPAGE
Lloh41:
	ldr	x8, [x8, _DEFAULT_PATH@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
Lloh43:
	adrp	x9, _rom_filename@GOTPAGE
Lloh44:
	ldr	x9, [x9, _rom_filename@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	sub	w10, w19, #1
	sub	sp, sp, #32
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh46:
	adrp	x1, l_.str.5@PAGE
Lloh47:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_sprintf
	add	sp, sp, #32
	b	LBB0_17
LBB0_11:
Lloh48:
	adrp	x0, l_.str.2@PAGE
Lloh49:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh50:
	adrp	x1, l_.str.14@PAGE
Lloh51:
	add	x1, x1, l_.str.14@PAGEOFF
	b	LBB0_42
LBB0_12:
Lloh52:
	adrp	x0, l_.str.2@PAGE
Lloh53:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh54:
	adrp	x1, l_.str.3@PAGE
Lloh55:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_42
LBB0_13:
	str	x0, [sp, #-16]!
Lloh56:
	adrp	x1, l_.str.15@PAGE
Lloh57:
	add	x1, x1, l_.str.15@PAGEOFF
LBB0_14:
	sub	x0, x29, #120
	bl	_sprintf
	add	sp, sp, #16
Lloh58:
	adrp	x0, l_.str.2@PAGE
Lloh59:
	add	x0, x0, l_.str.2@PAGEOFF
	sub	x1, x29, #120
	bl	_GUI_WaitPrompt
LBB0_15:
	mov	x0, x20
	bl	_CARD_Unmount
	b	LBB0_43
LBB0_16:
Lloh60:
	adrp	x8, _DEFAULT_PATH@GOTPAGE
Lloh61:
	ldr	x8, [x8, _DEFAULT_PATH@GOTPAGEOFF]
Lloh62:
	ldr	x8, [x8]
Lloh63:
	adrp	x9, _rom_filename@GOTPAGE
Lloh64:
	ldr	x9, [x9, _rom_filename@GOTPAGEOFF]
Lloh65:
	ldr	x9, [x9]
	stp	x8, x9, [sp, #-16]!
Lloh66:
	adrp	x1, l_.str.6@PAGE
Lloh67:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	bl	_sprintf
	add	sp, sp, #16
LBB0_17:
Lloh68:
	adrp	x1, l_.str.7@PAGE
Lloh69:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x21
	bl	_fopen
	cbz	x0, LBB0_22
; %bb.18:
	mov	x21, x0
Lloh70:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh71:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh72:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	mov	x0, x21
	bl	_ftell
	mov	x22, x0
Lloh73:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh74:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh75:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_fseek
	mov	w0, #32
	mov	x1, x22
	bl	_memalign
	cbz	x0, LBB0_30
; %bb.19:
	mov	x20, x0
Lloh76:
	adrp	x23, _CHUNKSIZE@GOTPAGE
Lloh77:
	ldr	x23, [x23, _CHUNKSIZE@GOTPAGEOFF]
	ldr	x1, [x23]
	cmp	x22, x1
	b.ls	LBB0_31
; %bb.20:
	mov	x24, #0
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x24, lsl #2
	mov	w2, #1
	mov	x3, x21
	bl	_fread
	ldr	x1, [x23]
	add	x24, x1, x24
	sub	x22, x22, x1
	cmp	x22, x1
	b.hi	LBB0_21
	b	LBB0_32
LBB0_22:
Lloh78:
	adrp	x0, l_.str.2@PAGE
Lloh79:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh80:
	adrp	x1, l_.str.8@PAGE
Lloh81:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_42
LBB0_23:
	ldp	x22, x8, [x29, #-144]
	stur	x22, [x29, #-128]
	udiv	x9, x22, x8
	msub	x10, x9, x8, x22
	cbz	x10, LBB0_25
; %bb.24:
	madd	x22, x8, x9, x8
	stur	x22, [x29, #-128]
LBB0_25:
	mov	w0, #32
	mov	x1, x22
	bl	_memalign
	cbz	x0, LBB0_35
; %bb.26:
	mov	x21, x0
	cbz	x22, LBB0_36
; %bb.27:
	mov	x23, #0
	ldur	x2, [x29, #-136]
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	add	x1, x21, x23, lsl #2
	sub	x0, x29, #144
	mov	x3, x23
	bl	_CARD_Read
	ldur	x2, [x29, #-136]
	add	x23, x2, x23
	subs	x22, x22, x2
	stur	x22, [x29, #-128]
	b.ne	LBB0_28
; %bb.29:
	sub	x22, x23, #2116
	b	LBB0_37
LBB0_30:
Lloh82:
	adrp	x0, l_.str.2@PAGE
Lloh83:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh84:
	adrp	x1, l_.str.9@PAGE
Lloh85:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_GUI_WaitPrompt
	mov	x0, x21
	bl	_fclose
	b	LBB0_43
LBB0_31:
	mov	x24, #0
LBB0_32:
	stur	x22, [x29, #-128]
	add	x0, x20, x24, lsl #2
	mov	x1, x22
	mov	w2, #1
	mov	x3, x21
	bl	_fread
	mov	x0, x21
	bl	_fclose
	cmp	w19, #1
	b.lt	LBB0_39
LBB0_33:
	mov	x0, x20
	bl	_state_load
	cmp	x0, #0
	b.gt	LBB0_40
; %bb.34:
	mov	x0, x20
	bl	_free
Lloh86:
	adrp	x0, l_.str.2@PAGE
Lloh87:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh88:
	adrp	x1, l_.str.17@PAGE
Lloh89:
	add	x1, x1, l_.str.17@PAGEOFF
	b	LBB0_42
LBB0_35:
Lloh90:
	adrp	x0, l_.str.2@PAGE
Lloh91:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh92:
	adrp	x1, l_.str.9@PAGE
Lloh93:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_GUI_WaitPrompt
	sub	x0, x29, #144
	bl	_CARD_Close
	b	LBB0_15
LBB0_36:
	mov	x22, #-2116
LBB0_37:
	sub	x0, x29, #144
	bl	_CARD_Close
	mov	x0, x20
	bl	_CARD_Unmount
	mov	w8, #8448
	add	x1, x21, x8
	sub	x0, x29, #128
	mov	w2, #4
	bl	_memcpy
	ldur	x1, [x29, #-128]
	mov	w0, #32
	bl	_memalign
	cbz	x0, LBB0_41
; %bb.38:
	mov	x20, x0
	mov	w8, #8464
	add	x2, x21, x8
	sub	x1, x29, #128
	mov	x3, x22
	bl	_uncompress
	mov	x0, x21
	bl	_free
	cmp	w19, #1
	b.ge	LBB0_33
LBB0_39:
Lloh94:
	adrp	x19, _sram@GOTPAGE
Lloh95:
	ldr	x19, [x19, _sram@GOTPAGEOFF]
	ldr	x0, [x19]
	mov	x1, x20
	mov	w2, #65536
	bl	_memcpy
	ldr	x1, [x19]
	mov	w0, #0
	mov	w2, #65536
	bl	_crc32
	str	w0, [x19, #8]
LBB0_40:
	mov	x0, x20
	bl	_free
	bl	_GUI_MsgBoxClose
	mov	w0, #1
	b	LBB0_44
LBB0_41:
	mov	x0, x21
	bl	_free
Lloh96:
	adrp	x0, l_.str.2@PAGE
Lloh97:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh98:
	adrp	x1, l_.str.9@PAGE
Lloh99:
	add	x1, x1, l_.str.9@PAGEOFF
LBB0_42:
	bl	_GUI_WaitPrompt
LBB0_43:
	mov	w0, #0
LBB0_44:
	ldur	x8, [x29, #-56]
Lloh100:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh101:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh102:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_46
; %bb.45:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_46:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpAdd	Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.loh AdrpLdrGotLdr	Lloh70, Lloh71, Lloh72
	.loh AdrpLdrGot	Lloh76, Lloh77
	.loh AdrpAdd	Lloh80, Lloh81
	.loh AdrpAdd	Lloh78, Lloh79
	.loh AdrpAdd	Lloh84, Lloh85
	.loh AdrpAdd	Lloh82, Lloh83
	.loh AdrpAdd	Lloh88, Lloh89
	.loh AdrpAdd	Lloh86, Lloh87
	.loh AdrpAdd	Lloh92, Lloh93
	.loh AdrpAdd	Lloh90, Lloh91
	.loh AdrpLdrGot	Lloh94, Lloh95
	.loh AdrpAdd	Lloh98, Lloh99
	.loh AdrpAdd	Lloh96, Lloh97
	.loh AdrpLdrGotLdr	Lloh100, Lloh101, Lloh102
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPATHLEN,4,2                 ; @MAXPATHLEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Information"

l_.str.1:                               ; @.str.1
	.asciz	"Loading State ..."

	.comm	_sram,16,3                      ; @sram
l_.str.2:                               ; @.str.2
	.asciz	"Error"

l_.str.3:                               ; @.str.3
	.asciz	"Backup RAM is disabled !"

l_.str.4:                               ; @.str.4
	.asciz	"Loading Backup RAM ..."

l_.str.5:                               ; @.str.5
	.asciz	"%s/saves/%s.gp%d"

	.comm	_DEFAULT_PATH,8,3               ; @DEFAULT_PATH
	.comm	_rom_filename,8,3               ; @rom_filename
l_.str.6:                               ; @.str.6
	.asciz	"%s/saves/%s.srm"

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

l_.str.8:                               ; @.str.8
	.asciz	"Unable to open file !"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.9:                               ; @.str.9
	.asciz	"Unable to allocate memory !"

	.comm	_CHUNKSIZE,8,3                  ; @CHUNKSIZE
l_.str.10:                              ; @.str.10
	.asciz	"MD-%04X.gp%d"

	.comm	_rominfo,4,2                    ; @rominfo
l_.str.11:                              ; @.str.11
	.asciz	"MD-%04X.srm"

	.comm	_SysArea,4,2                    ; @SysArea
	.comm	_CARD_WORKAREA,4,2              ; @CARD_WORKAREA
l_.str.12:                              ; @.str.12
	.asciz	"GENP"

l_.str.13:                              ; @.str.13
	.asciz	"00"

l_.str.14:                              ; @.str.14
	.asciz	"Unable to mount memory card"

l_.str.15:                              ; @.str.15
	.asciz	"Invalid sector size (%d)"

l_.str.16:                              ; @.str.16
	.asciz	"Unable to open file (%d)"

l_.str.17:                              ; @.str.17
	.asciz	"Invalid state file !"

.subsections_via_symbols
