	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_uart_apdma_start_tx
_mtk_uart_apdma_start_tx:               ## @mtk_uart_apdma_start_tx
	.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
	movq	8(%rdi), %rdi
	callq	_to_mtk_uart_apdma_dev
	movq	%rax, %r15
	movq	(%rbx), %r13
	movl	16(%rbx), %r14d
	movq	_VFF_LEN@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_read
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	_VFF_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movl	(%r12), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_mtk_uart_apdma_write
	movq	_VFF_THRE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r14d, %edi
	callq	_VFF_TX_THRE
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_mtk_uart_apdma_write
	movq	_VFF_WPT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtk_uart_apdma_write
	movq	_VFF_INT_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VFF_TX_INT_CLR_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	cmpq	$0, (%r15)
	je	LBB0_3
## %bb.2:
	movq	_VFF_4G_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VFF_4G_EN_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
LBB0_3:
	movq	_VFF_EN@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_VFF_EN_B@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_read
	cmpl	(%r12), %eax
	je	LBB0_5
## %bb.4:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_5:
	movq	_VFF_LEFT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_read
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	_VFF_WPT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_read
	movq	(%rbx), %rcx
	addl	8(%rcx), %eax
	movq	_VFF_RING_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_VFF_RING_WRAP@GOTPCREL(%rip), %rsi
	movl	%eax, %edx
	notl	%edx
	andl	(%rsi), %edx
	cmpl	%r14d, %ecx
	cmovnel	%eax, %edx
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movq	_VFF_INT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VFF_TX_INT_EN_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_write
	movq	_VFF_FLUSH@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_mtk_uart_apdma_read
	testl	%eax, %eax
	je	LBB0_8
## %bb.10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_VFF_TX_INT_EN_B@GOTPCREL(%rip), %rax
	movq	_VFF_INT_EN@GOTPCREL(%rip), %r14
	jmp	LBB0_9
LBB0_8:
	movq	_VFF_FLUSH_B@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%r14), %esi
	movl	(%rax), %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_uart_apdma_write           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VFF_LEN,4,2                    ## @VFF_LEN
	.comm	_VFF_ADDR,4,2                   ## @VFF_ADDR
	.comm	_VFF_THRE,4,2                   ## @VFF_THRE
	.comm	_VFF_WPT,4,2                    ## @VFF_WPT
	.comm	_VFF_INT_FLAG,4,2               ## @VFF_INT_FLAG
	.comm	_VFF_TX_INT_CLR_B,4,2           ## @VFF_TX_INT_CLR_B
	.comm	_VFF_4G_SUPPORT,4,2             ## @VFF_4G_SUPPORT
	.comm	_VFF_4G_EN_B,4,2                ## @VFF_4G_EN_B
	.comm	_VFF_EN,4,2                     ## @VFF_EN
	.comm	_VFF_EN_B,4,2                   ## @VFF_EN_B
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Enable TX fail\n"

	.comm	_VFF_LEFT_SIZE,4,2              ## @VFF_LEFT_SIZE
	.comm	_VFF_INT_EN,4,2                 ## @VFF_INT_EN
	.comm	_VFF_TX_INT_EN_B,4,2            ## @VFF_TX_INT_EN_B
	.comm	_VFF_RING_SIZE,4,2              ## @VFF_RING_SIZE
	.comm	_VFF_RING_WRAP,4,2              ## @VFF_RING_WRAP
	.comm	_VFF_FLUSH,4,2                  ## @VFF_FLUSH
	.comm	_VFF_FLUSH_B,4,2                ## @VFF_FLUSH_B
	.no_dead_strip	_mtk_uart_apdma_start_tx
