	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_uart_apdma_alloc_chan_resources
_mtk_uart_apdma_alloc_chan_resources:   ## @mtk_uart_apdma_alloc_chan_resources
	.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
	movq	%rdi, %r14
	movq	(%rdi), %rdi
	callq	_to_mtk_uart_apdma_dev
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_mtk_uart_apdma_chan
	movq	%rax, %r12
	movl	8(%r15), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_VFF_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_mtk_uart_apdma_write
	movq	_VFF_THRE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_mtk_uart_apdma_write
	movq	_VFF_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_mtk_uart_apdma_write
	movq	_VFF_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VFF_WARM_RST_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_mtk_uart_apdma_write
	movq	_readl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VFF_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	xorl	%ecx, %ecx
	movl	$10, %r8d
	movl	$100, %r9d
	callq	_readx_poll_timeout
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movl	(%r12), %edi
	movq	_mtk_uart_apdma_irq_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQF_TRIGGER_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_KBUILD_MODNAME@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %r8
	callq	_request_irq
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	%eax, %ebx
	cmpq	$0, (%r15)
	je	LBB0_7
## %bb.6:
	movq	_VFF_4G_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VFF_4G_SUPPORT_CLR_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_mtk_uart_apdma_write
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %ebx
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_pm_runtime_put_noidle
	jmp	LBB0_7
LBB0_4:
	movq	(%r14), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VFF_ADDR,4,2                   ## @VFF_ADDR
	.comm	_VFF_THRE,4,2                   ## @VFF_THRE
	.comm	_VFF_LEN,4,2                    ## @VFF_LEN
	.comm	_VFF_RST,4,2                    ## @VFF_RST
	.comm	_VFF_WARM_RST_B,4,2             ## @VFF_WARM_RST_B
	.comm	_readl,4,2                      ## @readl
	.comm	_VFF_EN,8,3                     ## @VFF_EN
	.comm	_mtk_uart_apdma_irq_handler,4,2 ## @mtk_uart_apdma_irq_handler
	.comm	_IRQF_TRIGGER_NONE,4,2          ## @IRQF_TRIGGER_NONE
	.comm	_KBUILD_MODNAME,4,2             ## @KBUILD_MODNAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't request dma IRQ\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VFF_4G_SUPPORT,4,2             ## @VFF_4G_SUPPORT
	.comm	_VFF_4G_SUPPORT_CLR_B,4,2       ## @VFF_4G_SUPPORT_CLR_B
	.no_dead_strip	_mtk_uart_apdma_alloc_chan_resources
.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_alloc_chan_resources
_mtk_uart_apdma_alloc_chan_resources:   ; @mtk_uart_apdma_alloc_chan_resources
	.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	x0, [x0]
	bl	_to_mtk_uart_apdma_dev
	mov	x21, x0
	mov	x0, x19
	bl	_to_mtk_uart_apdma_chan
	mov	x20, x0
	ldr	w0, [x21, #8]
	bl	_pm_runtime_get_sync
	tbnz	w0, #31, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _VFF_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VFF_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_mtk_uart_apdma_write
Lloh3:
	adrp	x8, _VFF_THRE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VFF_THRE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_mtk_uart_apdma_write
Lloh6:
	adrp	x8, _VFF_LEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VFF_LEN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_mtk_uart_apdma_write
Lloh9:
	adrp	x8, _VFF_RST@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VFF_RST@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _VFF_WARM_RST_B@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VFF_WARM_RST_B@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mtk_uart_apdma_write
Lloh15:
	adrp	x8, _readl@GOTPAGE
Lloh16:
	ldr	x8, [x8, _readl@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	x8, [x20, #8]
Lloh18:
	adrp	x9, _VFF_EN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _VFF_EN@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w3, #0
	mov	w4, #10
	mov	w5, #100
	bl	_readx_poll_timeout
	mov	x22, x0
	cbnz	w0, LBB0_7
; %bb.2:
	ldr	w0, [x20]
Lloh21:
	adrp	x8, _mtk_uart_apdma_irq_handler@GOTPAGE
Lloh22:
	ldr	x8, [x8, _mtk_uart_apdma_irq_handler@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _IRQF_TRIGGER_NONE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IRQF_TRIGGER_NONE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
Lloh27:
	adrp	x8, _KBUILD_MODNAME@GOTPAGE
Lloh28:
	ldr	x8, [x8, _KBUILD_MODNAME@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
	mov	x4, x19
	bl	_request_irq
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	x22, x0
	ldr	x8, [x21]
	cbz	x8, LBB0_7
; %bb.4:
Lloh30:
	adrp	x8, _VFF_4G_SUPPORT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _VFF_4G_SUPPORT@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x8, _VFF_4G_SUPPORT_CLR_B@GOTPAGE
Lloh34:
	ldr	x8, [x8, _VFF_4G_SUPPORT_CLR_B@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mtk_uart_apdma_write
	b	LBB0_7
LBB0_5:
	mov	x22, x0
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_pm_runtime_put_noidle
	b	LBB0_7
LBB0_6:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh36:
	adrp	x1, l_.str@PAGE
Lloh37:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh38:
	adrp	x8, _EINVAL@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x22
	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	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
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_VFF_ADDR,4,2                   ; @VFF_ADDR
	.comm	_VFF_THRE,4,2                   ; @VFF_THRE
	.comm	_VFF_LEN,4,2                    ; @VFF_LEN
	.comm	_VFF_RST,4,2                    ; @VFF_RST
	.comm	_VFF_WARM_RST_B,4,2             ; @VFF_WARM_RST_B
	.comm	_readl,4,2                      ; @readl
	.comm	_VFF_EN,8,3                     ; @VFF_EN
	.comm	_mtk_uart_apdma_irq_handler,4,2 ; @mtk_uart_apdma_irq_handler
	.comm	_IRQF_TRIGGER_NONE,4,2          ; @IRQF_TRIGGER_NONE
	.comm	_KBUILD_MODNAME,4,2             ; @KBUILD_MODNAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't request dma IRQ\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VFF_4G_SUPPORT,4,2             ; @VFF_4G_SUPPORT
	.comm	_VFF_4G_SUPPORT_CLR_B,4,2       ; @VFF_4G_SUPPORT_CLR_B
	.no_dead_strip	_mtk_uart_apdma_alloc_chan_resources
.subsections_via_symbols
