	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_aud_set_input
_mtk_hdmi_aud_set_input:                ## @mtk_hdmi_aud_set_input
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_HDMI_AUD_SWAP_LFE_CC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mtk_hdmi_hw_aud_set_channel_swap
	movq	_GRL_MIX_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MIX_CTRL_FLAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mtk_hdmi_set_bits
	movq	(%rbx), %rax
	movq	_HDMI_AUD_INPUT_SPDIF@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_3
## %bb.1:
	movq	8(%rbx), %rax
	movq	_HDMI_AUDIO_CODING_TYPE_DST@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	_HDMI_AUDIO_SAMPLE_SIZE_24@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_aud_set_bit_num
	movq	16(%rbx), %rsi
	jmp	LBB0_5
LBB0_3:
	movq	16(%rbx), %rsi
	movq	_HDMI_I2S_MODE_LJT_24BIT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_5
## %bb.4:
	movq	_HDMI_I2S_MODE_LJT_16BIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rsi, 16(%rbx)
LBB0_5:
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_aud_set_i2s_fmt
	movq	_HDMI_AUDIO_SAMPLE_SIZE_24@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_aud_set_bit_num
	movq	(%rbx), %rax
	xorl	%esi, %esi
	cmpq	(%r14), %rax
	jne	LBB0_7
## %bb.6:
	movq	8(%rbx), %rax
	movq	_HDMI_AUDIO_CODING_TYPE_DST@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	sete	%sil
LBB0_7:
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_audio_config
	movq	(%rbx), %rax
	cmpq	(%r14), %rax
	jne	LBB0_8
## %bb.9:
	movq	_HDMI_AUD_CHAN_TYPE_2_0@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	leaq	24(%rbx), %rax
LBB0_10:
	movl	(%rax), %r14d
	movl	%r14d, %edi
	callq	_mtk_hdmi_aud_get_chnl_count
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_mtk_hdmi_hw_aud_set_i2s_chan_num
	movq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_aud_set_input_type
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_AUD_SWAP_LFE_CC,4,2       ## @HDMI_AUD_SWAP_LFE_CC
	.comm	_GRL_MIX_CTRL,4,2               ## @GRL_MIX_CTRL
	.comm	_MIX_CTRL_FLAT,4,2              ## @MIX_CTRL_FLAT
	.comm	_HDMI_AUD_INPUT_SPDIF,8,3       ## @HDMI_AUD_INPUT_SPDIF
	.comm	_HDMI_AUDIO_CODING_TYPE_DST,8,3 ## @HDMI_AUDIO_CODING_TYPE_DST
	.comm	_HDMI_AUDIO_SAMPLE_SIZE_24,4,2  ## @HDMI_AUDIO_SAMPLE_SIZE_24
	.comm	_HDMI_I2S_MODE_LJT_24BIT,8,3    ## @HDMI_I2S_MODE_LJT_24BIT
	.comm	_HDMI_I2S_MODE_LJT_16BIT,8,3    ## @HDMI_I2S_MODE_LJT_16BIT
	.comm	_HDMI_AUD_CHAN_TYPE_2_0,4,2     ## @HDMI_AUD_CHAN_TYPE_2_0
	.no_dead_strip	_mtk_hdmi_aud_set_input
.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_input
_mtk_hdmi_aud_set_input:                ; @mtk_hdmi_aud_set_input
	.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
Lloh0:
	adrp	x8, _HDMI_AUD_SWAP_LFE_CC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDMI_AUD_SWAP_LFE_CC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mtk_hdmi_hw_aud_set_channel_swap
Lloh3:
	adrp	x8, _GRL_MIX_CTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GRL_MIX_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _MIX_CTRL_FLAT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MIX_CTRL_FLAT@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mtk_hdmi_set_bits
	ldr	x8, [x19]
Lloh9:
	adrp	x20, _HDMI_AUD_INPUT_SPDIF@GOTPAGE
