	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uniphier_sd_external_dma_start
_uniphier_sd_external_dma_start:        ## @uniphier_sd_external_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	%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, %r15
	movq	%rdi, %rbx
	callq	_uniphier_sd_priv
	cmpl	$0, 4(%rax)
	je	LBB0_8
## %bb.1:
	movq	%rax, %r14
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	(%r15), %r12d
	jne	LBB0_2
## %bb.3:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	12(%rbx), %edi
	callq	_mmc_dev
	movl	4(%rbx), %edx
	movl	8(%rbx), %esi
	movl	(%r14), %ecx
	movl	%eax, %edi
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	testl	%r12d, %r12d
	cmovel	%r13d, %r15d
	movl	4(%r14), %edi
	movl	8(%rbx), %esi
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%eax, %edx
	movl	%r15d, %ecx
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_uniphier_sd_external_dma_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	%rbx, (%rax)
	movq	%rax, %rdi
	callq	_dmaengine_submit
	testq	%rax, %rax
	js	LBB0_7
## %bb.9:
	movl	$1, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	12(%rbx), %edi
	callq	_mmc_dev
	movl	4(%rbx), %edx
	movl	8(%rbx), %esi
	movl	(%r14), %ecx
	movl	%eax, %edi
	callq	_dma_unmap_sg
LBB0_8:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_uniphier_sd_dma_endisable      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_uniphier_sd_external_dma_callback,4,2 ## @uniphier_sd_external_dma_callback
	.no_dead_strip	_uniphier_sd_external_dma_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uniphier_sd_external_dma_start
_uniphier_sd_external_dma_start:        ; @uniphier_sd_external_dma_start
	.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	x21, x1
	mov	x19, x0
	bl	_uniphier_sd_priv
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x20, x0
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ands	w21, w9, w8
Lloh3:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh5:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _DMA_MEM_TO_DEV@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DMA_MEM_TO_DEV@GOTPAGEOFF]
	str	w8, [x0]
Lloh9:
	ldr	w22, [x9]
Lloh10:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh12:
	ldr	w23, [x8]
	ldr	w0, [x19, #12]
	bl	_mmc_dev
	ldp	w2, w1, [x19, #4]
	ldr	w3, [x20]
	bl	_dma_map_sg
	cbz	w0, LBB0_6
; %bb.2:
	mov	x2, x0
	cmp	w21, #0
	csel	w3, w22, w23, eq
	ldr	w0, [x20, #4]
	ldr	w1, [x19, #8]
Lloh13:
	adrp	x8, _DMA_CTRL_ACK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh15:
	ldr	w4, [x8]
	bl	_dmaengine_prep_slave_sg
	cbz	x0, LBB0_5
; %bb.3:
Lloh16:
	adrp	x8, _uniphier_sd_external_dma_callback@GOTPAGE
Lloh17:
	ldr	x8, [x8, _uniphier_sd_external_dma_callback@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	str	x19, [x0]
	bl	_dmaengine_submit
	tbnz	x0, #63, LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19]
	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
LBB0_5:
	ldr	w0, [x19, #12]
	bl	_mmc_dev
	ldp	w2, w1, [x19, #4]
	ldr	w3, [x20]
	bl	_dma_unmap_sg
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	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	_uniphier_sd_dma_endisable
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_uniphier_sd_external_dma_callback,4,2 ; @uniphier_sd_external_dma_callback
	.no_dead_strip	_uniphier_sd_external_dma_start
.subsections_via_symbols
