	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x0u_stop
_mt76x0u_stop:                          ## @mt76x0u_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rbx
	movq	_MT76_STATE_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%rbx), %r14
	movq	%r14, %rsi
	callq	_clear_bit
	leaq	12(%rbx), %rdi
	callq	_cancel_delayed_work_sync
	leaq	8(%rbx), %rdi
	callq	_cancel_delayed_work_sync
	movq	%rbx, %rdi
	callq	_mt76u_stop_tx
	movq	%rbx, %rdi
	callq	_mt76x02u_exit_beacon_config
	movq	_MT76_REMOVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	_MT_USB_DMA_CFG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_MT_USB_DMA_CFG_TX_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_mt76_poll
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_3:
	movq	%rbx, %rdi
	callq	_mt76x0_mac_stop
	movl	(%r14), %esi
	movq	_MT_USB_DMA_CFG_RX_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_mt76_poll
	testl	%eax, %eax
	je	LBB0_5
LBB0_4:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MT76_STATE_RUNNING,4,2         ## @MT76_STATE_RUNNING
	.comm	_MT76_REMOVED,4,2               ## @MT76_REMOVED
	.comm	_MT_USB_DMA_CFG,4,2             ## @MT_USB_DMA_CFG
	.comm	_MT_USB_DMA_CFG_TX_BUSY,4,2     ## @MT_USB_DMA_CFG_TX_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TX DMA did not stop\n"

	.comm	_MT_USB_DMA_CFG_RX_BUSY,4,2     ## @MT_USB_DMA_CFG_RX_BUSY
L_.str.1:                               ## @.str.1
	.asciz	"RX DMA did not stop\n"

	.no_dead_strip	_mt76x0u_stop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x0u_stop
_mt76x0u_stop:                          ; @mt76x0u_stop
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _MT76_STATE_RUNNING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT76_STATE_RUNNING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x20, x19, #4
	mov	x1, x20
	bl	_clear_bit
	add	x0, x19, #12
	bl	_cancel_delayed_work_sync
	add	x0, x19, #8
	bl	_cancel_delayed_work_sync
	mov	x0, x19
	bl	_mt76u_stop_tx
	mov	x0, x19
	bl	_mt76x02u_exit_beacon_config
Lloh3:
	adrp	x8, _MT76_REMOVED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT76_REMOVED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	cbnz	x0, LBB0_4
; %bb.1:
Lloh6:
	adrp	x20, _MT_USB_DMA_CFG@GOTPAGE
Lloh7:
	ldr	x20, [x20, _MT_USB_DMA_CFG@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh8:
	adrp	x8, _MT_USB_DMA_CFG_TX_BUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MT_USB_DMA_CFG_TX_BUSY@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	bl	_mt76_poll
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_3:
	mov	x0, x19
	bl	_mt76x0_mac_stop
	ldr	w1, [x20]
Lloh13:
	adrp	x8, _MT_USB_DMA_CFG_RX_BUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MT_USB_DMA_CFG_RX_BUSY@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	bl	_mt76_poll
	cbz	w0, LBB0_5
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 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 AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MT76_STATE_RUNNING,4,2         ; @MT76_STATE_RUNNING
	.comm	_MT76_REMOVED,4,2               ; @MT76_REMOVED
	.comm	_MT_USB_DMA_CFG,4,2             ; @MT_USB_DMA_CFG
	.comm	_MT_USB_DMA_CFG_TX_BUSY,4,2     ; @MT_USB_DMA_CFG_TX_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TX DMA did not stop\n"

	.comm	_MT_USB_DMA_CFG_RX_BUSY,4,2     ; @MT_USB_DMA_CFG_RX_BUSY
l_.str.1:                               ; @.str.1
	.asciz	"RX DMA did not stop\n"

	.no_dead_strip	_mt76x0u_stop
.subsections_via_symbols
