	.file	"extr_clk-sun4i-tcon-ch1.c_tcon_ch1_determine_rate.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tcon_ch1_determine_rate, @function
tcon_ch1_determine_rate:
.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
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xor	ebp, ebp
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	r15, QWORD PTR EINVAL[rip]
	neg	r15
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, ebp
	mov	rdi, r14
	call	clk_hw_get_parent_by_index@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L3
	mov	rdi, rax
	call	clk_hw_get_rate@PLT
	mov	rdi, QWORD PTR 0[r13]
	xor	ecx, ecx
	xor	edx, edx
	mov	rsi, rax
	mov	r12, rax
	call	tcon_ch1_calc_divider@PLT
	test	r15, r15
	js	.L4
	mov	rdx, QWORD PTR 0[r13]
	mov	rcx, rdx
	sub	rdx, r15
	sub	rcx, rax
	cmp	rcx, rdx
	jnb	.L3
.L4:
	mov	QWORD PTR 8[r13], r12
	mov	r15, rax
	mov	QWORD PTR 16[r13], rbx
.L3:
	add	ebp, 1
.L2:
	mov	rdi, r14
	call	clk_hw_get_num_parents@PLT
	cmp	eax, ebp
	jg	.L5
	mov	eax, r15d
	test	r15, r15
	js	.L1
	mov	QWORD PTR 0[r13], r15
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE0:
	.size	tcon_ch1_determine_rate, .-tcon_ch1_determine_rate
	.comm	EINVAL,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_clk-sun4i-tcon-ch1.c_tcon_ch1_determine_rate.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tcon_ch1_determine_rate, %function
tcon_ch1_determine_rate:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L12
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r8, [r3]
	mov	r7, r0
	mov	r6, r1
	mov	r5, #0
	rsb	r8, r8, #0
	b	.L2
.L5:
	mov	r1, r5
	mov	r0, r7
	bl	clk_hw_get_parent_by_index
	subs	r9, r0, #0
	beq	.L3
	bl	clk_hw_get_rate
	mov	r3, #0
	mov	r1, r0
	mov	r4, r0
	mov	r2, r3
	ldr	r0, [r6]
	bl	tcon_ch1_calc_divider
	cmp	r8, #0
	blt	.L4
	ldr	r3, [r6]
	sub	r2, r3, r0
	sub	r3, r3, r8
	cmp	r2, r3
	bcs	.L3
.L4:
	mov	r8, r0
	stmib	r6, {r4, r9}
.L3:
	add	r5, r5, #1
.L2:
	mov	r0, r7
	bl	clk_hw_get_num_parents
	cmp	r0, r5
	bgt	.L5
	cmp	r8, #0
	strge	r8, [r6]
	movge	r8, #0
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	.align	2
.L12:
	.word	EINVAL
	.size	tcon_ch1_determine_rate, .-tcon_ch1_determine_rate
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
