	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3cmci_prepare_dma
_s3cmci_prepare_dma:                    ## @s3cmci_prepare_dma
	.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
	subq	$40, %rsp
	.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
	movl	(%rsi), %eax
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	andl	%eax, %r15d
	movq	_DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -68(%rbp)
	movl	%ecx, -64(%rbp)
	movq	24(%rdi), %rcx
	movq	32(%rdi), %rdx
	addq	(%rdx), %rcx
	movq	%rcx, -56(%rbp)
	movq	%rcx, -48(%rbp)
	movq	_BOTH_DIR@GOTPCREL(%rip), %rcx
	notl	%eax
	xorl	%edi, %edi
	andl	(%rcx), %eax
	sete	%dil
	callq	_BUG_ON
	movl	16(%rbx), %edi
	movq	_S3C2410_SDIPRE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	testl	%r15d, %r15d
	jne	LBB0_1
## %bb.2:
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movl	(%rbx), %edi
	callq	_mmc_dev
	movl	%eax, %r15d
	movl	4(%r14), %r12d
	movl	8(%r14), %r13d
	movq	%r14, %rdi
	callq	_mmc_get_dma_dir
	movl	%r15d, %edi
	movl	%r13d, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_dma_map_sg
	movl	4(%rbx), %edi
	leaq	-72(%rbp), %rsi
	callq	_dmaengine_slave_config
	movl	4(%rbx), %edi
	movl	4(%r14), %edx
	movl	8(%r14), %esi
	movl	-72(%rbp), %ecx
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %r9
	movq	_DMA_PREP_INTERRUPT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	orl	(%r9), %r8d
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_s3cmci_dma_done_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	%rbx, (%rax)
	movq	%rax, %rdi
	callq	_dmaengine_submit
	movl	4(%rbx), %edi
	callq	_dma_async_issue_pending
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_5:
	movl	(%rbx), %edi
	callq	_mmc_dev
	movl	%eax, %r12d
	movl	4(%r14), %r15d
	movl	8(%r14), %ebx
	movq	%r14, %rdi
	callq	_mmc_get_dma_dir
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_dma_unmap_sg
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ## @DMA_SLAVE_BUSWIDTH_4_BYTES
	.comm	_BOTH_DIR,4,2                   ## @BOTH_DIR
	.comm	_S3C2410_SDIPRE,8,3             ## @S3C2410_SDIPRE
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_CTRL_ACK,4,2               ## @DMA_CTRL_ACK
	.comm	_DMA_PREP_INTERRUPT,4,2         ## @DMA_PREP_INTERRUPT
	.comm	_s3cmci_dma_done_callback,4,2   ## @s3cmci_dma_done_callback
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_s3cmci_prepare_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3cmci_prepare_dma
_s3cmci_prepare_dma:                    ; @s3cmci_prepare_dma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MMC_DATA_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MMC_DATA_WRITE@GOTPAGEOFF]
	ldr	w21, [x1]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	stp	w8, w8, [sp, #4]
	ldp	x9, x8, [x0, #24]
	ldr	x8, [x8]
	add	x8, x9, x8
	stp	x8, x8, [sp, #16]
Lloh6:
	adrp	x8, _BOTH_DIR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BOTH_DIR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	bics	wzr, w8, w21
	cset	w0, eq
	bl	_BUG_ON
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x9, _S3C2410_SDIPRE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _S3C2410_SDIPRE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh12:
	adrp	x8, _DMA_DEV_TO_MEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh14:
	adrp	x9, _DMA_MEM_TO_DEV@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DMA_MEM_TO_DEV@GOTPAGEOFF]
	tst	w22, w21
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [sp]
	ldr	w0, [x19]
	bl	_mmc_dev
	mov	x21, x0
	ldp	w23, w22, [x20, #4]
	mov	x0, x20
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_dma_map_sg
	ldr	w0, [x19, #4]
	mov	x1, sp
	bl	_dmaengine_slave_config
	ldr	w0, [x19, #4]
	ldp	w2, w1, [x20, #4]
Lloh16:
	adrp	x8, _DMA_CTRL_ACK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DMA_CTRL_ACK@GOTPAGEOFF]
	ldr	w3, [sp]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _DMA_PREP_INTERRUPT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DMA_PREP_INTERRUPT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w4, w9, w8
	bl	_dmaengine_prep_slave_sg
	cbz	x0, LBB0_2
; %bb.1:
Lloh22:
	adrp	x8, _s3cmci_dma_done_callback@GOTPAGE
Lloh23:
	ldr	x8, [x8, _s3cmci_dma_done_callback@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	str	x19, [x0]
	bl	_dmaengine_submit
	ldr	w0, [x19, #4]
	bl	_dma_async_issue_pending
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19]
	bl	_mmc_dev
	mov	x19, x0
	ldp	w22, w21, [x20, #4]
	mov	x0, x20
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_dma_unmap_sg
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ; @DMA_SLAVE_BUSWIDTH_4_BYTES
	.comm	_BOTH_DIR,4,2                   ; @BOTH_DIR
	.comm	_S3C2410_SDIPRE,8,3             ; @S3C2410_SDIPRE
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_CTRL_ACK,4,2               ; @DMA_CTRL_ACK
	.comm	_DMA_PREP_INTERRUPT,4,2         ; @DMA_PREP_INTERRUPT
	.comm	_s3cmci_dma_done_callback,4,2   ; @s3cmci_dma_done_callback
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_s3cmci_prepare_dma
.subsections_via_symbols
