	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il4965_tx_cmd_build_rate
_il4965_tx_cmd_build_rate:              ## @il4965_tx_cmd_build_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movq	%rcx, %r12
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	%r8d, %edi
	callq	_ieee80211_is_probe_resp
	movl	$3, %edi
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_IL4965_DEFAULT_TX_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
LBB0_2:
	movl	%edi, (%r13)
	movl	$60, %esi
	callq	_min
	movl	%eax, 24(%r13)
	movl	%ebx, %edi
	callq	_ieee80211_is_data
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	$0, 16(%r13)
	movq	_TX_CMD_FLG_STA_RATE_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r13)
	jmp	LBB0_13
LBB0_4:
	movq	8(%r15), %rax
	movq	_IEEE80211_TX_RC_MCS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rax)
	jne	LBB0_7
## %bb.5:
	movl	(%rax), %eax
	testl	%eax, %eax
	js	LBB0_7
## %bb.6:
	movq	_RATE_COUNT_LEGACY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_8
LBB0_7:
	movq	(%r15), %rdi
	shlq	$2, %rdi
	addq	8(%r14), %rdi
	movq	%r12, %rsi
	callq	_rate_lowest_index
LBB0_8:
	movq	(%r15), %rsi
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rdi
	xorl	%ecx, %ecx
	movl	$0, %edx
	cmpq	(%rdi), %rsi
	jne	LBB0_10
## %bb.9:
	movq	_IL_FIRST_OFDM_RATE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_10:
	addl	%eax, %edx
	movq	_il_rates@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edx, %rsi
	movq	_IL_FIRST_CCK_RATE@GOTPCREL(%rip), %rdx
	movq	_IL_LAST_CCK_RATE@GOTPCREL(%rip), %rdi
	movl	$0, %ebx
	cmpl	(%rdi), %esi
	jg	LBB0_12
## %bb.11:
	movq	_RATE_MCS_CCK_MSK@GOTPCREL(%rip), %rdi
	movl	(%rdi), %ebx
LBB0_12:
	cmpl	(%rdx), %esi
	cmovll	%ecx, %ebx
	movl	4(%r14), %edx
	orl	(%rax,%rsi,4), %ebx
	movq	%r14, %rdi
	movq	%r14, %rsi
	callq	_il4965_toggle_tx_ant
	movl	(%r14), %edi
	callq	_BIT
	movq	_RATE_MCS_ANT_POS@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, %ebx
	movl	%ebx, %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%r13)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IL4965_DEFAULT_TX_RETRY,4,2    ## @IL4965_DEFAULT_TX_RETRY
	.comm	_TX_CMD_FLG_STA_RATE_MSK,4,2    ## @TX_CMD_FLG_STA_RATE_MSK
	.comm	_IEEE80211_TX_RC_MCS,4,2        ## @IEEE80211_TX_RC_MCS
	.comm	_RATE_COUNT_LEGACY,4,2          ## @RATE_COUNT_LEGACY
	.comm	_NL80211_BAND_5GHZ,8,3          ## @NL80211_BAND_5GHZ
	.comm	_IL_FIRST_OFDM_RATE,8,3         ## @IL_FIRST_OFDM_RATE
	.comm	_il_rates,8,3                   ## @il_rates
	.comm	_IL_FIRST_CCK_RATE,4,2          ## @IL_FIRST_CCK_RATE
	.comm	_IL_LAST_CCK_RATE,4,2           ## @IL_LAST_CCK_RATE
	.comm	_RATE_MCS_CCK_MSK,4,2           ## @RATE_MCS_CCK_MSK
	.comm	_RATE_MCS_ANT_POS,4,2           ## @RATE_MCS_ANT_POS
	.no_dead_strip	_il4965_tx_cmd_build_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il4965_tx_cmd_build_rate
_il4965_tx_cmd_build_rate:              ; @il4965_tx_cmd_build_rate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x23, x4
	mov	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x4
	bl	_ieee80211_is_probe_resp
