	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_hw_make_reg_writable
_mtk_hdmi_hw_make_reg_writable:         ## @mtk_hdmi_hw_make_reg_writable
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	12(%rdi), %edi
	callq	_phy_get_drvdata
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	movl	8(%r14), %edi
	movq	_HDMI_SYS_CFG20@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	testl	%ebx, %ebx
	movl	$32768, %eax                    ## imm = 0x8000
	movl	$-2147483643, %ecx              ## imm = 0x80000005
	cmovel	%eax, %ecx
	movl	$-2147450875, %edx              ## imm = 0x80008005
	callq	_regmap_update_bits
	jmp	LBB0_4
LBB0_3:
	movq	_MTK_SIP_SET_AUTHORIZED_SECURE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	subq	$8, %rsp
	leaq	-24(%rbp), %rax
	movl	$335546628, %esi                ## imm = 0x14000904
	movl	$-2147483648, %edx              ## imm = 0x80000000
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	$0
	pushq	$0
	callq	_arm_smccc_smc
	addq	$32, %rsp
LBB0_4:
	movl	8(%r14), %edi
	movq	_HDMI_SYS_CFG20@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	movq	_HDMI_PCLK_FREE_RUN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%ebx, %ebx
	movl	%edx, %ecx
	cmovel	%ebx, %ecx
	callq	_regmap_update_bits
	movq	_HDMI_ON@GOTPCREL(%rip), %rax
	movq	_ANLG_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	testl	%ebx, %ebx
	movl	8(%r14), %edi
	movq	_HDMI_SYS_CFG1C@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmovnel	%edx, %ebx
	addq	(%r14), %rsi
	movl	%ebx, %ecx
	callq	_regmap_update_bits
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDMI_SYS_CFG20,8,3             ## @HDMI_SYS_CFG20
	.comm	_MTK_SIP_SET_AUTHORIZED_SECURE_REG,4,2 ## @MTK_SIP_SET_AUTHORIZED_SECURE_REG
	.comm	_HDMI_PCLK_FREE_RUN,4,2         ## @HDMI_PCLK_FREE_RUN
	.comm	_HDMI_SYS_CFG1C,8,3             ## @HDMI_SYS_CFG1C
	.comm	_HDMI_ON,4,2                    ## @HDMI_ON
	.comm	_ANLG_ON,4,2                    ## @ANLG_ON
	.no_dead_strip	_mtk_hdmi_hw_make_reg_writable
.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_make_reg_writable
_mtk_hdmi_hw_make_reg_writable:         ; @mtk_hdmi_hw_make_reg_writable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
	mov	x20, x0
	ldr	w0, [x0, #12]
	bl	_phy_get_drvdata
	ldr	x8, [x0]
Lloh0:
	adrp	x21, _HDMI_SYS_CFG20@GOTPAGE
Lloh1:
	ldr	x21, [x21, _HDMI_SYS_CFG20@GOTPAGEOFF]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w0, [x20, #8]
	ldr	x8, [x20]
	ldr	x9, [x21]
	add	x1, x9, x8
	mov	w8, #5
	movk	w8, #32768, lsl #16
	mov	w9, #32768
	cmp	w19, #0
	csel	w3, w9, w8, eq
	orr	w2, w8, #0x8000
	bl	_regmap_update_bits
	b	LBB0_4
LBB0_3:
Lloh2:
	adrp	x8, _MTK_SIP_SET_AUTHORIZED_SECURE_REG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTK_SIP_SET_AUTHORIZED_SECURE_REG@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x8, sp, #8
	str	x8, [sp]
	mov	w1, #2308
	movk	w1, #5120, lsl #16
	mov	w2, #-2147483648
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	mov	w6, #0
	mov	w7, #0
	bl	_arm_smccc_smc
LBB0_4:
	ldr	w0, [x20, #8]
	ldr	x8, [x20]
	ldr	x9, [x21]
	add	x1, x9, x8
Lloh5:
	adrp	x8, _HDMI_PCLK_FREE_RUN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HDMI_PCLK_FREE_RUN@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	cmp	w19, #0
	csel	w3, wzr, w2, eq
	bl	_regmap_update_bits
	ldr	w0, [x20, #8]
Lloh8:
	adrp	x8, _HDMI_SYS_CFG1C@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HDMI_SYS_CFG1C@GOTPAGEOFF]
	ldr	x9, [x20]
Lloh10:
	ldr	x8, [x8]
	add	x1, x8, x9
Lloh11:
	adrp	x8, _HDMI_ON@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HDMI_ON@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _ANLG_ON@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ANLG_ON@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w2, w9, w8
	cmp	w19, #0
	csel	w3, wzr, w2, eq
	bl	_regmap_update_bits
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_HDMI_SYS_CFG20,8,3             ; @HDMI_SYS_CFG20
	.comm	_MTK_SIP_SET_AUTHORIZED_SECURE_REG,4,2 ; @MTK_SIP_SET_AUTHORIZED_SECURE_REG
	.comm	_HDMI_PCLK_FREE_RUN,4,2         ; @HDMI_PCLK_FREE_RUN
	.comm	_HDMI_SYS_CFG1C,8,3             ; @HDMI_SYS_CFG1C
	.comm	_HDMI_ON,4,2                    ; @HDMI_ON
	.comm	_ANLG_ON,4,2                    ; @ANLG_ON
	.no_dead_strip	_mtk_hdmi_hw_make_reg_writable
.subsections_via_symbols
