	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmci_dma_start                 ## -- Begin function mmci_dma_start
	.p2align	4, 0x90
_mmci_dma_start:                        ## @mmci_dma_start
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, -20(%rbp)
	cmpl	$0, 20(%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_mmci_prep_data
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.5:
	movl	16(%rbx), %edi
	callq	_mmc_dev
	movl	12(%r14), %edx
	movl	8(%r14), %ecx
	movl	(%r14), %r9d
	movl	4(%r14), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_vdbg
	movq	8(%rbx), %rax
	leaq	-20(%rbp), %rsi
	movq	%rbx, %rdi
	callq	*(%rax)
	movl	-20(%rbp), %esi
	movq	%rbx, %rdi
	callq	_mmci_write_datactrlreg
	movq	_MMCIMASK0@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%rbx), %rdi
	callq	_readl
	movq	_MCI_DATAENDMASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%r14), %rsi
	addq	(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Submit MMCI DMA job, sglen %d blksz %04x blks %04x flags %08x\n"

	.comm	_MMCIMASK0,8,3                  ## @MMCIMASK0
	.comm	_MCI_DATAENDMASK,4,2            ## @MCI_DATAENDMASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmci_dma_start                 ; -- Begin function mmci_dma_start
	.p2align	2
_mmci_dma_start:                        ; @mmci_dma_start
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	str	w1, [sp, #12]
	ldr	w8, [x0, #20]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0, #24]
	mov	x1, x20
	mov	w2, #0
	bl	_mmci_prep_data
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	w0, [x19, #16]
	bl	_mmc_dev
	ldp	w3, w2, [x20, #8]
	ldp	w5, w4, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_vdbg
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	add	x1, sp, #12
	mov	x0, x19
	blr	x8
	ldr	w1, [sp, #12]
	mov	x0, x19
	bl	_mmci_write_datactrlreg
	ldr	x8, [x19]
Lloh2:
	adrp	x20, _MMCIMASK0@GOTPAGE
Lloh3:
	ldr	x20, [x20, _MMCIMASK0@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh4:
	adrp	x8, _MCI_DATAENDMASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MCI_DATAENDMASK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Submit MMCI DMA job, sglen %d blksz %04x blks %04x flags %08x\n"

	.comm	_MMCIMASK0,8,3                  ; @MMCIMASK0
	.comm	_MCI_DATAENDMASK,4,2            ; @MCI_DATAENDMASK
.subsections_via_symbols
