	.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_i2s_fmt
_mtk_hdmi_hw_aud_set_i2s_fmt:           ## @mtk_hdmi_hw_aud_set_i2s_fmt
	.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_CFG0@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_mtk_hdmi_read
	movq	_CFG0_W_LENGTH_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_CFG0_I2S_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	$-128, %ebx
	cmpl	$5, %ebx
	ja	LBB0_1
## %bb.2:
	movslq	%ebx, %rdi
	leaq	l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt(%rip), %rsi
	movq	(%rsi,%rdi,8), %rsi
	leaq	l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt.1(%rip), %rbx
	movq	(%rbx,%rdi,8), %rdi
	jmp	LBB0_3
LBB0_1:
	movq	_CFG0_W_LENGTH_24BIT@GOTPCREL(%rip), %rdi
	movq	_CFG0_I2S_MODE_LTJ@GOTPCREL(%rip), %rsi
LBB0_3:
	movl	(%rdi), %edi
	orl	(%rsi), %edi
	orl	%edx, %ecx
	notl	%ecx
	andl	%ecx, %eax
	orl	%edi, %eax
	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_CFG0,4,2                   ## @GRL_CFG0
	.comm	_CFG0_W_LENGTH_MASK,4,2         ## @CFG0_W_LENGTH_MASK
	.comm	_CFG0_I2S_MODE_MASK,4,2         ## @CFG0_I2S_MODE_MASK
	.comm	_CFG0_I2S_MODE_RTJ,4,2          ## @CFG0_I2S_MODE_RTJ
	.comm	_CFG0_W_LENGTH_24BIT,4,2        ## @CFG0_W_LENGTH_24BIT
	.comm	_CFG0_W_LENGTH_16BIT,4,2        ## @CFG0_W_LENGTH_16BIT
	.comm	_CFG0_I2S_MODE_LTJ,4,2          ## @CFG0_I2S_MODE_LTJ
	.comm	_CFG0_I2S_MODE_I2S,4,2          ## @CFG0_I2S_MODE_I2S
	.no_dead_strip	_mtk_hdmi_hw_aud_set_i2s_fmt
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.mtk_hdmi_hw_aud_set_i2s_fmt
l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt:
	.quad	_CFG0_I2S_MODE_RTJ
	.quad	_CFG0_I2S_MODE_RTJ
	.quad	_CFG0_I2S_MODE_LTJ
	.quad	_CFG0_I2S_MODE_LTJ
	.quad	_CFG0_I2S_MODE_I2S
	.quad	_CFG0_I2S_MODE_I2S

	.p2align	3                               ## @switch.table.mtk_hdmi_hw_aud_set_i2s_fmt.1
l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt.1:
	.quad	_CFG0_W_LENGTH_24BIT
	.quad	_CFG0_W_LENGTH_16BIT
	.quad	_CFG0_W_LENGTH_24BIT
	.quad	_CFG0_W_LENGTH_16BIT
	.quad	_CFG0_W_LENGTH_24BIT
	.quad	_CFG0_W_LENGTH_16BIT

.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_i2s_fmt
_mtk_hdmi_hw_aud_set_i2s_fmt:           ; @mtk_hdmi_hw_aud_set_i2s_fmt
	.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_CFG0@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GRL_CFG0@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_mtk_hdmi_read
Lloh2:
	adrp	x8, _CFG0_W_LENGTH_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CFG0_W_LENGTH_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _CFG0_I2S_MODE_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CFG0_I2S_MODE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	sub	w10, w20, #128
	cmp	w10, #5
	b.hi	LBB0_2
; %bb.1:
	sbfiz	x11, x10, #3, #32
Lloh8:
	adrp	x10, l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt@PAGE
Lloh9:
	add	x10, x10, l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt@PAGEOFF
	ldr	x10, [x10, x11]
Lloh10:
	adrp	x12, l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt.1@PAGE
Lloh11:
	add	x12, x12, l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt.1@PAGEOFF
	ldr	x11, [x12, x11]
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x11, _CFG0_W_LENGTH_24BIT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _CFG0_W_LENGTH_24BIT@GOTPAGEOFF]
Lloh14:
	adrp	x10, _CFG0_I2S_MODE_LTJ@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CFG0_I2S_MODE_LTJ@GOTPAGEOFF]
LBB0_3:
	ldr	w10, [x10]
	ldr	w11, [x11]
	orr	w10, w11, w10
	orr	w8, w9, w8
	bic	w8, w0, w8
	orr	w2, w10, w8
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GRL_CFG0,4,2                   ; @GRL_CFG0
	.comm	_CFG0_W_LENGTH_MASK,4,2         ; @CFG0_W_LENGTH_MASK
	.comm	_CFG0_I2S_MODE_MASK,4,2         ; @CFG0_I2S_MODE_MASK
	.comm	_CFG0_I2S_MODE_RTJ,4,2          ; @CFG0_I2S_MODE_RTJ
	.comm	_CFG0_W_LENGTH_24BIT,4,2        ; @CFG0_W_LENGTH_24BIT
	.comm	_CFG0_W_LENGTH_16BIT,4,2        ; @CFG0_W_LENGTH_16BIT
	.comm	_CFG0_I2S_MODE_LTJ,4,2          ; @CFG0_I2S_MODE_LTJ
	.comm	_CFG0_I2S_MODE_I2S,4,2          ; @CFG0_I2S_MODE_I2S
	.no_dead_strip	_mtk_hdmi_hw_aud_set_i2s_fmt
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.mtk_hdmi_hw_aud_set_i2s_fmt
l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt:
	.quad	_CFG0_I2S_MODE_RTJ
	.quad	_CFG0_I2S_MODE_RTJ
	.quad	_CFG0_I2S_MODE_LTJ
	.quad	_CFG0_I2S_MODE_LTJ
	.quad	_CFG0_I2S_MODE_I2S
	.quad	_CFG0_I2S_MODE_I2S

	.p2align	3                               ; @switch.table.mtk_hdmi_hw_aud_set_i2s_fmt.1
l_switch.table.mtk_hdmi_hw_aud_set_i2s_fmt.1:
	.quad	_CFG0_W_LENGTH_24BIT
	.quad	_CFG0_W_LENGTH_16BIT
	.quad	_CFG0_W_LENGTH_24BIT
	.quad	_CFG0_W_LENGTH_16BIT
	.quad	_CFG0_W_LENGTH_24BIT
	.quad	_CFG0_W_LENGTH_16BIT

.subsections_via_symbols
