	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_StateSav_ReadAtariState        ## -- Begin function StateSav_ReadAtariState
	.p2align	4, 0x90
_StateSav_ReadAtariState:               ## @StateSav_ReadAtariState
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -60(%rbp)
	movl	$0, -68(%rbp)
	movq	_StateFile@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_GZCLOSE
	movq	$0, (%r15)
LBB0_2:
	movq	_Z_OK@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_nFileError@GOTPCREL(%rip), %r13
	movq	%rax, (%r13)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_GZOPEN
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	leaq	-56(%rbp), %rsi
	movq	%rax, %rdi
	movl	$8, %edx
	xorl	%eax, %eax
	callq	_GZREAD
	testq	%rax, %rax
	je	LBB0_18
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	leaq	-56(%rbp), %rdi
	movl	$8, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	xorl	%eax, %eax
	callq	_Log_print
	jmp	LBB0_19
LBB0_7:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_Log_print
	xorl	%eax, %eax
	callq	_GetGZErrorText
	jmp	LBB0_20
LBB0_8:
	movq	(%r15), %rdi
	leaq	-60(%rbp), %rsi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_GZREAD
	testq	%rax, %rax
	je	LBB0_17
## %bb.9:
	movq	(%r15), %rdi
	leaq	-68(%rbp), %rsi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_GZREAD
	testq	%rax, %rax
	je	LBB0_17
## %bb.10:
	movl	-60(%rbp), %edi
	cmpl	$3, %edi
	jl	LBB0_23
## %bb.11:
	movq	_SAVE_VERSION_NUMBER@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jg	LBB0_23
## %bb.12:
	callq	_Atari800_StateRead
	movl	-60(%rbp), %edi
	cmpl	$4, %edi
	jl	LBB0_14
## %bb.13:
	callq	_CARTRIDGE_StateRead
	xorl	%eax, %eax
	callq	_SIO_StateRead
LBB0_14:
	xorl	%eax, %eax
	callq	_ANTIC_StateRead
	movl	-68(%rbp), %edi
	movl	-60(%rbp), %esi
	callq	_CPU_StateRead
	movl	-60(%rbp), %edi
	callq	_GTIA_StateRead
	movl	-60(%rbp), %edi
	callq	_PIA_StateRead
	xorl	%eax, %eax
	callq	_POKEY_StateRead
	cmpl	$6, -60(%rbp)
	jl	LBB0_30
## %bb.15:
	leaq	-72(%rbp), %rdi
	movl	$1, %esi
	callq	_StateSav_ReadINT
	cmpl	$0, -72(%rbp)
	je	LBB0_24
## %bb.16:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_6
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_print
LBB0_18:
	xorl	%eax, %eax
	callq	_GetGZErrorText
LBB0_19:
	movq	(%r15), %rdi
	callq	_GZCLOSE
	movq	$0, (%r15)
LBB0_20:
	movq	_FALSE@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_33
## %bb.22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_6
LBB0_24:
	xorl	%eax, %eax
	callq	_PBI_StateRead
	leaq	-64(%rbp), %rdi
	movl	$1, %esi
	callq	_StateSav_ReadINT
	cmpl	$0, -64(%rbp)
	je	LBB0_26
## %bb.25:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_6
LBB0_26:
	leaq	-64(%rbp), %rdi
	movl	$1, %esi
	callq	_StateSav_ReadINT
	cmpl	$0, -64(%rbp)
	je	LBB0_28
## %bb.27:
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_6
LBB0_28:
	leaq	-64(%rbp), %rdi
	movl	$1, %esi
	callq	_StateSav_ReadINT
	cmpl	$0, -64(%rbp)
	je	LBB0_30
## %bb.29:
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_6
LBB0_30:
	movq	(%r15), %rdi
	callq	_GZCLOSE
	movq	$0, (%r15)
	movq	(%r13), %rax
	cmpq	(%r12), %rax
	jne	LBB0_20
## %bb.31:
	movq	_TRUE@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_33:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_StateFile,8,3                  ## @StateFile
	.comm	_Z_OK,8,3                       ## @Z_OK
	.comm	_nFileError,8,3                 ## @nFileError
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not open %s for state read."

	.comm	_FALSE,4,2                      ## @FALSE
L_.str.1:                               ## @.str.1
	.asciz	"ATARI800"

L_.str.2:                               ## @.str.2
	.asciz	"This is not an Atari800 state save file."

L_.str.3:                               ## @.str.3
	.asciz	"Failed read from Atari state file."

	.comm	_SAVE_VERSION_NUMBER,4,2        ## @SAVE_VERSION_NUMBER
L_.str.4:                               ## @.str.4
	.asciz	"Cannot read this state file because it is an incompatible version."

L_.str.5:                               ## @.str.5
	.asciz	"Cannot read this state file because this version does not support XEP80."

L_.str.6:                               ## @.str.6
	.asciz	"Cannot read this state file because this version does not support MIO."

L_.str.7:                               ## @.str.7
	.asciz	"Cannot read this state file because this version does not support the Black Box."

L_.str.8:                               ## @.str.8
	.asciz	"Cannot read this state file because this version does not support the 1400XL/1450XLD."

	.comm	_TRUE,4,2                       ## @TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_StateSav_ReadAtariState        ; -- Begin function StateSav_ReadAtariState
	.p2align	2
