	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il4965_rs_get_best_rate
_il4965_rs_get_best_rate:               ## @il4965_rs_get_best_rate
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %rbx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	16(%rsi), %rcx
	leaq	(%rax,%rax,2), %rax
	movq	(%rcx,%rax,8), %rsi
	movq	16(%rcx,%rax,8), %rax
	movl	(%rax,%r8,4), %r14d
	movl	(%rsi,%r8,4), %r13d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_RATE_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r15d, %r12d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, %r12d
	movl	%eax, %ebx
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %ecx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_il4965_rs_get_adjacent_rate
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx,%rbx,4), %ecx
	imull	$100, %ecx, %edx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	cmpl	8(%rsi), %edx
	jle	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_RATE_DECREASE_TH@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r14d
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_RATE_HIGH_TH@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r14d
	jg	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r13d, %ecx
	jle	LBB0_7
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_RATE_SCALE_SWITCH@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r14d
	jl	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r13d, %ecx
	jle	LBB0_11
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r12d, %ecx
	movq	_RATE_INVALID@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r12d
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movzbl	%al, %eax
	movl	%ebx, %r15d
	cmpl	%ecx, %eax
	jne	LBB0_14
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_RATE_INVALID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r15d
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	movzbl	%ah, %ecx
	movl	%ecx, %eax
	cmpl	%r15d, %ecx
	jne	LBB0_14
LBB0_9:
	movl	%ebx, %ecx
	jmp	LBB0_10
LBB0_12:
	movl	%r15d, %ecx
LBB0_10:
	movl	%ecx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RATE_INVALID,4,2               ## @RATE_INVALID
	.comm	_RATE_DECREASE_TH,4,2           ## @RATE_DECREASE_TH
	.comm	_RATE_HIGH_TH,4,2               ## @RATE_HIGH_TH
	.comm	_RATE_SCALE_SWITCH,4,2          ## @RATE_SCALE_SWITCH
	.no_dead_strip	_il4965_rs_get_best_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il4965_rs_get_best_rate
_il4965_rs_get_best_rate:               ; @il4965_rs_get_best_rate
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x4
	mov	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x23, x0
	ldr	x8, [x1, #16]
	ldr	x9, [x1]
	mov	w10, #24
	madd	x8, x9, x10, x8
	ldr	x9, [x8, #16]
	lsl	x10, x4, #2
	ldr	w25, [x9, x10]
	ldr	x8, [x8]
	ldr	w26, [x8, x10]
	ldr	x27, [x2]
Lloh0:
	adrp	x8, _RATE_INVALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RATE_INVALID@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	mov	x28, x24
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w3, [x20, #8]
	mov	x0, x23
	mov	x1, x21
	mov	x2, x19
	bl	_il4965_rs_get_adjacent_rate
	ldr	w8, [x27, x21, lsl #2]
	mov	w9, #100
	mul	w9, w8, w9
	ldr	w10, [x22, #8]
Lloh3:
	adrp	x11, _RATE_DECREASE_TH@GOTPAGE
Lloh4:
	ldr	x11, [x11, _RATE_DECREASE_TH@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
Lloh6:
	adrp	x12, _RATE_HIGH_TH@GOTPAGE
Lloh7:
	ldr	x12, [x12, _RATE_HIGH_TH@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	cmp	w9, w10
	ccmp	w25, w11, #4, gt
	ccmp	w25, w12, #0, gt
	ccmp	w8, w26, #0, le
	b.le	LBB0_6
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
Lloh9:
	adrp	x9, _RATE_SCALE_SWITCH@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RATE_SCALE_SWITCH@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w25, w9
	ccmp	w8, w26, #4, ge
	b.gt	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
Lloh12:
	adrp	x8, _RATE_INVALID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RATE_INVALID@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w28, w8
	b.ne	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ubfx	w24, w0, #8, #8
	mov	x8, x24
	cmp	w24, w28
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w21, w8
	b	LBB0_1
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
Lloh15:
	adrp	x8, _RATE_INVALID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RATE_INVALID@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w24, w8
	b.ne	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	and	w8, w0, #0xff
	cmp	w8, w24
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x28, x21
	mov	w21, w8
	b	LBB0_1
LBB0_9:
	mov	x24, x21
	b	LBB0_11
LBB0_10:
	mov	x24, x28
LBB0_11:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_RATE_INVALID,4,2               ; @RATE_INVALID
	.comm	_RATE_DECREASE_TH,4,2           ; @RATE_DECREASE_TH
	.comm	_RATE_HIGH_TH,4,2               ; @RATE_HIGH_TH
	.comm	_RATE_SCALE_SWITCH,4,2          ; @RATE_SCALE_SWITCH
	.no_dead_strip	_il4965_rs_get_best_rate
.subsections_via_symbols
