	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun6i_dma_terminate_all
_sun6i_dma_terminate_all:               ## @sun6i_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_sun6i_dma_dev
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_sun6i_vchan
	movq	%rax, %rbx
	movq	16(%rax), %r15
	movq	_head@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LIST_HEAD
	movq	%r14, %rdi
	callq	_spin_lock
	leaq	24(%rbx), %rdi
	callq	_list_del_init
	movq	%r14, %rdi
	callq	_spin_unlock
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	cmpl	$0, (%rbx)
	je	LBB0_6
## %bb.1:
	movl	$0, (%rbx)
	testq	%r15, %r15
	je	LBB0_2
## %bb.3:
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rsi
	addq	$8, %rsi
	callq	_list_add_tail
LBB0_5:
	movq	_head@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_vchan_get_all_descriptors
	jmp	LBB0_7
LBB0_6:
	movq	_head@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_vchan_get_all_descriptors
	testq	%r15, %r15
	je	LBB0_8
LBB0_7:
	movq	_DMA_CHAN_ENABLE_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DMA_CHAN_ENABLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%r15), %rsi
	callq	_writel
	movq	_DMA_CHAN_PAUSE_RESUME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DMA_CHAN_PAUSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%r15), %rsi
	callq	_writel
	movq	$0, 16(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movq	$0, 16(%r15)
	jmp	LBB0_8
LBB0_2:
	movq	_head@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_vchan_get_all_descriptors
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	_head@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_vchan_dma_desc_free_list
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_head,4,2                       ## @head
	.comm	_DMA_CHAN_ENABLE_STOP,4,2       ## @DMA_CHAN_ENABLE_STOP
	.comm	_DMA_CHAN_ENABLE,8,3            ## @DMA_CHAN_ENABLE
	.comm	_DMA_CHAN_PAUSE_RESUME,4,2      ## @DMA_CHAN_PAUSE_RESUME
	.comm	_DMA_CHAN_PAUSE,8,3             ## @DMA_CHAN_PAUSE
	.no_dead_strip	_sun6i_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 sun6i_dma_terminate_all
_sun6i_dma_terminate_all:               ; @sun6i_dma_terminate_all
	.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	w0, [x0]
	bl	_to_sun6i_dma_dev
	mov	x20, x0
	mov	x0, x19
	bl	_to_sun6i_vchan
	mov	x19, x0
	ldr	x21, [x0, #16]
Lloh0:
	adrp	x8, _head@GOTPAGE
Lloh1:
	ldr	x8, [x8, _head@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_LIST_HEAD
	mov	x0, x20
	bl	_spin_lock
	add	x0, x19, #24
	bl	_list_del_init
	mov	x0, x20
	bl	_spin_unlock
	add	x20, x19, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.1:
	str	wzr, [x19]
	cbz	x21, LBB0_7
; %bb.2:
	ldr	x0, [x21, #8]
	cbz	x0, LBB0_4
; %bb.3:
	add	x1, x19, #8
	bl	_list_add_tail
LBB0_4:
Lloh3:
	adrp	x1, _head@GOTPAGE
Lloh4:
	ldr	x1, [x1, _head@GOTPAGEOFF]
	mov	x0, x20
	bl	_vchan_get_all_descriptors
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x1, _head@GOTPAGE
Lloh6:
	ldr	x1, [x1, _head@GOTPAGEOFF]
	mov	x0, x20
	bl	_vchan_get_all_descriptors
	cbz	x21, LBB0_8
LBB0_6:
Lloh7:
	adrp	x8, _DMA_CHAN_ENABLE_STOP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DMA_CHAN_ENABLE_STOP@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldr	x8, [x21, #24]
Lloh10:
	adrp	x9, _DMA_CHAN_ENABLE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DMA_CHAN_ENABLE@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh13:
	adrp	x8, _DMA_CHAN_PAUSE_RESUME@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_CHAN_PAUSE_RESUME@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	x8, [x21, #24]
Lloh16:
	adrp	x9, _DMA_CHAN_PAUSE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _DMA_CHAN_PAUSE@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	str	xzr, [x19, #16]
	stp	xzr, xzr, [x21, #8]
	str	xzr, [x21]
	b	LBB0_8
LBB0_7:
Lloh19:
	adrp	x1, _head@GOTPAGE
Lloh20:
	ldr	x1, [x1, _head@GOTPAGEOFF]
	mov	x0, x20
	bl	_vchan_get_all_descriptors
LBB0_8:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh21:
	adrp	x1, _head@GOTPAGE
Lloh22:
	ldr	x1, [x1, _head@GOTPAGEOFF]
	mov	x0, x20
	bl	_vchan_dma_desc_free_list
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_head,4,2                       ; @head
	.comm	_DMA_CHAN_ENABLE_STOP,4,2       ; @DMA_CHAN_ENABLE_STOP
	.comm	_DMA_CHAN_ENABLE,8,3            ; @DMA_CHAN_ENABLE
	.comm	_DMA_CHAN_PAUSE_RESUME,4,2      ; @DMA_CHAN_PAUSE_RESUME
	.comm	_DMA_CHAN_PAUSE,8,3             ; @DMA_CHAN_PAUSE
	.no_dead_strip	_sun6i_dma_terminate_all
.subsections_via_symbols
