	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76_mac_tx_rate_val           ## -- Begin function mt76_mac_tx_rate_val
	.p2align	4, 0x90
_mt76_mac_tx_rate_val:                  ## @mt76_mac_tx_rate_val
	.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	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %eax
	movq	_IEEE80211_TX_RC_MCS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_5
## %bb.1:
	movl	4(%rsi), %esi
	movl	%esi, %r15d
	sarl	$3, %r15d
	movq	_IEEE80211_TX_RC_GREEN_FIELD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_2
## %bb.3:
	movq	_MT_PHY_TYPE_HT@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_5:
	movq	(%rdi), %rcx
	movq	8(%rdi), %rdx
	movslq	(%rdx), %rdx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%rdx,8), %rcx
	movq	(%rcx), %rcx
	movslq	4(%rsi), %rdx
	movq	_IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPCREL(%rip), %rsi
	testl	%eax, (%rsi)
	leaq	(%rcx,%rdx,8), %rax
	leaq	4(%rcx,%rdx,8), %rcx
	cmovneq	%rax, %rcx
	movl	(%rcx), %r12d
	movzbl	%r12b, %esi
	sarl	$8, %r12d
	xorl	%r13d, %r13d
	movl	$1, %r15d
	jmp	LBB0_6
LBB0_2:
	movq	_MT_PHY_TYPE_HT_GF@GOTPCREL(%rip), %rcx
LBB0_4:
	incl	%r15d
	movl	(%rcx), %r12d
	movq	_IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	testl	%eax, (%rcx)
	setne	%r13b
LBB0_6:
	movq	_MT_RXWI_RATE_MCS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_FIELD_PREP
	movl	%eax, %r14d
	movq	_MT_RXWI_RATE_PHY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	_MT_RXWI_RATE_BW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_FIELD_PREP
	orl	%r14d, %eax
	movq	_IEEE80211_TX_RC_SHORT_GI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	andl	(%rdx), %ecx
	je	LBB0_8
## %bb.7:
	movq	_MT_RXWI_RATE_SGI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_8:
	orl	%ecx, %eax
	orl	%eax, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IEEE80211_TX_RC_MCS,4,2        ## @IEEE80211_TX_RC_MCS
	.comm	_MT_PHY_TYPE_HT,4,2             ## @MT_PHY_TYPE_HT
	.comm	_IEEE80211_TX_RC_GREEN_FIELD,4,2 ## @IEEE80211_TX_RC_GREEN_FIELD
	.comm	_MT_PHY_TYPE_HT_GF,4,2          ## @MT_PHY_TYPE_HT_GF
	.comm	_IEEE80211_TX_RC_40_MHZ_WIDTH,4,2 ## @IEEE80211_TX_RC_40_MHZ_WIDTH
	.comm	_IEEE80211_TX_RC_USE_SHORT_PREAMBLE,4,2 ## @IEEE80211_TX_RC_USE_SHORT_PREAMBLE
	.comm	_MT_RXWI_RATE_MCS,4,2           ## @MT_RXWI_RATE_MCS
	.comm	_MT_RXWI_RATE_PHY,4,2           ## @MT_RXWI_RATE_PHY
	.comm	_MT_RXWI_RATE_BW,4,2            ## @MT_RXWI_RATE_BW
	.comm	_IEEE80211_TX_RC_SHORT_GI,4,2   ## @IEEE80211_TX_RC_SHORT_GI
	.comm	_MT_RXWI_RATE_SGI,4,2           ## @MT_RXWI_RATE_SGI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76_mac_tx_rate_val           ; -- Begin function mt76_mac_tx_rate_val
	.p2align	2
