	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hsdma_free_pchan
_mtk_hsdma_free_pchan:                  ## @mtk_hsdma_free_pchan
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_MTK_HSDMA_GLO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MTK_HSDMA_GLO_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_mtk_dma_clr
	movq	%rbx, %rdi
	callq	_mtk_hsdma_busy_wait
	movq	_MTK_HSDMA_INT_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MTK_HSDMA_INT_RXDONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_dma_clr
	movq	_MTK_HSDMA_TX_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtk_dma_write
	movq	_MTK_HSDMA_TX_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtk_dma_write
	movq	_MTK_HSDMA_TX_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtk_dma_write
	movq	_MTK_HSDMA_RX_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtk_dma_write
	movq	_MTK_HSDMA_RX_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtk_dma_write
	movq	_MTK_HSDMA_RX_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MTK_DMA_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	decq	%rdx
	movq	%rbx, %rdi
	callq	_mtk_dma_write
	movl	12(%r14), %edi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_hsdma2dev
	movl	8(%r14), %edx
	movl	(%r14), %esi
	movl	4(%r14), %ecx
	movl	%eax, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dma_free_coherent              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_HSDMA_GLO,4,2              ## @MTK_HSDMA_GLO
	.comm	_MTK_HSDMA_GLO_DMA,4,2          ## @MTK_HSDMA_GLO_DMA
	.comm	_MTK_HSDMA_INT_ENABLE,4,2       ## @MTK_HSDMA_INT_ENABLE
	.comm	_MTK_HSDMA_INT_RXDONE,4,2       ## @MTK_HSDMA_INT_RXDONE
	.comm	_MTK_HSDMA_TX_BASE,4,2          ## @MTK_HSDMA_TX_BASE
	.comm	_MTK_HSDMA_TX_CNT,4,2           ## @MTK_HSDMA_TX_CNT
	.comm	_MTK_HSDMA_TX_CPU,4,2           ## @MTK_HSDMA_TX_CPU
	.comm	_MTK_HSDMA_RX_BASE,4,2          ## @MTK_HSDMA_RX_BASE
	.comm	_MTK_HSDMA_RX_CNT,4,2           ## @MTK_HSDMA_RX_CNT
	.comm	_MTK_HSDMA_RX_CPU,4,2           ## @MTK_HSDMA_RX_CPU
	.comm	_MTK_DMA_SIZE,8,3               ## @MTK_DMA_SIZE
	.no_dead_strip	_mtk_hsdma_free_pchan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hsdma_free_pchan
_mtk_hsdma_free_pchan:                  ; @mtk_hsdma_free_pchan
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _MTK_HSDMA_GLO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTK_HSDMA_GLO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MTK_HSDMA_GLO_DMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTK_HSDMA_GLO_DMA@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_mtk_dma_clr
	mov	x0, x20
	bl	_mtk_hsdma_busy_wait
Lloh6:
	adrp	x8, _MTK_HSDMA_INT_ENABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTK_HSDMA_INT_ENABLE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _MTK_HSDMA_INT_RXDONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MTK_HSDMA_INT_RXDONE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mtk_dma_clr
Lloh12:
	adrp	x8, _MTK_HSDMA_TX_BASE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MTK_HSDMA_TX_BASE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_mtk_dma_write
Lloh15:
	adrp	x8, _MTK_HSDMA_TX_CNT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MTK_HSDMA_TX_CNT@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_mtk_dma_write
Lloh18:
	adrp	x8, _MTK_HSDMA_TX_CPU@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MTK_HSDMA_TX_CPU@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_mtk_dma_write
Lloh21:
	adrp	x8, _MTK_HSDMA_RX_BASE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MTK_HSDMA_RX_BASE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_mtk_dma_write
Lloh24:
	adrp	x8, _MTK_HSDMA_RX_CNT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MTK_HSDMA_RX_CNT@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	bl	_mtk_dma_write
Lloh27:
	adrp	x8, _MTK_HSDMA_RX_CPU@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MTK_HSDMA_RX_CPU@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _MTK_DMA_SIZE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MTK_DMA_SIZE@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	sub	x2, x8, #1
	mov	x0, x20
	bl	_mtk_dma_write
	ldr	w0, [x19, #12]
	bl	_kfree
	mov	x0, x20
	bl	_hsdma2dev
	ldp	w3, w2, [x19, #4]
	ldr	w1, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dma_free_coherent
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_HSDMA_GLO,4,2              ; @MTK_HSDMA_GLO
	.comm	_MTK_HSDMA_GLO_DMA,4,2          ; @MTK_HSDMA_GLO_DMA
	.comm	_MTK_HSDMA_INT_ENABLE,4,2       ; @MTK_HSDMA_INT_ENABLE
	.comm	_MTK_HSDMA_INT_RXDONE,4,2       ; @MTK_HSDMA_INT_RXDONE
	.comm	_MTK_HSDMA_TX_BASE,4,2          ; @MTK_HSDMA_TX_BASE
	.comm	_MTK_HSDMA_TX_CNT,4,2           ; @MTK_HSDMA_TX_CNT
	.comm	_MTK_HSDMA_TX_CPU,4,2           ; @MTK_HSDMA_TX_CPU
	.comm	_MTK_HSDMA_RX_BASE,4,2          ; @MTK_HSDMA_RX_BASE
	.comm	_MTK_HSDMA_RX_CNT,4,2           ; @MTK_HSDMA_RX_CNT
	.comm	_MTK_HSDMA_RX_CPU,4,2           ; @MTK_HSDMA_RX_CPU
	.comm	_MTK_DMA_SIZE,8,3               ; @MTK_DMA_SIZE
	.no_dead_strip	_mtk_hsdma_free_pchan
.subsections_via_symbols
