	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_WriteAsync                ## -- Begin function CARD_WriteAsync
	.p2align	4, 0x90
_CARD_WriteAsync:                       ## @CARD_WriteAsync
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	$0, -48(%rbp)
	leaq	-48(%rbp), %rcx
	movl	%edx, %esi
	movl	%r13d, %edx
	callq	___card_seek
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rdi
	testl	%ebx, %ebx
	js	LBB0_6
## %bb.3:
	movl	(%rdi), %eax
	decl	%eax
	testl	%ebx, %eax
	jne	LBB0_6
## %bb.4:
	testl	%r13d, %r13d
	jle	LBB0_7
## %bb.5:
	andl	%r13d, %eax
	je	LBB0_7
LBB0_6:
	movq	_CARD_ERROR_FATAL_ERROR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	___card_putcntrlblock
	movl	(%rbx), %r14d
	jmp	LBB0_11
LBB0_1:
	movl	%eax, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_DCStoreRange
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	jne	LBB0_9
## %bb.8:
	movq	___card_defaultapicallback@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
LBB0_9:
	movq	-48(%rbp), %rax
	movq	%rcx, 16(%rax)
	movq	%r15, 8(%rax)
	movl	4(%r12), %edi
	movl	(%rax), %esi
	imull	(%r12), %esi
	movq	___erase_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	___card_sectorerase
	movl	%eax, %r14d
	testl	%eax, %eax
	jns	LBB0_11
## %bb.10:
	movq	-48(%rbp), %rdi
	movl	%r14d, %esi
	callq	___card_putcntrlblock
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ## @CARD_ERROR_FATAL_ERROR
	.comm	___card_defaultapicallback,8,3  ## @__card_defaultapicallback
	.comm	___erase_callback,4,2           ## @__erase_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_WriteAsync                ; -- Begin function CARD_WriteAsync
	.p2align	2
_CARD_WriteAsync:                       ; @CARD_WriteAsync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x4
	mov	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	add	x3, sp, #8
	mov	x1, x2
	mov	x2, x23
	bl	___card_seek
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	x0, [sp, #8]
	tbnz	w22, #31, LBB0_5
; %bb.2:
	ldr	w8, [x0]
	sub	w8, w8, #1
	tst	w8, w22
	b.ne	LBB0_5
; %bb.3:
	cmp	w23, #1
	b.lt	LBB0_8
; %bb.4:
	and	w8, w8, w23
	cbz	w8, LBB0_8
LBB0_5:
Lloh0:
	adrp	x19, _CARD_ERROR_FATAL_ERROR@GOTPAGE
Lloh1:
	ldr	x19, [x19, _CARD_ERROR_FATAL_ERROR@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	___card_putcntrlblock
	ldr	w24, [x19]
	b	LBB0_7
LBB0_6:
	mov	x24, x0
LBB0_7:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_8:
	mov	x0, x20
	mov	x1, x22
	bl	_DCStoreRange
Lloh2:
	adrp	x8, ___card_defaultapicallback@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___card_defaultapicallback@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x21, #0
	csel	x8, x8, x21, eq
	ldr	x9, [sp, #8]
	stp	x20, x8, [x9, #8]
	ldp	w8, w0, [x19]
	ldr	w9, [x9]
	mul	w1, w9, w8
Lloh5:
	adrp	x8, ___erase_callback@GOTPAGE
Lloh6:
	ldr	x8, [x8, ___erase_callback@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	___card_sectorerase
	mov	x24, x0
	tbz	w0, #31, LBB0_7
; %bb.9:
	ldr	x0, [sp, #8]
	mov	x1, x24
	bl	___card_putcntrlblock
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ; @CARD_ERROR_FATAL_ERROR
	.comm	___card_defaultapicallback,8,3  ; @__card_defaultapicallback
	.comm	___erase_callback,4,2           ; @__erase_callback
.subsections_via_symbols
