	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7603_mac_tx_rate_val
_mt7603_mac_tx_rate_val:                ## @mt7603_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movl	$0, (%rcx)
	movl	(%rsi), %eax
	movq	_IEEE80211_TX_RC_MCS@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_6
## %bb.1:
	movl	4(%rbx), %esi
	movl	%esi, %r12d
	sarl	$3, %r12d
	movq	_IEEE80211_TX_RC_GREEN_FIELD@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	jne	LBB0_2
## %bb.3:
	movq	_MT_PHY_TYPE_HT@GOTPCREL(%rip), %rdx
	jmp	LBB0_4
LBB0_6:
	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), %r15d
	movzbl	%r15b, %esi
	sarl	$8, %r15d
	movl	$1, %r12d
	jmp	LBB0_7
LBB0_2:
	movq	_MT_PHY_TYPE_HT_GF@GOTPCREL(%rip), %rdx
LBB0_4:
	incl	%r12d
	movl	(%rdx), %r15d
	movq	_IEEE80211_TX_RC_40_MHZ_WIDTH@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_7
## %bb.5:
	movl	$1, (%rcx)
LBB0_7:
	movq	_MT_TX_RATE_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	_MT_TX_RATE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_FIELD_PREP
	xorl	%ecx, %ecx
	cmpl	$1, %r12d
	jne	LBB0_9
## %bb.8:
	movq	_MT_TX_RATE_STBC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_9:
	testl	%r14d, %r14d
	cmovel	%r14d, %ecx
	orl	%ecx, %ebx
	orl	%ebx, %eax
	popq	%rbx
	popq	%r12
	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_TX_RATE_IDX,4,2             ## @MT_TX_RATE_IDX
	.comm	_MT_TX_RATE_MODE,4,2            ## @MT_TX_RATE_MODE
	.comm	_MT_TX_RATE_STBC,4,2            ## @MT_TX_RATE_STBC
	.no_dead_strip	_mt7603_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 mt7603_mac_tx_rate_val
_mt7603_mac_tx_rate_val:                ; @mt7603_mac_tx_rate_val
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x20, x1
	str	wzr, [x3]
	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_3
; %bb.1:
	ldr	w1, [x20, #4]
	asr	w9, w1, #3
	add	w22, 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	w20, [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
	b.eq	LBB0_4
; %bb.2:
	mov	w8, #1
	str	w8, [x3]
	b	LBB0_4
LBB0_3:
	ldr	x8, [x0]
	ldrsw	x21, [x8]
	bl	_mt76_hw
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x8, [x8, x21, lsl #3]
	ldr	x8, [x8]
	ldp	w10, w9, [x20]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
Lloh13:
	adrp	x11, _IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPAGE
Lloh14:
	ldr	x11, [x11, _IEEE80211_TX_RC_USE_SHORT_PREAMBLE@GOTPAGEOFF]
Lloh15:
	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	w20, w8, #8
	and	w1, w8, #0xff
	mov	w22, #1
LBB0_4:
Lloh16:
	adrp	x8, _MT_TX_RATE_IDX@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MT_TX_RATE_IDX@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_FIELD_PREP
	mov	x21, x0
Lloh19:
	adrp	x8, _MT_TX_RATE_MODE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MT_TX_RATE_MODE@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_FIELD_PREP
	orr	w8, w0, w21
	cmp	w22, #1
	ccmp	w19, #0, #4, eq
Lloh22:
	adrp	x9, _MT_TX_RATE_STBC@GOTPAGE
Lloh23:
	ldr	x9, [x9, _MT_TX_RATE_STBC@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	csel	w9, w9, wzr, ne
	orr	w0, w8, w9
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 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	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_TX_RATE_IDX,4,2             ; @MT_TX_RATE_IDX
	.comm	_MT_TX_RATE_MODE,4,2            ; @MT_TX_RATE_MODE
	.comm	_MT_TX_RATE_STBC,4,2            ; @MT_TX_RATE_STBC
	.no_dead_strip	_mt7603_mac_tx_rate_val
.subsections_via_symbols
