	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_hw_aud_set_input_type
_mtk_hdmi_hw_aud_set_input_type:        ## @mtk_hdmi_hw_aud_set_input_type
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_GRL_CFG1@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_mtk_hdmi_read
	movq	_HDMI_AUD_INPUT_I2S@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_3
## %bb.1:
	movq	_CFG1_SPDIF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %edx
	notl	%edx
	testl	%edx, %ecx
	jne	LBB0_3
## %bb.2:
	notl	%ecx
	andl	%ecx, %eax
	jmp	LBB0_5
LBB0_3:
	movq	_HDMI_AUD_INPUT_SPDIF@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_5
## %bb.4:
	movq	_CFG1_SPDIF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	testl	%eax, %ecx
	cmovel	%ecx, %edx
	orl	%edx, %eax
LBB0_5:
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_hdmi_write                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GRL_CFG1,4,2                   ## @GRL_CFG1
	.comm	_HDMI_AUD_INPUT_I2S,4,2         ## @HDMI_AUD_INPUT_I2S
	.comm	_CFG1_SPDIF,4,2                 ## @CFG1_SPDIF
	.comm	_HDMI_AUD_INPUT_SPDIF,4,2       ## @HDMI_AUD_INPUT_SPDIF
	.no_dead_strip	_mtk_hdmi_hw_aud_set_input_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hdmi_hw_aud_set_input_type
_mtk_hdmi_hw_aud_set_input_type:        ; @mtk_hdmi_hw_aud_set_input_type
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _GRL_CFG1@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GRL_CFG1@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_mtk_hdmi_read
	mov	x2, x0
Lloh2:
	adrp	x8, _HDMI_AUD_INPUT_I2S@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HDMI_AUD_INPUT_I2S@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _CFG1_SPDIF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CFG1_SPDIF@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	bics	wzr, w8, w2
	b.ne	LBB0_3
; %bb.2:
	bic	w2, w2, w8
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x8, _HDMI_AUD_INPUT_SPDIF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HDMI_AUD_INPUT_SPDIF@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _CFG1_SPDIF@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CFG1_SPDIF@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w2
	csel	w8, w8, wzr, eq
	orr	w2, w8, w2
LBB0_5:
	ldr	w1, [x21]
	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
	b	_mtk_hdmi_write
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GRL_CFG1,4,2                   ; @GRL_CFG1
	.comm	_HDMI_AUD_INPUT_I2S,4,2         ; @HDMI_AUD_INPUT_I2S
	.comm	_CFG1_SPDIF,4,2                 ; @CFG1_SPDIF
	.comm	_HDMI_AUD_INPUT_SPDIF,4,2       ; @HDMI_AUD_INPUT_SPDIF
	.no_dead_strip	_mtk_hdmi_hw_aud_set_input_type
.subsections_via_symbols
