	.file	"extr_dw_mipi_dsi-stm.c_dsi_pll_get_params.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dsi_pll_get_params, @function
dsi_pll_get_params:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	QWORD PTR 16[rsp], rcx
	mov	QWORD PTR 24[rsp], r8
	mov	QWORD PTR 32[rsp], r9
	test	esi, esi
	jle	.L12
	mov	ebx, edx
	test	edx, edx
	jle	.L12
	mov	edx, DWORD PTR [rdi]
	mov	eax, DWORD PTR 4[rdi]
	imul	edx, DWORD PTR ODF_MAX[rip]
	mov	ebp, DWORD PTR IDF_MIN[rip]
	imul	eax, DWORD PTR ODF_MIN[rip]
	cmp	ebp, DWORD PTR IDF_MAX[rip]
	jg	.L5
	lea	ecx, [rsi+rsi]
	mov	DWORD PTR 40[rsp], 1000000
	mov	r12d, esi
	mov	DWORD PTR 52[rsp], ecx
	lea	ecx, [rdx+rdx]
	imul	edx, ebp
	mov	DWORD PTR 60[rsp], ecx
	add	edx, edx
	mov	DWORD PTR 48[rsp], edx
	lea	edx, [rax+rax]
	imul	eax, ebp
	mov	DWORD PTR 56[rsp], edx
	add	eax, eax
	mov	DWORD PTR 44[rsp], eax
.L11:
	mov	eax, DWORD PTR 48[rsp]
	mov	ecx, DWORD PTR 52[rsp]
	mov	r14d, DWORD PTR NDIV_MAX[rip]
	cdq
	idiv	ecx
	lea	r13d, 1[rax]
	mov	eax, DWORD PTR 44[rsp]
	cdq
	idiv	ecx
	cmp	r14d, r13d
	jle	.L5
	cmp	DWORD PTR NDIV_MIN[rip], r13d
	cmovge	r13d, DWORD PTR NDIV_MIN[rip]
	cmp	r14d, eax
	cmovle	eax, r14d
	mov	r15d, DWORD PTR ODF_MIN[rip]
	cmp	r15d, DWORD PTR ODF_MAX[rip]
	mov	DWORD PTR 12[rsp], eax
	jg	.L6
	mov	r14d, r15d
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, r14d
	mov	esi, r12d
	imul	edi, ebp
	imul	edi, ebx
	call	DIV_ROUND_CLOSEST@PLT
	mov	r15d, eax
	cmp	r13d, eax
	jg	.L7
	cmp	DWORD PTR 12[rsp], eax
	jl	.L7
	mov	esi, ebp
	mov	ecx, r14d
	mov	edx, eax
	mov	edi, r12d
	call	dsi_pll_get_clkout_khz@PLT
	mov	esi, ebx
	sub	esi, eax
	sub	eax, ebx
	cmovs	eax, esi
	cmp	eax, DWORD PTR 40[rsp]
	jge	.L9
	mov	rdx, QWORD PTR 16[rsp]
	mov	rcx, QWORD PTR 32[rsp]
	mov	DWORD PTR 40[rsp], eax
	mov	DWORD PTR [rdx], ebp
	mov	rdx, QWORD PTR 24[rsp]
	mov	DWORD PTR [rdx], r15d
	mov	DWORD PTR [rcx], r14d
.L9:
	test	eax, eax
	je	.L5
.L7:
	add	r14d, r14d
	cmp	DWORD PTR ODF_MAX[rip], r14d
	jge	.L10
.L6:
	mov	edx, DWORD PTR 60[rsp]
	add	ebp, 1
	add	DWORD PTR 48[rsp], edx
	mov	edx, DWORD PTR 56[rsp]
	add	DWORD PTR 44[rsp], edx
	cmp	DWORD PTR IDF_MAX[rip], ebp
	jge	.L11
.L5:
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 72
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	dsi_pll_get_params, .-dsi_pll_get_params
	.comm	ODF_MIN,4,4
	.comm	ODF_MAX,4,4
	.comm	NDIV_MIN,4,4
	.comm	NDIV_MAX,4,4
	.comm	IDF_MIN,4,4
	.comm	IDF_MAX,4,4
	.comm	EINVAL,4,4
	.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_dw_mipi_dsi-stm.c_dsi_pll_get_params.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dsi_pll_get_params, %function