Lloh10:
	ldr	x20, [x20, _HDMI_AUD_INPUT_SPDIF@GOTPAGEOFF]
	ldr	x9, [x20]
Lloh11:
	adrp	x21, _HDMI_AUDIO_SAMPLE_SIZE_24@GOTPAGE
Lloh12:
	ldr	x21, [x21, _HDMI_AUDIO_SAMPLE_SIZE_24@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
Lloh13:
	adrp	x9, _HDMI_AUDIO_CODING_TYPE_DST@GOTPAGE
Lloh14:
	ldr	x9, [x9, _HDMI_AUDIO_CODING_TYPE_DST@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mtk_hdmi_hw_aud_set_bit_num
	ldr	x1, [x19, #16]
	b	LBB0_5
LBB0_3:
	ldr	x1, [x19, #16]
Lloh16:
	adrp	x8, _HDMI_I2S_MODE_LJT_24BIT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HDMI_I2S_MODE_LJT_24BIT@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_5
; %bb.4:
Lloh19:
	adrp	x8, _HDMI_I2S_MODE_LJT_16BIT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HDMI_I2S_MODE_LJT_16BIT@GOTPAGEOFF]
Lloh21:
	ldr	x1, [x8]
	str	x1, [x19, #16]
LBB0_5:
	mov	x0, x19
	bl	_mtk_hdmi_hw_aud_set_i2s_fmt
	ldr	w1, [x21]
	mov	x0, x19
	bl	_mtk_hdmi_hw_aud_set_bit_num
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	ldr	x8, [x19, #8]
Lloh22:
	adrp	x9, _HDMI_AUDIO_CODING_TYPE_DST@GOTPAGE
Lloh23:
	ldr	x9, [x9, _HDMI_AUDIO_CODING_TYPE_DST@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w1, eq
	b	LBB0_8
LBB0_7:
	mov	w1, #0
LBB0_8:
	mov	x0, x19
	bl	_mtk_hdmi_hw_audio_config
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x10, x19, #24
Lloh25:
	adrp	x11, _HDMI_AUD_CHAN_TYPE_2_0@GOTPAGE
Lloh26:
	ldr	x11, [x11, _HDMI_AUD_CHAN_TYPE_2_0@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x11, x10, eq
	ldr	w20, [x8]
	mov	x0, x20
	bl	_mtk_hdmi_aud_get_chnl_count
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_mtk_hdmi_hw_aud_set_i2s_chan_num
	ldr	x1, [x19]
	mov	x0, x19
	bl	_mtk_hdmi_hw_aud_set_input_type
	mov	w0, #0
	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	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_AUD_SWAP_LFE_CC,4,2       ; @HDMI_AUD_SWAP_LFE_CC
	.comm	_GRL_MIX_CTRL,4,2               ; @GRL_MIX_CTRL
	.comm	_MIX_CTRL_FLAT,4,2              ; @MIX_CTRL_FLAT
	.comm	_HDMI_AUD_INPUT_SPDIF,8,3       ; @HDMI_AUD_INPUT_SPDIF
	.comm	_HDMI_AUDIO_CODING_TYPE_DST,8,3 ; @HDMI_AUDIO_CODING_TYPE_DST
	.comm	_HDMI_AUDIO_SAMPLE_SIZE_24,4,2  ; @HDMI_AUDIO_SAMPLE_SIZE_24
	.comm	_HDMI_I2S_MODE_LJT_24BIT,8,3    ; @HDMI_I2S_MODE_LJT_24BIT
	.comm	_HDMI_I2S_MODE_LJT_16BIT,8,3    ; @HDMI_I2S_MODE_LJT_16BIT
	.comm	_HDMI_AUD_CHAN_TYPE_2_0,4,2     ; @HDMI_AUD_CHAN_TYPE_2_0
	.no_dead_strip	_mtk_hdmi_aud_set_input
.subsections_via_symbols
