	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	16(%rsi), %rcx
	leaq	(%rax,%rax,2), %rax
	movq	(%rcx,%rax,8), %rsi
	movq	16(%rcx,%rax,8), %rax
	movq	(%rax,%r8,8), %r14
	movq	(%rsi,%r8,8), %r12
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_IWL_RATE_INVALID@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %r13
	movq	%r8, %rbx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %ecx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r8, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_rs_get_adjacent_rate
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx,%rbx,4), %rcx
	imull	$100, %ecx, %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	cmpl	8(%rsi), %edx
	jle	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_IWL_RATE_DECREASE_TH@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %r14
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_IWL_RATE_HIGH_TH@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %r14
	jg	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rcx, %r12
	jge	LBB0_7
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_IWL_RATE_SCALE_SWITCH@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %r14
	jl	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rcx, %r12
	jge	LBB0_10
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_IWL_RATE_INVALID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r13
	movq	%r13, %rcx
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movzbl	%al, %r8d
	movq	%rbx, %r15
	cmpq	%r8, %rcx
	jne	LBB0_1
	jmp	LBB0_13
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_IWL_RATE_INVALID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r15
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movzbl	%ah, %ecx
	movq	%rcx, %r8
	cmpq	%rcx, %r15
	jne	LBB0_1
	jmp	LBB0_13
LBB0_8:
	movq	%rcx, %rbx
LBB0_13:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r15, %rbx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_IWL_RATE_INVALID,8,3           ## @IWL_RATE_INVALID
	.comm	_IWL_RATE_DECREASE_TH,8,3       ## @IWL_RATE_DECREASE_TH
	.comm	_IWL_RATE_HIGH_TH,8,3           ## @IWL_RATE_HIGH_TH
	.comm	_IWL_RATE_SCALE_SWITCH,8,3      ## @IWL_RATE_SCALE_SWITCH
	.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:
	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	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x8, [x1, #16]
	ldr	x9, [x1]
	mov	w10, #24
	madd	x8, x9, x10, x8
	ldr	x9, [x8, #16]
	lsl	x10, x4, #3
	ldr	x24, [x9, x10]
	ldr	x8, [x8]
	ldr	x25, [x8, x10]
	ldr	x26, [x2]
Lloh0:
	adrp	x8, _IWL_RATE_INVALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IWL_RATE_INVALID@GOTPAGEOFF]
Lloh2:
	ldr	x27, [x8]
	mov	x28, x27
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x23, x4
	ldr	w3, [x20, #8]
	mov	x0, x22
	mov	x1, x4
	mov	x2, x19
	bl	_rs_get_adjacent_rate
	ldrsw	x8, [x26, x23, lsl #2]
	mov	w9, #100
	mul	w9, w8, w9
	ldr	w10, [x21, #8]
Lloh3:
	adrp	x11, _IWL_RATE_DECREASE_TH@GOTPAGE
Lloh4:
	ldr	x11, [x11, _IWL_RATE_DECREASE_TH@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
Lloh6:
	adrp	x12, _IWL_RATE_HIGH_TH@GOTPAGE
Lloh7:
	ldr	x12, [x12, _IWL_RATE_HIGH_TH@GOTPAGEOFF]
Lloh8:
	ldr	x12, [x12]
	cmp	w9, w10
	ccmp	x24, x11, #4, gt
	ccmp	x24, x12, #0, gt
	ccmp	x25, x8, #8, le
	b.ge	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
Lloh9:
	adrp	x9, _IWL_RATE_SCALE_SWITCH@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IWL_RATE_SCALE_SWITCH@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x24, x9
	ccmp	x25, x8, #0, ge
	b.ge	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
Lloh12:
	adrp	x8, _IWL_RATE_INVALID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IWL_RATE_INVALID@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x27, x8
	b.ne	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	and	w4, w0, #0xff
	mov	x28, x23
	cmp	x27, x4
	b.ne	LBB0_1
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
Lloh15:
	adrp	x8, _IWL_RATE_INVALID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IWL_RATE_INVALID@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x28, x8
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	ubfx	w27, w0, #8, #8
	mov	x4, x27
	cmp	x28, x27
	b.ne	LBB0_1
	b	LBB0_8
LBB0_7:
	mov	x23, x27
LBB0_8:
	mov	x0, x23
	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
LBB0_9:
	mov	x23, x28
	b	LBB0_8
	.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	_IWL_RATE_INVALID,8,3           ; @IWL_RATE_INVALID
	.comm	_IWL_RATE_DECREASE_TH,8,3       ; @IWL_RATE_DECREASE_TH
	.comm	_IWL_RATE_HIGH_TH,8,3           ; @IWL_RATE_HIGH_TH
	.comm	_IWL_RATE_SCALE_SWITCH,8,3      ; @IWL_RATE_SCALE_SWITCH
	.no_dead_strip	_rs_get_best_rate
.subsections_via_symbols
