	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt7601u_mac_set_protection     ## -- Begin function mt7601u_mac_set_protection
	.p2align	4, 0x90
_mt7601u_mac_set_protection:            ## @mt7601u_mac_set_protection
	.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	%edx, %r9d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_IEEE80211_HT_OP_MODE_PROTECTION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	_MT_PROT_NAV_SHORT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_MT_PROT_TXOP_ALLOW_ALL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	orl	%ecx, %ebx
	movq	_MT_PROT_RTS_THR_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%ebx, %edx
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movq	_MT_PROT_CTRL_CTS2SELF@GOTPCREL(%rip), %rsi
	movl	(%rsi), %eax
	movq	_MT_PROT_TXOP_ALLOW_BW20@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	orl	%edx, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MT_PROT_RATE_CCK_11@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	%esi, %ecx
	jmp	LBB0_3
LBB0_2:
	movq	_MT_PROT_TXOP_ALLOW_BW20@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_MT_PROT_RATE_OFDM_24@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_MT_PROT_RATE_DUP_OFDM_24@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
LBB0_3:
	andl	%r9d, %edi
	addl	$-128, %edi
	movl	%edi, %eax
	andb	$15, %al
	movzbl	%al, %r11d
	orl	%ebx, %esi
	xorl	%r10d, %r10d
	movl	$12, %ebx
	btl	%r11d, %ebx
	movq	_MT_PROT_CTRL_RTS_CTS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	%eax, %ebx
	cmovbl	%r10d, %ebx
	cmpl	$4, %edi
	cmovael	%r10d, %ebx
	movl	$0, %r12d
	cmovbl	%eax, %r12d
	movl	%ecx, %r14d
	orl	%ebx, %r14d
	cmpb	$2, %r11b
	cmovel	%r10d, %r12d
	movl	%esi, %r13d
	orl	%r12d, %r13d
	testl	%r9d, %r8d
	cmovnel	%eax, %ebx
	cmovnel	%eax, %r12d
	orl	%ecx, %ebx
	orl	%esi, %r12d
	movq	_MT_CCK_PROT_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_mt7601u_wr
	movq	_MT_CCK_PROT_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$4, %rsi
	movq	%r15, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_mt7601u_wr
	movq	_MT_CCK_PROT_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$8, %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_mt7601u_wr
	movq	_MT_CCK_PROT_CFG@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	$12, %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_mt7601u_wr
	movq	(%r14), %rsi
	addq	$16, %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_mt7601u_wr
	movq	(%r14), %rsi
	addq	$20, %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mt7601u_wr                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IEEE80211_HT_OP_MODE_PROTECTION,4,2 ## @IEEE80211_HT_OP_MODE_PROTECTION
	.comm	_IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT,4,2 ## @IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT
	.comm	_MT_PROT_NAV_SHORT,4,2          ## @MT_PROT_NAV_SHORT
	.comm	_MT_PROT_TXOP_ALLOW_ALL,4,2     ## @MT_PROT_TXOP_ALLOW_ALL
	.comm	_MT_PROT_RTS_THR_EN,4,2         ## @MT_PROT_RTS_THR_EN
	.comm	_MT_PROT_CTRL_CTS2SELF,4,2      ## @MT_PROT_CTRL_CTS2SELF
	.comm	_MT_PROT_TXOP_ALLOW_BW20,4,2    ## @MT_PROT_TXOP_ALLOW_BW20
	.comm	_MT_PROT_RATE_CCK_11,4,2        ## @MT_PROT_RATE_CCK_11
	.comm	_MT_PROT_RATE_OFDM_24,4,2       ## @MT_PROT_RATE_OFDM_24
	.comm	_MT_PROT_RATE_DUP_OFDM_24,4,2   ## @MT_PROT_RATE_DUP_OFDM_24
	.comm	_MT_PROT_CTRL_RTS_CTS,4,2       ## @MT_PROT_CTRL_RTS_CTS
	.comm	_MT_CCK_PROT_CFG,8,3            ## @MT_CCK_PROT_CFG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt7601u_mac_set_protection     ; -- Begin function mt7601u_mac_set_protection
	.p2align	2
_mt7601u_mac_set_protection:            ; @mt7601u_mac_set_protection
	.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	x19, x0
Lloh0:
	adrp	x8, _IEEE80211_HT_OP_MODE_PROTECTION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IEEE80211_HT_OP_MODE_PROTECTION@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x8]
Lloh3:
	adrp	x8, _IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x8]
Lloh6:
	adrp	x8, _MT_PROT_NAV_SHORT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_PROT_NAV_SHORT@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x8]
Lloh9:
	adrp	x8, _MT_PROT_TXOP_ALLOW_ALL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT_PROT_TXOP_ALLOW_ALL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w10, w8, w12
Lloh12:
	adrp	x8, _MT_PROT_RTS_THR_EN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MT_PROT_RTS_THR_EN@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	orr	w8, w10, w8
	cbz	w1, LBB0_2
; %bb.1:
Lloh15:
	adrp	x13, _MT_PROT_CTRL_CTS2SELF@GOTPAGE
Lloh16:
	ldr	x13, [x13, _MT_PROT_CTRL_CTS2SELF@GOTPAGEOFF]
Lloh17:
	ldr	w13, [x13]
	orr	w20, w13, w8
