	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uniphier_sd_internal_dma_start
_uniphier_sd_internal_dma_start:        ## @uniphier_sd_internal_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, %r14
	movq	%rdi, %rbx
	callq	_uniphier_sd_priv
	movq	%rax, %r12
	movq	24(%rbx), %r15
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, (%r14)
	je	LBB0_2
## %bb.1:
	cmpl	$0, 20(%rbx)
	je	LBB0_9
LBB0_2:
	xorl	%edi, %edi
	cmpl	$1, (%rbx)
	setne	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
LBB0_9:
	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
LBB0_3:
	movl	(%r15), %edi
	movl	$8, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_9
## %bb.4:
	movl	(%r13), %r13d
	andl	(%r14), %r13d
	jne	LBB0_5
## %bb.6:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movq	_UNIPHIER_SD_DMA_MODE_DIR_TO_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_UNIPHIER_SD_DMA_MODE_DIR_FROM_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	16(%rbx), %edi
	callq	_mmc_dev
	movl	(%r12), %ecx
	movl	%eax, %edi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	testl	%r13d, %r13d
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	cmovel	-44(%rbp), %esi                 ## 4-byte Folded Reload
	movq	_UNIPHIER_SD_DMA_MODE_DIR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_FIELD_PREP
	movl	%eax, %r15d
	movq	_UNIPHIER_SD_DMA_MODE_WIDTH_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_UNIPHIER_SD_DMA_MODE_WIDTH_64@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_FIELD_PREP
	orl	%eax, %r15d
	movq	_UNIPHIER_SD_DMA_MODE_ADDR_INC@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_UNIPHIER_SD_DMA_MODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	movl	%r15d, %edi
	callq	_writel
	movl	4(%r14), %edi
	callq	_sg_dma_address
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_lower_32_bits
	movq	_UNIPHIER_SD_DMA_ADDR_L@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	8(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	movl	%r14d, %edi
	callq	_upper_32_bits
	movq	_UNIPHIER_SD_DMA_ADDR_H@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	8(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	movl	$1, 4(%rbx)
	addq	$8, %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	_UNIPHIER_SD_DMA_MODE_DIR_FROM_DEV,4,2 ## @UNIPHIER_SD_DMA_MODE_DIR_FROM_DEV
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_UNIPHIER_SD_DMA_MODE_DIR_TO_DEV,4,2 ## @UNIPHIER_SD_DMA_MODE_DIR_TO_DEV
	.comm	_UNIPHIER_SD_DMA_MODE_DIR_MASK,4,2 ## @UNIPHIER_SD_DMA_MODE_DIR_MASK
	.comm	_UNIPHIER_SD_DMA_MODE_WIDTH_MASK,4,2 ## @UNIPHIER_SD_DMA_MODE_WIDTH_MASK
	.comm	_UNIPHIER_SD_DMA_MODE_WIDTH_64,4,2 ## @UNIPHIER_SD_DMA_MODE_WIDTH_64
	.comm	_UNIPHIER_SD_DMA_MODE_ADDR_INC,4,2 ## @UNIPHIER_SD_DMA_MODE_ADDR_INC
	.comm	_UNIPHIER_SD_DMA_MODE,8,3       ## @UNIPHIER_SD_DMA_MODE
	.comm	_UNIPHIER_SD_DMA_ADDR_L,8,3     ## @UNIPHIER_SD_DMA_ADDR_L
	.comm	_UNIPHIER_SD_DMA_ADDR_H,8,3     ## @UNIPHIER_SD_DMA_ADDR_H
	.no_dead_strip	_uniphier_sd_internal_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_internal_dma_start
_uniphier_sd_internal_dma_start:        ; @uniphier_sd_internal_dma_start
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_uniphier_sd_priv
	mov	x22, x0
	ldr	x21, [x19, #24]
	ldr	w8, [x20]
Lloh0:
	adrp	x23, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MMC_DATA_READ@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_3
LBB0_2:
	ldr	w8, [x19]
	cmp	w8, #1
	cset	w0, ne
	bl	_WARN_ON
	cbz	x0, LBB0_4
LBB0_3:
	mov	x0, x19
	mov	w1, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_uniphier_sd_dma_endisable
LBB0_4:
	ldr	w0, [x21]
	mov	w1, #8
	bl	_IS_ALIGNED
	cbz	w0, LBB0_3
; %bb.5:
	ldr	w8, [x20]
	ldr	w9, [x23]
	ands	w23, w9, w8
Lloh2:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh4:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _UNIPHIER_SD_DMA_MODE_DIR_TO_DEV@GOTPAGE
Lloh7:
	ldr	x9, [x9, _UNIPHIER_SD_DMA_MODE_DIR_TO_DEV@GOTPAGEOFF]
	str	w8, [x22]
Lloh8:
	ldr	w24, [x9]
Lloh9:
	adrp	x8, _UNIPHIER_SD_DMA_MODE_DIR_FROM_DEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _UNIPHIER_SD_DMA_MODE_DIR_FROM_DEV@GOTPAGEOFF]
Lloh11:
	ldr	w25, [x8]
	ldr	w0, [x19, #16]
	bl	_mmc_dev
	ldr	w3, [x22]
	mov	w22, #1
	mov	x1, x21
	mov	w2, #1
	bl	_dma_map_sg
	cbz	w0, LBB0_3
; %bb.6:
	cmp	w23, #0
	csel	w1, w24, w25, eq
Lloh12:
	adrp	x8, _UNIPHIER_SD_DMA_MODE_DIR_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _UNIPHIER_SD_DMA_MODE_DIR_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_FIELD_PREP
	mov	x21, x0
Lloh15:
	adrp	x8, _UNIPHIER_SD_DMA_MODE_WIDTH_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _UNIPHIER_SD_DMA_MODE_WIDTH_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x8, _UNIPHIER_SD_DMA_MODE_WIDTH_64@GOTPAGE
Lloh19:
	ldr	x8, [x8, _UNIPHIER_SD_DMA_MODE_WIDTH_64@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_FIELD_PREP
	orr	w8, w0, w21
Lloh21:
	adrp	x9, _UNIPHIER_SD_DMA_MODE_ADDR_INC@GOTPAGE
Lloh22:
	ldr	x9, [x9, _UNIPHIER_SD_DMA_MODE_ADDR_INC@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x19, #8]
Lloh24:
	adrp	x9, _UNIPHIER_SD_DMA_MODE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _UNIPHIER_SD_DMA_MODE@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w0, [x20, #4]
	bl	_sg_dma_address
	mov	x20, x0
	bl	_lower_32_bits
	ldr	x8, [x19, #8]
Lloh27:
	adrp	x9, _UNIPHIER_SD_DMA_ADDR_L@GOTPAGE
Lloh28:
	ldr	x9, [x9, _UNIPHIER_SD_DMA_ADDR_L@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x20
	bl	_upper_32_bits
	ldr	x8, [x19, #8]
Lloh30:
	adrp	x9, _UNIPHIER_SD_DMA_ADDR_H@GOTPAGE
Lloh31:
	ldr	x9, [x9, _UNIPHIER_SD_DMA_ADDR_H@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	str	w22, [x19, #4]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_UNIPHIER_SD_DMA_MODE_DIR_FROM_DEV,4,2 ; @UNIPHIER_SD_DMA_MODE_DIR_FROM_DEV
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_UNIPHIER_SD_DMA_MODE_DIR_TO_DEV,4,2 ; @UNIPHIER_SD_DMA_MODE_DIR_TO_DEV
	.comm	_UNIPHIER_SD_DMA_MODE_DIR_MASK,4,2 ; @UNIPHIER_SD_DMA_MODE_DIR_MASK
	.comm	_UNIPHIER_SD_DMA_MODE_WIDTH_MASK,4,2 ; @UNIPHIER_SD_DMA_MODE_WIDTH_MASK
	.comm	_UNIPHIER_SD_DMA_MODE_WIDTH_64,4,2 ; @UNIPHIER_SD_DMA_MODE_WIDTH_64
	.comm	_UNIPHIER_SD_DMA_MODE_ADDR_INC,4,2 ; @UNIPHIER_SD_DMA_MODE_ADDR_INC
	.comm	_UNIPHIER_SD_DMA_MODE,8,3       ; @UNIPHIER_SD_DMA_MODE
	.comm	_UNIPHIER_SD_DMA_ADDR_L,8,3     ; @UNIPHIER_SD_DMA_ADDR_L
	.comm	_UNIPHIER_SD_DMA_ADDR_H,8,3     ; @UNIPHIER_SD_DMA_ADDR_H
	.no_dead_strip	_uniphier_sd_internal_dma_start
.subsections_via_symbols
