	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_aic_init
_mtk_aic_init:                          ## @mtk_aic_init
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_mtk_aic_cap_check
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	_MTK_RING_MAX@GOTPCREL(%rip), %rax
	movq	(%r15), %r12
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_AIC_G_ENABLE_CTRL@GOTPCREL(%rip), %rax
	addq	(%rax), %r12
	xorl	%edi, %edi
	movq	%r12, %rsi
	callq	_writel
	movq	_AIC_G_POL_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_AIC_G_TYPE_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	xorl	%edi, %edi
	callq	_writel
	movq	_AIC_G_ENABLE_SET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	jmp	LBB0_4
LBB0_3:
	movl	%ebx, %edi
	callq	_AIC_ENABLE_CTRL
	addq	%rax, %r12
	xorl	%edi, %edi
	movq	%r12, %rsi
	callq	_writel
	movq	(%r15), %r12
	movl	%ebx, %edi
	callq	_AIC_POL_CTRL
	addq	%rax, %r12
	xorl	%edi, %edi
	movq	%r12, %rsi
	callq	_writel
	movq	(%r15), %r12
	movl	%ebx, %edi
	callq	_AIC_TYPE_CTRL
	addq	%rax, %r12
	xorl	%edi, %edi
	movq	%r12, %rsi
	callq	_writel
	movq	(%r15), %r15
	movl	%ebx, %edi
	callq	_AIC_ENABLE_SET
	movq	%rax, %rsi
	addq	%r15, %rsi
LBB0_4:
	xorl	%edi, %edi
	callq	_writel
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_RING_MAX,4,2               ## @MTK_RING_MAX
	.comm	_AIC_G_ENABLE_CTRL,8,3          ## @AIC_G_ENABLE_CTRL
	.comm	_AIC_G_POL_CTRL,8,3             ## @AIC_G_POL_CTRL
	.comm	_AIC_G_TYPE_CTRL,8,3            ## @AIC_G_TYPE_CTRL
	.comm	_AIC_G_ENABLE_SET,8,3           ## @AIC_G_ENABLE_SET
	.no_dead_strip	_mtk_aic_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_aic_init
_mtk_aic_init:                          ; @mtk_aic_init
	.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	x21, x1
	mov	x20, x0
	bl	_mtk_aic_cap_check
	mov	x19, x0
	cbnz	w0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _MTK_RING_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTK_RING_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x22, [x20]
	cmp	w8, w21
	b.ne	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _AIC_G_ENABLE_CTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AIC_G_ENABLE_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x1, x8, x22
	mov	w0, #0
	bl	_writel
	ldr	x8, [x20]
Lloh6:
	adrp	x9, _AIC_G_POL_CTRL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AIC_G_POL_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x20]
Lloh9:
	adrp	x9, _AIC_G_TYPE_CTRL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AIC_G_TYPE_CTRL@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x20]
Lloh12:
	adrp	x9, _AIC_G_ENABLE_SET@GOTPAGE
Lloh13:
	ldr	x9, [x9, _AIC_G_ENABLE_SET@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	b	LBB0_4
LBB0_3:
	mov	x0, x21
	bl	_AIC_ENABLE_CTRL
	add	x1, x0, x22
	mov	w0, #0
	bl	_writel
	ldr	x22, [x20]
	mov	x0, x21
	bl	_AIC_POL_CTRL
	add	x1, x0, x22
	mov	w0, #0
	bl	_writel
	ldr	x22, [x20]
	mov	x0, x21
	bl	_AIC_TYPE_CTRL
	add	x1, x0, x22
	mov	w0, #0
	bl	_writel
	ldr	x20, [x20]
	mov	x0, x21
	bl	_AIC_ENABLE_SET
	add	x1, x0, x20
LBB0_4:
	mov	w0, #0
	bl	_writel
LBB0_5:
	mov	x0, x19
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_RING_MAX,4,2               ; @MTK_RING_MAX
	.comm	_AIC_G_ENABLE_CTRL,8,3          ; @AIC_G_ENABLE_CTRL
	.comm	_AIC_G_POL_CTRL,8,3             ; @AIC_G_POL_CTRL
	.comm	_AIC_G_TYPE_CTRL,8,3            ; @AIC_G_TYPE_CTRL
	.comm	_AIC_G_ENABLE_SET,8,3           ; @AIC_G_ENABLE_SET
	.no_dead_strip	_mtk_aic_init
.subsections_via_symbols