Lloh18:
	adrp	x13, _MT_PROT_TXOP_ALLOW_BW20@GOTPAGE
Lloh19:
	ldr	x13, [x13, _MT_PROT_TXOP_ALLOW_BW20@GOTPAGEOFF]
Lloh20:
	ldr	w13, [x13]
	orr	w12, w13, w12
Lloh21:
	adrp	x13, _MT_PROT_RATE_CCK_11@GOTPAGE
Lloh22:
	ldr	x13, [x13, _MT_PROT_RATE_CCK_11@GOTPAGEOFF]
Lloh23:
	ldr	w13, [x13]
	orr	w12, w13, w12
	b	LBB0_3
LBB0_2:
Lloh24:
	adrp	x13, _MT_PROT_TXOP_ALLOW_BW20@GOTPAGE
Lloh25:
	ldr	x13, [x13, _MT_PROT_TXOP_ALLOW_BW20@GOTPAGEOFF]
Lloh26:
	ldr	w13, [x13]
	orr	w12, w13, w12
Lloh27:
	adrp	x13, _MT_PROT_RATE_OFDM_24@GOTPAGE
Lloh28:
	ldr	x13, [x13, _MT_PROT_RATE_OFDM_24@GOTPAGEOFF]
Lloh29:
	ldr	w13, [x13]
	orr	w12, w13, w12
Lloh30:
	adrp	x13, _MT_PROT_RATE_DUP_OFDM_24@GOTPAGE
Lloh31:
	ldr	x13, [x13, _MT_PROT_RATE_DUP_OFDM_24@GOTPAGEOFF]
Lloh32:
	ldr	w13, [x13]
	mov	x20, x8
LBB0_3:
	and	w11, w11, w2
	sub	w11, w11, #128
	cmp	w11, #3
	cset	w14, hi
	and	w15, w11, #0xf
	and	x11, x11, #0xf
	mov	w16, #12
	lsr	w11, w16, w11
	cmp	w15, #2
	cset	w15, eq
	orr	w11, w14, w11
	orr	w14, w15, w14
	orr	w10, w13, w10
Lloh33:
	adrp	x13, _MT_PROT_CTRL_RTS_CTS@GOTPAGE
Lloh34:
	ldr	x13, [x13, _MT_PROT_CTRL_RTS_CTS@GOTPAGEOFF]
Lloh35:
	ldr	w13, [x13]
	tst	w11, #0x1
	csel	w11, wzr, w13, ne
	orr	w21, w12, w11
	cmp	w14, #0
	csel	w14, wzr, w13, ne
	orr	w22, w10, w14
	tst	w9, w2
	csel	w9, w11, w13, eq
	orr	w23, w12, w9
	csel	w9, w14, w13, eq
	orr	w24, w10, w9
Lloh36:
	adrp	x25, _MT_CCK_PROT_CFG@GOTPAGE
Lloh37:
	ldr	x25, [x25, _MT_CCK_PROT_CFG@GOTPAGEOFF]
	ldr	x1, [x25]
	mov	x0, x19
	mov	x2, x8
	bl	_mt7601u_wr
	ldr	x8, [x25]
	add	x1, x8, #4
	mov	x0, x19
	mov	x2, x20
	bl	_mt7601u_wr
	ldr	x8, [x25]
	add	x1, x8, #8
	mov	x0, x19
	mov	x2, x21
	bl	_mt7601u_wr
	ldr	x8, [x25]
	add	x1, x8, #12
	mov	x0, x19
	mov	x2, x22
	bl	_mt7601u_wr
	ldr	x8, [x25]
	add	x1, x8, #16
	mov	x0, x19
	mov	x2, x23
	bl	_mt7601u_wr
	ldr	x8, [x25]
	add	x1, x8, #20
	mov	x0, x19
	mov	x2, x24
	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
	b	_mt7601u_wr
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_IEEE80211_HT_OP_MODE_PROTECTION,4,2 ; @IEEE80211_HT_OP_MODE_PROTECTION
	.comm	_IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT,4,2 ; @IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT
	.comm	_MT_PROT_NAV_SHORT,4,2          ; @MT_PROT_NAV_SHORT
	.comm	_MT_PROT_TXOP_ALLOW_ALL,4,2     ; @MT_PROT_TXOP_ALLOW_ALL
	.comm	_MT_PROT_RTS_THR_EN,4,2         ; @MT_PROT_RTS_THR_EN
	.comm	_MT_PROT_CTRL_CTS2SELF,4,2      ; @MT_PROT_CTRL_CTS2SELF
	.comm	_MT_PROT_TXOP_ALLOW_BW20,4,2    ; @MT_PROT_TXOP_ALLOW_BW20
	.comm	_MT_PROT_RATE_CCK_11,4,2        ; @MT_PROT_RATE_CCK_11
	.comm	_MT_PROT_RATE_OFDM_24,4,2       ; @MT_PROT_RATE_OFDM_24
	.comm	_MT_PROT_RATE_DUP_OFDM_24,4,2   ; @MT_PROT_RATE_DUP_OFDM_24
	.comm	_MT_PROT_CTRL_RTS_CTS,4,2       ; @MT_PROT_CTRL_RTS_CTS
	.comm	_MT_CCK_PROT_CFG,8,3            ; @MT_CCK_PROT_CFG
.subsections_via_symbols
