	.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_chan_num
_mtk_hdmi_hw_aud_set_i2s_chan_num:      ## @mtk_hdmi_hw_aud_set_i2s_chan_num
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movl	%esi, %r12d
	movq	%rdi, %r14
	movl	$7, %edi
	movl	$7, %esi
	callq	_CH_SWITCH
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	$6, %edi
	movl	$6, %esi
	callq	_CH_SWITCH
	movl	%eax, %ebx
	movl	$5, %edi
	movl	$5, %esi
	callq	_CH_SWITCH
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	$4, %edi
	movl	$4, %esi
	callq	_CH_SWITCH
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	$3, %edi
	movl	$3, %esi
	callq	_CH_SWITCH
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	$1, %edi
	movl	$2, %esi
	callq	_CH_SWITCH
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	$2, %edi
	movl	$1, %esi
	callq	_CH_SWITCH
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_CH_SWITCH
	movl	%eax, %r15d
	cmpl	$2, %r13d
	jne	LBB0_2
LBB0_1:
	xorl	%edi, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r12d
	jmp	LBB0_18
LBB0_2:
	leal	-3(%r13), %eax
	cmpl	$1, %eax
	ja	LBB0_7
## %bb.3:
	cmpl	$4, %r13d
	jne	LBB0_6
## %bb.4:
	movq	_HDMI_AUD_CHAN_TYPE_3_0_LRS@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_14
## %bb.5:
	movq	_HDMI_AUD_CHAN_TYPE_4_0@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_14
LBB0_6:
	movl	$3, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r13d
	movl	$2, %edi
	jmp	LBB0_16
LBB0_7:
	leal	-5(%r13), %eax
	cmpl	$1, %eax
	ja	LBB0_12
## %bb.8:
	cmpl	$6, %r13d
	jne	LBB0_11
## %bb.9:
	movq	_HDMI_AUD_CHAN_TYPE_5_1@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	je	LBB0_11
## %bb.10:
	movq	_HDMI_AUD_CHAN_TYPE_4_1_CLRS@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_13
LBB0_11:
	movl	$2, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r12d
	movl	$1, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r13d
	orl	%r12d, %r13d
	jmp	LBB0_15
LBB0_12:
	addl	$-7, %r13d
	cmpl	$1, %r13d
	ja	LBB0_1
LBB0_13:
	movl	$3, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r12d
	movl	$2, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r13d
	orl	%r12d, %r13d
	movl	$1, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%edi, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r12d
	orl	-44(%rbp), %r12d                ## 4-byte Folded Reload
	jmp	LBB0_17
LBB0_14:
	movl	$2, %edi
	callq	_I2S_UV_CH_EN
	movl	%eax, %r13d
LBB0_15:
	xorl	%edi, %edi
LBB0_16:
	callq	_I2S_UV_CH_EN
	movl	%eax, %r12d
LBB0_17:
	orl	%r13d, %r12d
