	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hdmi_video_change_vpll
_mtk_hdmi_video_change_vpll:            ## @mtk_hdmi_video_change_vpll
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	_MTK_HDMI_CLK_HDMI_PLL@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_clk_set_rate
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	movl	%r14d, %ecx
	callq	_dev_err
	jmp	LBB0_6
LBB0_2:
	movq	8(%rbx), %rax
	movq	(%r12), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_clk_get_rate
	movq	%rax, %r12
	movq	%rax, %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_CLOSEST
	movq	%rax, %r13
	movq	%r15, %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_CLOSEST
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdx
	movq	%r12, %rcx
	cmpq	%rax, %r13
	jne	LBB0_3
## %bb.4:
	callq	_dev_dbg
	jmp	LBB0_5
LBB0_3:
	callq	_dev_warn
LBB0_5:
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_config_sys
	movq	%rbx, %rdi
	callq	_mtk_hdmi_hw_set_deep_color_mode
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_HDMI_CLK_HDMI_PLL,8,3      ## @MTK_HDMI_CLK_HDMI_PLL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set PLL to %u Hz: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Want PLL %u Hz, got %lu Hz\n"

	.no_dead_strip	_mtk_hdmi_video_change_vpll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hdmi_video_change_vpll
_mtk_hdmi_video_change_vpll:            ; @mtk_hdmi_video_change_vpll
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x22, _MTK_HDMI_CLK_HDMI_PLL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MTK_HDMI_CLK_HDMI_PLL@GOTPAGEOFF]
	ldr	x9, [x22]
	ldr	w0, [x8, x9, lsl #2]
	bl	_clk_set_rate
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x20]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x19
	bl	_dev_err
	b	LBB0_6
LBB0_2:
	ldr	x8, [x20, #8]
	ldr	x9, [x22]
	ldr	w0, [x8, x9, lsl #2]
	bl	_clk_get_rate
	mov	x22, x0
	mov	w1, #1000
	bl	_DIV_ROUND_CLOSEST
	mov	x23, x0
	mov	x0, x21
	mov	w1, #1000
	bl	_DIV_ROUND_CLOSEST
	mov	x8, x0
	ldr	w0, [x20]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	mov	x3, x22
	cmp	x23, x8
	b.ne	LBB0_4
; %bb.3:
	bl	_dev_dbg
	b	LBB0_5
LBB0_4:
	bl	_dev_warn
LBB0_5:
	mov	x0, x20
	bl	_mtk_hdmi_hw_config_sys
	mov	x0, x20
	bl	_mtk_hdmi_hw_set_deep_color_mode
LBB0_6:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_HDMI_CLK_HDMI_PLL,8,3      ; @MTK_HDMI_CLK_HDMI_PLL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set PLL to %u Hz: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Want PLL %u Hz, got %lu Hz\n"

	.no_dead_strip	_mtk_hdmi_video_change_vpll
.subsections_via_symbols
