	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_aic_cap_check
_mtk_aic_cap_check:                     ## @mtk_aic_cap_check
	.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, %r12d
	movq	%rdi, %r14
	movq	_MTK_RING_MAX@GOTPCREL(%rip), %r15
	movq	(%rdi), %rbx
	cmpl	%esi, (%r15)
	jne	LBB0_2
## %bb.1:
	movq	_AIC_G_VERSION@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	jmp	LBB0_3
LBB0_2:
	movl	%r12d, %edi
	callq	_AIC_VERSION
	movq	%rax, %rdi
LBB0_3:
	addq	%rbx, %rdi
	callq	_readl
	movq	_MTK_AIC_VER_MSK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_MTK_AIC_VER11@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_5
## %bb.4:
	movq	_MTK_AIC_VER12@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_10
LBB0_5:
	movq	(%r14), %rbx
	cmpl	%r12d, (%r15)
	jne	LBB0_7
## %bb.6:
	movq	_AIC_G_OPTIONS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	jmp	LBB0_8
LBB0_7:
	movl	%r12d, %edi
	callq	_AIC_OPTIONS
	movq	%rax, %rdi
LBB0_8:
	addq	%rbx, %rdi
	callq	_readl
	movl	%eax, %ecx
	movq	_MTK_AIC_INT_MSK@GOTPCREL(%rip), %rax
	andl	(%rax), %ecx
	je	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	cmpl	$33, %ecx
	jl	LBB0_11
LBB0_10:
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	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_VERSION,8,3              ## @AIC_G_VERSION
	.comm	_MTK_AIC_VER_MSK,4,2            ## @MTK_AIC_VER_MSK
	.comm	_MTK_AIC_VER11,4,2              ## @MTK_AIC_VER11
	.comm	_MTK_AIC_VER12,4,2              ## @MTK_AIC_VER12
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_AIC_G_OPTIONS,8,3              ## @AIC_G_OPTIONS
	.comm	_MTK_AIC_INT_MSK,4,2            ## @MTK_AIC_INT_MSK
	.no_dead_strip	_mtk_aic_cap_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_aic_cap_check
_mtk_aic_cap_check:                     ; @mtk_aic_cap_check
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _MTK_RING_MAX@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MTK_RING_MAX@GOTPAGEOFF]
	ldr	w8, [x21]
	ldr	x22, [x0]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _AIC_G_VERSION@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AIC_G_VERSION@GOTPAGEOFF]
Lloh4:
	ldr	x0, [x8]
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_AIC_VERSION
LBB0_3:
	add	x0, x0, x22
	bl	_readl
Lloh5:
	adrp	x8, _MTK_AIC_VER_MSK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MTK_AIC_VER_MSK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh8:
	adrp	x9, _MTK_AIC_VER11@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MTK_AIC_VER11@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _MTK_AIC_VER12@GOTPAGE
Lloh12:
	ldr	x10, [x10, _MTK_AIC_VER12@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_10
; %bb.4:
	ldr	w8, [x21]
	ldr	x20, [x20]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.5:
Lloh14:
	adrp	x8, _AIC_G_OPTIONS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AIC_G_OPTIONS@GOTPAGEOFF]
Lloh16:
	ldr	x0, [x8]
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_AIC_OPTIONS
LBB0_7:
	add	x0, x0, x20
	bl	_readl
Lloh17:
	adrp	x8, _MTK_AIC_INT_MSK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MTK_AIC_INT_MSK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ands	w8, w8, w0
	b.eq	LBB0_10
; %bb.8:
	cmp	w8, #33
	b.ge	LBB0_10
; %bb.9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh20:
	adrp	x8, _ENXIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_RING_MAX,4,2               ; @MTK_RING_MAX
	.comm	_AIC_G_VERSION,8,3              ; @AIC_G_VERSION
	.comm	_MTK_AIC_VER_MSK,4,2            ; @MTK_AIC_VER_MSK
	.comm	_MTK_AIC_VER11,4,2              ; @MTK_AIC_VER11
	.comm	_MTK_AIC_VER12,4,2              ; @MTK_AIC_VER12
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_AIC_G_OPTIONS,8,3              ; @AIC_G_OPTIONS
	.comm	_MTK_AIC_INT_MSK,4,2            ; @MTK_AIC_INT_MSK
	.no_dead_strip	_mtk_aic_cap_check
.subsections_via_symbols
