	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs_get_best_rate
_rs_get_best_rate:                      ## @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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rcx, -48(%rbp)
	movq	(%rsi), %rax
	movq	16(%rsi), %rcx
	leaq	(%rax,%rax,2), %rax
	movq	(%rcx,%rax,8), %rsi
	movq	16(%rcx,%rax,8), %rax
	movq	(%rax,%r8,8), %r15
	movl	(%rsi,%r8,4), %r13d
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %r12
	movq	_IWL_MVM_RS_SR_NO_DECREASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RS_PERCENT
	movq	%r15, %rdx
	cmpq	%rax, %r15
	movq	%r14, %r15
	jge	LBB0_1
## %bb.2:
	movl	8(%rbx), %r13d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_1:
	imull	$100, %r13d, %r13d
	leaq	L_.str(%rip), %rsi
LBB0_3:
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_IWL_DEBUG_RATE
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_find_first_bit
	movq	_IWL_RATE_INVALID@GOTPCREL(%rip), %r14
	cmpl	(%r14), %eax
	jne	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	jmp	LBB0_8
LBB0_5:
	movq	%r15, %rdi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%eax, %rbx
	imull	$100, (%r12,%rbx,4), %r8d
	cmpl	%r8d, %r13d
	jl	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %ecx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rs_get_adjacent_rate
	movq	%r15, %rdi
	movzbl	%ah, %eax
	cmpl	(%r14), %eax
	jne	LBB0_6
LBB0_8:
	movq	_IWL_INVALID_VALUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movslq	%eax, %rbx
LBB0_9:
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_IWL_DEBUG_RATE
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IWL_MVM_RS_SR_NO_DECREASE,4,2  ## @IWL_MVM_RS_SR_NO_DECREASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SR %d high. Find rate exceeding EXPECTED_CURRENT %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"SR %d not that good. Find rate exceeding ACTUAL_TPT %d\n"

	.comm	_BITS_PER_LONG,4,2              ## @BITS_PER_LONG
	.comm	_IWL_RATE_INVALID,4,2           ## @IWL_RATE_INVALID
L_.str.2:                               ## @.str.2
	.asciz	"Best rate found %d target_tp %d expected_new %d\n"

	.comm	_IWL_INVALID_VALUE,4,2          ## @IWL_INVALID_VALUE
	.no_dead_strip	_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 rs_get_best_rate
_rs_get_best_rate:                      ; @rs_get_best_rate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	str	x3, [sp, #8]
	ldr	x8, [x1, #16]
	ldr	x9, [x1]
	mov	w10, #24
	madd	x8, x9, x10, x8
	ldr	x9, [x8, #16]
	ldr	x22, [x9, x4, lsl #3]
	ldr	x8, [x8]
	ldr	w24, [x8, x4, lsl #2]
	ldr	x23, [x2]
Lloh0:
	adrp	x8, _IWL_MVM_RS_SR_NO_DECREASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IWL_MVM_RS_SR_NO_DECREASE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_RS_PERCENT
	cmp	x22, x0
	b.ge	LBB0_2
; %bb.1:
	ldr	w20, [x20, #8]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:
	mov	w8, #100
	mul	w20, w24, w8
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
LBB0_3:
	mov	x0, x19
	mov	x2, x22
	mov	x3, x20
	bl	_IWL_DEBUG_RATE
Lloh7:
	adrp	x8, _BITS_PER_LONG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BITS_PER_LONG@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_find_first_bit
	mov	x8, x0
Lloh10:
	adrp	x22, _IWL_RATE_INVALID@GOTPAGE
Lloh11:
	ldr	x22, [x22, _IWL_RATE_INVALID@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w0, w9
	b.eq	LBB0_7
; %bb.4:
	mov	w24, #100
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x23, w8, sxtw #2]
	mul	w9, w9, w24
	cmp	w20, w9
	b.lt	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x2, [sp, #8]
	ldr	w3, [x21, #8]
	mov	x0, x19
	mov	x1, x8
	bl	_rs_get_adjacent_rate
	ubfx	w8, w0, #8, #8
	ldr	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_5
LBB0_7:
Lloh12:
	adrp	x9, _IWL_INVALID_VALUE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IWL_INVALID_VALUE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	sxtw	x21, w8
	b	LBB0_9
LBB0_8:
	mov	x10, x8
	sxtw	x21, w10
LBB0_9:
	str	x9, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x8
	mov	x3, x20
	bl	_IWL_DEBUG_RATE
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_IWL_MVM_RS_SR_NO_DECREASE,4,2  ; @IWL_MVM_RS_SR_NO_DECREASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SR %d high. Find rate exceeding EXPECTED_CURRENT %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"SR %d not that good. Find rate exceeding ACTUAL_TPT %d\n"

	.comm	_BITS_PER_LONG,4,2              ; @BITS_PER_LONG
	.comm	_IWL_RATE_INVALID,4,2           ; @IWL_RATE_INVALID
l_.str.2:                               ; @.str.2
	.asciz	"Best rate found %d target_tp %d expected_new %d\n"

	.comm	_IWL_INVALID_VALUE,4,2          ; @IWL_INVALID_VALUE
	.no_dead_strip	_rs_get_best_rate
.subsections_via_symbols
