	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __write_callback
___write_callback:                      ## @__write_callback
	.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
	movq	%rdi, %r14
	movq	_cardmap@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%rdi, %rbx
	shlq	$5, %rbx
	leaq	(%rbx,%r13), %r15
	movq	24(%r13,%rbx), %r12
	movq	(%r12), %rax
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movslq	(%r15), %rcx
	subq	%rax, %rcx
	movq	%rcx, (%r12)
	jle	LBB0_7
## %bb.3:
	movq	%r15, %rdi
	callq	___card_getbatblock
	movl	(%r15), %esi
	addl	%esi, 16(%r12)
	movq	(%rax), %rax
	movq	24(%r12), %rcx
	movq	_CARD_SYSAREA@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	subq	%rdx, %rcx
	movq	(%rax,%rcx,8), %rcx
	movq	%rcx, 24(%r12)
	movq	_CARD_ERROR_BROKEN@GOTPCREL(%rip), %rax
	cmpq	%rdx, %rcx
	jb	LBB0_5
## %bb.4:
	cmpq	8(%r13,%rbx), %rcx
	jae	LBB0_5
## %bb.8:
	imull	%ecx, %esi
	movq	___erase_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___card_sectorerase             ## TAILCALL
LBB0_1:
	movq	_CARD_ERROR_CANCELED@GOTPCREL(%rip), %rax
LBB0_5:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r12
	movq	16(%r13,%rbx), %r14
	movq	$0, 16(%r13,%rbx)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	___card_putcntrlblock
	testq	%r14, %r14
	je	LBB0_6
## %bb.9:
	movq	%r14, %rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r15, %rdi
	callq	___card_getdirblock
	movq	(%rax), %r15
	movq	8(%r12), %r12
	xorl	%edi, %edi
	callq	_time
	movl	%eax, (%r15,%r12,4)
	movq	16(%r13,%rbx), %rsi
	movq	$0, 16(%r13,%rbx)
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___card_updatedir               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_cardmap,8,3                    ## @cardmap
	.comm	_CARD_SYSAREA,8,3               ## @CARD_SYSAREA
	.comm	_CARD_ERROR_BROKEN,8,3          ## @CARD_ERROR_BROKEN
	.comm	___erase_callback,4,2           ## @__erase_callback
	.comm	_CARD_ERROR_CANCELED,8,3        ## @CARD_ERROR_CANCELED
	.no_dead_strip	___write_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __write_callback
___write_callback:                      ; @__write_callback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _cardmap@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cardmap@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	add	x20, x21, x0, lsl #5
	ldr	x22, [x20, #24]
	ldr	x8, [x22]
	tbnz	x8, #63, LBB0_5
; %bb.1:
	ldrsw	x9, [x20]
	sub	x8, x9, x8
	str	x8, [x22]
	cmp	x8, #0
	b.le	LBB0_10
; %bb.2:
	mov	x0, x20
	bl	___card_getbatblock
	ldr	w8, [x20]
	ldr	w9, [x22, #16]
	add	w9, w9, w8
	str	w9, [x22, #16]
	ldr	x9, [x0]
	ldr	x10, [x22, #24]
Lloh3:
	adrp	x11, _CARD_SYSAREA@GOTPAGE
Lloh4:
	ldr	x11, [x11, _CARD_SYSAREA@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	sub	x10, x10, x11
	ldr	x9, [x9, x10, lsl #3]
	str	x9, [x22, #24]
	cmp	x9, x11
	b.lo	LBB0_6
; %bb.3:
	add	x10, x21, x19, lsl #5
	ldr	x10, [x10, #8]
	cmp	x9, x10
	b.hs	LBB0_6
; %bb.4:
	mul	w1, w8, w9
Lloh6:
	adrp	x8, ___erase_callback@GOTPAGE
Lloh7:
	ldr	x8, [x8, ___erase_callback@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	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
	add	sp, sp, #64
	b	___card_sectorerase
LBB0_5:
Lloh9:
	adrp	x8, _CARD_ERROR_CANCELED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CARD_ERROR_CANCELED@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh11:
	adrp	x8, _CARD_ERROR_BROKEN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CARD_ERROR_BROKEN@GOTPAGEOFF]
LBB0_7:
	ldr	x21, [x8]
	ldr	x0, [x20, #16]
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	str	xzr, [x20, #16]
	mov	x0, x20
	mov	x1, x21
	bl	___card_putcntrlblock
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	cbz	x2, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	x1, x21
	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
	add	sp, sp, #64
	br	x2
LBB0_9:
	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
	add	sp, sp, #64
	ret
LBB0_10:
	mov	x0, x20
	bl	___card_getdirblock
	ldr	x20, [x0]
	ldr	x22, [x22, #8]
	mov	x0, #0
	bl	_time
	str	w0, [x20, x22, lsl #2]
	add	x8, x21, x19, lsl #5
	ldr	x1, [x8, #16]
	str	xzr, [x8, #16]
	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
	add	sp, sp, #64
	b	___card_updatedir
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_cardmap,8,3                    ; @cardmap
	.comm	_CARD_SYSAREA,8,3               ; @CARD_SYSAREA
	.comm	_CARD_ERROR_BROKEN,8,3          ; @CARD_ERROR_BROKEN
	.comm	___erase_callback,4,2           ; @__erase_callback
	.comm	_CARD_ERROR_CANCELED,8,3        ; @CARD_ERROR_CANCELED
	.no_dead_strip	___write_callback
.subsections_via_symbols
