	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_hsmmc_setup_dma_transfer
_omap_hsmmc_setup_dma_transfer:         ## @omap_hsmmc_setup_dma_transfer
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %r12
	movl	(%r12), %ecx
	leal	3(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	movq	%rdi, %r14
	sarl	$2, %eax
	movl	%eax, -64(%rbp)
	movl	%eax, -60(%rbp)
	movq	_DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	%eax, -52(%rbp)
	movq	_OMAP_HSMMC_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	8(%rdi), %rax
	movq	%rax, -48(%rbp)
	movq	%rax, -40(%rbp)
	movl	4(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_5
## %bb.1:
	movq	16(%r12), %rdi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rbx,4), %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	cmpq	%rbx, %rsi
	jne	LBB0_3
LBB0_5:
	testb	$3, %cl
	je	LBB0_6
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%edi, %edi
	cmpl	$-1, (%r14)
	setne	%dil
	callq	_BUG_ON
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_omap_hsmmc_get_dma_chan
	movq	%rax, %r15
	leaq	-64(%rbp), %rsi
	movq	%rax, %rdi
	callq	_dmaengine_slave_config
	testl	%eax, %eax
	jne	LBB0_14
## %bb.7:
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	movq	%r15, %rcx
	callq	_omap_hsmmc_pre_dma_transfer
	testl	%eax, %eax
	jne	LBB0_14
## %bb.8:
	movq	16(%r12), %rsi
	movl	4(%r12), %edx
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%r12), %eax
	jne	LBB0_9
## %bb.10:
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ecx
	movq	_DMA_PREP_INTERRUPT@GOTPCREL(%rip), %rax
	movq	_DMA_CTRL_ACK@GOTPCREL(%rip), %rdi
	movl	(%rdi), %r8d
	orl	(%rax), %r8d
	movq	%r15, %rdi
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	_omap_hsmmc_dma_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	%r14, (%rax)
	movq	%rax, %rdi
	callq	_dmaengine_submit
	movl	$1, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_12:
	movl	4(%r14), %edi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movl	$-1, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ## @DMA_SLAVE_BUSWIDTH_4_BYTES
	.comm	_OMAP_HSMMC_DATA,8,3            ## @OMAP_HSMMC_DATA
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.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	"prep_slave_sg() failed\n"

	.comm	_omap_hsmmc_dma_callback,4,2    ## @omap_hsmmc_dma_callback
	.no_dead_strip	_omap_hsmmc_setup_dma_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_hsmmc_setup_dma_transfer
_omap_hsmmc_setup_dma_transfer:         ; @omap_hsmmc_setup_dma_transfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	ldr	x20, [x1]
	ldr	w8, [x20]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w9, w9, #2
	stp	w9, w9, [sp]
Lloh0:
	adrp	x9, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_SLAVE_BUSWIDTH_4_BYTES@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	stp	w9, w9, [sp, #8]
	ldr	x9, [x0, #8]
Lloh3:
	adrp	x10, _OMAP_HSMMC_DATA@GOTPAGE
Lloh4:
	ldr	x10, [x10, _OMAP_HSMMC_DATA@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	add	x9, x10, x9
	stp	x9, x9, [sp, #16]
	ldr	w9, [x20, #4]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.1:
	ldr	x10, [x20, #16]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10]
	sdiv	w12, w11, w8
	msub	w11, w12, w8, w11
	cbnz	w11, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x10, x10, #4
	subs	x9, x9, #1
	b.ne	LBB0_2
LBB0_4:
	tst	w8, #0x3
	b.eq	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	add	sp, sp, #80
	ret
LBB0_7:
	ldr	w8, [x19]
	cmn	w8, #1
	cset	w0, ne
	bl	_BUG_ON
	mov	x0, x19
	mov	x1, x20
	bl	_omap_hsmmc_get_dma_chan
	mov	x21, x0
	mov	x1, sp
	bl	_dmaengine_slave_config
	cbnz	w0, LBB0_6
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	mov	x3, x21
	bl	_omap_hsmmc_pre_dma_transfer
	cbnz	w0, LBB0_6
; %bb.9:
	ldr	x1, [x20, #16]
	ldp	w2, w8, [x20, #4]
Lloh9:
	adrp	x9, _MMC_DATA_WRITE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MMC_DATA_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _DMA_MEM_TO_DEV@GOTPAGE
Lloh13:
	ldr	x10, [x10, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh14:
	adrp	x11, _DMA_DEV_TO_MEM@GOTPAGE
Lloh15:
	ldr	x11, [x11, _DMA_DEV_TO_MEM@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
Lloh16:
	adrp	x9, _DMA_PREP_INTERRUPT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DMA_PREP_INTERRUPT@GOTPAGEOFF]
	ldr	w3, [x8]
Lloh18:
	ldr	w8, [x9]
Lloh19:
	adrp	x9, _DMA_CTRL_ACK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DMA_CTRL_ACK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w4, w9, w8
	mov	x0, x21
	bl	_dmaengine_prep_slave_sg
	cbz	x0, LBB0_11
; %bb.10:
Lloh22:
	adrp	x8, _omap_hsmmc_dma_callback@GOTPAGE
Lloh23:
	ldr	x8, [x8, _omap_hsmmc_dma_callback@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	str	x19, [x0]
	bl	_dmaengine_submit
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_6
LBB0_11:
	ldr	w0, [x19, #4]
	bl	_mmc_dev
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w0, #-1
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.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	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_SLAVE_BUSWIDTH_4_BYTES,4,2 ; @DMA_SLAVE_BUSWIDTH_4_BYTES
	.comm	_OMAP_HSMMC_DATA,8,3            ; @OMAP_HSMMC_DATA
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.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	"prep_slave_sg() failed\n"

	.comm	_omap_hsmmc_dma_callback,4,2    ; @omap_hsmmc_dma_callback
	.no_dead_strip	_omap_hsmmc_setup_dma_transfer
.subsections_via_symbols
