	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_omap_prepare_data
_mmc_omap_prepare_data:                 ## @mmc_omap_prepare_data
	.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	%rsi, %r14
	movq	%rdi, %r13
	movq	(%rsi), %r15
	movq	%r15, 48(%rdi)
	testq	%r15, %r15
	je	LBB0_17
## %bb.1:
	movl	(%r15), %ebx
	movl	4(%r15), %edx
	movq	_NBLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	decl	%edx
	movq	%r13, %rdi
	callq	_OMAP_MMC_WRITE
	movq	_BLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	-1(%rbx), %edx
	movq	%r13, %rdi
	callq	_OMAP_MMC_WRITE
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_set_data_timeout
	cmpl	$1, 4(%r15)
	jne	LBB0_2
## %bb.8:
	movl	$1, %r12d
	cmpl	$0, 4(%r13)
	jne	LBB0_9
	jmp	LBB0_12
LBB0_17:
	movq	_BLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_OMAP_MMC_WRITE
	movq	_NBLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_OMAP_MMC_WRITE
	movq	_BUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_OMAP_MMC_WRITE
	movl	$0, (%r13)
	movq	%r13, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_cmd_timeout                ## TAILCALL
LBB0_2:
	movl	8(%r15), %r12d
	cmpl	$0, 4(%r13)
	je	LBB0_12
## %bb.3:
	testl	%r12d, %r12d
	je	LBB0_4
LBB0_9:
	movq	16(%r15), %rcx
	movl	%r12d, %esi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdi,4), %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rdi
	cmpq	%rdi, %rsi
	jne	LBB0_11
	jmp	LBB0_5
LBB0_12:
	movq	$0, 40(%r13)
	jmp	LBB0_13
LBB0_4:
	xorl	%r12d, %r12d
LBB0_5:
	movq	$0, 40(%r13)
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_mmc_omap_get_dma_channel
	testq	%rax, %rax
	je	LBB0_6
LBB0_13:
	movq	_BUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$7967, %edx                     ## imm = 0x1F1F
	callq	_OMAP_MMC_WRITE
	imull	4(%r15), %ebx
	movl	%ebx, 12(%r13)
	movl	%r12d, 8(%r13)
	movq	%r13, %rdi
	callq	_mmc_omap_sg_to_buf
	movl	$0, (%r13)
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	12(%r15), %eax
	jne	LBB0_7
## %bb.14:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_7:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %ebx
	movl	32(%r13), %edi
	callq	_mmc_dev
	movq	16(%r15), %rsi
	movl	%eax, %edi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	callq	_dma_map_sg
	movl	%eax, 8(%r13)
	movl	$0, 12(%r13)
	movq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_mmc_omap_prepare_dma
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r13)
	movl	$1, (%r13)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_BLEN,4,2                       ## @BLEN
	.comm	_NBLK,4,2                       ## @NBLK
	.comm	_BUF,4,2                        ## @BUF
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_mmc_omap_prepare_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_omap_prepare_data
_mmc_omap_prepare_data:                 ; @mmc_omap_prepare_data
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	ldr	x21, [x1]
	str	x21, [x0, #48]
	cbz	x21, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _NBLK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NBLK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldp	w23, w8, [x21]
	sub	w2, w8, #1
	mov	x0, x19
	bl	_OMAP_MMC_WRITE
Lloh3:
	adrp	x8, _BLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BLEN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	sub	w2, w23, #1
	mov	x0, x19
	bl	_OMAP_MMC_WRITE
	mov	x0, x19
	mov	x1, x20
	bl	_set_data_timeout
	ldr	w8, [x21, #4]
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x19, #4]
	mov	w22, #1
	cbnz	w8, LBB0_6
	b	LBB0_11
LBB0_3:
Lloh6:
	adrp	x8, _BLEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BLEN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OMAP_MMC_WRITE
Lloh9:
	adrp	x8, _NBLK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NBLK@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OMAP_MMC_WRITE
Lloh12:
	adrp	x8, _BUF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BUF@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_OMAP_MMC_WRITE
	str	wzr, [x19]
	mov	x0, x19
	mov	x1, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_set_cmd_timeout
LBB0_4:
	ldr	w22, [x21, #8]
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_11
; %bb.5:
	cbz	w22, LBB0_9
LBB0_6:
	ldr	x8, [x21, #16]
	mov	w9, w22
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8]
	sdiv	w11, w10, w23
	msub	w10, w11, w23, w10
	cbnz	w10, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x8, #4
	subs	x9, x9, #1
	b.ne	LBB0_7
LBB0_9:
	str	xzr, [x19, #40]
	mov	x0, x19
	mov	x1, x21
	bl	_mmc_omap_get_dma_channel
	cbnz	x0, LBB0_12
; %bb.10:
	ldr	w8, [x21, #12]
Lloh15:
	adrp	x9, _MMC_DATA_WRITE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _DMA_FROM_DEVICE@GOTPAGE
Lloh19:
	ldr	x10, [x10, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh20:
	adrp	x11, _DMA_TO_DEVICE@GOTPAGE
Lloh21:
	ldr	x11, [x11, _DMA_TO_DEVICE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w23, [x8]
	ldr	w0, [x19, #32]
	bl	_mmc_dev
	ldr	x1, [x21, #16]
	mov	x2, x22
	mov	x3, x23
	bl	_dma_map_sg
	stp	w0, wzr, [x19, #8]
	ldr	x1, [x20]
	mov	x0, x19
	bl	_mmc_omap_prepare_dma
	stp	xzr, xzr, [x19, #16]
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_13
LBB0_11:
	str	xzr, [x19, #40]
LBB0_12:
Lloh22:
	adrp	x8, _BUF@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BUF@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #7967
	bl	_OMAP_MMC_WRITE
	ldr	w8, [x21, #4]
	mul	w8, w8, w23
	stp	w22, w8, [x19, #8]
	mov	x0, x19
	bl	_mmc_omap_sg_to_buf
	str	wzr, [x19]
LBB0_13:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_BLEN,4,2                       ; @BLEN
	.comm	_NBLK,4,2                       ; @NBLK
	.comm	_BUF,4,2                        ; @BUF
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_mmc_omap_prepare_data
.subsections_via_symbols
