	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_spi_readblock
_mmc_spi_readblock:                     ## @mmc_spi_readblock
	.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	%rdx, %r13
	movq	%rsi, %r12
	movq	32(%rdi), %r15
	movq	40(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movl	$1, %esi
	callq	_mmc_spi_readbytes
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	(%r15), %rax
	movl	(%rax), %ebx
	cmpl	$255, %ebx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %r15
	je	LBB0_4
## %bb.3:
	testl	%ebx, %ebx
	jne	LBB0_5
LBB0_4:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mmc_spi_readtoken
	movl	%eax, %ebx
LBB0_5:
	testl	%ebx, %ebx
	js	LBB0_8
## %bb.6:
	movl	$7, %r13d
	testb	$-128, %bl
	jne	LBB0_9
## %bb.7:
	movl	%ebx, %r14d
	jmp	LBB0_11
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_30
LBB0_8:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_30
LBB0_9:
	movl	$7, %r13d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	(%rbx,%rbx), %r14d
	decl	%r13d
	testb	$64, %bl
	movl	%r14d, %ebx
	jne	LBB0_10
LBB0_11:
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:
	movl	(%r15), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$16, %edx
	callq	_dma_sync_single_for_device
	movq	8(%r15), %rdi
	movl	(%r12), %esi
	movl	4(%r12), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_sync_single_for_device
LBB0_13:
	leaq	24(%r15), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spi_sync
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	movl	(%r15), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$16, %edx
	callq	_dma_sync_single_for_cpu
	movq	8(%r15), %rdi
	movl	(%r12), %esi
	movl	4(%r12), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_sync_single_for_cpu
LBB0_15:
	testl	%r13d, %r13d
	je	LBB0_25
## %bb.16:
	addl	%r14d, %r14d
	movl	$8, %r11d
	subl	%r13d, %r11d
	movl	4(%r12), %r9d
	testl	%r9d, %r9d
	je	LBB0_24
## %bb.17:
	movq	8(%r12), %rdx
	leal	-1(%r9), %r8d
	movl	%r9d, %r10d
	andl	$3, %r10d
	je	LBB0_21
## %bb.18:
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx), %ebx
	movl	%ebx, %esi
	movl	%r13d, %ecx
	shrl	%cl, %esi
	orl	%r14d, %esi
	movl	%ebx, %r14d
	movl	%r11d, %ecx
	shll	%cl, %r14d
	movl	%esi, (%rdx)
	addq	$4, %rdx
	incl	%edi
	cmpl	%edi, %r10d
	jne	LBB0_19
## %bb.20:
	subl	%edi, %r9d
LBB0_21:
	cmpl	$3, %r8d
	jb	LBB0_24
## %bb.22:
	movl	%r9d, %r8d
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rdi,4), %r9d
	movl	%r9d, %ebx
	movl	%r13d, %ecx
	shrl	%cl, %ebx
	movl	%r11d, %ecx
	shll	%cl, %r9d
	movl	4(%rdx,%rdi,4), %esi
	movl	%esi, %eax
	movl	%r13d, %ecx
	shrl	%cl, %eax
	orl	%r14d, %ebx
	movl	%ebx, (%rdx,%rdi,4)
	orl	%r9d, %eax
	movl	%eax, 4(%rdx,%rdi,4)
	movl	%r11d, %ecx
	shll	%cl, %esi
	movl	8(%rdx,%rdi,4), %ebx
	movl	%ebx, %eax
	movl	%r13d, %ecx
	shrl	%cl, %eax
	orl	%esi, %eax
	movl	%eax, 8(%rdx,%rdi,4)
	movl	%r11d, %ecx
	shll	%cl, %ebx
	movl	12(%rdx,%rdi,4), %r14d
	movl	%r14d, %eax
	movl	%r13d, %ecx
	shrl	%cl, %eax
	movl	%r11d, %ecx
	shll	%cl, %r14d
	orl	%ebx, %eax
	movl	%eax, 12(%rdx,%rdi,4)
	addq	$4, %rdi
	cmpl	%edi, %r8d
	jne	LBB0_23
LBB0_24:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	8(%rdi), %eax
	movl	%eax, %edx
	movl	%r13d, %ecx
	shrl	%cl, %edx
	movl	%r11d, %ecx
	shll	%cl, %eax
	movl	12(%rdi), %esi
	movl	%r13d, %ecx
	shrl	%cl, %esi
	orl	%r14d, %edx
	movl	%edx, 8(%rdi)
	orl	%eax, %esi
	movl	%esi, 12(%rdi)
