	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_edcca_init             ## -- Begin function mt76x02_edcca_init
	.p2align	4, 0x90
_mt76x02_edcca_init:                    ## @mt76x02_edcca_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rdi)
	cmpq	$0, 16(%rdi)
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	_MT_TX_LINK_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TX_CFACK_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$3598, %eax                     ## imm = 0xE0E
	movl	$8224, %r14d                    ## imm = 0x2020
	cmovel	%eax, %r14d
	movq	%rbx, %rdi
	callq	_mt76_clear
	movq	_MT_TXOP_CTRL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TXOP_ED_CCA_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mt76_set
	movq	_AGC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$2, %esi
	callq	_MT_BBP
	movl	%eax, %r15d
	movl	$15, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%r14d, %ecx
	callq	_mt76_rmw
	jmp	LBB0_4
LBB0_2:
	movq	_MT_TX_LINK_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TX_CFACK_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mt76_set
	movq	_MT_TXOP_CTRL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TXOP_ED_CCA_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mt76_clear
	movq	%rbx, %rdi
	callq	_is_mt76x2
	movq	%rax, %r14
	movq	_AGC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$2, %esi
	callq	_MT_BBP
	movq	%rbx, %rdi
	movl	%eax, %esi
	testq	%r14, %r14
	je	LBB0_5
## %bb.3:
	movl	$28784, %edx                    ## imm = 0x7070
	callq	_mt76_wr
LBB0_4:
	movq	_MT_TXOP_HLDR_ET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TXOP_HLDR_TX40M_BLK_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mt76_set
LBB0_6:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_mt76x02_edcca_tx_enable
	movl	$1, (%rbx)
	movq	_MT_ED_CCA_TIMER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mt76_rr
	xorl	%eax, %eax
	callq	_ktime_get_boottime
	movl	%eax, 4(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	$3826788, %edx                  ## imm = 0x3A6464
	callq	_mt76_wr
	movq	_MT_TXOP_HLDR_ET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TXOP_HLDR_TX40M_BLK_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mt76_clear
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_5GHZ,8,3          ## @NL80211_BAND_5GHZ
	.comm	_MT_TX_LINK_CFG,4,2             ## @MT_TX_LINK_CFG
	.comm	_MT_TX_CFACK_EN,4,2             ## @MT_TX_CFACK_EN
	.comm	_MT_TXOP_CTRL_CFG,4,2           ## @MT_TXOP_CTRL_CFG
	.comm	_MT_TXOP_ED_CCA_EN,4,2          ## @MT_TXOP_ED_CCA_EN
	.comm	_AGC,4,2                        ## @AGC
	.comm	_MT_TXOP_HLDR_ET,4,2            ## @MT_TXOP_HLDR_ET
	.comm	_MT_TXOP_HLDR_TX40M_BLK_EN,4,2  ## @MT_TXOP_HLDR_TX40M_BLK_EN
	.comm	_MT_ED_CCA_TIMER,4,2            ## @MT_ED_CCA_TIMER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_edcca_init             ; -- Begin function mt76x02_edcca_init
	.p2align	2
_mt76x02_edcca_init:                    ; @mt76x02_edcca_init
	.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, x0
	stp	xzr, xzr, [x0, #24]
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x21, [x8]
Lloh0:
	adrp	x8, _NL80211_BAND_5GHZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
Lloh3:
	adrp	x8, _MT_TX_LINK_CFG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_TX_LINK_CFG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _MT_TX_CFACK_EN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_TX_CFACK_EN@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_clear
Lloh9:
	adrp	x8, _MT_TXOP_CTRL_CFG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT_TXOP_CTRL_CFG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _MT_TXOP_ED_CCA_EN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MT_TXOP_ED_CCA_EN@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_set
Lloh15:
	adrp	x8, _AGC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AGC@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	w1, #2
	bl	_MT_BBP
	mov	x20, x0
	mov	w0, #15
	mov	w1, #0
	bl	_GENMASK
	mov	x2, x0
	cmp	x21, x22
	mov	w8, #8224
	mov	w9, #3598
	csel	w3, w9, w8, eq
	mov	x0, x19
	mov	x1, x20
	bl	_mt76_rmw
	b	LBB0_4
LBB0_2:
Lloh18:
	adrp	x8, _MT_TX_LINK_CFG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MT_TX_LINK_CFG@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _MT_TX_CFACK_EN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MT_TX_CFACK_EN@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_set
Lloh24:
	adrp	x8, _MT_TXOP_CTRL_CFG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MT_TXOP_CTRL_CFG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _MT_TXOP_ED_CCA_EN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MT_TXOP_ED_CCA_EN@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_clear
	mov	x0, x19
	bl	_is_mt76x2
	mov	x20, x0
Lloh30:
	adrp	x8, _AGC@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AGC@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	mov	w1, #2
	bl	_MT_BBP
	mov	x1, x0
	mov	x0, x19
	cbz	x20, LBB0_6
; %bb.3:
	mov	w2, #28784
	bl	_mt76_wr
LBB0_4:
Lloh33:
	adrp	x8, _MT_TXOP_HLDR_ET@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MT_TXOP_HLDR_ET@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x8, _MT_TXOP_HLDR_TX40M_BLK_EN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MT_TXOP_HLDR_TX40M_BLK_EN@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_set
LBB0_5:
	mov	w20, #1
	mov	x0, x19
	mov	w1, #1
	bl	_mt76x02_edcca_tx_enable
	str	w20, [x19]
Lloh39:
	adrp	x8, _MT_ED_CCA_TIMER@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MT_ED_CCA_TIMER@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76_rr
	bl	_ktime_get_boottime
	str	w0, [x19, #4]
	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
LBB0_6:
	mov	w2, #25700
	movk	w2, #58, lsl #16
	bl	_mt76_wr
Lloh42:
	adrp	x8, _MT_TXOP_HLDR_ET@GOTPAGE
Lloh43:
	ldr	x8, [x8, _MT_TXOP_HLDR_ET@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
Lloh45:
	adrp	x8, _MT_TXOP_HLDR_TX40M_BLK_EN@GOTPAGE
Lloh46:
	ldr	x8, [x8, _MT_TXOP_HLDR_TX40M_BLK_EN@GOTPAGEOFF]
Lloh47:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_clear
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.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	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_BAND_5GHZ,8,3          ; @NL80211_BAND_5GHZ
	.comm	_MT_TX_LINK_CFG,4,2             ; @MT_TX_LINK_CFG
	.comm	_MT_TX_CFACK_EN,4,2             ; @MT_TX_CFACK_EN
	.comm	_MT_TXOP_CTRL_CFG,4,2           ; @MT_TXOP_CTRL_CFG
	.comm	_MT_TXOP_ED_CCA_EN,4,2          ; @MT_TXOP_ED_CCA_EN
	.comm	_AGC,4,2                        ; @AGC
	.comm	_MT_TXOP_HLDR_ET,4,2            ; @MT_TXOP_HLDR_ET
	.comm	_MT_TXOP_HLDR_TX40M_BLK_EN,4,2  ; @MT_TXOP_HLDR_TX40M_BLK_EN
	.comm	_MT_ED_CCA_TIMER,4,2            ; @MT_ED_CCA_TIMER
.subsections_via_symbols
