	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_spi_data_do
_mmc_spi_data_do:                       ## @mmc_spi_data_do
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -96(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movl	(%rdx), %eax
	xorl	%esi, %esi
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	cmpl	$2, %eax
	setge	%sil
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	andl	4(%rdx), %eax
	jne	LBB0_1
## %bb.2:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
LBB0_3:
	movq	8(%r13), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	56(%r13), %r14
	movl	(%rax), %r12d
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_mmc_spi_setup_data_message
	movl	64(%r13), %ecx
	testl	%ecx, %ecx
	jne	LBB0_5
## %bb.4:
	movl	(%r14), %ecx
LBB0_5:
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movslq	8(%r14), %rsi
	imull	$1000000, 12(%r14), %eax        ## imm = 0xF4240
	cltd
	idivl	%ecx
	cltq
	addq	%rsi, %rax
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rcx      ## imm = 0x20C49BA5E353F7CF
	mulq	%rcx
	movq	%rdx, %rdi
	shrq	$4, %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_usecs_to_jiffies
	incl	%eax
	cltq
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	16(%r14), %edx
	testl	%edx, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_27
## %bb.6:
	leaq	64(%r13), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %r15
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rbx
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movl	(%r15), %r14d
	testq	%rcx, %rcx
	movl	%edx, -92(%rbp)                 ## 4-byte Spill
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%r12d, %eax
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r14d
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	cmovnel	%eax, %r12d
	cmpq	$0, 8(%r15)
	cmovnel	%eax, %r12d
	movq	%r15, %rdi
	callq	_sg_page
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	%r12d, -64(%rbp)                ## 4-byte Spill
	movl	%r12d, %r8d
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	callq	_dma_map_page
	movq	%rax, %rcx
	xorl	%eax, %eax
	cmpl	(%rbx), %r12d
	sete	%al
	movq	%rcx, %rdx
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	addq	8(%r15), %rcx
	movq	%rcx, 88(%r13,%rax,8)
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	xorl	%eax, %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	%r12d, -64(%rbp)                ## 4-byte Spill
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	callq	_sg_page
	movl	%eax, %edi
	callq	_kmap
	xorl	%ecx, %ecx
	cmpl	(%rbx), %r12d
	sete	%cl
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	addq	8(%r15), %rax
	movq	%rax, 72(%r13,%rcx,8)
	testl	%r14d, %r14d
	je	LBB0_13
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r14d, %edi
	movl	-96(%rbp), %esi                 ## 4-byte Reload
	callq	_min
	movl	%eax, 68(%r13)
	movq	56(%r13), %rdi
	addq	$4, %rdi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %r12d
	leaq	L_.str.2(%rip), %rdx
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rcx, %rdx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	cmpl	(%rbx), %r12d
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	movq	%r13, %rdi
	movq	-120(%rbp), %rsi                ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	_mmc_spi_writeblock
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=2
	movq	%r13, %rdi
	movq	-120(%rbp), %rsi                ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	callq	_mmc_spi_readblock
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=2
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=2
	movl	68(%r13), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, 20(%rcx)
	cmpl	$2, -68(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_14 Depth=2
	subl	%eax, %r14d
	jne	LBB0_14
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r15d, %r15d
LBB0_20:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_page
	movl	%eax, %edi
	callq	_flush_kernel_dcache_page
LBB0_22:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_sg_page
	movl	%eax, %edi
	callq	_kunmap
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	callq	_dma_unmap_page
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_24:                                ##   in Loop: Header=BB0_7 Depth=1
	testl	%r15d, %r15d
	js	LBB0_25
## %bb.26:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	addq	$16, %r15
	movl	-92(%rbp), %edx                 ## 4-byte Reload
	decl	%edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rbx
	jne	LBB0_7
	jmp	LBB0_27
LBB0_25:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, 24(%rax)
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leaq	4(%rax), %rdi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	leaq	L_.str.2(%rip), %rdx
	leaq	L_.str.1(%rip), %rax
	cmoveq	%rax, %rdx
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_27:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_45
## %bb.28:
	cmpl	$2, -68(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_45
## %bb.29:
	movq	48(%r13), %r15
	movq	-104(%rbp), %r12                ## 8-byte Reload
	leaq	4(%r12), %rdi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	leaq	16(%r13), %r14
	movq	%r14, %rdi
	callq	_INIT_LIST_HEAD
	leaq	40(%r13), %rdi
	movq	%r14, %rsi
	callq	_list_add
	movq	(%r15), %rdi
	movl	$255, %esi
	movl	$8, %edx
	callq	_memset
	movq	_SPI_TOKEN_STOP_TRAN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rcx
	movq	%rax, (%rcx)
	movl	32(%r13), %eax
	movl	%eax, 36(%r13)
	movl	24(%r13), %eax
	movl	%eax, 28(%r13)
	movl	$8, 20(%r13)
	movq	8(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_31
## %bb.30:
	movl	(%r13), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %edx
	callq	_dma_sync_single_for_device
LBB0_31:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_spi_sync
	movl	%eax, %r14d
	movq	8(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_33
## %bb.32:
	movl	(%r13), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$8, %edx
	callq	_dma_sync_single_for_cpu
LBB0_33:
	testl	%r14d, %r14d
	js	LBB0_43
## %bb.34:
	movq	(%r15), %rax
	cmpq	$0, 16(%rax)
	jne	LBB0_45
## %bb.35:
	cmpq	$0, 24(%rax)
	jne	LBB0_45
## %bb.36:
	cmpq	$0, 32(%rax)
	jne	LBB0_45
## %bb.37:
	cmpq	$0, 40(%rax)
	jne	LBB0_45
## %bb.38:
	cmpq	$0, 48(%rax)
	jne	LBB0_45
## %bb.39:
	cmpq	$0, 56(%rax)
	jne	LBB0_45
## %bb.40:
	movq	%r13, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_mmc_spi_wait_unbusy
	testl	%eax, %eax
	jns	LBB0_45
## %bb.41:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$0, 24(%rcx)
	jne	LBB0_45
## %bb.42:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 24(%rcx)
	jmp	LBB0_45
LBB0_43:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 24(%rax)
	jne	LBB0_45
## %bb.44:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, 24(%rax)
LBB0_45:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"    mmc_spi: %s block, %d bytes\n"

L_.str.1:                               ## @.str.1
	.asciz	"write"

L_.str.2:                               ## @.str.2
	.asciz	"read"

L_.str.3:                               ## @.str.3
	.asciz	"%s status %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"    mmc_spi: STOP_TRAN\n"

	.comm	_SPI_TOKEN_STOP_TRAN,8,3        ## @SPI_TOKEN_STOP_TRAN
	.no_dead_strip	_mmc_spi_data_do
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_spi_data_do
_mmc_spi_data_do:                       ; @mmc_spi_data_do
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x3
	mov	x19, x2
	mov	x20, x0
	ldr	x22, [x0, #56]
	ldr	x8, [x0, #8]
	str	x8, [sp, #48]                   ; 8-byte Folded Spill
	ldp	w28, w8, [x2]
	cmp	w28, #1
	cset	w1, gt
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	adrp	x21, _DMA_TO_DEVICE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _DMA_FROM_DEVICE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _DMA_FROM_DEVICE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x21, x10, eq
	ldr	w23, [x8]
	mov	x2, x23
	bl	_mmc_spi_setup_data_message
	mov	x26, x20
	ldr	w8, [x26, #64]!
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	w8, [x22]
LBB0_2:
	str	x22, [sp, #16]                  ; 8-byte Folded Spill
	ldp	w9, w10, [x19, #8]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	mov	w11, #16960
	movk	w11, #15, lsl #16
	mul	w10, w10, w11
	sdiv	w8, w10, w8
	add	x8, x9, w8, sxtw
	lsr	x8, x8, #3
	mov	x9, #63439
	movk	x9, #58195, lsl #16
	movk	x9, #39845, lsl #32
	movk	x9, #8388, lsl #48
	umulh	x8, x8, x9
	lsr	x0, x8, #4
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_usecs_to_jiffies
	add	w8, w0, #1
	sxtw	x8, w8
	str	x8, [sp, #56]                   ; 8-byte Folded Spill
	ldr	w9, [x19, #16]
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	cbz	w9, LBB0_22
; %bb.3:
	ldr	x27, [x19, #32]
	str	w28, [sp, #28]                  ; 4-byte Folded Spill
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	str	w9, [sp, #44]                   ; 4-byte Folded Spill
	ldr	w22, [x27]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x8
	ldr	x8, [x27, #8]
Lloh7:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w22, w9
	ccmp	x8, #0, #0, eq
Lloh10:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ccmp	w23, w8, #0, ne
Lloh13:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	csel	w28, w8, w23, eq
	mov	x0, x27
	bl	_sg_page
	mov	x1, x0
Lloh16:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	mov	x0, x25
	mov	w2, #0
	str	w28, [sp, #40]                  ; 4-byte Folded Spill
	mov	x4, x28
	bl	_dma_map_page
	ldr	w8, [x21]
	ldr	x9, [x27, #8]
	str	x0, [sp, #32]                   ; 8-byte Folded Spill
	add	x9, x0, x9
	cmp	w23, w8
	mov	w8, #88
	mov	w10, #96
	csel	x8, x10, x8, eq
	str	x9, [x20, x8]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	xzr, [sp, #32]                  ; 8-byte Folded Spill
	str	w23, [sp, #40]                  ; 4-byte Folded Spill
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	bl	_sg_page
	bl	_kmap
	ldr	w8, [x21]
	cmp	w23, w8
	mov	w8, #72
	mov	w9, #80
	csel	x8, x9, x8, eq
	ldr	x9, [x27, #8]
	add	x9, x0, x9
	str	x9, [x20, x8]
	cbz	w22, LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w28, [sp, #28]                  ; 4-byte Folded Reload
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	mov	x1, x24
	bl	_min
                                        ; kill: def $w0 killed $w0 def $x0
	str	w0, [x20, #68]
	ldr	x8, [x20, #56]
	add	x8, x8, #4
	ldr	w9, [x21]
	cmp	w23, w9
Lloh19:
	adrp	x9, l_.str.2@PAGE
Lloh20:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh21:
	adrp	x10, l_.str.1@PAGE
Lloh22:
	add	x10, x10, l_.str.1@PAGEOFF
	csel	x9, x10, x9, eq
	stp	x9, x0, [sp]
	mov	x0, x8
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x21]
	mov	x0, x20
	mov	x1, x26
	cmp	w23, w8
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x2, [sp, #56]                   ; 8-byte Folded Reload
	bl	_mmc_spi_writeblock
	mov	x25, x0
	tbz	w0, #31, LBB0_12
	b	LBB0_15
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=2
	ldr	x2, [sp, #56]                   ; 8-byte Folded Reload
	bl	_mmc_spi_readblock
	mov	x25, x0
	tbnz	w0, #31, LBB0_15
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=2
	ldr	w8, [x20, #68]
	ldr	w9, [x19, #20]
	add	w9, w9, w8
	str	w9, [x19, #20]
	cmp	w28, #2
	b.lt	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=2
	sub	w22, w22, w8
	cbnz	w22, LBB0_9
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w25, #0
	ldr	w28, [sp, #28]                  ; 4-byte Folded Reload
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh25:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	bl	_sg_page
	bl	_flush_kernel_dcache_page
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	bl	_sg_page
	bl	_kunmap
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	cbz	x8, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh28:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	ldr	x0, [sp, #48]                   ; 8-byte Folded Reload
	ldr	x1, [sp, #32]                   ; 8-byte Folded Reload
	ldr	w3, [sp, #40]                   ; 4-byte Folded Reload
	bl	_dma_unmap_page
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
	tbnz	w25, #31, LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_4 Depth=1
	add	x27, x27, #16
	ldr	w9, [sp, #44]                   ; 4-byte Folded Reload
	subs	w9, w9, #1
	b.ne	LBB0_4
	b	LBB0_22
LBB0_21:
	str	w25, [x19, #24]
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x0, x8, #4
	ldr	w8, [x21]
	cmp	w23, w8
Lloh31:
	adrp	x8, l_.str.2@PAGE
Lloh32:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh33:
	adrp	x9, l_.str.1@PAGE
Lloh34:
	add	x9, x9, l_.str.1@PAGEOFF
	csel	x8, x9, x8, eq
	stp	x8, x25, [sp]
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
LBB0_22:
	ldr	w8, [x21]
	cmp	w23, w8
	ccmp	w28, #2, #8, eq
	b.lt	LBB0_39
; %bb.23:
	ldr	x21, [x20, #48]
	ldr	x24, [sp, #16]                  ; 8-byte Folded Reload
	add	x0, x24, #4
Lloh37:
	adrp	x1, l_.str.4@PAGE
Lloh38:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
	add	x22, x20, #16
	mov	x0, x22
	bl	_INIT_LIST_HEAD
	add	x0, x20, #40
	mov	x1, x22
	bl	_list_add
	ldr	x0, [x21]
	mov	w23, #8
	mov	w1, #255
	mov	w2, #8
	bl	_memset
Lloh39:
	adrp	x8, _SPI_TOKEN_STOP_TRAN@GOTPAGE
Lloh40:
	ldr	x8, [x8, _SPI_TOKEN_STOP_TRAN@GOTPAGEOFF]
Lloh41:
	ldr	x8, [x8]
	ldr	x9, [x21]
	str	x8, [x9]
	ldr	w8, [x20, #32]
	str	w8, [x20, #36]
	ldr	w8, [x20, #24]
	str	w8, [x20, #28]
	str	w23, [x20, #20]
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_25
; %bb.24:
	ldr	w1, [x20]
Lloh42:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh43:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh44:
	ldr	w3, [x8]
	mov	w2, #8
	bl	_dma_sync_single_for_device
LBB0_25:
	mov	x0, x24
	mov	x1, x22
	bl	_spi_sync
	mov	x22, x0
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_27
; %bb.26:
	ldr	w1, [x20]
Lloh45:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh46:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh47:
	ldr	w3, [x8]
	mov	w2, #8
	bl	_dma_sync_single_for_cpu
LBB0_27:
	tbnz	w22, #31, LBB0_37
; %bb.28:
	ldr	x8, [x21]
	ldr	x9, [x8, #16]
	cbnz	x9, LBB0_39
; %bb.29:
	ldr	x9, [x8, #24]
	cbnz	x9, LBB0_39
; %bb.30:
	ldr	x9, [x8, #32]
	cbnz	x9, LBB0_39
; %bb.31:
	ldr	x9, [x8, #40]
	cbnz	x9, LBB0_39
; %bb.32:
	ldr	x9, [x8, #48]
	cbnz	x9, LBB0_39
; %bb.33:
	ldr	x8, [x8, #56]
	cbnz	x8, LBB0_39
; %bb.34:
	mov	x0, x20
	ldr	x1, [sp, #56]                   ; 8-byte Folded Reload
	bl	_mmc_spi_wait_unbusy
	tbz	w0, #31, LBB0_39
; %bb.35:
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_39
; %bb.36:
	str	w0, [x19, #24]
	b	LBB0_39
LBB0_37:
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_39
; %bb.38:
	str	w22, [x19, #24]
LBB0_39:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"    mmc_spi: %s block, %d bytes\n"

l_.str.1:                               ; @.str.1
	.asciz	"write"

l_.str.2:                               ; @.str.2
	.asciz	"read"

l_.str.3:                               ; @.str.3
	.asciz	"%s status %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"    mmc_spi: STOP_TRAN\n"

	.comm	_SPI_TOKEN_STOP_TRAN,8,3        ; @SPI_TOKEN_STOP_TRAN
	.no_dead_strip	_mmc_spi_data_do
.subsections_via_symbols
