	.file	"extr_mtk_mt2701_hdmi_phy.c_mtk_hdmi_pll_recalc_rate.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mtk_hdmi_pll_recalc_rate, @function
mtk_hdmi_pll_recalc_rate:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rsi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	to_mtk_hdmi_phy@PLT
	mov	rdi, QWORD PTR HDMI_CON6[rip]
	add	rdi, QWORD PTR [rax]
	mov	rbx, rax
	call	readl@PLT
	mov	ecx, DWORD PTR RG_HTPLL_PREDIV[rip]
	and	eax, DWORD PTR RG_HTPLL_PREDIV_MASK[rip]
	sar	eax, cl
	test	eax, eax
	je	.L2
	mov	rcx, r12
	mov	rsi, r12
	shr	rcx
	shr	rsi, 2
	cmp	eax, 1
	cmovne	rcx, rsi
	mov	r12, rcx
.L2:
	mov	rdi, QWORD PTR HDMI_CON6[rip]
	add	rdi, QWORD PTR [rbx]
	call	readl@PLT
	mov	ecx, DWORD PTR RG_HTPLL_FBKDIV[rip]
	and	eax, DWORD PTR RG_HTPLL_FBKDIV_MASK[rip]
	mov	rdi, QWORD PTR HDMI_CON2[rip]
	add	rdi, QWORD PTR [rbx]
	sar	eax, cl
	cdqe
	lea	rsi, 1[rax]
	imul	rsi, r12
	lea	r12, [rsi+rsi]
	call	readl@PLT
	mov	rcx, QWORD PTR RG_HDMITX_TX_POSDIV[rip]
	and	eax, DWORD PTR RG_HDMITX_TX_POSDIV_MASK[rip]
	movsx	rdi, eax
	shr	rdi, cl
	mov	rcx, rdi
	mov	rdi, QWORD PTR HDMI_CON2[rip]
	add	rdi, QWORD PTR [rbx]
	shr	r12, cl
	call	readl@PLT
	test	DWORD PTR RG_HDMITX_EN_TX_POSDIV[rip], eax
	je	.L1
	movabs	rdx, -3689348814741910323
	mov	rax, r12
	mul	rdx
	shr	rdx, 2
	mov	r12, rdx
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 24
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	mtk_hdmi_pll_recalc_rate, .-mtk_hdmi_pll_recalc_rate
	.comm	RG_HTPLL_PREDIV_MASK,4,4
	.comm	RG_HTPLL_PREDIV,4,4
	.comm	RG_HTPLL_FBKDIV_MASK,4,4
	.comm	RG_HTPLL_FBKDIV,4,4
	.comm	RG_HDMITX_TX_POSDIV_MASK,4,4
	.comm	RG_HDMITX_TX_POSDIV,8,8
	.comm	RG_HDMITX_EN_TX_POSDIV,4,4
	.comm	HDMI_CON6,8,8
	.comm	HDMI_CON2,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mtk_mt2701_hdmi_phy.c_mtk_hdmi_pll_recalc_rate.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtk_hdmi_pll_recalc_rate, %function
mtk_hdmi_pll_recalc_rate:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r1
	bl	to_mtk_hdmi_phy
	ldr	r6, .L13
	mov	r5, r0
	ldr	r3, [r6]
	ldr	r0, [r0]
	add	r0, r0, r3
	bl	readl
	ldr	r3, .L13+4
	ldr	r2, .L13+8
	ldr	r3, [r3]
	ldr	r2, [r2]
	and	r3, r3, r0
	asrs	r3, r3, r2
	beq	.L2
	cmp	r3, #1
	lsreq	r4, r4, #1
	lsrne	r4, r4, #2
.L2:
	ldr	r3, [r6]
	ldr	r0, [r5]
	ldr	r6, .L13+12
	add	r0, r0, r3
	bl	readl
	ldr	r3, .L13+16
	ldr	r2, .L13+20
	ldr	r3, [r3]
	ldr	r1, [r2]
	and	r3, r3, r0
	asr	r3, r3, r1
	add	r3, r3, #1
	mul	r1, r4, r3
	ldr	r0, [r5]
	ldr	r3, [r6]
	lsl	r4, r1, #1
	add	r0, r0, r3
	bl	readl
	ldr	r3, .L13+24
	ldr	r1, .L13+28
	ldr	r3, [r3]
	ldr	r2, [r6]
	ldr	ip, [r5]
	ldr	r1, [r1]
	and	r3, r3, r0
	lsr	r3, r3, r1
	add	r0, ip, r2
	lsr	r4, r4, r3
	bl	readl
	ldr	r3, .L13+32
	ldr	r3, [r3]
	tst	r0, r3
	ldrne	r3, .L13+36
	umullne	r2, r3, r4, r3
	lsrne	r4, r3, #2
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L14:
	.align	2
.L13:
	.word	HDMI_CON6
	.word	RG_HTPLL_PREDIV_MASK
	.word	RG_HTPLL_PREDIV
	.word	HDMI_CON2
	.word	RG_HTPLL_FBKDIV_MASK
	.word	RG_HTPLL_FBKDIV
	.word	RG_HDMITX_TX_POSDIV_MASK
	.word	RG_HDMITX_TX_POSDIV
	.word	RG_HDMITX_EN_TX_POSDIV
	.word	-858993459
	.size	mtk_hdmi_pll_recalc_rate, .-mtk_hdmi_pll_recalc_rate
	.comm	RG_HTPLL_PREDIV_MASK,4,4
	.comm	RG_HTPLL_PREDIV,4,4
	.comm	RG_HTPLL_FBKDIV_MASK,4,4
	.comm	RG_HTPLL_FBKDIV,4,4
	.comm	RG_HDMITX_TX_POSDIV_MASK,4,4
	.comm	RG_HDMITX_TX_POSDIV,4,4
	.comm	RG_HDMITX_EN_TX_POSDIV,4,4
	.comm	HDMI_CON6,4,4
	.comm	HDMI_CON2,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
