	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_uart_apdma_terminate_all
_mtk_uart_apdma_terminate_all:          ## @mtk_uart_apdma_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_to_mtk_uart_apdma_chan
	movq	%rax, %rbx
	movq	_head@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LIST_HEAD
	movq	_VFF_FLUSH@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movq	_VFF_FLUSH_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movq	_readl@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	(%r14), %rsi
	addq	32(%rbx), %rsi
	xorl	%ecx, %ecx
	movl	$10, %r8d
	movl	$100, %r9d
	callq	_readx_poll_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	16(%rbx), %rax
	movl	(%rax), %r14d
	movq	_VFF_DEBUG_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_read
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	callq	_dev_err
LBB0_2:
	movq	_VFF_STOP@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	_VFF_STOP_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movl	(%r15), %edi
	movq	_VFF_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%rbx), %rsi
	xorl	%ecx, %ecx
	movl	$10, %r8d
	movl	$100, %r9d
	callq	_readx_poll_timeout
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	16(%rbx), %rax
	movl	(%rax), %r14d
	movq	_VFF_DEBUG_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_read
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	callq	_dev_err
LBB0_4:
	movq	(%r12), %rsi
	movq	_VFF_STOP_CLR_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movq	_VFF_INT_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_VFF_INT_EN_CLR_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movq	(%rbx), %rax
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_VFF_RX_INT_CLR_B@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	movq	_VFF_TX_INT_CLR_B@GOTPCREL(%rip), %rax
LBB0_8:
	movq	_VFF_INT_FLAG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
LBB0_9:
	movl	24(%rbx), %edi
	callq	_synchronize_irq
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_head@GOTPCREL(%rip), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_vchan_get_all_descriptors
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_vchan_dma_desc_free_list
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_head,4,2                       ## @head
	.comm	_VFF_FLUSH,8,3                  ## @VFF_FLUSH
	.comm	_VFF_FLUSH_B,4,2                ## @VFF_FLUSH_B
	.comm	_readl,4,2                      ## @readl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"flush: fail, status=0x%x\n"

	.comm	_VFF_DEBUG_STATUS,4,2           ## @VFF_DEBUG_STATUS
	.comm	_VFF_STOP,8,3                   ## @VFF_STOP
	.comm	_VFF_STOP_B,4,2                 ## @VFF_STOP_B
	.comm	_VFF_EN,8,3                     ## @VFF_EN
L_.str.1:                               ## @.str.1
	.asciz	"stop: fail, status=0x%x\n"

	.comm	_VFF_STOP_CLR_B,4,2             ## @VFF_STOP_CLR_B
	.comm	_VFF_INT_EN,8,3                 ## @VFF_INT_EN
	.comm	_VFF_INT_EN_CLR_B,4,2           ## @VFF_INT_EN_CLR_B
	.comm	_DMA_DEV_TO_MEM,8,3             ## @DMA_DEV_TO_MEM
	.comm	_VFF_INT_FLAG,8,3               ## @VFF_INT_FLAG
	.comm	_VFF_RX_INT_CLR_B,4,2           ## @VFF_RX_INT_CLR_B
	.comm	_DMA_MEM_TO_DEV,8,3             ## @DMA_MEM_TO_DEV
	.comm	_VFF_TX_INT_CLR_B,4,2           ## @VFF_TX_INT_CLR_B
	.no_dead_strip	_mtk_uart_apdma_terminate_all
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_uart_apdma_terminate_all
_mtk_uart_apdma_terminate_all:          ; @mtk_uart_apdma_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
	bl	_to_mtk_uart_apdma_chan
	mov	x19, x0
Lloh0:
	adrp	x8, _head@GOTPAGE