Lloh0:
	adrp	x8, _IL4965_DEFAULT_TX_RETRY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IL4965_DEFAULT_TX_RETRY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	x0, #0
	mov	w9, #3
	csel	w0, w8, w9, eq
	str	w0, [x19]
	mov	w1, #60
	bl	_min
	str	w0, [x19, #24]
	mov	x0, x23
	bl	_ieee80211_is_data
	cbz	x0, LBB0_2
; %bb.1:
	str	xzr, [x19, #16]
Lloh3:
	adrp	x8, _TX_CMD_FLG_STA_RATE_MSK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TX_CMD_FLG_STA_RATE_MSK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	b	LBB0_7
LBB0_2:
	ldr	x8, [x21, #8]
	ldr	w9, [x8, #4]
Lloh6:
	adrp	x10, _IEEE80211_TX_RC_MCS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IEEE80211_TX_RC_MCS@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_5
; %bb.3:
	ldr	w0, [x8]
	tbnz	w0, #31, LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, _RATE_COUNT_LEGACY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RATE_COUNT_LEGACY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_6
LBB0_5:
	ldr	x8, [x20, #8]
	ldr	x9, [x21]
	add	x0, x8, x9, lsl #2
	mov	x1, x22
	bl	_rate_lowest_index
LBB0_6:
	ldr	x8, [x21]
Lloh12:
	adrp	x9, _NL80211_BAND_5GHZ@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
Lloh15:
	adrp	x10, _IL_FIRST_OFDM_RATE@GOTPAGE
Lloh16:
	ldr	x10, [x10, _IL_FIRST_OFDM_RATE@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	cmp	x8, x9
Lloh18:
	adrp	x8, _il_rates@GOTPAGE
Lloh19:
	ldr	x8, [x8, _il_rates@GOTPAGEOFF]
	csel	w9, w10, wzr, eq
Lloh20:
	ldr	x8, [x8]
Lloh21:
	adrp	x10, _IL_LAST_CCK_RATE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _IL_LAST_CCK_RATE@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	add	w9, w9, w0
	cmp	w9, w10
	ldr	w21, [x8, w9, sxtw #2]
Lloh24:
	adrp	x8, _IL_FIRST_CCK_RATE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IL_FIRST_CCK_RATE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ccmp	w9, w8, #8, le
Lloh27:
	adrp	x8, _RATE_MCS_CCK_MSK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RATE_MCS_CCK_MSK@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	csel	w22, wzr, w8, lt
	ldr	w2, [x20, #4]
	mov	x0, x20
	mov	x1, x20
	bl	_il4965_toggle_tx_ant
	ldr	w0, [x20]
	bl	_BIT
Lloh30:
	adrp	x8, _RATE_MCS_ANT_POS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RATE_MCS_ANT_POS@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	orr	w9, w22, w21
	orr	w0, w9, w8
	bl	_cpu_to_le32
	str	w0, [x19, #4]
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IL4965_DEFAULT_TX_RETRY,4,2    ; @IL4965_DEFAULT_TX_RETRY
	.comm	_TX_CMD_FLG_STA_RATE_MSK,4,2    ; @TX_CMD_FLG_STA_RATE_MSK
	.comm	_IEEE80211_TX_RC_MCS,4,2        ; @IEEE80211_TX_RC_MCS
	.comm	_RATE_COUNT_LEGACY,4,2          ; @RATE_COUNT_LEGACY
	.comm	_NL80211_BAND_5GHZ,8,3          ; @NL80211_BAND_5GHZ
	.comm	_IL_FIRST_OFDM_RATE,8,3         ; @IL_FIRST_OFDM_RATE
	.comm	_il_rates,8,3                   ; @il_rates
	.comm	_IL_FIRST_CCK_RATE,4,2          ; @IL_FIRST_CCK_RATE
	.comm	_IL_LAST_CCK_RATE,4,2           ; @IL_LAST_CCK_RATE
	.comm	_RATE_MCS_CCK_MSK,4,2           ; @RATE_MCS_CCK_MSK
	.comm	_RATE_MCS_ANT_POS,4,2           ; @RATE_MCS_ANT_POS
	.no_dead_strip	_il4965_tx_cmd_build_rate
.subsections_via_symbols
