	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MEMORY_CartA0bfEnable          ## -- Begin function MEMORY_CartA0bfEnable
	.p2align	4, 0x90
_MEMORY_CartA0bfEnable:                 ## @MEMORY_CartA0bfEnable
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_MEMORY_cartA0BF_enabled@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	jne	LBB0_6
## %bb.1:
	movq	_MEMORY_ram_size@GOTPCREL(%rip), %rax
	cmpl	$41, (%rax)
	jl	LBB0_4
## %bb.2:
	movq	_PIA_PORTB@GOTPCREL(%rip), %rax
	movq	_PIA_PORTB_mask@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	callq	_builtin_cart
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_under_cartA0BF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MEMORY_mem@GOTPCREL(%rip), %rax
	movl	$40960, %esi                    ## imm = 0xA000
	addq	(%rax), %rsi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_memcpy
	movl	$40960, %edi                    ## imm = 0xA000
	movl	$49151, %esi                    ## imm = 0xBFFF
	callq	_MEMORY_SetROM
LBB0_4:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	_Atari800_machine_type@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_Atari800_MACHINE_XLXE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_GTIA_TRIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$1, 12(%rax)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MEMORY_cartA0BF_enabled,8,3    ## @MEMORY_cartA0BF_enabled
	.comm	_MEMORY_ram_size,4,2            ## @MEMORY_ram_size
	.comm	_PIA_PORTB,4,2                  ## @PIA_PORTB
	.comm	_PIA_PORTB_mask,4,2             ## @PIA_PORTB_mask
	.comm	_under_cartA0BF,4,2             ## @under_cartA0BF
	.comm	_MEMORY_mem,8,3                 ## @MEMORY_mem
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_Atari800_machine_type,8,3      ## @Atari800_machine_type
	.comm	_Atari800_MACHINE_XLXE,8,3      ## @Atari800_MACHINE_XLXE
	.comm	_GTIA_TRIG,8,3                  ## @GTIA_TRIG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MEMORY_CartA0bfEnable          ; -- Begin function MEMORY_CartA0bfEnable
	.p2align	2
_MEMORY_CartA0bfEnable:                 ; @MEMORY_CartA0bfEnable
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, _MEMORY_cartA0BF_enabled@GOTPAGE
Lloh1:
	ldr	x19, [x19, _MEMORY_cartA0BF_enabled@GOTPAGEOFF]
	ldr	x8, [x19]
	cbnz	x8, LBB0_6
; %bb.1:
Lloh2:
	adrp	x8, _MEMORY_ram_size@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MEMORY_ram_size@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, #41
	b.lt	LBB0_4
; %bb.2:
Lloh5:
	adrp	x8, _PIA_PORTB@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PIA_PORTB@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _PIA_PORTB_mask@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PIA_PORTB_mask@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w0, w9, w8
	bl	_builtin_cart
	cbnz	x0, LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _under_cartA0BF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _under_cartA0BF@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x8, _MEMORY_mem@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MEMORY_mem@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	add	x1, x8, #10, lsl #12            ; =40960
	mov	w2, #8192
	bl	_memcpy
	mov	w0, #40960
	mov	w1, #49151
	bl	_MEMORY_SetROM
LBB0_4:
Lloh17:
	adrp	x8, _TRUE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
Lloh20:
	adrp	x9, _Atari800_machine_type@GOTPAGE
Lloh21:
	ldr	x9, [x9, _Atari800_machine_type@GOTPAGEOFF]
	str	x8, [x19]
Lloh22:
	ldr	x8, [x9]
Lloh23:
	adrp	x9, _Atari800_MACHINE_XLXE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _Atari800_MACHINE_XLXE@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh26:
	adrp	x8, _GTIA_TRIG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GTIA_TRIG@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	mov	w9, #1
	str	w9, [x8, #12]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_MEMORY_cartA0BF_enabled,8,3    ; @MEMORY_cartA0BF_enabled
	.comm	_MEMORY_ram_size,4,2            ; @MEMORY_ram_size
	.comm	_PIA_PORTB,4,2                  ; @PIA_PORTB
	.comm	_PIA_PORTB_mask,4,2             ; @PIA_PORTB_mask
	.comm	_under_cartA0BF,4,2             ; @under_cartA0BF
	.comm	_MEMORY_mem,8,3                 ; @MEMORY_mem
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_Atari800_machine_type,8,3      ; @Atari800_machine_type
	.comm	_Atari800_MACHINE_XLXE,8,3      ; @Atari800_MACHINE_XLXE
	.comm	_GTIA_TRIG,8,3                  ; @GTIA_TRIG
.subsections_via_symbols
