	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function InitCartridge
_InitCartridge:                         ## @InitCartridge
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_PreprocessCart
	movq	%rbx, %rdi
	callq	_ResetCartState
	cmpq	_CARTRIDGE_main@GOTPCREL(%rip), %rbx
	jne	LBB0_6
## %bb.1:
	movq	_CARTRIDGE_main@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CartIsFor5200
	movq	_Atari800_machine_type@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_Atari800_MACHINE_5200@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	$16, %r14d
	cmpq	%rdi, %rcx
	jne	LBB0_5
	jmp	LBB0_6
LBB0_3:
	cmpq	%rdi, %rcx
	jne	LBB0_6
## %bb.4:
	movq	_Atari800_MACHINE_XLXE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	$64, %r14d
LBB0_5:
	callq	_Atari800_SetMachineType
	movq	_MEMORY_ram_size@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	xorl	%eax, %eax
	callq	_Atari800_InitialiseMachine
LBB0_6:
	movq	_active_cart@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_8
## %bb.7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_MapActiveCart                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CARTRIDGE_main,4,2             ## @CARTRIDGE_main
	.comm	_Atari800_machine_type,8,3      ## @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ## @Atari800_MACHINE_5200
	.comm	_MEMORY_ram_size,4,2            ## @MEMORY_ram_size
	.comm	_Atari800_MACHINE_XLXE,8,3      ## @Atari800_MACHINE_XLXE
	.comm	_active_cart,8,3                ## @active_cart
	.no_dead_strip	_InitCartridge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function InitCartridge
_InitCartridge:                         ; @InitCartridge
	.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
	mov	x19, x0
	bl	_PreprocessCart
	mov	x0, x19
	bl	_ResetCartState
Lloh0:
	adrp	x8, _CARTRIDGE_main@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CARTRIDGE_main@GOTPAGEOFF]
	cmp	x19, x8
	b.ne	LBB0_7
; %bb.1:
	ldr	w0, [x8]
	bl	_CartIsFor5200
	mov	x8, x0
Lloh2:
	adrp	x9, _Atari800_machine_type@GOTPAGE
Lloh3:
	ldr	x9, [x9, _Atari800_machine_type@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x10, _Atari800_MACHINE_5200@GOTPAGE
Lloh6:
	ldr	x10, [x10, _Atari800_MACHINE_5200@GOTPAGEOFF]
Lloh7:
	ldr	x0, [x10]
	cbz	w8, LBB0_4
; %bb.2:
	cmp	x9, x0
	b.eq	LBB0_7
; %bb.3:
	mov	w20, #16
	b	LBB0_6
LBB0_4:
	cmp	x9, x0
	b.ne	LBB0_7
; %bb.5:
Lloh8:
	adrp	x8, _Atari800_MACHINE_XLXE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _Atari800_MACHINE_XLXE@GOTPAGEOFF]
Lloh10:
	ldr	x0, [x8]
	mov	w20, #64
LBB0_6:
	bl	_Atari800_SetMachineType
Lloh11:
	adrp	x8, _MEMORY_ram_size@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MEMORY_ram_size@GOTPAGEOFF]
Lloh13:
	str	w20, [x8]
	bl	_Atari800_InitialiseMachine
LBB0_7:
Lloh14:
	adrp	x8, _active_cart@GOTPAGE
Lloh15:
	ldr	x8, [x8, _active_cart@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x8, x19
	b.eq	LBB0_9
; %bb.8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_MapActiveCart
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_CARTRIDGE_main,4,2             ; @CARTRIDGE_main
	.comm	_Atari800_machine_type,8,3      ; @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ; @Atari800_MACHINE_5200
	.comm	_MEMORY_ram_size,4,2            ; @MEMORY_ram_size
	.comm	_Atari800_MACHINE_XLXE,8,3      ; @Atari800_MACHINE_XLXE
	.comm	_active_cart,8,3                ; @active_cart
	.no_dead_strip	_InitCartridge
.subsections_via_symbols
