	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_dma_terminate_all
_sun4i_dma_terminate_all:               ## @sun4i_dma_terminate_all
	.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	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_sun4i_dma_dev
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_sun4i_dma_vchan
	movq	%rax, %rbx
	leaq	8(%rax), %r13
	movq	8(%rax), %r15
	movq	_head@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_LIST_HEAD
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_vchan_get_all_descriptors
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	testq	%r15, %r15
	je	LBB0_5
## %bb.1:
	cmpq	$0, 8(%r15)
	jne	LBB0_2
## %bb.3:
	movq	_SUN4I_NDMA_CFG_REG@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_SUN4I_DDMA_CFG_REG@GOTPCREL(%rip), %rax
LBB0_4:
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_set_pchan_interrupt
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_release_pchan
LBB0_5:
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_head@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_vchan_dma_desc_free_list
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r13)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_head,4,2                       ## @head
	.comm	_SUN4I_DDMA_CFG_REG,8,3         ## @SUN4I_DDMA_CFG_REG
	.comm	_SUN4I_NDMA_CFG_REG,8,3         ## @SUN4I_NDMA_CFG_REG
	.no_dead_strip	_sun4i_dma_terminate_all
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_dma_terminate_all
_sun4i_dma_terminate_all:               ; @sun4i_dma_terminate_all
	.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	x19, x0
	ldr	w0, [x0]
	bl	_to_sun4i_dma_dev
	mov	x20, x0
	mov	x0, x19
	bl	_to_sun4i_dma_vchan
	mov	x19, x0
	mov	x23, x0
	ldr	x21, [x23, #8]!
Lloh0:
	adrp	x22, _head@GOTPAGE
Lloh1:
	ldr	x22, [x22, _head@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_LIST_HEAD
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x22
	bl	_vchan_get_all_descriptors
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	cbz	x21, LBB0_2
; %bb.1:
	ldp	x9, x8, [x21]
Lloh2:
	adrp	x10, _SUN4I_NDMA_CFG_REG@GOTPAGE
Lloh3:
	ldr	x10, [x10, _SUN4I_NDMA_CFG_REG@GOTPAGEOFF]
Lloh4:
	adrp	x11, _SUN4I_DDMA_CFG_REG@GOTPAGE
Lloh5:
	ldr	x11, [x11, _SUN4I_DDMA_CFG_REG@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x11, eq
	ldr	x8, [x8]
	add	x1, x8, x9
	mov	w0, #0
	bl	_writel
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	mov	w3, #0
	bl	_set_pchan_interrupt
	mov	x0, x20
	mov	x1, x21
	bl	_release_pchan
LBB0_2:
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh6:
	adrp	x1, _head@GOTPAGE
Lloh7:
	ldr	x1, [x1, _head@GOTPAGEOFF]
	mov	x0, x19
	bl	_vchan_dma_desc_free_list
	stp	xzr, xzr, [x23]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_head,4,2                       ; @head
	.comm	_SUN4I_DDMA_CFG_REG,8,3         ; @SUN4I_DDMA_CFG_REG
	.comm	_SUN4I_NDMA_CFG_REG,8,3         ; @SUN4I_NDMA_CFG_REG
	.no_dead_strip	_sun4i_dma_terminate_all
.subsections_via_symbols
