	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function state_load_gfx
_state_load_gfx:                        ## @state_load_gfx
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_g_read_offs@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	leaq	-56(%rbp), %r14
	movl	$8, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_CHECKED_READ
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	leaq	-56(%rbp), %rdi
	movl	$8, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str.2(%rip), %rdi
	callq	_R_ERROR_RETURN
LBB0_3:
	leaq	-64(%rbp), %rsi
	movl	$4, %edi
	xorl	%eax, %eax
	callq	_CHECKED_READ
	movq	%rbx, %rdi
	callq	_areaEof
	testl	%eax, %eax
	je	LBB0_4
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	-56(%rbp), %r14
	leaq	-60(%rbp), %r15
	movq	_CHUNK_FM@GOTPCREL(%rip), %r13
	movq	_SEEK_CUR@GOTPCREL(%rip), %r12
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-60(%rbp), %esi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_areaSeek
	movq	%rbx, %rdi
	callq	_areaEof
	testl	%eax, %eax
	jne	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_CHECKED_READ
	movl	$4, %edi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_CHECKED_READ
	cmpl	$524289, -60(%rbp)              ## imm = 0x80001
	jb	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.3(%rip), %rdi
	callq	_R_ERROR_RETURN
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movzbl	-56(%rbp), %eax
	cmpb	(%r13), %al
	jle	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_CHUNK_MISC_CD@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	jg	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_PAHW_MCD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PicoAHW@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.4(%rip), %rdi
	callq	_R_ERROR_RETURN
	jmp	LBB0_11
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PicoAHW,4,2                    ## @PicoAHW
	.comm	_PAHW_32X,4,2                   ## @PAHW_32X
	.comm	_g_read_offs,8,3                ## @g_read_offs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PicoSMCD"

L_.str.1:                               ## @.str.1
	.asciz	"PicoSEXT"

L_.str.2:                               ## @.str.2
	.asciz	"bad header"

L_.str.3:                               ## @.str.3
	.asciz	"bad length"

	.comm	_CHUNK_FM,1,0                   ## @CHUNK_FM
	.comm	_CHUNK_MISC_CD,1,0              ## @CHUNK_MISC_CD
	.comm	_PAHW_MCD,4,2                   ## @PAHW_MCD
L_.str.4:                               ## @.str.4
	.asciz	"cd chunk in non CD state?"

	.comm	_Pico,16,2                      ## @Pico
	.comm	_Pico32xMem,8,3                 ## @Pico32xMem
	.comm	_Pico32x,4,2                    ## @Pico32x
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.no_dead_strip	_state_load_gfx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function state_load_gfx
_state_load_gfx:                        ; @state_load_gfx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _g_read_offs@GOTPAGE
Lloh4:
	ldr	x8, [x8, _g_read_offs@GOTPAGEOFF]
Lloh5:
	str	xzr, [x8]
	add	x8, sp, #16
	str	x8, [sp]
	mov	w0, #8
	bl	_CHECKED_READ
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #16
	mov	w2, #8
	bl	_strncmp
	cbz	x0, LBB0_3
; %bb.1:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #16
	mov	w2, #8
	bl	_strncmp
	cbz	x0, LBB0_3
; %bb.2:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_R_ERROR_RETURN
LBB0_3:
	add	x8, sp, #12
	str	x8, [sp]
	mov	w0, #4
	bl	_CHECKED_READ
	mov	x0, x19
	bl	_areaEof
	cbz	w0, LBB0_6
LBB0_4:
	ldr	x8, [sp, #24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.5:
	mov	w0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_6:
	add	x22, sp, #16
	add	x23, sp, #8
Lloh15:
	adrp	x24, _CHUNK_FM@GOTPAGE
Lloh16:
	ldr	x24, [x24, _CHUNK_FM@GOTPAGEOFF]
Lloh17:
	adrp	x25, _CHUNK_MISC_CD@GOTPAGE
Lloh18:
	ldr	x25, [x25, _CHUNK_MISC_CD@GOTPAGEOFF]
Lloh19:
	adrp	x20, l_.str.3@PAGE
Lloh20:
	add	x20, x20, l_.str.3@PAGEOFF
Lloh21:
	adrp	x26, _SEEK_CUR@GOTPAGE
Lloh22:
	ldr	x26, [x26, _SEEK_CUR@GOTPAGEOFF]
Lloh23:
	adrp	x27, _PicoAHW@GOTPAGE
Lloh24:
	ldr	x27, [x27, _PicoAHW@GOTPAGEOFF]
Lloh25:
	adrp	x28, _PAHW_MCD@GOTPAGE
Lloh26:
	ldr	x28, [x28, _PAHW_MCD@GOTPAGEOFF]
Lloh27:
	adrp	x21, l_.str.4@PAGE
Lloh28:
	add	x21, x21, l_.str.4@PAGEOFF
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w1, [sp, #8]
	ldr	w2, [x26]
	mov	x0, x19
	bl	_areaSeek
	mov	x0, x19
	bl	_areaEof
	cbnz	w0, LBB0_4
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	str	x22, [sp]
	mov	w0, #1
	bl	_CHECKED_READ
	str	x23, [sp]
	mov	w0, #4
	bl	_CHECKED_READ
	ldr	w8, [sp, #8]
	cmp	w8, #128, lsl #12               ; =524288
	b.ls	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	bl	_R_ERROR_RETURN
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	ldrsb	w8, [sp, #16]
	ldrsb	w9, [x24]
	ldrsb	w10, [x25]
	cmp	w8, w9
	ccmp	w8, w10, #0, gt
	b.gt	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x27]
	ldr	w9, [x28]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	bl	_R_ERROR_RETURN
	b	LBB0_7
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PicoAHW,4,2                    ; @PicoAHW
	.comm	_PAHW_32X,4,2                   ; @PAHW_32X
	.comm	_g_read_offs,8,3                ; @g_read_offs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PicoSMCD"

l_.str.1:                               ; @.str.1
	.asciz	"PicoSEXT"

l_.str.2:                               ; @.str.2
	.asciz	"bad header"

l_.str.3:                               ; @.str.3
	.asciz	"bad length"

	.comm	_CHUNK_FM,1,0                   ; @CHUNK_FM
	.comm	_CHUNK_MISC_CD,1,0              ; @CHUNK_MISC_CD
	.comm	_PAHW_MCD,4,2                   ; @PAHW_MCD
l_.str.4:                               ; @.str.4
	.asciz	"cd chunk in non CD state?"

	.comm	_Pico,16,2                      ; @Pico
	.comm	_Pico32xMem,8,3                 ; @Pico32xMem
	.comm	_Pico32x,4,2                    ; @Pico32x
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.no_dead_strip	_state_load_gfx
.subsections_via_symbols
