	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_helper_load_scale_clocks ## -- Begin function venus_helper_load_scale_clocks
	.p2align	4, 0x90
_venus_helper_load_scale_clocks:        ## @venus_helper_load_scale_clocks
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	24(%rdi), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	16(%rax), %r12
	movl	(%rax), %r15d
	movq	(%r12), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	32(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_VIDC_SESSION_TYPE_ENC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_load_per_type
	movq	%rax, %r14
	movq	_VIDC_SESSION_TYPE_DEC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_load_per_type
	movq	%rax, %rbx
	addq	%r14, %rbx
	movq	16(%r13), %rax
	movq	8(%rax), %rcx
	cmpq	%rcx, %rbx
	jle	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_dev_warn
LBB0_2:
	testq	%rbx, %rbx
	jne	LBB0_5
## %bb.3:
	cmpl	$1, %r15d
	jbe	LBB0_5
## %bb.4:
	decl	%r15d
	shlq	$4, %r15
	movq	(%r12,%r15), %r14
	jmp	LBB0_12
LBB0_5:
	testq	%r15, %r15
	je	LBB0_11
## %bb.6:
	cmpq	8(%r12), %rbx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jg	LBB0_13
## %bb.7:
	shlq	$4, %r15
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rcx
	addq	$16, %rax
	cmpq	%rax, %r15
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpq	24(%r12,%rcx), %rbx
	jle	LBB0_8
LBB0_10:
	movq	(%r12,%rcx), %r14
	jmp	LBB0_13
LBB0_11:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_13:
	movq	%r14, %rsi
	callq	_clk_set_rate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.14:
	movq	8(%r13), %rdi
	movq	%r14, %rsi
	callq	_clk_set_rate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.15:
	movq	(%r13), %rdi
	movq	%r14, %rsi
	callq	_clk_set_rate
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_18
LBB0_16:
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	movl	%ebx, %ecx
	callq	_dev_err
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	xorl	%ebx, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDC_SESSION_TYPE_ENC,4,2      ## @VIDC_SESSION_TYPE_ENC
	.comm	_VIDC_SESSION_TYPE_DEC,4,2      ## @VIDC_SESSION_TYPE_DEC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HW is overloaded, needed: %d max: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to set clock rate %lu (%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_helper_load_scale_clocks ; -- Begin function venus_helper_load_scale_clocks
	.p2align	2
_venus_helper_load_scale_clocks:        ; @venus_helper_load_scale_clocks
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	ldp	x8, x19, [x0, #16]
	ldr	x24, [x8, #16]
	ldr	w25, [x8]
	ldr	x21, [x24]
	ldr	x8, [x0, #32]
	ldr	x22, [x8]
Lloh0:
	adrp	x8, _VIDC_SESSION_TYPE_ENC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDC_SESSION_TYPE_ENC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_load_per_type
	mov	x23, x0
Lloh3:
	adrp	x8, _VIDC_SESSION_TYPE_DEC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDC_SESSION_TYPE_DEC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_load_per_type
	ldr	x8, [x20, #16]
	ldr	x3, [x8, #8]
	add	x23, x0, x23
	cmp	x23, x3
	b.le	LBB0_2
; %bb.1:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x23
	bl	_dev_warn
LBB0_2:
	cmp	x23, #0
	ccmp	w25, #1, #0, eq
	b.hi	LBB0_8
; %bb.3:
	cbz	w25, LBB0_10
; %bb.4:
	ldr	x8, [x24, #8]
	cmp	x23, x8
	b.gt	LBB0_10
; %bb.5:
	mov	x11, #0
	add	x8, x24, #24
	sub	x10, x25, #1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x9, x11
	cmp	x10, x11
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x12, [x8], #16
	add	x11, x9, #1
	cmp	x23, x12
	b.le	LBB0_6
	b	LBB0_9
LBB0_8:
	sub	w9, w25, #1
LBB0_9:
	lsl	x8, x9, #4
	ldr	x21, [x24, x8]
LBB0_10:
	mov	x0, x22
	mov	x1, x21
	bl	_clk_set_rate
	mov	x22, x0
	cbnz	w0, LBB0_13
; %bb.11:
	ldr	x0, [x20, #8]
	mov	x1, x21
	bl	_clk_set_rate
	mov	x22, x0
	cbnz	w0, LBB0_13
; %bb.12:
	ldr	x0, [x20]
	mov	x1, x21
	bl	_clk_set_rate
	mov	x22, x0
	cbz	w0, LBB0_14
LBB0_13:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	bl	_dev_err
LBB0_14:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDC_SESSION_TYPE_ENC,4,2      ; @VIDC_SESSION_TYPE_ENC
	.comm	_VIDC_SESSION_TYPE_DEC,4,2      ; @VIDC_SESSION_TYPE_DEC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HW is overloaded, needed: %d max: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to set clock rate %lu (%d)\n"

.subsections_via_symbols