.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_start_tx
_mtk_uart_apdma_start_tx:               ; @mtk_uart_apdma_start_tx
	.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	x0, [x0, #8]
	bl	_to_mtk_uart_apdma_dev
	mov	x21, x0
	ldr	x23, [x19]
	ldr	w20, [x19, #16]
Lloh0:
	adrp	x22, _VFF_LEN@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VFF_LEN@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_mtk_uart_apdma_read
	cbnz	w0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _VFF_ADDR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VFF_ADDR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x20
	bl	_mtk_uart_apdma_write
Lloh5:
	adrp	x8, _VFF_THRE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VFF_THRE@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_VFF_TX_THRE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_mtk_uart_apdma_write
Lloh8:
	adrp	x8, _VFF_WPT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VFF_WPT@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_mtk_uart_apdma_write
Lloh11:
	adrp	x8, _VFF_INT_FLAG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VFF_INT_FLAG@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _VFF_TX_INT_CLR_B@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VFF_TX_INT_CLR_B@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
	ldr	x8, [x21]
	cbz	x8, LBB0_3
; %bb.2:
Lloh17:
	adrp	x8, _VFF_4G_SUPPORT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _VFF_4G_SUPPORT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _VFF_4G_EN_B@GOTPAGE
Lloh21:
	ldr	x8, [x8, _VFF_4G_EN_B@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
LBB0_3:
Lloh23:
	adrp	x21, _VFF_EN@GOTPAGE
Lloh24:
	ldr	x21, [x21, _VFF_EN@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh25:
	adrp	x22, _VFF_EN_B@GOTPAGE
Lloh26:
	ldr	x22, [x22, _VFF_EN_B@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mtk_uart_apdma_read
	ldr	w8, [x22]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.4:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_5:
Lloh29:
	adrp	x8, _VFF_LEFT_SIZE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _VFF_LEFT_SIZE@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mtk_uart_apdma_read
Lloh32:
	adrp	x22, _VFF_TX_INT_EN_B@GOTPAGE
Lloh33:
	ldr	x22, [x22, _VFF_TX_INT_EN_B@GOTPAGEOFF]
Lloh34:
	adrp	x21, _VFF_INT_EN@GOTPAGE
Lloh35:
	ldr	x21, [x21, _VFF_INT_EN@GOTPAGEOFF]
	cbz	w0, LBB0_9
; %bb.6:
Lloh36:
	adrp	x23, _VFF_WPT@GOTPAGE
Lloh37:
	ldr	x23, [x23, _VFF_WPT@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_mtk_uart_apdma_read
	ldr	x8, [x19]
	ldr	w8, [x8, #8]
Lloh38:
	adrp	x9, _VFF_RING_SIZE@GOTPAGE
Lloh39:
	ldr	x9, [x9, _VFF_RING_SIZE@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
Lloh41:
	adrp	x10, _VFF_RING_WRAP@GOTPAGE
Lloh42:
	ldr	x10, [x10, _VFF_RING_WRAP@GOTPAGEOFF]
	add	w8, w0, w8
	and	w9, w8, w9
Lloh43:
	ldr	w10, [x10]
	bic	w10, w10, w8
	cmp	w9, w20
	csel	w2, w10, w8, eq
	ldr	w1, [x23]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_mtk_uart_apdma_write
Lloh44:
	adrp	x21, _VFF_FLUSH@GOTPAGE
Lloh45:
	ldr	x21, [x21, _VFF_FLUSH@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mtk_uart_apdma_read
	cbz	w0, LBB0_8
; %bb.7:
	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
LBB0_8:
Lloh46:
	adrp	x22, _VFF_FLUSH_B@GOTPAGE
Lloh47:
	ldr	x22, [x22, _VFF_FLUSH_B@GOTPAGEOFF]
LBB0_9:
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	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
	b	_mtk_uart_apdma_write
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_VFF_LEN,4,2                    ; @VFF_LEN
	.comm	_VFF_ADDR,4,2                   ; @VFF_ADDR
	.comm	_VFF_THRE,4,2                   ; @VFF_THRE
	.comm	_VFF_WPT,4,2                    ; @VFF_WPT
	.comm	_VFF_INT_FLAG,4,2               ; @VFF_INT_FLAG
	.comm	_VFF_TX_INT_CLR_B,4,2           ; @VFF_TX_INT_CLR_B
	.comm	_VFF_4G_SUPPORT,4,2             ; @VFF_4G_SUPPORT
	.comm	_VFF_4G_EN_B,4,2                ; @VFF_4G_EN_B
	.comm	_VFF_EN,4,2                     ; @VFF_EN
	.comm	_VFF_EN_B,4,2                   ; @VFF_EN_B
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Enable TX fail\n"

	.comm	_VFF_LEFT_SIZE,4,2              ; @VFF_LEFT_SIZE
	.comm	_VFF_INT_EN,4,2                 ; @VFF_INT_EN
	.comm	_VFF_TX_INT_EN_B,4,2            ; @VFF_TX_INT_EN_B
	.comm	_VFF_RING_SIZE,4,2              ; @VFF_RING_SIZE
	.comm	_VFF_RING_WRAP,4,2              ; @VFF_RING_WRAP
	.comm	_VFF_FLUSH,4,2                  ; @VFF_FLUSH
	.comm	_VFF_FLUSH_B,4,2                ; @VFF_FLUSH_B
	.no_dead_strip	_mtk_uart_apdma_start_tx
.subsections_via_symbols
