	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AFILE_OpenFile                 ## -- Begin function AFILE_OpenFile
	.p2align	4, 0x90
_AFILE_OpenFile:                        ## @AFILE_OpenFile
	.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
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_AFILE_DetectFileType
	movl	%eax, %r14d
	addl	$-131, %eax
	cmpl	$15, %eax
	ja	LBB0_19
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movl	%r13d, %edi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_SIO_Mount
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	testl	%r15d, %r15d
	jne	LBB0_5
	jmp	LBB0_19
LBB0_6:
	movq	%rbx, %rdi
	callq	_BINLOAD_Loader
	testl	%eax, %eax
	je	LBB0_3
	jmp	LBB0_19
LBB0_17:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_StateSav_ReadAtariState
	testl	%eax, %eax
	je	LBB0_3
## %bb.18:
	movq	_GTIA_consol_override@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	jmp	LBB0_19
LBB0_7:
	movq	%rbx, %rdi
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.8:
	callq	_CARTRIDGE_InsertAutoReboot
	jmp	LBB0_10
LBB0_14:
	movq	%rbx, %rdi
	callq	_CASSETTE_Insert
	testl	%eax, %eax
	je	LBB0_3
## %bb.15:
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.16:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_CASSETTE_hold_start@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_5:
	xorl	%eax, %eax
	callq	_Atari800_Coldstart
	jmp	LBB0_19
LBB0_9:
	callq	_CARTRIDGE_Insert
LBB0_10:
                                        ## kill: def $eax killed $eax def $rax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_3
## %bb.11:
	testl	%eax, %eax
	je	LBB0_19
## %bb.12:
	cmpl	$130, %eax
	je	LBB0_19
## %bb.13:
	movl	%eax, %edi
	callq	_UI_SelectCartType
	movq	_CARTRIDGE_main@GOTPCREL(%rip), %rdi
	movl	%eax, %esi
	callq	_CARTRIDGE_SetTypeAutoReboot
	jmp	LBB0_19
LBB0_3:
	movq	_AFILE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_2
	.long	L0_0_set_6
	.long	L0_0_set_17
	.long	L0_0_set_17
	.long	L0_0_set_7
	.long	L0_0_set_2
	.long	L0_0_set_6
	.long	L0_0_set_2
	.long	L0_0_set_14
	.long	L0_0_set_7
	.long	L0_0_set_14
	.long	L0_0_set_6
	.long	L0_0_set_2
	.long	L0_0_set_2
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_AFILE_ERROR,4,2                ## @AFILE_ERROR
	.comm	_CARTRIDGE_main,4,2             ## @CARTRIDGE_main
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_CASSETTE_hold_start,4,2        ## @CASSETTE_hold_start
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rb"

	.comm	_GTIA_consol_override,4,2       ## @GTIA_consol_override
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AFILE_OpenFile                 ; -- Begin function AFILE_OpenFile
	.p2align	2
_AFILE_OpenFile:                        ; @AFILE_OpenFile
	.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
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	bl	_AFILE_DetectFileType
	mov	x19, x0
	sub	w8, w0, #131
	cmp	w8, #15
	b.hi	LBB0_19
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	mov	x0, x23
	mov	x1, x21
	mov	x2, x22
	bl	_SIO_Mount
	cbz	w0, LBB0_18
; %bb.3:
	cbz	w20, LBB0_19
; %bb.4:
	bl	_Atari800_Coldstart
	b	LBB0_19
LBB0_5:
	mov	x0, x21
	bl	_BINLOAD_Loader
Lloh2:
	adrp	x8, _AFILE_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AFILE_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w19, w8, w19, eq
	b	LBB0_19
LBB0_6:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_StateSav_ReadAtariState
	cbz	w0, LBB0_18
; %bb.7:
Lloh7:
	adrp	x8, _GTIA_consol_override@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GTIA_consol_override@GOTPAGEOFF]
Lloh9:
	str	wzr, [x8]
	b	LBB0_19
LBB0_8:
	mov	x0, x21
	cbz	w20, LBB0_13
; %bb.9:
	bl	_CARTRIDGE_InsertAutoReboot
	b	LBB0_14
LBB0_10:
	mov	x0, x21
	bl	_CASSETTE_Insert
	cbz	w0, LBB0_18
; %bb.11:
	cbz	w20, LBB0_19
; %bb.12:
Lloh10:
	adrp	x8, _TRUE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _CASSETTE_hold_start@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CASSETTE_hold_start@GOTPAGEOFF]
Lloh15:
	str	w8, [x9]
	bl	_Atari800_Coldstart
	b	LBB0_19
LBB0_13:
	bl	_CARTRIDGE_Insert
LBB0_14:
	sub	w8, w0, #128
	cmp	w8, #2
	b.lo	LBB0_18
; %bb.15:
	cbz	w0, LBB0_19
; %bb.16:
	cmp	w0, #130
	b.eq	LBB0_19
; %bb.17:
	bl	_UI_SelectCartType
	mov	x1, x0
Lloh16:
	adrp	x0, _CARTRIDGE_main@GOTPAGE
Lloh17:
	ldr	x0, [x0, _CARTRIDGE_main@GOTPAGEOFF]
	bl	_CARTRIDGE_SetTypeAutoReboot
	b	LBB0_19
LBB0_18:
Lloh18:
	adrp	x8, _AFILE_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AFILE_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w19, [x8]
LBB0_19:
	mov	x0, x19
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
                                        ; -- End function
	.comm	_AFILE_ERROR,4,2                ; @AFILE_ERROR
	.comm	_CARTRIDGE_main,4,2             ; @CARTRIDGE_main
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_CASSETTE_hold_start,4,2        ; @CASSETTE_hold_start
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rb"

	.comm	_GTIA_consol_override,4,2       ; @GTIA_consol_override
.subsections_via_symbols
