	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_cqdma_remove
_mtk_cqdma_remove:                      ## @mtk_cqdma_remove
	.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, %r14
	callq	_platform_get_drvdata
	movq	%rax, %r15
	cmpl	$0, (%rax)
	jle	LBB0_3
## %bb.1:
	movl	$4, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %r13
	leaq	(%rbx,%r13), %rdi
	callq	_list_del
	leaq	(%rbx,%r13), %rdi
	addq	$-4, %rdi
	callq	_tasklet_kill
	incq	%r12
	movslq	(%r15), %rax
	addq	$8, %rbx
	cmpq	%rax, %r12
	jl	LBB0_2
LBB0_3:
	cmpl	$0, 4(%r15)
	jle	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	movq	_MTK_CQDMA_INT_EN@GOTPCREL(%rip), %r12
	movq	_MTK_CQDMA_INT_EN_BIT@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	$8, %rdi
	callq	_spin_lock_irqsave
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	movl	(%r12), %esi
	movl	(%r13), %edx
	callq	_mtk_dma_clr
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	$8, %rdi
	callq	_spin_unlock_irqrestore
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rax
	movl	4(%rax), %edi
	callq	_synchronize_irq
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_tasklet_kill
	incq	%rbx
	movslq	4(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_5
LBB0_6:
	movq	%r15, %rdi
	callq	_mtk_cqdma_hw_deinit
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_dma_async_device_unregister
	movl	(%r14), %edi
	callq	_of_dma_controller_free
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_CQDMA_INT_EN,4,2           ## @MTK_CQDMA_INT_EN
	.comm	_MTK_CQDMA_INT_EN_BIT,4,2       ## @MTK_CQDMA_INT_EN_BIT
	.no_dead_strip	_mtk_cqdma_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_cqdma_remove
_mtk_cqdma_remove:                      ; @mtk_cqdma_remove
	.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
	bl	_platform_get_drvdata
	mov	x20, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x22, #0
	mov	w23, #4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	add	x21, x8, x23
	mov	x0, x21
	bl	_list_del
	sub	x0, x21, #4
	bl	_tasklet_kill
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x23, x23, #8
	cmp	x22, x8
	b.lt	LBB0_2
LBB0_3:
	ldr	w8, [x20, #4]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x21, #0
Lloh0:
	adrp	x22, _MTK_CQDMA_INT_EN@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MTK_CQDMA_INT_EN@GOTPAGEOFF]
Lloh2:
	adrp	x23, _MTK_CQDMA_INT_EN_BIT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _MTK_CQDMA_INT_EN_BIT@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	lsl	x24, x21, #3
	ldr	x8, [x8, x24]
	add	x0, x8, #8
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #16]
	ldr	x0, [x8, x24]
	ldr	w1, [x22]
	ldr	w2, [x23]
	bl	_mtk_dma_clr
	ldr	x8, [x20, #16]
	ldr	x8, [x8, x24]
	add	x0, x8, #8
	bl	_spin_unlock_irqrestore
	ldr	x8, [x20, #16]
	ldr	x8, [x8, x24]
	ldr	w0, [x8, #4]
	bl	_synchronize_irq
	ldr	x8, [x20, #16]
	ldr	x0, [x8, x24]
	bl	_tasklet_kill
	add	x21, x21, #1
	ldrsw	x8, [x20, #4]
	cmp	x21, x8
	b.lt	LBB0_5
LBB0_6:
	mov	x0, x20
	bl	_mtk_cqdma_hw_deinit
	add	x0, x20, #8
	bl	_dma_async_device_unregister
	ldr	w0, [x19]
	bl	_of_dma_controller_free
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_CQDMA_INT_EN,4,2           ; @MTK_CQDMA_INT_EN
	.comm	_MTK_CQDMA_INT_EN_BIT,4,2       ; @MTK_CQDMA_INT_EN_BIT
	.no_dead_strip	_mtk_cqdma_remove
.subsections_via_symbols