Lloh1:
	ldr	x8, [x8, _head@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_LIST_HEAD
Lloh3:
	adrp	x20, _VFF_FLUSH@GOTPAGE
Lloh4:
	ldr	x20, [x20, _VFF_FLUSH@GOTPAGEOFF]
	ldr	x1, [x20]
Lloh5:
	adrp	x8, _VFF_FLUSH_B@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VFF_FLUSH_B@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
Lloh8:
	adrp	x22, _readl@GOTPAGE
Lloh9:
	ldr	x22, [x22, _readl@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	x8, [x19, #32]
	ldr	x9, [x20]
	add	x1, x9, x8
	mov	w3, #0
	mov	w4, #10
	mov	w5, #100
	bl	_readx_poll_timeout
Lloh10:
	adrp	x21, _VFF_DEBUG_STATUS@GOTPAGE
Lloh11:
	ldr	x21, [x21, _VFF_DEBUG_STATUS@GOTPAGEOFF]
	cbz	w0, LBB0_2
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	w20, [x8]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mtk_uart_apdma_read
	mov	x2, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_2:
Lloh14:
	adrp	x23, _VFF_STOP@GOTPAGE
Lloh15:
	ldr	x23, [x23, _VFF_STOP@GOTPAGEOFF]
	ldr	x1, [x23]
Lloh16:
	adrp	x8, _VFF_STOP_B@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VFF_STOP_B@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
	ldr	w0, [x22]
	ldr	x8, [x19, #32]
Lloh19:
	adrp	x9, _VFF_EN@GOTPAGE
Lloh20:
	ldr	x9, [x9, _VFF_EN@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w3, #0
	mov	w4, #10
	mov	w5, #100
	bl	_readx_poll_timeout
	cbz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	w20, [x8]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mtk_uart_apdma_read
	mov	x2, x0
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_4:
	ldr	x1, [x23]
Lloh24:
	adrp	x8, _VFF_STOP_CLR_B@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VFF_STOP_CLR_B@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
Lloh27:
	adrp	x8, _VFF_INT_EN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _VFF_INT_EN@GOTPAGEOFF]
Lloh29:
	ldr	x1, [x8]
Lloh30:
	adrp	x8, _VFF_INT_EN_CLR_B@GOTPAGE
Lloh31:
	ldr	x8, [x8, _VFF_INT_EN_CLR_B@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
	ldr	x8, [x19]
Lloh33:
	adrp	x9, _DMA_DEV_TO_MEM@GOTPAGE
Lloh34:
	ldr	x9, [x9, _DMA_DEV_TO_MEM@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh36:
	adrp	x8, _VFF_RX_INT_CLR_B@GOTPAGE
Lloh37:
	ldr	x8, [x8, _VFF_RX_INT_CLR_B@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh38:
	adrp	x9, _DMA_MEM_TO_DEV@GOTPAGE
Lloh39:
	ldr	x9, [x9, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
Lloh41:
	adrp	x8, _VFF_TX_INT_CLR_B@GOTPAGE
Lloh42:
	ldr	x8, [x8, _VFF_TX_INT_CLR_B@GOTPAGEOFF]
LBB0_8:
Lloh43:
	adrp	x9, _VFF_INT_FLAG@GOTPAGE
Lloh44:
	ldr	x9, [x9, _VFF_INT_FLAG@GOTPAGEOFF]
Lloh45:
	ldr	x1, [x9]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
LBB0_9:
	ldr	w0, [x19, #24]
	bl	_synchronize_irq
	add	x19, x19, #8
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh46:
	adrp	x20, _head@GOTPAGE
Lloh47:
	ldr	x20, [x20, _head@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x20
	bl	_vchan_get_all_descriptors
	mov	x0, x19
	mov	x1, x20
	bl	_vchan_dma_desc_free_list
	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	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_head,4,2                       ; @head
	.comm	_VFF_FLUSH,8,3                  ; @VFF_FLUSH
	.comm	_VFF_FLUSH_B,4,2                ; @VFF_FLUSH_B
	.comm	_readl,4,2                      ; @readl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"flush: fail, status=0x%x\n"

	.comm	_VFF_DEBUG_STATUS,4,2           ; @VFF_DEBUG_STATUS
	.comm	_VFF_STOP,8,3                   ; @VFF_STOP
	.comm	_VFF_STOP_B,4,2                 ; @VFF_STOP_B
	.comm	_VFF_EN,8,3                     ; @VFF_EN
l_.str.1:                               ; @.str.1
	.asciz	"stop: fail, status=0x%x\n"

	.comm	_VFF_STOP_CLR_B,4,2             ; @VFF_STOP_CLR_B
	.comm	_VFF_INT_EN,8,3                 ; @VFF_INT_EN
	.comm	_VFF_INT_EN_CLR_B,4,2           ; @VFF_INT_EN_CLR_B
	.comm	_DMA_DEV_TO_MEM,8,3             ; @DMA_DEV_TO_MEM
	.comm	_VFF_INT_FLAG,8,3               ; @VFF_INT_FLAG
	.comm	_VFF_RX_INT_CLR_B,4,2           ; @VFF_RX_INT_CLR_B
	.comm	_DMA_MEM_TO_DEV,8,3             ; @DMA_MEM_TO_DEV
	.comm	_VFF_TX_INT_CLR_B,4,2           ; @VFF_TX_INT_CLR_B
	.no_dead_strip	_mtk_uart_apdma_terminate_all
.subsections_via_symbols
