	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CartFlush                      ## -- Begin function CartFlush
	.p2align	4, 0x90
_CartFlush:                             ## @CartFlush
	.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	_CartridgeArea@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movl	(%rax), %ecx
	movq	_CART_PAR@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_5
## %bb.2:
	movq	24(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.3:
	movq	8(%rax), %rcx
	movl	$262144, %esi                   ## imm = 0x40000
	movl	$2, %edx
	callq	_T123Save
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_YAB_ERR_FILEWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rax
	movq	8(%rax), %rsi
	callq	_YabSetError
LBB0_5:
	movq	(%rbx), %rax
	movq	16(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.6:
	movl	(%rax), %ecx
	addl	$-128, %ecx
	cmpl	$3, %ecx
	ja	LBB0_8
## %bb.7:
	movslq	%ecx, %rcx
	leaq	L_switch.table.CartFlush(%rip), %rdx
	movl	(%rdx,%rcx,4), %esi
	movq	8(%rax), %rcx
	movl	$1, %edx
	callq	_T123Save
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	_YAB_ERR_FILEWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rax
	movq	8(%rax), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_YabSetError                    ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CartridgeArea,8,3              ## @CartridgeArea
	.comm	_CART_PAR,4,2                   ## @CART_PAR
	.comm	_YAB_ERR_FILEWRITE,4,2          ## @YAB_ERR_FILEWRITE
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ## @switch.table.CartFlush
L_switch.table.CartFlush:
	.long	2097152                         ## 0x200000
	.long	1048576                         ## 0x100000
	.long	8388608                         ## 0x800000
	.long	4194304                         ## 0x400000

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CartFlush                      ; -- Begin function CartFlush
	.p2align	2
_CartFlush:                             ; @CartFlush
	.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, _CartridgeArea@GOTPAGE
Lloh1:
	ldr	x19, [x19, _CartridgeArea@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_9
; %bb.1:
	ldr	w9, [x8]
Lloh2:
	adrp	x10, _CART_PAR@GOTPAGE
Lloh3:
	ldr	x10, [x10, _CART_PAR@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_5
; %bb.2:
	ldr	x0, [x8, #24]
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x3, [x8, #8]
	mov	w1, #262144
	mov	w2, #2
	bl	_T123Save
	cbz	x0, LBB0_5
; %bb.4:
Lloh5:
	adrp	x8, _YAB_ERR_FILEWRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _YAB_ERR_FILEWRITE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	x8, [x19]
	ldr	x1, [x8, #8]
	bl	_YabSetError
LBB0_5:
	ldr	x8, [x19]
	ldr	x0, [x8, #16]
	cbz	x0, LBB0_9
; %bb.6:
	ldr	w9, [x8]
	sub	w9, w9, #128
	cmp	w9, #3
	b.hi	LBB0_9
; %bb.7:
Lloh8:
	adrp	x10, l_switch.table.CartFlush@PAGE
Lloh9:
	add	x10, x10, l_switch.table.CartFlush@PAGEOFF
	ldr	w1, [x10, w9, sxtw #2]
	ldr	x3, [x8, #8]
	mov	w2, #1
	bl	_T123Save
	cbz	x0, LBB0_9
; %bb.8:
Lloh10:
	adrp	x8, _YAB_ERR_FILEWRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _YAB_ERR_FILEWRITE@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	x8, [x19]
	ldr	x1, [x8, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_YabSetError
LBB0_9:
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CartridgeArea,8,3              ; @CartridgeArea
	.comm	_CART_PAR,4,2                   ; @CART_PAR
	.comm	_YAB_ERR_FILEWRITE,4,2          ; @YAB_ERR_FILEWRITE
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @switch.table.CartFlush
l_switch.table.CartFlush:
	.long	2097152                         ; 0x200000
	.long	1048576                         ; 0x100000
	.long	8388608                         ; 0x800000
	.long	4194304                         ; 0x400000

.subsections_via_symbols
