	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_davinci_send_dma_request
_mmc_davinci_send_dma_request:          ## @mmc_davinci_send_dma_request
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_DAVINCI_MMC_DATADIR_WRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movq	_DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, -72(%rbp)
	movq	_rw_threshold@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ecx
	movl	%eax, -68(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -64(%rbp)
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%eax, -48(%rbp)
	movq	24(%rbx), %rax
	movq	_DAVINCI_MMCDXR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	(%rax), %rcx
	movq	%rcx, -40(%rbp)
	movq	32(%rbx), %r14
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_dmaengine_slave_config
	movq	32(%rbx), %rdi
	movl	(%r15), %esi
	movl	12(%rbx), %edx
	movl	(%r12), %ecx
	movq	_DMA_PREP_INTERRUPT@GOTPCREL(%rip), %r9
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	orl	(%r9), %r8d
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movl	8(%rbx), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_4:
	movq	$0, -72(%rbp)
	movq	_DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, -64(%rbp)
	movq	_rw_threshold@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ecx
	movl	%eax, -60(%rbp)
	movq	24(%rbx), %rax
	movq	_DAVINCI_MMCDRR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	(%rax), %rcx
	movq	%rcx, -56(%rbp)
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%eax, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	16(%rbx), %r14
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_dmaengine_slave_config
	movq	16(%rbx), %rdi
	movl	(%r15), %esi
	movl	12(%rbx), %edx
	movl	(%r12), %ecx
	movq	_DMA_PREP_INTERRUPT@GOTPCREL(%rip), %r9
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	orl	(%r9), %r8d
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	je	LBB0_5
LBB0_6:
	movq	%rax, %rdi
	callq	_dmaengine_submit
	movq	%r14, %rdi
	callq	_dma_async_issue_pending
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_5:
	movl	8(%rbx), %edi
	callq	_mmc_dev
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	movl	%eax, %edi
	callq	_dev_dbg
	movl	$-1, %eax
LBB0_7:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DAVINCI_MMC_DATADIR_WRITE,8,3  ## @DAVINCI_MMC_DATADIR_WRITE
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ## @DMA_SLAVE_BUSWIDTH_4_BYTES
	.comm	_rw_threshold,4,2               ## @rw_threshold
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DAVINCI_MMCDXR,8,3             ## @DAVINCI_MMCDXR
	.comm	_DMA_PREP_INTERRUPT,4,2         ## @DMA_PREP_INTERRUPT
	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate DMA TX descriptor"

	.comm	_DAVINCI_MMCDRR,8,3             ## @DAVINCI_MMCDRR
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
L_.str.1:                               ## @.str.1
	.asciz	"failed to allocate DMA RX descriptor"

	.no_dead_strip	_mmc_davinci_send_dma_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_davinci_send_dma_request
_mmc_davinci_send_dma_request:          ; @mmc_davinci_send_dma_request
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _DAVINCI_MMC_DATADIR_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DAVINCI_MMC_DATADIR_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _rw_threshold@GOTPAGE
Lloh7:
	ldr	x9, [x9, _rw_threshold@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	sdiv	w9, w9, w8
	stp	w8, w9, [sp, #8]
	stp	xzr, xzr, [sp, #16]
Lloh9:
	adrp	x22, _DMA_MEM_TO_DEV@GOTPAGE
Lloh10:
	ldr	x22, [x22, _DMA_MEM_TO_DEV@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [sp, #32]
	ldp	x8, x20, [x19, #24]
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _DAVINCI_MMCDXR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DAVINCI_MMCDXR@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x8, x9, x8
	str	x8, [sp, #40]
	add	x1, sp, #8
	mov	x0, x20
	bl	_dmaengine_slave_config
	ldr	x0, [x19, #32]
	ldr	w1, [x21]
	ldr	w2, [x19, #12]
Lloh14:
	adrp	x8, _DMA_PREP_INTERRUPT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DMA_PREP_INTERRUPT@GOTPAGEOFF]
	ldr	w3, [x22]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _DMA_CTRL_ACK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w4, w9, w8
	bl	_dmaengine_prep_slave_sg
	cbnz	x0, LBB0_4
; %bb.2:
	ldr	w0, [x19, #8]
	bl	_mmc_dev
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_3:
	str	xzr, [sp, #8]
Lloh22:
	adrp	x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGE
Lloh23:
	ldr	x8, [x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGEOFF]
Lloh24:
	adrp	x9, _rw_threshold@GOTPAGE
Lloh25:
	ldr	x9, [x9, _rw_threshold@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	ldr	w9, [x9]
	sdiv	w9, w9, w8
	stp	w8, w9, [sp, #16]
	ldp	x20, x8, [x19, #16]
	ldr	x8, [x8]
Lloh28:
	adrp	x9, _DAVINCI_MMCDRR@GOTPAGE
Lloh29:
	ldr	x9, [x9, _DAVINCI_MMCDRR@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	add	x8, x9, x8
	str	x8, [sp, #24]
Lloh31:
	adrp	x22, _DMA_DEV_TO_MEM@GOTPAGE
Lloh32:
	ldr	x22, [x22, _DMA_DEV_TO_MEM@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [sp, #32]
	str	xzr, [sp, #40]
	add	x1, sp, #8
	mov	x0, x20
	bl	_dmaengine_slave_config
	ldr	x0, [x19, #16]
	ldr	w1, [x21]
	ldr	w2, [x19, #12]
Lloh33:
	adrp	x8, _DMA_PREP_INTERRUPT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _DMA_PREP_INTERRUPT@GOTPAGEOFF]
	ldr	w3, [x22]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _DMA_CTRL_ACK@GOTPAGE
Lloh37:
	ldr	x9, [x9, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w4, w9, w8
	bl	_dmaengine_prep_slave_sg
	cbz	x0, LBB0_5
LBB0_4:
	bl	_dmaengine_submit
	mov	x0, x20
	bl	_dma_async_issue_pending
	mov	w0, #0
	b	LBB0_7
LBB0_5:
	ldr	w0, [x19, #8]
	bl	_mmc_dev
Lloh39:
	adrp	x1, l_.str.1@PAGE
Lloh40:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	bl	_dev_dbg
	mov	w0, #-1
LBB0_7:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh26
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_DAVINCI_MMC_DATADIR_WRITE,8,3  ; @DAVINCI_MMC_DATADIR_WRITE
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ; @DMA_SLAVE_BUSWIDTH_4_BYTES
	.comm	_rw_threshold,4,2               ; @rw_threshold
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DAVINCI_MMCDXR,8,3             ; @DAVINCI_MMCDXR
	.comm	_DMA_PREP_INTERRUPT,4,2         ; @DMA_PREP_INTERRUPT
	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate DMA TX descriptor"

	.comm	_DAVINCI_MMCDRR,8,3             ; @DAVINCI_MMCDRR
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
l_.str.1:                               ; @.str.1
	.asciz	"failed to allocate DMA RX descriptor"

	.no_dead_strip	_mmc_davinci_send_dma_request
.subsections_via_symbols