_mt76_mac_tx_rate_val:                  ; @mt76_mac_tx_rate_val
	.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	x19, x2
	mov	x20, x1
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _IEEE80211_TX_RC_MCS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IEEE80211_TX_RC_MCS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w1, [x20, #4]
	asr	w9, w1, #3
	add	w24, w9, #1
Lloh3:
	adrp	x9, _IEEE80211_TX_RC_GREEN_FIELD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IEEE80211_TX_RC_GREEN_FIELD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _MT_PHY_TYPE_HT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _MT_PHY_TYPE_HT@GOTPAGEOFF]
Lloh8:
	adrp	x11, _MT_PHY_TYPE_HT_GF@GOTPAGE
Lloh9:
	ldr	x11, [x11, _MT_PHY_TYPE_HT_GF@GOTPAGEOFF]
	tst	w9, w8
	csel	x9, x10, x11, eq
	ldr	w22, [x9]
Lloh10:
	adrp	x9, _IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w21, ne
	b	LBB0_3
LBB0_2:
	mov	w21, #0
	ldp	x10, x9, [x0]
	ldrsw	x9, [x9]
	ldr	x10, [x10]
	ldr	x10, [x10]
	ldr	x9, [x10, x9, lsl #3]
	ldr	x9, [x9]
	ldrsw	x10, [x20, #4]
	add	x9, x9, x10, lsl #3
Lloh13:
	adrp	x10, _IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	tst	w10, w8
	add	x8, x9, #4
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	asr	w22, w8, #8
	and	w1, w8, #0xff
	mov	w24, #1
LBB0_3:
Lloh16:
	adrp	x8, _MT_RXWI_RATE_MCS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MT_RXWI_RATE_MCS@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_FIELD_PREP
	mov	x23, x0
Lloh19:
	adrp	x8, _MT_RXWI_RATE_PHY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MT_RXWI_RATE_PHY@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_FIELD_PREP
	orr	w22, w0, w23
Lloh22:
	adrp	x8, _MT_RXWI_RATE_BW@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MT_RXWI_RATE_BW@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_FIELD_PREP
	orr	w8, w22, w0
	ldr	w9, [x20]
Lloh25:
	adrp	x10, _IEEE80211_TX_RC_SHORT_GI@GOTPAGE
Lloh26:
	ldr	x10, [x10, _IEEE80211_TX_RC_SHORT_GI@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
Lloh28:
	adrp	x11, _MT_RXWI_RATE_SGI@GOTPAGE
Lloh29:
	ldr	x11, [x11, _MT_RXWI_RATE_SGI@GOTPAGEOFF]
Lloh30:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, wzr, w11, eq
	orr	w0, w8, w9
	str	w24, [x19]
	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	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_IEEE80211_TX_RC_MCS,4,2        ; @IEEE80211_TX_RC_MCS
	.comm	_MT_PHY_TYPE_HT,4,2             ; @MT_PHY_TYPE_HT
	.comm	_IEEE80211_TX_RC_GREEN_FIELD,4,2 ; @IEEE80211_TX_RC_GREEN_FIELD
	.comm	_MT_PHY_TYPE_HT_GF,4,2          ; @MT_PHY_TYPE_HT_GF
	.comm	_IEEE80211_TX_RC_40_MHZ_WIDTH,4,2 ; @IEEE80211_TX_RC_40_MHZ_WIDTH
	.comm	_IEEE80211_TX_RC_USE_SHORT_PREAMBLE,4,2 ; @IEEE80211_TX_RC_USE_SHORT_PREAMBLE
	.comm	_MT_RXWI_RATE_MCS,4,2           ; @MT_RXWI_RATE_MCS
	.comm	_MT_RXWI_RATE_PHY,4,2           ; @MT_RXWI_RATE_PHY
	.comm	_MT_RXWI_RATE_BW,4,2            ; @MT_RXWI_RATE_BW
	.comm	_IEEE80211_TX_RC_SHORT_GI,4,2   ; @IEEE80211_TX_RC_SHORT_GI
	.comm	_MT_RXWI_RATE_SGI,4,2           ; @MT_RXWI_RATE_SGI
.subsections_via_symbols
