	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_spi_writeblock
_mmc_spi_writeblock:                    ## @mmc_spi_writeblock
	.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	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	32(%rdi), %r15
	movq	16(%rdi), %rax
	movq	24(%rdi), %r14
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movl	12(%r12), %esi
	movq	(%r12), %rdx
	xorl	%edi, %edi
	callq	_crc_itu_t
	movl	%eax, %edi
	callq	_cpu_to_be16
	movl	%eax, 8(%r14)
LBB0_2:
	movq	(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	movl	8(%r13), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$16, %edx
	callq	_dma_sync_single_for_device
LBB0_4:
	leaq	12(%r13), %rsi
	movq	%r15, %rdi
	callq	_spi_sync_locked
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_16
LBB0_6:
	movq	(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	movl	8(%r13), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$16, %edx
	callq	_dma_sync_single_for_cpu
LBB0_8:
	movq	(%r14), %rdi
	callq	_get_unaligned_be32
	movq	_EPROTO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.9:
	negl	%ebx
	movq	(%r14), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_16
LBB0_10:
	movl	(%r12), %eax
	addl	%eax, 12(%r12)
	cmpq	$0, (%r13)
	je	LBB0_12
## %bb.11:
	addl	%eax, 8(%r12)
LBB0_12:
	movq	(%r14), %rax
	xorl	%ebx, %ebx
	testb	$1, 16(%rax)
	jne	LBB0_16
## %bb.13:
	testb	$1, 20(%rax)
	jne	LBB0_16
## %bb.14:
	testb	$1, 24(%rax)
	jne	LBB0_16
## %bb.15:
	testb	$1, 28(%rax)
	jne	LBB0_16
## %bb.17:
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mmc_spi_wait_unbusy            ## TAILCALL
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write error (%d)\n"

	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EPROTO,4,2                     ## @EPROTO
L_.str.1:                               ## @.str.1
	.asciz	"write error %02x (%d)\n"

	.no_dead_strip	_mmc_spi_writeblock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_spi_writeblock
_mmc_spi_writeblock:                    ; @mmc_spi_writeblock
	.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	x19, x2
	mov	x22, x1
	mov	x20, x0
	ldp	x24, x21, [x0, #24]
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w1, [x22, #12]
	ldr	x2, [x22]
	mov	w0, #0
	bl	_crc_itu_t
	bl	_cpu_to_be16
	str	w0, [x24, #8]
LBB0_2:
	ldr	x0, [x20]
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w1, [x20, #8]
Lloh0:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	w2, #16
	bl	_dma_sync_single_for_device
LBB0_4:
	add	x1, x20, #12
	mov	x0, x21
	bl	_spi_sync_locked
	cbz	w0, LBB0_6
; %bb.5:
	mov	x23, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_dbg
	b	LBB0_18
LBB0_6:
	ldr	x0, [x20]
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w1, [x20, #8]
Lloh5:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	mov	w2, #16
	bl	_dma_sync_single_for_cpu
LBB0_8:
	ldr	x0, [x24]
	bl	_get_unaligned_be32
Lloh8:
	adrp	x8, _EPROTO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cbz	w8, LBB0_10
; %bb.9:
	neg	w23, w8
	ldr	x8, [x24]
	ldr	w2, [x8]
	str	x23, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	b	LBB0_18
LBB0_10:
	ldr	w8, [x22]
	ldr	w9, [x22, #12]
	add	w9, w9, w8
	str	w9, [x22, #12]
	ldr	x9, [x20]
	cbz	x9, LBB0_12
; %bb.11:
	ldr	w9, [x22, #8]
	add	w8, w9, w8
	str	w8, [x22, #8]
LBB0_12:
	ldr	x8, [x24]
	ldrb	w9, [x8, #16]
	tbnz	w9, #0, LBB0_17
; %bb.13:
	ldrb	w9, [x8, #20]
	tbnz	w9, #0, LBB0_17
; %bb.14:
	ldrb	w9, [x8, #24]
	tbnz	w9, #0, LBB0_17
; %bb.15:
	ldrb	w8, [x8, #28]
	tbnz	w8, #0, LBB0_17
; %bb.16:
	mov	x0, x20
	mov	x1, x19
	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
	b	_mmc_spi_wait_unbusy
LBB0_17:
	mov	w23, #0
LBB0_18:
	mov	x0, x23
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write error (%d)\n"

	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EPROTO,4,2                     ; @EPROTO
l_.str.1:                               ; @.str.1
	.asciz	"write error %02x (%d)\n"

	.no_dead_strip	_mmc_spi_writeblock
.subsections_via_symbols
