	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs_initialize_lq
_rs_initialize_lq:                      ## @rs_initialize_lq
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_rs_use_green
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.1:
	testq	%r12, %r12
	je	LBB0_8
## %bb.2:
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	(%r12), %eax
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r14), %rcx
	movq	(%rcx), %rdi
	movq	8(%r12), %rcx
	movl	$1, %ebx
	subq	%rcx, %rbx
	cmpl	$0, 32(%r12)
	cmoveq	%rcx, %rbx
	movq	_IWL_RATE_COUNT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	movq	24(%r12), %r14
	movl	$0, %r15d
	cmovll	%eax, %r15d
	leaq	(%r14,%rbx,8), %r13
	testl	%eax, %eax
	cmovsl	%edx, %r15d
	movq	_iwl_rates@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r15,4), %eax
	movl	%eax, -44(%rbp)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_first_antenna
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, (%r14,%rbx,8)
	movq	_RATE_MCS_ANT_POS@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	-44(%rbp), %eax
	movl	%eax, -44(%rbp)
	movq	_IWL_FIRST_CCK_RATE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r15d
	jl	LBB0_5
## %bb.3:
	movq	_IWL_LAST_CCK_RATE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r15d
	jg	LBB0_5
## %bb.4:
	movq	_RATE_MCS_CCK_MSK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -44(%rbp)
LBB0_5:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	8(%r14), %esi
	leaq	-60(%rbp), %rcx
	movl	%eax, %edi
	movq	%r13, %rdx
	callq	_rs_get_tbl_info_from_mcs
	movl	(%r13), %esi
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_rs_is_valid_ant
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_rs_toggle_antenna
LBB0_7:
	movl	-60(%rbp), %edx
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	callq	_rate_n_flags_from_tbl
	movl	%eax, -44(%rbp)
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 4(%rcx,%rbx,8)
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_rs_set_expected_tpt_table
	movl	-44(%rbp), %edx
	xorl	%edi, %edi
	movq	%r12, %rsi
	callq	_rs_fill_link_cmd
	movq	(%r14), %rax
	movq	16(%r12), %rcx
	addq	$16, %r12
	movq	%r12, (%rax,%rcx,8)
	movq	%r14, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	_iwl_send_lq_cmd
LBB0_8:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IWL_RATE_COUNT,4,2             ## @IWL_RATE_COUNT
	.comm	_iwl_rates,8,3                  ## @iwl_rates
	.comm	_RATE_MCS_ANT_POS,4,2           ## @RATE_MCS_ANT_POS
	.comm	_IWL_FIRST_CCK_RATE,4,2         ## @IWL_FIRST_CCK_RATE
	.comm	_IWL_LAST_CCK_RATE,4,2          ## @IWL_LAST_CCK_RATE
	.comm	_RATE_MCS_CCK_MSK,4,2           ## @RATE_MCS_CCK_MSK
	.no_dead_strip	_rs_initialize_lq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rs_initialize_lq
_rs_initialize_lq:                      ; @rs_initialize_lq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x21, x1
	mov	x20, x0
	mov	x0, x1
	bl	_rs_use_green
	cbz	x21, LBB0_7
; %bb.1:
	cbz	x19, LBB0_7
; %bb.2:
	mov	x22, x0
	ldr	x8, [x21]
	ldr	x21, [x8]
	ldr	w8, [x19]
	ldr	x9, [x20, #16]
	ldr	x24, [x9]
	ldr	w9, [x19, #32]
	ldr	x10, [x19, #8]
	mov	w11, #1
	sub	x11, x11, x10
	cmp	w9, #0
	csel	x25, x10, x11, eq
	ldr	x26, [x19, #24]
Lloh0:
	adrp	x9, _IWL_RATE_COUNT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IWL_RATE_COUNT@GOTPAGEOFF]
	add	x23, x26, x25, lsl #3
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	mov	w9, #-1
	ccmp	w8, w9, #4, lt
	csel	w27, w8, wzr, gt
Lloh3:
	adrp	x8, _iwl_rates@GOTPAGE
Lloh4:
	ldr	x8, [x8, _iwl_rates@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w8, [x8, w27, uxtw #2]
	str	w8, [sp, #8]
	mov	x0, x24
	bl	_first_antenna
	str	w0, [x23]
Lloh6:
	adrp	x8, _RATE_MCS_ANT_POS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RATE_MCS_ANT_POS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	ldr	w9, [sp, #8]
	orr	w0, w9, w8
	str	w0, [sp, #8]
Lloh9:
	adrp	x8, _IWL_FIRST_CCK_RATE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IWL_FIRST_CCK_RATE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _IWL_LAST_CCK_RATE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IWL_LAST_CCK_RATE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w27, w8
	ccmp	w27, w9, #0, ge
	b.gt	LBB0_4
; %bb.3:
Lloh15:
	adrp	x8, _RATE_MCS_CCK_MSK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RATE_MCS_CCK_MSK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w0, w8, w0
	str	w0, [sp, #8]
LBB0_4:
	ldr	w1, [x20, #8]
	add	x3, sp, #12
	mov	x2, x23
	bl	_rs_get_tbl_info_from_mcs
	ldr	w1, [x23]
	mov	x0, x24
	bl	_rs_is_valid_ant
	cbnz	w0, LBB0_6
; %bb.5:
	add	x1, sp, #8
	mov	x0, x24
	mov	x2, x23
	bl	_rs_toggle_antenna
LBB0_6:
	ldr	w2, [sp, #12]
	mov	x0, x20
	mov	x1, x23
	mov	x3, x22
	bl	_rate_n_flags_from_tbl
	str	w0, [sp, #8]
	add	x8, x26, x25, lsl #3
	str	w0, [x8, #4]
	mov	x0, x19
	mov	x1, x23
	bl	_rs_set_expected_tpt_table
	ldr	w2, [sp, #8]
	mov	x0, #0
	mov	x1, x19
	bl	_rs_fill_link_cmd
	ldr	x8, [x20]
	ldr	x9, [x19, #16]!
	str	x19, [x8, x9, lsl #3]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	mov	w3, #0
	mov	w4, #1
	bl	_iwl_send_lq_cmd
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IWL_RATE_COUNT,4,2             ; @IWL_RATE_COUNT
	.comm	_iwl_rates,8,3                  ; @iwl_rates
	.comm	_RATE_MCS_ANT_POS,4,2           ; @RATE_MCS_ANT_POS
	.comm	_IWL_FIRST_CCK_RATE,4,2         ; @IWL_FIRST_CCK_RATE
	.comm	_IWL_LAST_CCK_RATE,4,2          ; @IWL_LAST_CCK_RATE
	.comm	_RATE_MCS_CCK_MSK,4,2           ; @RATE_MCS_CCK_MSK
	.no_dead_strip	_rs_initialize_lq
.subsections_via_symbols