LBB0_18:
	orl	-68(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	-64(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	-60(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	-52(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%r15d, %ebx
	movq	_GRL_CH_SW0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bl, %edx
	movq	%r14, %rdi
	callq	_mtk_hdmi_write
	movq	_GRL_CH_SW1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bh, %edx
	movq	%r14, %rdi
	callq	_mtk_hdmi_write
	movq	_GRL_CH_SW2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shrl	$16, %ebx
	movzbl	%bl, %edx
	movq	%r14, %rdi
	callq	_mtk_hdmi_write
	movq	_GRL_I2S_UV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_hdmi_write                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_AUD_CHAN_TYPE_3_0_LRS,4,2 ## @HDMI_AUD_CHAN_TYPE_3_0_LRS
	.comm	_HDMI_AUD_CHAN_TYPE_4_0,4,2     ## @HDMI_AUD_CHAN_TYPE_4_0
	.comm	_HDMI_AUD_CHAN_TYPE_5_1,4,2     ## @HDMI_AUD_CHAN_TYPE_5_1
	.comm	_HDMI_AUD_CHAN_TYPE_4_1_CLRS,4,2 ## @HDMI_AUD_CHAN_TYPE_4_1_CLRS
	.comm	_GRL_CH_SW0,4,2                 ## @GRL_CH_SW0
	.comm	_GRL_CH_SW1,4,2                 ## @GRL_CH_SW1
	.comm	_GRL_CH_SW2,4,2                 ## @GRL_CH_SW2
	.comm	_GRL_I2S_UV,4,2                 ## @GRL_I2S_UV
	.no_dead_strip	_mtk_hdmi_hw_aud_set_i2s_chan_num
.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_chan_num
_mtk_hdmi_hw_aud_set_i2s_chan_num:      ; @mtk_hdmi_hw_aud_set_i2s_chan_num
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x28, x1
	mov	x19, x0
	mov	w0, #7
	mov	w1, #7
	bl	_CH_SWITCH
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	mov	w0, #6
	mov	w1, #6
	bl	_CH_SWITCH
	mov	x21, x0
	mov	w0, #5
	mov	w1, #5
	bl	_CH_SWITCH
	mov	x22, x0
	mov	w0, #4
	mov	w1, #4
	bl	_CH_SWITCH
	mov	x23, x0
	mov	w0, #3
	mov	w1, #3
	bl	_CH_SWITCH
	mov	x24, x0
	mov	w0, #1
	mov	w1, #2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9:
	mov	w0, #2
	bl	_I2S_UV_CH_EN
	mov	x20, x0
	mov	w0, #1
	bl	_I2S_UV_CH_EN
	orr	w20, w0, w20
	b	LBB0_14
LBB0_10:
	mov	w0, #3
	bl	_I2S_UV_CH_EN
	mov	x20, x0
	mov	w0, #2
LBB0_11:
	bl	_I2S_UV_CH_EN
	orr	w20, w0, w20
	b	LBB0_15
LBB0_12:
	sub	w8, w20, #7
	cmp	w8, #1
	b.hi	LBB0_1
LBB0_13:
	mov	w0, #3
	bl	_I2S_UV_CH_EN
	mov	x20, x0
	mov	w0, #2
	bl	_I2S_UV_CH_EN
	orr	w20, w0, w20
	mov	w0, #1
	bl	_I2S_UV_CH_EN
	orr	w20, w20, w0
LBB0_14:
	mov	w0, #0
	bl	_I2S_UV_CH_EN
	orr	w20, w20, w0
LBB0_15:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	orr	w8, w21, w8
	orr	w8, w8, w22
	orr	w8, w8, w23
	orr	w8, w8, w24
	orr	w8, w8, w25
	orr	w8, w8, w26
	orr	w21, w8, w27
Lloh12:
	adrp	x8, _GRL_CH_SW0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GRL_CH_SW0@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	and	w2, w21, #0xff
	mov	x0, x19
	bl	_mtk_hdmi_write
Lloh15:
	adrp	x8, _GRL_CH_SW1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GRL_CH_SW1@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ubfx	w2, w21, #8, #8
	mov	x0, x19
	bl	_mtk_hdmi_write
Lloh18:
	adrp	x8, _GRL_CH_SW2@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GRL_CH_SW2@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ubfx	w2, w21, #16, #8
	mov	x0, x19
	bl	_mtk_hdmi_write
Lloh21:
	adrp	x8, _GRL_I2S_UV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GRL_I2S_UV@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_mtk_hdmi_write
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_AUD_CHAN_TYPE_3_0_LRS,4,2 ; @HDMI_AUD_CHAN_TYPE_3_0_LRS
	.comm	_HDMI_AUD_CHAN_TYPE_4_0,4,2     ; @HDMI_AUD_CHAN_TYPE_4_0
	.comm	_HDMI_AUD_CHAN_TYPE_5_1,4,2     ; @HDMI_AUD_CHAN_TYPE_5_1
	.comm	_HDMI_AUD_CHAN_TYPE_4_1_CLRS,4,2 ; @HDMI_AUD_CHAN_TYPE_4_1_CLRS
	.comm	_GRL_CH_SW0,4,2                 ; @GRL_CH_SW0
	.comm	_GRL_CH_SW1,4,2                 ; @GRL_CH_SW1
	.comm	_GRL_CH_SW2,4,2                 ; @GRL_CH_SW2
	.comm	_GRL_I2S_UV,4,2                 ; @GRL_I2S_UV
	.no_dead_strip	_mtk_hdmi_hw_aud_set_i2s_chan_num
.subsections_via_symbols