_StateSav_ReadAtariState:               ; @StateSav_ReadAtariState
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	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]
	str	x8, [sp, #40]
	str	xzr, [sp, #24]
Lloh3:
	adrp	x21, _StateFile@GOTPAGE
Lloh4:
	ldr	x21, [x21, _StateFile@GOTPAGEOFF]
	ldr	x0, [x21]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_GZCLOSE
	str	xzr, [x21]
LBB0_2:
Lloh5:
	adrp	x22, _Z_OK@GOTPAGE
Lloh6:
	ldr	x22, [x22, _Z_OK@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh7:
	adrp	x23, _nFileError@GOTPAGE
Lloh8:
	ldr	x23, [x23, _nFileError@GOTPAGEOFF]
	str	x8, [x23]
	mov	x0, x19
	mov	x1, x20
	bl	_GZOPEN
	str	x0, [x21]
	cbz	x0, LBB0_6
; %bb.3:
	mov	w8, #8
	add	x9, sp, #32
	stp	x9, x8, [sp]
	bl	_GZREAD
	cbz	x0, LBB0_17
; %bb.4:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #32
	mov	w2, #8
	bl	_memcmp
	cbz	x0, LBB0_7
; %bb.5:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Log_print
	b	LBB0_18
LBB0_6:
	str	x19, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_print
	bl	_GetGZErrorText
	b	LBB0_19
LBB0_7:
	ldr	x0, [x21]
	mov	w8, #1
	add	x9, sp, #28
	stp	x9, x8, [sp]
	bl	_GZREAD
	cbz	x0, LBB0_16
; %bb.8:
	ldr	x0, [x21]
	mov	w8, #1
	add	x9, sp, #24
	stp	x9, x8, [sp]
	bl	_GZREAD
	cbz	x0, LBB0_16
; %bb.9:
	ldr	w0, [sp, #28]
	cmp	w0, #3
	b.lt	LBB0_22
; %bb.10:
Lloh15:
	adrp	x8, _SAVE_VERSION_NUMBER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SAVE_VERSION_NUMBER@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, w8
	b.gt	LBB0_22
; %bb.11:
	bl	_Atari800_StateRead
	ldr	w0, [sp, #28]
	cmp	w0, #4
	b.lt	LBB0_13
; %bb.12:
	bl	_CARTRIDGE_StateRead
	bl	_SIO_StateRead
LBB0_13:
	bl	_ANTIC_StateRead
	ldp	w0, w1, [sp, #24]
	bl	_CPU_StateRead
	ldr	w0, [sp, #28]
	bl	_GTIA_StateRead
	ldr	w0, [sp, #28]
	bl	_PIA_StateRead
	bl	_POKEY_StateRead
	ldr	w8, [sp, #28]
	cmp	w8, #6
	b.lt	LBB0_29
; %bb.14:
	add	x0, sp, #20
	mov	w1, #1
	bl	_StateSav_ReadINT
	ldr	w8, [sp, #20]
	cbz	w8, LBB0_23
; %bb.15:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_Log_print
	b	LBB0_18
LBB0_16:
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Log_print
LBB0_17:
	bl	_GetGZErrorText
LBB0_18:
	ldr	x0, [x21]
	bl	_GZCLOSE
	str	xzr, [x21]
LBB0_19:
Lloh22:
	adrp	x8, _FALSE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_20:
	ldr	w0, [x8]
	ldr	x8, [sp, #40]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_31
; %bb.21:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_22:
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_Log_print
	b	LBB0_18
LBB0_23:
	bl	_PBI_StateRead
	add	x0, sp, #16
	mov	w1, #1
	bl	_StateSav_ReadINT
	ldr	w8, [sp, #16]
	cbz	w8, LBB0_25
; %bb.24:
Lloh29:
	adrp	x0, l_.str.6@PAGE
Lloh30:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_Log_print
	b	LBB0_18
LBB0_25:
	add	x0, sp, #16
	mov	w1, #1
	bl	_StateSav_ReadINT
	ldr	w8, [sp, #16]
	cbz	w8, LBB0_27
; %bb.26:
Lloh31:
	adrp	x0, l_.str.7@PAGE
Lloh32:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_Log_print
	b	LBB0_18
LBB0_27:
	add	x0, sp, #16
	mov	w1, #1
	bl	_StateSav_ReadINT
	ldr	w8, [sp, #16]
	cbz	w8, LBB0_29
; %bb.28:
Lloh33:
	adrp	x0, l_.str.8@PAGE
Lloh34:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_Log_print
	b	LBB0_18
LBB0_29:
	ldr	x0, [x21]
	bl	_GZCLOSE
	str	xzr, [x21]
	ldr	x8, [x23]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.30:
Lloh35:
	adrp	x8, _TRUE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_20
LBB0_31:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_StateFile,8,3                  ; @StateFile
	.comm	_Z_OK,8,3                       ; @Z_OK
	.comm	_nFileError,8,3                 ; @nFileError
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not open %s for state read."

	.comm	_FALSE,4,2                      ; @FALSE
l_.str.1:                               ; @.str.1
	.asciz	"ATARI800"

l_.str.2:                               ; @.str.2
	.asciz	"This is not an Atari800 state save file."

l_.str.3:                               ; @.str.3
	.asciz	"Failed read from Atari state file."

	.comm	_SAVE_VERSION_NUMBER,4,2        ; @SAVE_VERSION_NUMBER
l_.str.4:                               ; @.str.4
	.asciz	"Cannot read this state file because it is an incompatible version."

l_.str.5:                               ; @.str.5
	.asciz	"Cannot read this state file because this version does not support XEP80."

l_.str.6:                               ; @.str.6
	.asciz	"Cannot read this state file because this version does not support MIO."

l_.str.7:                               ; @.str.7
	.asciz	"Cannot read this state file because this version does not support the Black Box."

l_.str.8:                               ; @.str.8
	.asciz	"Cannot read this state file because this version does not support the 1400XL/1450XLD."

	.comm	_TRUE,4,2                       ; @TRUE
.subsections_via_symbols
