	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7615_mac_tx_rate_val
_mt7615_mac_tx_rate_val:                ## @mt7615_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movl	$0, (%rcx)
	movl	(%rsi), %ecx
	movq	_IEEE80211_TX_RC_VHT_MCS@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_ieee80211_rate_get_vht_mcs
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_ieee80211_rate_get_vht_nss
	movq	_MT_PHY_TYPE_VHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	movl	(%rbx), %ecx
	movq	_IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_2
## %bb.6:
	movq	_IEEE80211_TX_RC_80_MHZ_WIDTH@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_12
## %bb.7:
	movl	$2, (%r13)
	jmp	LBB0_14
LBB0_3:
	movq	_IEEE80211_TX_RC_MCS@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_8
## %bb.4:
	movl	4(%rbx), %r15d
	movl	%r15d, %eax
	sarl	$3, %eax
	movq	_IEEE80211_TX_RC_GREEN_FIELD@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_9
## %bb.5:
	movq	_MT_PHY_TYPE_HT@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_8:
	movq	(%rdi), %rax
	movslq	(%rax), %r15
	callq	_mt76_hw
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rax
	movq	(%rax), %rax
	movslq	4(%rbx), %rcx
	movq	_IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rbx)
	leaq	(%rax,%rcx,8), %rdx
	leaq	4(%rax,%rcx,8), %rax
	cmovneq	%rdx, %rax
	movl	(%rax), %r12d
	movzbl	%r12b, %r15d
	sarl	$8, %r12d
	movl	$1, %eax
	jmp	LBB0_14
LBB0_9:
	movq	_MT_PHY_TYPE_HT_GF@GOTPCREL(%rip), %rdx
LBB0_10:
	incl	%eax
	movl	(%rdx), %r12d
	movq	_IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_14
LBB0_2:
	movl	$1, (%r13)
LBB0_14:
	testl	%r14d, %r14d
	setne	%cl
	cmpl	$1, %eax
	sete	%dl
	movq	_MT_TX_RATE_STBC@GOTPCREL(%rip), %rsi
	decl	%eax
	xorl	%r13d, %r13d
	testb	%dl, %cl
	cmovnel	(%rsi), %r13d
	movq	_MT_TX_RATE_IDX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	$1, %r14d
	cmovel	%eax, %r14d
	movl	%r15d, %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	_MT_TX_RATE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_FIELD_PREP
	movl	%eax, %r15d
	movq	_MT_TX_RATE_NSS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_FIELD_PREP
	orl	%r13d, %ebx
	orl	%ebx, %eax
	orl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_IEEE80211_TX_RC_160_MHZ_WIDTH@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_14
## %bb.13:
	movl	$3, (%r13)
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_IEEE80211_TX_RC_VHT_MCS,4,2    ## @IEEE80211_TX_RC_VHT_MCS
	.comm	_MT_PHY_TYPE_VHT,4,2            ## @MT_PHY_TYPE_VHT
	.comm	_IEEE80211_TX_RC_40_MHZ_WIDTH,4,2 ## @IEEE80211_TX_RC_40_MHZ_WIDTH
	.comm	_IEEE80211_TX_RC_80_MHZ_WIDTH,4,2 ## @IEEE80211_TX_RC_80_MHZ_WIDTH
	.comm	_IEEE80211_TX_RC_160_MHZ_WIDTH,4,2 ## @IEEE80211_TX_RC_160_MHZ_WIDTH
	.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_USE_SHORT_PREAMBLE,4,2 ## @IEEE80211_TX_RC_USE_SHORT_PREAMBLE
	.comm	_MT_TX_RATE_STBC,4,2            ## @MT_TX_RATE_STBC
	.comm	_MT_TX_RATE_IDX,4,2             ## @MT_TX_RATE_IDX
	.comm	_MT_TX_RATE_MODE,4,2            ## @MT_TX_RATE_MODE
	.comm	_MT_TX_RATE_NSS,4,2             ## @MT_TX_RATE_NSS
	.no_dead_strip	_mt7615_mac_tx_rate_val
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7615_mac_tx_rate_val
_mt7615_mac_tx_rate_val:                ; @mt7615_mac_tx_rate_val
	.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	x22, x3
	mov	x19, x2
	mov	x23, x1
	str	wzr, [x3]
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _IEEE80211_TX_RC_VHT_MCS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IEEE80211_TX_RC_VHT_MCS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	mov	x0, x23
	bl	_ieee80211_rate_get_vht_mcs
	mov	x20, x0
	mov	x0, x23
	bl	_ieee80211_rate_get_vht_nss
Lloh3:
	adrp	x8, _MT_PHY_TYPE_VHT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_PHY_TYPE_VHT@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	ldr	w8, [x23]
Lloh6:
	adrp	x9, _IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.2:
