	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mwl8k_tx_wait_empty
_mwl8k_tx_wait_empty:                   ## @mwl8k_tx_wait_empty
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	_tx_wait@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_DECLARE_COMPLETION_ONSTACK
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_might_sleep
	cmpl	$0, (%r14)
	je	LBB0_3
## %bb.1:
	movq	8(%r14), %rax
	movq	_current@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_21
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_21
LBB0_3:
	leaq	36(%r14), %r12
	movq	%r12, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jne	LBB0_21
## %bb.4:
	cmpl	$0, 16(%r14)
	je	LBB0_21
## %bb.5:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	leaq	20(%r14), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_bh
	movq	%r13, 24(%r14)
	leaq	32(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$1, %ecx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	$0, 24(%r14)
	movl	(%rbx), %edi
	movq	_MWL8K_TX_WAIT_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_wiphy_err
	movq	%rbx, %rdi
	callq	_mwl8k_dump_tx_rings
	movl	$1, (%r14)
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_ieee80211_queue_work
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_19:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	_tx_wait@GOTPCREL(%rip), %r13
	testl	%r15d, %r15d
	jne	LBB0_20
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	16(%r14), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_spin_unlock_bh
	movq	_MWL8K_TX_WAIT_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	movq	%rax, %r13
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_atomic_read
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_spin_lock_bh
	testq	%r15, %r15
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	16(%r14), %ecx
	testq	%r13, %r13
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, %ecx
	jge	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	(%rbx), %edi
	xorl	%r15d, %r15d
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_wiphy_notice
	movl	$1, %ecx
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_mwl8k_tx_start
	xorl	%r15d, %r15d
	xorl	%ecx, %ecx
	jmp	LBB0_19
LBB0_7:
	movq	$0, 24(%r14)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_bh
	xorl	%r15d, %r15d
	jmp	LBB0_21
LBB0_10:
	xorl	%ecx, %ecx
LBB0_11:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%ecx, %edi
	callq	_WARN_ON
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.13:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_wiphy_notice
	jmp	LBB0_20
LBB0_12:
	xorl	%r15d, %r15d
LBB0_20:
	movq	$0, 24(%r14)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_bh
LBB0_21:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tx_wait,4,2                    ## @tx_wait
	.comm	_current,8,3                    ## @current
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MWL8K_TX_WAIT_TIMEOUT_MS,4,2   ## @MWL8K_TX_WAIT_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tx rings drained\n"

L_.str.1:                               ## @.str.1
	.asciz	"waiting for tx rings to drain (%d -> %d pkts)\n"

L_.str.2:                               ## @.str.2
	.asciz	"tx rings stuck for %d ms\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_mwl8k_tx_wait_empty
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mwl8k_tx_wait_empty
_mwl8k_tx_wait_empty:                   ; @mwl8k_tx_wait_empty
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x22, _tx_wait@GOTPAGE
Lloh1:
	ldr	x22, [x22, _tx_wait@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_DECLARE_COMPLETION_ONSTACK
	bl	_might_sleep
	ldr	w8, [x19]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _current@GOTPAGE
Lloh3:
	ldr	x9, [x9, _current@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.2:
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_5
LBB0_3:
	add	x23, x19, #36
	mov	x0, x23
	bl	_atomic_read
	cbz	x0, LBB0_6
LBB0_4:
	mov	w27, #0
LBB0_5:
	mov	x0, x27
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_6:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_4
; %bb.7:
	add	x21, x19, #20
	mov	x0, x21
	bl	_spin_lock_bh
	str	x22, [x19, #24]
	add	x8, x19, #32
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
Lloh8:
	adrp	x25, _MWL8K_TX_WAIT_TIMEOUT_MS@GOTPAGE
Lloh9:
	ldr	x25, [x25, _MWL8K_TX_WAIT_TIMEOUT_MS@GOTPAGEOFF]
	mov	w26, #1
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	str	xzr, [x19, #24]
	ldr	w0, [x20]
	ldr	w2, [x25]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_wiphy_err
	mov	x0, x20
	bl	_mwl8k_dump_tx_rings
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x20
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	bl	_ieee80211_queue_work
	mov	w26, #0
Lloh12:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	cbnz	w27, LBB0_20
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w24, [x19, #16]
	mov	x0, x21
	bl	_spin_unlock_bh
	ldr	w0, [x25]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x22
	bl	_wait_for_completion_timeout
	mov	x27, x0
	mov	x0, x23
	bl	_atomic_read
	mov	x28, x0
	mov	x0, x21
	bl	_spin_lock_bh
	cbnz	x28, LBB0_21
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w0, [x19, #16]
	cbnz	x27, LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	cbz	w0, LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	cbnz	w26, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w0, w24
	b.ge	LBB0_8
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x20]
	stp	x24, x0, [sp]
	mov	x0, x8
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wiphy_notice
	mov	w27, #0
	mov	w26, #1
	b	LBB0_9
LBB0_16:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	bl	_mwl8k_tx_start
	mov	w27, #0
	mov	w26, #0
	b	LBB0_9
LBB0_17:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_WARN_ON
	cbz	w26, LBB0_19
; %bb.18:
	ldr	w0, [x20]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wiphy_notice
LBB0_19:
	mov	w27, #0
LBB0_20:
	str	xzr, [x19, #24]
	mov	x0, x21
	bl	_spin_unlock_bh
	b	LBB0_5
LBB0_21:
	str	xzr, [x19, #24]
	mov	x0, x21
	bl	_spin_unlock_bh
	mov	w27, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_tx_wait,4,2                    ; @tx_wait
	.comm	_current,8,3                    ; @current
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MWL8K_TX_WAIT_TIMEOUT_MS,4,2   ; @MWL8K_TX_WAIT_TIMEOUT_MS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tx rings drained\n"

l_.str.1:                               ; @.str.1
	.asciz	"waiting for tx rings to drain (%d -> %d pkts)\n"

l_.str.2:                               ; @.str.2
	.asciz	"tx rings stuck for %d ms\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_mwl8k_tx_wait_empty
.subsections_via_symbols
