	.file	"extr_helpers.c_venus_helper_load_scale_clocks.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"HW is overloaded, needed: %d max: %d\n"
	.align 8
.LC1:
	.string	"failed to set clock rate %lu (%d)\n"
	.text
	.p2align 4
	.globl	venus_helper_load_scale_clocks
	.type	venus_helper_load_scale_clocks, @function
venus_helper_load_scale_clocks:
.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
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR 16[rdi]
	mov	esi, DWORD PTR VIDC_SESSION_TYPE_ENC[rip]
	mov	r14, QWORD PTR 24[rdi]
	mov	rbx, QWORD PTR 16[rax]
	mov	r15d, DWORD PTR [rax]
	mov	rax, QWORD PTR 32[rdi]
	mov	r13, QWORD PTR [rbx]
	mov	r8, QWORD PTR [rax]
	mov	QWORD PTR 8[rsp], r8
	call	load_per_type@PLT
	mov	esi, DWORD PTR VIDC_SESSION_TYPE_DEC[rip]
	mov	rdi, r12
	mov	rbp, rax
	call	load_per_type@PLT
	mov	r8, QWORD PTR 8[rsp]
	add	rbp, rax
	mov	rax, QWORD PTR 16[r12]
	mov	rcx, QWORD PTR 8[rax]
	cmp	rcx, rbp
	jl	.L20
.L2:
	test	rbp, rbp
	jne	.L10
	cmp	r15d, 1
	jbe	.L10
	lea	eax, -1[r15]
	sal	rax, 4
	mov	r13, QWORD PTR [rbx+rax]
.L6:
	mov	rsi, r13
	mov	rdi, r8
	call	clk_set_rate@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L21
.L8:
	mov	ecx, r15d
	mov	rdx, r13
	lea	rsi, .LC1[rip]
	mov	rdi, r14
	call	dev_err@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L10:
	.cfi_restore_state
	test	r15d, r15d
	je	.L6
	lea	edx, -1[r15]
	mov	rax, rbx
	sal	rdx, 4
	lea	rdx, 16[rbx+rdx]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	mov	r13, QWORD PTR [rax]
	add	rax, 16
	cmp	rdx, rax
	je	.L6
.L7:
	cmp	QWORD PTR 8[rax], rbp
	jge	.L22
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdi, QWORD PTR 8[r12]
	mov	rsi, r13
	call	clk_set_rate@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L8
	mov	rdi, QWORD PTR [r12]
	mov	rsi, r13
	call	clk_set_rate@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L1
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdx, rbp
	lea	rsi, .LC0[rip]
	mov	rdi, r14
	call	dev_warn@PLT
	mov	r8, QWORD PTR 8[rsp]
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	venus_helper_load_scale_clocks, .-venus_helper_load_scale_clocks
	.comm	VIDC_SESSION_TYPE_ENC,4,4
	.comm	VIDC_SESSION_TYPE_DEC,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_helpers.c_venus_helper_load_scale_clocks.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"HW is overloaded, needed: %d max: %d\012\000"
	.align	2
.LC1:
	.ascii	"failed to set clock rate %lu (%d)\012\000"
	.text
	.align	2
	.global	venus_helper_load_scale_clocks
	.syntax unified
	.arm
	.fpu softvfp
	.type	venus_helper_load_scale_clocks, %function
venus_helper_load_scale_clocks:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0, #8]
	ldr	r1, .L19
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r2, [r0, #16]
	ldr	r7, [r3, #8]
	ldr	r1, [r1]
	mov	r6, r0
	ldr	r5, [r3]
	ldr	r9, [r2]
	ldr	r4, [r7]
	ldr	r8, [r0, #12]
	bl	load_per_type
	ldr	r3, .L19+4
	mov	r10, r0
	ldr	r1, [r3]
	mov	r0, r6
	bl	load_per_type
	ldr	r3, [r6, #8]
	add	r10, r10, r0
	ldr	r3, [r3, #4]
	cmp	r3, r10
	blt	.L16
.L2:
	cmp	r5, #1
	movls	r3, #0
	movhi	r3, #1
	cmp	r10, #0
	movne	r3, #0
	cmp	r3, #0
	bne	.L3
	cmp	r5, #0
	addne	r1, r7, #4
	bne	.L4
	b	.L5
.L17:
	ldr	r4, [r7, r3, lsl #3]
	add	r3, r3, #1
	cmp	r5, r3
	beq	.L5
.L4:
	ldr	r2, [r1, r3, lsl #3]
	cmp	r2, r10
	bge	.L17
.L5:
	mov	r0, r9
	mov	r1, r4
	bl	clk_set_rate
	subs	r5, r0, #0
	beq	.L18
.L6:
	mov	r2, r4
	mov	r0, r8
	mov	r3, r5
	ldr	r1, .L19+8
	bl	dev_err
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	mov	r1, r4
	ldr	r0, [r6, #4]
	bl	clk_set_rate
	subs	r5, r0, #0
	bne	.L6
	mov	r1, r4
	ldr	r0, [r6]
	bl	clk_set_rate
	subs	r5, r0, #0
	bne	.L6
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	sub	r5, r5, #-536870911
	ldr	r4, [r7, r5, lsl #3]
	b	.L5
.L16:
	mov	r2, r10
	mov	r0, r8
	ldr	r1, .L19+12
	bl	dev_warn
	b	.L2
.L20:
	.align	2
.L19:
	.word	VIDC_SESSION_TYPE_ENC
	.word	VIDC_SESSION_TYPE_DEC
	.word	.LC1
	.word	.LC0
	.size	venus_helper_load_scale_clocks, .-venus_helper_load_scale_clocks
	.comm	VIDC_SESSION_TYPE_ENC,4,4
	.comm	VIDC_SESSION_TYPE_DEC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