Lloh9:
	adrp	x9, _IEEE80211_TX_RC_80_MHZ_WIDTH@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IEEE80211_TX_RC_80_MHZ_WIDTH@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.3:
	mov	w8, #2
	b	LBB0_7
LBB0_4:
Lloh12:
	adrp	x9, _IEEE80211_TX_RC_MCS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IEEE80211_TX_RC_MCS@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.5:
	ldr	w20, [x23, #4]
	asr	w9, w20, #3
	add	w0, w9, #1
Lloh15:
	adrp	x9, _IEEE80211_TX_RC_GREEN_FIELD@GOTPAGE
Lloh16:
	ldr	x9, [x9, _IEEE80211_TX_RC_GREEN_FIELD@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _MT_PHY_TYPE_HT@GOTPAGE
Lloh19:
	ldr	x10, [x10, _MT_PHY_TYPE_HT@GOTPAGEOFF]
Lloh20:
	adrp	x11, _MT_PHY_TYPE_HT_GF@GOTPAGE
Lloh21:
	ldr	x11, [x11, _MT_PHY_TYPE_HT_GF@GOTPAGEOFF]
	tst	w9, w8
	csel	x9, x10, x11, eq
	ldr	w21, [x9]
Lloh22:
	adrp	x9, _IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPAGE
Lloh23:
	ldr	x9, [x9, _IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_6:
	mov	w8, #1
LBB0_7:
	str	w8, [x22]
LBB0_8:
	cmp	w19, #0
	cset	w22, ne
	subs	w23, w0, #1
	cset	w24, eq
Lloh25:
	adrp	x8, _MT_TX_RATE_STBC@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MT_TX_RATE_STBC@GOTPAGEOFF]
Lloh27:
	ldr	w25, [x8]
Lloh28:
	adrp	x8, _MT_TX_RATE_IDX@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MT_TX_RATE_IDX@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_FIELD_PREP
	mov	x19, x0
Lloh31:
	adrp	x8, _MT_TX_RATE_MODE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MT_TX_RATE_MODE@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_FIELD_PREP
	mov	x20, x0
	tst	w22, w24
	csel	w21, w25, wzr, ne
Lloh34:
	adrp	x8, _MT_TX_RATE_NSS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MT_TX_RATE_NSS@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	csinc	w1, w23, wzr, eq
	bl	_FIELD_PREP
	orr	w8, w19, w21
	orr	w8, w8, w20
	orr	w0, w8, w0
	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
LBB0_9:
	ldr	x8, [x0]
	ldrsw	x20, [x8]
	bl	_mt76_hw
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x8, [x8, x20, lsl #3]
	ldr	x8, [x8]
	ldp	w10, w9, [x23]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
Lloh37:
	adrp	x11, _IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPAGE
Lloh38:
	ldr	x11, [x11, _IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPAGEOFF]
Lloh39:
	ldr	w11, [x11]
	add	x8, x8, x9, lsl #3
	add	x9, x8, #4
	tst	w11, w10
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	asr	w21, w8, #8
	and	w20, w8, #0xff
	mov	w0, #1
	b	LBB0_8
LBB0_10:
Lloh40:
	adrp	x9, _IEEE80211_TX_RC_160_MHZ_WIDTH@GOTPAGE
Lloh41:
	ldr	x9, [x9, _IEEE80211_TX_RC_160_MHZ_WIDTH@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.11:
	mov	w8, #3
	b	LBB0_7
	.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	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_IEEE80211_TX_RC_VHT_MCS,4,2    ; @IEEE80211_TX_RC_VHT_MCS
	.comm	_MT_PHY_TYPE_VHT,4,2            ; @MT_PHY_TYPE_VHT
	.comm	_IEEE80211_TX_RC_40_MHZ_WIDTH,4,2 ; @IEEE80211_TX_RC_40_MHZ_WIDTH
	.comm	_IEEE80211_TX_RC_80_MHZ_WIDTH,4,2 ; @IEEE80211_TX_RC_80_MHZ_WIDTH
	.comm	_IEEE80211_TX_RC_160_MHZ_WIDTH,4,2 ; @IEEE80211_TX_RC_160_MHZ_WIDTH
	.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_USE_SHORT_PREAMBLE,4,2 ; @IEEE80211_TX_RC_USE_SHORT_PREAMBLE
	.comm	_MT_TX_RATE_STBC,4,2            ; @MT_TX_RATE_STBC
	.comm	_MT_TX_RATE_IDX,4,2             ; @MT_TX_RATE_IDX
	.comm	_MT_TX_RATE_MODE,4,2            ; @MT_TX_RATE_MODE
	.comm	_MT_TX_RATE_NSS,4,2             ; @MT_TX_RATE_NSS
	.no_dead_strip	_mt7615_mac_tx_rate_val
.subsections_via_symbols