dsi_pll_get_params:
	@ args = 8, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	cmp	r2, #0
	cmpgt	r1, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #36
	str	r3, [sp, #8]
	ble	.L18
	ldr	r3, .L19
	mov	r6, r1
	ldr	r5, [r3]
	ldr	r3, .L19+4
	ldr	r9, .L19+8
	ldr	r1, [r3]
	ldr	ip, [r9]
	cmp	r5, r1
	ldr	r1, .L19+12
	mov	r4, r2
	ldm	r0, {r2, r3}
	ldr	r1, [r1]
	mul	r2, ip, r2
	mul	r3, r1, r3
	bgt	.L4
	mul	r0, r5, r2
	mul	r1, r5, r3
	lsl	r2, r2, #1
	lsl	r3, r3, #1
	ldr	ip, .L19+16
	lsl	r0, r0, #1
	str	r2, [sp, #28]
	str	r3, [sp, #24]
	lsl	r2, r1, #1
	lsl	r3, r6, #1
	str	ip, [sp, #4]
	str	r0, [sp, #16]
	str	r2, [sp, #12]
	str	r3, [sp, #20]
.L10:
	ldr	r8, [sp, #20]
	ldr	r0, [sp, #16]
	mov	r1, r8
	bl	__aeabi_idiv
	mov	r7, r0
	mov	r1, r8
	ldr	r0, [sp, #12]
	bl	__aeabi_idiv
	ldr	r3, .L19+20
	add	r7, r7, #1
	ldr	r8, [r3]
	cmp	r8, r7
	ble	.L4
	ldr	r3, .L19+24
	ldr	r2, [r3]
	ldr	r3, .L19+12
	cmp	r7, r2
	movlt	r7, r2
	ldr	fp, [r3]
	ldr	r2, [r9]
	cmp	r8, r0
	movge	r8, r0
	cmp	fp, r2
	bgt	.L5
.L9:
	mul	r0, r5, fp
	mov	r1, r6
	mul	r0, r4, r0
	bl	DIV_ROUND_CLOSEST
	cmp	r8, r0
	movge	r1, #0
	movlt	r1, #1
	cmp	r7, r0
	orrgt	r1, r1, #1
	cmp	r1, #0
	mov	r10, r0
	bne	.L6
	mov	r3, fp
	mov	r2, r0
	mov	r1, r5
	mov	r0, r6
	bl	dsi_pll_get_clkout_khz
	ldr	r3, [sp, #4]
	subs	r1, r0, r4
	submi	r1, r4, r0
	cmp	r1, r3
	bge	.L8
	ldr	r3, [sp, #8]
	str	r1, [sp, #4]
	str	r5, [r3]
	ldr	r3, [sp, #72]
	str	r10, [r3]
	ldr	r3, [sp, #76]
	str	fp, [r3]
.L8:
	cmp	r1, #0
	beq	.L4
.L6:
	ldr	r2, [r9]
	lsl	fp, fp, #1
	cmp	r2, fp
	bge	.L9
.L5:
	ldr	r3, .L19+4
	add	r5, r5, #1
	ldr	r3, [r3]
	ldr	r2, [sp, #28]
	cmp	r3, r5
	ldr	r3, [sp, #16]
	add	r3, r3, r2
	str	r3, [sp, #16]
	ldr	r2, [sp, #24]
	ldr	r3, [sp, #12]
	add	r3, r3, r2
	str	r3, [sp, #12]
	bge	.L10
.L4:
	mov	r0, #0
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	ldr	r3, .L19+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	.align	2
.L19:
	.word	IDF_MIN
	.word	IDF_MAX
	.word	ODF_MAX
	.word	ODF_MIN
	.word	1000000
	.word	NDIV_MAX
	.word	NDIV_MIN
	.word	EINVAL
	.size	dsi_pll_get_params, .-dsi_pll_get_params
	.comm	ODF_MIN,4,4
	.comm	ODF_MAX,4,4
	.comm	NDIV_MIN,4,4
	.comm	NDIV_MAX,4,4
	.comm	IDF_MIN,4,4
	.comm	IDF_MAX,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
