	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_hsmmc_dma_cleanup
_omap_hsmmc_dma_cleanup:                ## @omap_hsmmc_dma_cleanup
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	%esi, (%rax)
	leaq	24(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%rbx), %r15d
	movl	$-1, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	$0, 16(%rbx)
	je	LBB0_3
## %bb.1:
	cmpl	$-1, %r15d
	je	LBB0_3
## %bb.2:
	movq	8(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_omap_hsmmc_get_dma_chan
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_dmaengine_terminate_all
	movq	(%r14), %rax
	movl	(%rax), %r14d
	movq	8(%rbx), %rdi
	movl	16(%rdi), %r15d
	movl	20(%rdi), %r12d
	callq	_mmc_get_dma_dir
	movl	%r14d, %edi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_dma_unmap_sg
	movq	8(%rbx), %rax
	movq	$0, 8(%rax)
LBB0_3:
	movq	$0, 8(%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_omap_hsmmc_dma_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_hsmmc_dma_cleanup
_omap_hsmmc_dma_cleanup:                ; @omap_hsmmc_dma_cleanup
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x8, [x0, #8]
	str	w1, [x8]
	add	x20, x0, #24
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w21, [x19]
	mov	w8, #-1
	str	w8, [x19]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	x8, [x19, #16]
	cmp	x8, #0
	ccmn	w21, #1, #4, ne
	b.eq	LBB0_2
; %bb.1:
	ldr	x1, [x19, #8]
	mov	x0, x19
	bl	_omap_hsmmc_get_dma_chan
	mov	x20, x0
	bl	_dmaengine_terminate_all
	ldr	x8, [x20]
	ldr	w20, [x8]
	ldr	x0, [x19, #8]
	ldp	w22, w21, [x0, #16]
	bl	_mmc_get_dma_dir
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_dma_unmap_sg
	ldr	x8, [x19, #8]
	str	xzr, [x8, #8]
LBB0_2:
	str	xzr, [x19, #8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_omap_hsmmc_dma_cleanup
.subsections_via_symbols
