	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_aud_set_src
_mtk_hdmi_aud_set_src:                  ## @mtk_hdmi_aud_set_src
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	12(%rdi), %r14d
	xorl	%esi, %esi
	callq	_mtk_hdmi_aud_on_off_hw_ncts
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_aud_src_disable
	movq	_GRL_CFG2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CFG2_ACLK_INV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_hdmi_clear_bits
	movq	(%rbx), %rax
	movq	_HDMI_AUD_INPUT_I2S@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.1:
	cmpl	$47999, %r14d                   ## imm = 0xBB7F
	jle	LBB0_2
## %bb.5:
	cmpl	$48000, %r14d                   ## imm = 0xBB80
	je	LBB0_4
## %bb.6:
	cmpl	$88200, %r14d                   ## imm = 0x15888
	je	LBB0_4
## %bb.7:
	cmpl	$96000, %r14d                   ## imm = 0x17700
	je	LBB0_4
	jmp	LBB0_8
LBB0_9:
	movq	_HDMI_AUD_MCLK_128FS@GOTPCREL(%rip), %rax
	cmpl	$32000, %r14d                   ## imm = 0x7D00
	je	LBB0_12
## %bb.10:
	cmpl	$44100, %r14d                   ## imm = 0xAC44
	je	LBB0_12
## %bb.11:
	cmpl	$48000, %r14d                   ## imm = 0xBB80
	je	LBB0_12
	jmp	LBB0_8
LBB0_2:
	cmpl	$32000, %r14d                   ## imm = 0x7D00
	je	LBB0_4
## %bb.3:
	cmpl	$44100, %r14d                   ## imm = 0xAC44
	jne	LBB0_8
LBB0_4:
	leaq	8(%rbx), %rax
LBB0_12:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_aud_set_mclk
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mtk_hdmi_hw_aud_set_ncts
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_aud_src_reenable
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GRL_CFG2,4,2                   ## @GRL_CFG2
	.comm	_CFG2_ACLK_INV,4,2              ## @CFG2_ACLK_INV
	.comm	_HDMI_AUD_INPUT_I2S,8,3         ## @HDMI_AUD_INPUT_I2S
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HDMI_AUD_MCLK_128FS,4,2        ## @HDMI_AUD_MCLK_128FS
	.no_dead_strip	_mtk_hdmi_aud_set_src
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hdmi_aud_set_src
_mtk_hdmi_aud_set_src:                  ; @mtk_hdmi_aud_set_src
	.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	x19, x0
	ldr	w20, [x0, #12]
	mov	w1, #0
	bl	_mtk_hdmi_aud_on_off_hw_ncts
	mov	x0, x19
	bl	_mtk_hdmi_hw_aud_src_disable
Lloh0:
	adrp	x8, _GRL_CFG2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRL_CFG2@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CFG2_ACLK_INV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CFG2_ACLK_INV@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_hdmi_clear_bits
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _HDMI_AUD_INPUT_I2S@GOTPAGE
Lloh7:
	ldr	x9, [x9, _HDMI_AUD_INPUT_I2S@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	w8, #47999
	cmp	w20, w8
	b.le	LBB0_7
; %bb.2:
	mov	w8, #48000
	cmp	w20, w8
	b.eq	LBB0_9
; %bb.3:
	mov	w8, #22664
	movk	w8, #1, lsl #16
	cmp	w20, w8
	b.eq	LBB0_9
; %bb.4:
	mov	w8, #30464
	movk	w8, #1, lsl #16
	cmp	w20, w8
	b.eq	LBB0_9
	b	LBB0_12
LBB0_5:
	mov	w8, #32000
	cmp	w20, w8
	mov	w8, #44100
	ccmp	w20, w8, #4, ne
	mov	w8, #48000
	ccmp	w20, w8, #4, ne
	b.ne	LBB0_12
; %bb.6:
Lloh9:
	adrp	x8, _HDMI_AUD_MCLK_128FS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HDMI_AUD_MCLK_128FS@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:
	mov	w8, #32000
	cmp	w20, w8
	b.eq	LBB0_9
; %bb.8:
	mov	w8, #44100
	cmp	w20, w8
	b.ne	LBB0_12
LBB0_9:
	add	x8, x19, #8
LBB0_10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mtk_hdmi_hw_aud_set_mclk
	ldr	w2, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_mtk_hdmi_hw_aud_set_ncts
	mov	x0, x19
	bl	_mtk_hdmi_hw_aud_src_reenable
	mov	w0, #0
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
LBB0_12:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GRL_CFG2,4,2                   ; @GRL_CFG2
	.comm	_CFG2_ACLK_INV,4,2              ; @CFG2_ACLK_INV
	.comm	_HDMI_AUD_INPUT_I2S,8,3         ; @HDMI_AUD_INPUT_I2S
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HDMI_AUD_MCLK_128FS,4,2        ; @HDMI_AUD_MCLK_128FS
	.no_dead_strip	_mtk_hdmi_aud_set_src
.subsections_via_symbols
