	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwlagn_tx_cmd_build_rate
_iwlagn_tx_cmd_build_rate:              ## @iwlagn_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movq	%rsi, %r13
	movq	%rdi, %r14
	cmpq	$0, 32(%rdi)
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movq	_IWLAGN_LOW_RETRY_LIMIT@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%r15, %r12
	jmp	LBB0_8
LBB0_2:
	movq	_IWLAGN_RTS_DFAULT_RETRY_LIMIT@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movl	%ebx, %edi
	callq	_ieee80211_is_probe_resp
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_IWLAGN_MGMT_DFAULT_RETRY_LIMIT@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_min
	movq	%rax, %r15
	jmp	LBB0_8
LBB0_4:
	movl	%ebx, %edi
	callq	_ieee80211_is_back_req
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_IWLAGN_BAR_DFAULT_RETRY_LIMIT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_IWLAGN_DEFAULT_TX_RETRY@GOTPCREL(%rip), %rax
LBB0_7:
	movq	(%rax), %r12
LBB0_8:
	movq	%r12, 24(%r13)
	movq	%r15, 16(%r13)
	movl	%ebx, %edi
	callq	_ieee80211_is_data
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	$0, 8(%r13)
	movq	_TX_CMD_FLG_STA_RATE_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r13)
	jmp	LBB0_26
LBB0_10:
	movl	%ebx, %edi
	callq	_ieee80211_is_back_req
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_TX_CMD_FLG_STA_RATE_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r13)
LBB0_12:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rax
	movq	_IEEE80211_TX_RC_MCS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rax)
	jne	LBB0_15
## %bb.13:
	movl	(%rax), %eax
	testl	%eax, %eax
	js	LBB0_15
## %bb.14:
	movq	_IWL_RATE_COUNT_LEGACY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_16
LBB0_15:
	movq	8(%r14), %rax
	movq	(%rbx), %rdi
	shlq	$2, %rdi
	addq	8(%rax), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_rate_lowest_index
LBB0_16:
	movq	(%rbx), %rsi
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rdi
	xorl	%ecx, %ecx
	movl	$0, %edx
	cmpq	(%rdi), %rsi
	jne	LBB0_18
## %bb.17:
	movq	_IWL_FIRST_OFDM_RATE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_18:
	addl	%eax, %edx
	movq	_iwl_rates@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edx, %rdx
	movq	_IWL_FIRST_CCK_RATE@GOTPCREL(%rip), %rsi
	movq	_IWL_LAST_CCK_RATE@GOTPCREL(%rip), %rdi
	movl	$0, %ebx
	cmpl	(%rdi), %edx
	jg	LBB0_20
## %bb.19:
	movq	_RATE_MCS_CCK_MSK@GOTPCREL(%rip), %rdi
	movl	(%rdi), %ebx
LBB0_20:
	cmpl	(%rsi), %edx
	cmovll	%ecx, %ebx
	movq	(%rax,%rdx,8), %r15
	movq	24(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_24
## %bb.21:
	cmpq	$0, (%rax)
	je	LBB0_24
## %bb.22:
	cmpq	$0, 16(%r14)
	je	LBB0_24
## %bb.23:
	movq	(%r14), %r12
	movq	8(%r14), %rax
	movl	(%rax), %edi
	callq	_first_antenna
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	jmp	LBB0_25
LBB0_24:
	movq	(%r14), %rsi
	movq	8(%r14), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
LBB0_25:
	callq	_iwl_toggle_tx_ant
	movq	%rax, %rdi
	movq	%rax, (%r14)
	callq	_iwl_ant_idx_to_flags
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_iwl_hw_set_rate_n_flags
	movl	%eax, (%r13)
LBB0_26:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IWLAGN_LOW_RETRY_LIMIT,8,3     ## @IWLAGN_LOW_RETRY_LIMIT
	.comm	_IWLAGN_RTS_DFAULT_RETRY_LIMIT,8,3 ## @IWLAGN_RTS_DFAULT_RETRY_LIMIT
	.comm	_IWLAGN_MGMT_DFAULT_RETRY_LIMIT,8,3 ## @IWLAGN_MGMT_DFAULT_RETRY_LIMIT
	.comm	_IWLAGN_BAR_DFAULT_RETRY_LIMIT,8,3 ## @IWLAGN_BAR_DFAULT_RETRY_LIMIT
	.comm	_IWLAGN_DEFAULT_TX_RETRY,8,3    ## @IWLAGN_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	_IWL_RATE_COUNT_LEGACY,4,2      ## @IWL_RATE_COUNT_LEGACY
	.comm	_NL80211_BAND_5GHZ,8,3          ## @NL80211_BAND_5GHZ
	.comm	_IWL_FIRST_OFDM_RATE,8,3        ## @IWL_FIRST_OFDM_RATE
	.comm	_iwl_rates,8,3                  ## @iwl_rates
	.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	_iwlagn_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 iwlagn_tx_cmd_build_rate
_iwlagn_tx_cmd_build_rate:              ; @iwlagn_tx_cmd_build_rate
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x4
	mov	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _IWLAGN_LOW_RETRY_LIMIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IWLAGN_LOW_RETRY_LIMIT@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
	mov	x25, x24
	b	LBB0_8
LBB0_2:
Lloh3:
	adrp	x8, _IWLAGN_RTS_DFAULT_RETRY_LIMIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IWLAGN_RTS_DFAULT_RETRY_LIMIT@GOTPAGEOFF]
Lloh5:
	ldr	x24, [x8]
	mov	x0, x23
	bl	_ieee80211_is_probe_resp
	cbz	x0, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _IWLAGN_MGMT_DFAULT_RETRY_LIMIT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IWLAGN_MGMT_DFAULT_RETRY_LIMIT@GOTPAGEOFF]
