	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x0_mac_stop                ## -- Begin function mt76x0_mac_stop
	.p2align	4, 0x90
_mt76x0_mac_stop:                       ## @mt76x0_mac_stop
	.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	%rdi, %r12
	movq	_MT_TXOP_CTRL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TXOP_ED_CCA_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_mt76_clear
	movl	$-200, %ebx
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$10, %edi
	callq	_msleep
	incl	%ebx
	je	LBB0_5
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$1080, %esi                     ## imm = 0x438
	callq	_mt76_rr
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	movl	$2608, %esi                     ## imm = 0xA30
	callq	_mt76_rr
	testb	%al, %al
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	movl	$2612, %esi                     ## imm = 0xA34
	callq	_mt76_rr
	testl	$16711935, %eax                 ## imm = 0xFF00FF
	jne	LBB0_4
LBB0_5:
	movq	_MT_MAC_STATUS@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_MT_MAC_STATUS_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_mt76_poll
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_7:
	movq	_MT_MAC_SYS_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_MAC_SYS_CTRL_ENABLE_RX@GOTPCREL(%rip), %rax
	movq	_MT_MAC_SYS_CTRL_ENABLE_TX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r12, %rdi
	callq	_mt76_clear
	movl	$200, %ebx
	movq	_MT_RXQ_STA@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_mt76_rr
	testl	$16711680, %eax                 ## imm = 0xFF0000
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rdi
	movl	$2608, %esi                     ## imm = 0xA30
	callq	_mt76_rr
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r12, %rdi
	movl	$2612, %esi                     ## imm = 0xA34
	callq	_mt76_rr
	testl	%eax, %eax
	je	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	$1, %edi
	callq	_msleep
	decl	%ebx
	jne	LBB0_8
	jmp	LBB0_15
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$5, %r15d
	jg	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	incl	%r15d
	decl	%ebx
	jne	LBB0_8
LBB0_15:
	movl	(%r14), %esi
	movq	_MT_MAC_STATUS_RX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_mt76_poll
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.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	_MT_MAC_STATUS,4,2              ## @MT_MAC_STATUS
	.comm	_MT_MAC_STATUS_TX,4,2           ## @MT_MAC_STATUS_TX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: MAC TX did not stop!\n"

	.comm	_MT_MAC_SYS_CTRL,4,2            ## @MT_MAC_SYS_CTRL
	.comm	_MT_MAC_SYS_CTRL_ENABLE_RX,4,2  ## @MT_MAC_SYS_CTRL_ENABLE_RX
	.comm	_MT_MAC_SYS_CTRL_ENABLE_TX,4,2  ## @MT_MAC_SYS_CTRL_ENABLE_TX
	.comm	_MT_RXQ_STA,4,2                 ## @MT_RXQ_STA
	.comm	_MT_MAC_STATUS_RX,4,2           ## @MT_MAC_STATUS_RX
L_.str.1:                               ## @.str.1
	.asciz	"Warning: MAC RX did not stop!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x0_mac_stop                ; -- Begin function mt76x0_mac_stop
	.p2align	2
_mt76x0_mac_stop:                       ; @mt76x0_mac_stop
	.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, x0
Lloh0:
	adrp	x8, _MT_TXOP_CTRL_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_TXOP_CTRL_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MT_TXOP_ED_CCA_EN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_TXOP_ED_CCA_EN@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_mt76_clear
	mov	w20, #-200
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #10
	bl	_msleep
	adds	w20, w20, #1
	b.hs	LBB0_5
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #1080
	bl	_mt76_rr
	cbnz	w0, LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	mov	w1, #2608
	bl	_mt76_rr
	tst	w0, #0xff
	b.ne	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	mov	w1, #2612
	bl	_mt76_rr
	tst	w0, #0xff00ff
	b.ne	LBB0_1
LBB0_5:
Lloh6:
	adrp	x20, _MT_MAC_STATUS@GOTPAGE
Lloh7:
	ldr	x20, [x20, _MT_MAC_STATUS@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh8:
	adrp	x8, _MT_MAC_STATUS_TX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MT_MAC_STATUS_TX@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	bl	_mt76_poll
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_7:
Lloh13:
	adrp	x8, _MT_MAC_SYS_CTRL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MT_MAC_SYS_CTRL@GOTPAGEOFF]
Lloh15:
	adrp	x9, _MT_MAC_SYS_CTRL_ENABLE_RX@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MT_MAC_SYS_CTRL_ENABLE_RX@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	ldr	w8, [x9]
Lloh19:
	adrp	x9, _MT_MAC_SYS_CTRL_ENABLE_TX@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MT_MAC_SYS_CTRL_ENABLE_TX@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_mt76_clear
	mov	w21, #0
	mov	w22, #200
Lloh22:
	adrp	x23, _MT_RXQ_STA@GOTPAGE
Lloh23:
	ldr	x23, [x23, _MT_RXQ_STA@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_mt76_rr
	tst	w0, #0xff0000
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	mov	w1, #2608
	bl	_mt76_rr
	cbnz	w0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	mov	w1, #2612
	bl	_mt76_rr
	cbz	w0, LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w0, #1
	bl	_msleep
	subs	w22, w22, #1
	b.ne	LBB0_8
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	cmp	w21, #5
	b.gt	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	add	w21, w21, #1
	subs	w22, w22, #1
	b.ne	LBB0_8
LBB0_14:
	ldr	w1, [x20]
Lloh24:
	adrp	x8, _MT_MAC_STATUS_RX@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MT_MAC_STATUS_RX@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	bl	_mt76_poll
	cbz	w0, LBB0_16
; %bb.15:
	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
LBB0_16:
	ldr	w0, [x19]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	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
	b	_dev_warn
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.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	_MT_MAC_STATUS,4,2              ; @MT_MAC_STATUS
	.comm	_MT_MAC_STATUS_TX,4,2           ; @MT_MAC_STATUS_TX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: MAC TX did not stop!\n"

	.comm	_MT_MAC_SYS_CTRL,4,2            ; @MT_MAC_SYS_CTRL
	.comm	_MT_MAC_SYS_CTRL_ENABLE_RX,4,2  ; @MT_MAC_SYS_CTRL_ENABLE_RX
	.comm	_MT_MAC_SYS_CTRL_ENABLE_TX,4,2  ; @MT_MAC_SYS_CTRL_ENABLE_TX
	.comm	_MT_RXQ_STA,4,2                 ; @MT_RXQ_STA
	.comm	_MT_MAC_STATUS_RX,4,2           ; @MT_MAC_STATUS_RX
l_.str.1:                               ; @.str.1
	.asciz	"Warning: MAC RX did not stop!\n"

.subsections_via_symbols