LBB0_25:
	movq	16(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_28
## %bb.26:
	movq	8(%r12), %rsi
	movl	4(%r12), %edx
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_crc_itu_t
	movl	%eax, %r13d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	8(%r14), %rdi
	callq	_be16_to_cpus
	movl	8(%r14), %edx
	cmpl	%r13d, %edx
	jne	LBB0_27
LBB0_28:
	movslq	4(%r12), %rax
	leaq	(,%rax,4), %rcx
	addq	%rcx, 8(%r12)
	xorl	%ebx, %ebx
	cmpq	$0, 8(%r15)
	je	LBB0_30
## %bb.29:
	addl	%eax, (%r12)
	jmp	LBB0_30
LBB0_27:
	movl	4(%r12), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EILSEQ@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_30:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read error %02x (%d)\n"

	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
L_.str.1:                               ## @.str.1
	.asciz	"read - crc error: crc_val=0x%04x, computed=0x%04x len=%d\n"

	.comm	_EILSEQ,4,2                     ## @EILSEQ
	.no_dead_strip	_mmc_spi_readblock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_spi_readblock
_mmc_spi_readblock:                     ; @mmc_spi_readblock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x2
	mov	x19, x1
	mov	x21, x0
	ldp	x24, x20, [x0, #32]
	mov	w1, #1
	bl	_mmc_spi_readbytes
	tbnz	w0, #31, LBB0_19
; %bb.1:
	ldr	x8, [x24]
	ldr	w22, [x8]
	cmp	w22, #255
	ccmp	w22, #0, #4, ne
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x21
	mov	x1, x23
	bl	_mmc_spi_readtoken
	mov	x22, x0
LBB0_3:
	tbnz	w22, #31, LBB0_20
; %bb.4:
	mov	w23, #7
	tbz	w22, #7, LBB0_6
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x8, x22
	lsl	w22, w22, #1
	sub	w23, w23, #1
	tbnz	w8, #6, LBB0_5
LBB0_6:
	ldr	x0, [x21, #8]
Lloh0:
	adrp	x26, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh1:
	ldr	x26, [x26, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh2:
	adrp	x25, _DMA_FROM_DEVICE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _DMA_FROM_DEVICE@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w1, [x21]
	ldr	w3, [x26]
	mov	w2, #16
	bl	_dma_sync_single_for_device
	ldr	x0, [x21, #8]
	ldp	w1, w2, [x19]
	ldr	w3, [x25]
	bl	_dma_sync_single_for_device
LBB0_8:
	add	x1, x21, #24
	mov	x0, x20
	bl	_spi_sync
	ldr	x0, [x21, #8]
	cbz	x0, LBB0_10
; %bb.9:
	ldr	w1, [x21]
	ldr	w3, [x26]
	mov	w2, #16
	bl	_dma_sync_single_for_cpu
	ldr	x0, [x21, #8]
	ldp	w1, w2, [x19]
	ldr	w3, [x25]
	bl	_dma_sync_single_for_cpu
LBB0_10:
	cbz	w23, LBB0_15
; %bb.11:
	lsl	w9, w22, #1
	mov	w8, #8
	sub	w8, w8, w23
	ldr	w10, [x19, #4]
	cbz	w10, LBB0_14
; %bb.12:
	ldr	x11, [x19, #8]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	lsr	w13, w12, w23
	orr	w9, w13, w9
	str	w9, [x11], #4
	lsl	w9, w12, w8
	subs	w10, w10, #1
	b.ne	LBB0_13
LBB0_14:
	ldp	w10, w11, [x24, #8]
	lsr	w12, w10, w23
	orr	w9, w12, w9
	lsl	w8, w10, w8
	lsr	w10, w11, w23
	orr	w8, w10, w8
	stp	w9, w8, [x24, #8]
LBB0_15:
	ldr	x8, [x21, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.16:
	ldr	x1, [x19, #8]
	ldr	w2, [x19, #4]
	mov	w0, #0
	bl	_crc_itu_t
	mov	x22, x0
	add	x0, x24, #8
	bl	_be16_to_cpus
	ldr	w2, [x24, #8]
	cmp	w2, w22
	b.ne	LBB0_21
LBB0_17:
	ldrsw	x8, [x19, #4]
	ldr	x9, [x19, #8]
	add	x9, x9, x8, lsl #2
	str	x9, [x19, #8]
	ldr	x9, [x21, #8]
	cbz	x9, LBB0_22
; %bb.18:
	mov	w22, #0
	ldr	w9, [x19]
	add	w8, w9, w8
	str	w8, [x19]
	b	LBB0_23
LBB0_19:
	mov	x22, x0
	b	LBB0_23
LBB0_20:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	mov	x3, x22
	bl	_dev_dbg
	b	LBB0_23
LBB0_21:
	ldr	w8, [x19, #4]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x3, x22
	bl	_dev_dbg
Lloh8:
	adrp	x8, _EILSEQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EILSEQ@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_23
LBB0_22:
	mov	w22, #0
LBB0_23:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read error %02x (%d)\n"

	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
l_.str.1:                               ; @.str.1
	.asciz	"read - crc error: crc_val=0x%04x, computed=0x%04x len=%d\n"

	.comm	_EILSEQ,4,2                     ; @EILSEQ
	.no_dead_strip	_mmc_spi_readblock
.subsections_via_symbols