Lloh8:
	ldr	x25, [x8]
	mov	x0, x25
	mov	x1, x24
	bl	_min
	mov	x24, x0
	b	LBB0_8
LBB0_4:
	mov	x0, x23
	bl	_ieee80211_is_back_req
	cbz	x0, LBB0_6
; %bb.5:
Lloh9:
	adrp	x8, _IWLAGN_BAR_DFAULT_RETRY_LIMIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IWLAGN_BAR_DFAULT_RETRY_LIMIT@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh11:
	adrp	x8, _IWLAGN_DEFAULT_TX_RETRY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IWLAGN_DEFAULT_TX_RETRY@GOTPAGEOFF]
LBB0_7:
	ldr	x25, [x8]
LBB0_8:
	stp	x24, x25, [x19, #16]
	mov	x0, x23
	bl	_ieee80211_is_data
	cbz	x0, LBB0_10
; %bb.9:
	str	xzr, [x19, #8]
Lloh13:
	adrp	x8, _TX_CMD_FLG_STA_RATE_MSK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TX_CMD_FLG_STA_RATE_MSK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	b	LBB0_22
LBB0_10:
	mov	x0, x23
	bl	_ieee80211_is_back_req
	cbz	x0, LBB0_12
; %bb.11:
Lloh16:
	adrp	x8, _TX_CMD_FLG_STA_RATE_MSK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TX_CMD_FLG_STA_RATE_MSK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
LBB0_12:
	ldr	x8, [x21, #8]
	ldr	w9, [x8, #4]
Lloh19:
	adrp	x10, _IEEE80211_TX_RC_MCS@GOTPAGE
Lloh20:
	ldr	x10, [x10, _IEEE80211_TX_RC_MCS@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_15
; %bb.13:
	ldr	w0, [x8]
	tbnz	w0, #31, LBB0_15
; %bb.14:
Lloh22:
	adrp	x8, _IWL_RATE_COUNT_LEGACY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IWL_RATE_COUNT_LEGACY@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_16
LBB0_15:
	ldr	x8, [x20, #8]
	ldr	x8, [x8, #8]
	ldr	x9, [x21]
	add	x0, x8, x9, lsl #2
	mov	x1, x22
	bl	_rate_lowest_index
LBB0_16:
	ldr	x8, [x21]
Lloh25:
	adrp	x9, _NL80211_BAND_5GHZ@GOTPAGE
Lloh26:
	ldr	x9, [x9, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh27:
	adrp	x10, _IWL_FIRST_OFDM_RATE@GOTPAGE
Lloh28:
	ldr	x10, [x10, _IWL_FIRST_OFDM_RATE@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
Lloh30:
	ldr	w10, [x10]
	cmp	x8, x9
	csel	w8, w10, wzr, eq
Lloh31:
	adrp	x9, _iwl_rates@GOTPAGE
Lloh32:
	ldr	x9, [x9, _iwl_rates@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
Lloh34:
	adrp	x10, _IWL_LAST_CCK_RATE@GOTPAGE
Lloh35:
	ldr	x10, [x10, _IWL_LAST_CCK_RATE@GOTPAGEOFF]
Lloh36:
	ldr	w10, [x10]
	add	w8, w8, w0
	cmp	w8, w10
	ldr	x21, [x9, w8, sxtw #3]
Lloh37:
	adrp	x9, _IWL_FIRST_CCK_RATE@GOTPAGE
Lloh38:
	ldr	x9, [x9, _IWL_FIRST_CCK_RATE@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	ccmp	w8, w9, #8, le
Lloh40:
	adrp	x8, _RATE_MCS_CCK_MSK@GOTPAGE
Lloh41:
	ldr	x8, [x8, _RATE_MCS_CCK_MSK@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	csel	w23, wzr, w8, lt
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_20
; %bb.17:
	ldr	x8, [x8]
	cbz	x8, LBB0_20
; %bb.18:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_20
; %bb.19:
	ldp	x22, x8, [x20]
	ldr	w0, [x8]
	bl	_first_antenna
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	b	LBB0_21
LBB0_20:
	ldp	x1, x8, [x20]
	ldr	w2, [x8]
	mov	x0, x20
LBB0_21:
	bl	_iwl_toggle_tx_ant
	str	x0, [x20]
	bl	_iwl_ant_idx_to_flags
	orr	w1, w0, w23
	mov	x0, x21
	bl	_iwl_hw_set_rate_n_flags
	str	w0, [x19]
LBB0_22:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_IWLAGN_LOW_RETRY_LIMIT,8,3     ; @IWLAGN_LOW_RETRY_LIMIT
	.comm	_IWLAGN_RTS_DFAULT_RETRY_LIMIT,8,3 ; @IWLAGN_RTS_DFAULT_RETRY_LIMIT
	.comm	_IWLAGN_MGMT_DFAULT_RETRY_LIMIT,8,3 ; @IWLAGN_MGMT_DFAULT_RETRY_LIMIT
	.comm	_IWLAGN_BAR_DFAULT_RETRY_LIMIT,8,3 ; @IWLAGN_BAR_DFAULT_RETRY_LIMIT
	.comm	_IWLAGN_DEFAULT_TX_RETRY,8,3    ; @IWLAGN_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	_IWL_RATE_COUNT_LEGACY,4,2      ; @IWL_RATE_COUNT_LEGACY
	.comm	_NL80211_BAND_5GHZ,8,3          ; @NL80211_BAND_5GHZ
	.comm	_IWL_FIRST_OFDM_RATE,8,3        ; @IWL_FIRST_OFDM_RATE
	.comm	_iwl_rates,8,3                  ; @iwl_rates
	.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	_iwlagn_tx_cmd_build_rate
.subsections_via_symbols
