	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_tmds_set_rate
_sun4i_tmds_set_rate:                   ## @sun4i_tmds_set_rate
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	callq	_hw_to_tmds
	movq	%rax, %r12
	movq	8(%rax), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-36(%rbp), %r8
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_sun4i_tmds_calc_divider
	movq	(%r12), %rax
	movq	_SUN4I_HDMI_PAD_CTRL1_REG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	(%rax), %rdi
	callq	_readl
	movq	_SUN4I_HDMI_PAD_CTRL1_HALVE_CLK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%edi, %ecx
	notl	%ecx
	andl	%eax, %ecx
	orl	%eax, %edi
	cmpl	$0, -36(%rbp)
	cmovel	%ecx, %edi
	movq	(%r12), %rax
	movq	(%rbx), %rsi
	addq	(%rax), %rsi
	callq	_writel
	movq	(%r12), %rax
	movq	_SUN4I_HDMI_PLL_CTRL_REG@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%rax), %rdi
	callq	_readl
	movq	_SUN4I_HDMI_PLL_CTRL_DIV_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	-48(%rbp), %rdi
	subq	8(%r12), %rdi
	callq	_SUN4I_HDMI_PLL_CTRL_DIV
	orl	%eax, %ebx
	movq	(%r12), %rax
	movq	(%r14), %rsi
	addq	(%rax), %rsi
	movl	%ebx, %edi
	callq	_writel
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SUN4I_HDMI_PAD_CTRL1_REG,8,3   ## @SUN4I_HDMI_PAD_CTRL1_REG
	.comm	_SUN4I_HDMI_PAD_CTRL1_HALVE_CLK,4,2 ## @SUN4I_HDMI_PAD_CTRL1_HALVE_CLK
	.comm	_SUN4I_HDMI_PLL_CTRL_REG,8,3    ## @SUN4I_HDMI_PLL_CTRL_REG
	.comm	_SUN4I_HDMI_PLL_CTRL_DIV_MASK,4,2 ## @SUN4I_HDMI_PLL_CTRL_DIV_MASK
	.no_dead_strip	_sun4i_tmds_set_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_tmds_set_rate
_sun4i_tmds_set_rate:                   ; @sun4i_tmds_set_rate
	.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	x20, x2
	mov	x21, x1
	bl	_hw_to_tmds
	mov	x19, x0
	ldr	x2, [x0, #8]
	mov	x3, sp
	add	x4, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_sun4i_tmds_calc_divider
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh0:
	adrp	x20, _SUN4I_HDMI_PAD_CTRL1_REG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SUN4I_HDMI_PAD_CTRL1_REG@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh2:
	adrp	x8, _SUN4I_HDMI_PAD_CTRL1_HALVE_CLK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SUN4I_HDMI_PAD_CTRL1_HALVE_CLK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	bic	w9, w0, w8
	ldr	w10, [sp, #12]
	orr	w8, w8, w0
	cmp	w10, #0
	csel	w0, w9, w8, eq
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh5:
	adrp	x20, _SUN4I_HDMI_PLL_CTRL_REG@GOTPAGE
Lloh6:
	ldr	x20, [x20, _SUN4I_HDMI_PLL_CTRL_REG@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh7:
	adrp	x8, _SUN4I_HDMI_PLL_CTRL_DIV_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SUN4I_HDMI_PLL_CTRL_DIV_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	bic	w21, w0, w8
	ldr	x8, [sp]
	ldr	x9, [x19, #8]
	sub	x0, x8, x9
	bl	_SUN4I_HDMI_PLL_CTRL_DIV
	orr	w0, w0, w21
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SUN4I_HDMI_PAD_CTRL1_REG,8,3   ; @SUN4I_HDMI_PAD_CTRL1_REG
	.comm	_SUN4I_HDMI_PAD_CTRL1_HALVE_CLK,4,2 ; @SUN4I_HDMI_PAD_CTRL1_HALVE_CLK
	.comm	_SUN4I_HDMI_PLL_CTRL_REG,8,3    ; @SUN4I_HDMI_PLL_CTRL_REG
	.comm	_SUN4I_HDMI_PLL_CTRL_DIV_MASK,4,2 ; @SUN4I_HDMI_PLL_CTRL_DIV_MASK
	.no_dead_strip	_sun4i_tmds_set_rate
.subsections_via_symbols
