	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1271_tx_flush                ## -- Begin function wl1271_tx_flush
	.p2align	4, 0x90
_wl1271_tx_flush:                       ## @wl1271_tx_flush
	.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, %r14
	movq	_jiffies@GOTPCREL(%rip), %r15
	movq	(%r15), %r12
	movq	_WL1271_TX_FLUSH_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_usecs_to_jiffies
	movq	%rax, %rbx
	leaq	12(%r14), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	leaq	16(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	cmpq	$0, (%r14)
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_wl1271_tx_total_queue_count
	testq	%rax, %rax
	je	LBB0_14
LBB0_2:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	addq	%r12, %rbx
	movq	_WLCORE_QUEUE_STOP_REASON_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wlcore_stop_queues
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_time_after
	testl	%eax, %eax
	je	LBB0_3
LBB0_10:
	movq	_WL1271_TX_FLUSH_TIMEOUT@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$274877907, %rax, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wl1271_warning
	cmpl	$0, 8(%r14)
	jle	LBB0_13
## %bb.11:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_wl1271_tx_reset_link_queues
	incl	%ebx
	cmpl	8(%r14), %ebx
	jl	LBB0_12
LBB0_13:
	movq	_WLCORE_QUEUE_STOP_REASON_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wlcore_wake_queues
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	%r13, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_3:
	leaq	20(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r15), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_time_after
	testl	%eax, %eax
	jne	LBB0_10
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_DEBUG_MAC80211@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	(%r14), %r13
	movq	%r14, %rdi
	callq	_wl1271_tx_total_queue_count
	movl	%ebx, %edi
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_wl1271_debug
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_wl1271_tx_total_queue_count
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_wl1271_tx_work
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$20, %edi
	callq	_msleep
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_lock
	cmpq	$0, (%r14)
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_wl1271_tx_total_queue_count
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	_DEBUG_MAC80211@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	(%r15), %rdi
	subq	%r12, %rdi
	callq	_jiffies_to_msecs
	movslq	%eax, %rdx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_wl1271_debug
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_WL1271_TX_FLUSH_TIMEOUT,4,2    ## @WL1271_TX_FLUSH_TIMEOUT
	.comm	_WLCORE_QUEUE_STOP_REASON_FLUSH,4,2 ## @WLCORE_QUEUE_STOP_REASON_FLUSH
	.comm	_DEBUG_MAC80211,4,2             ## @DEBUG_MAC80211
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"flushing tx buffer: %d %d"

L_.str.1:                               ## @.str.1
	.asciz	"tx flush took %d ms"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to flush all TX buffers, timed out (timeout %d ms"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1271_tx_flush                ; -- Begin function wl1271_tx_flush
	.p2align	2
_wl1271_tx_flush:                       ; @wl1271_tx_flush
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
Lloh0:
	adrp	x28, _jiffies@GOTPAGE
Lloh1:
	ldr	x28, [x28, _jiffies@GOTPAGEOFF]
	ldr	x23, [x28]
Lloh2:
	adrp	x8, _WL1271_TX_FLUSH_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WL1271_TX_FLUSH_TIMEOUT@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_usecs_to_jiffies
	mov	x22, x0
	add	x20, x19, #12
	mov	x0, x20
	bl	_mutex_lock
	add	x21, x19, #16
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19]
	cbnz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_wl1271_tx_total_queue_count
	cbz	x0, LBB0_7
LBB0_2:
	str	x23, [sp, #8]                   ; 8-byte Folded Spill
	add	x22, x22, x23
Lloh5:
	adrp	x8, _WLCORE_QUEUE_STOP_REASON_FLUSH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WLCORE_QUEUE_STOP_REASON_FLUSH@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wlcore_stop_queues
	ldr	x0, [x28]
	mov	x1, x22
	bl	_time_after
	cbz	w0, LBB0_8
LBB0_3:
Lloh8:
	adrp	x8, _WL1271_TX_FLUSH_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WL1271_TX_FLUSH_TIMEOUT@GOTPAGEOFF]
Lloh10:
	ldrsw	x8, [x8]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w1, w8, w9
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_wl1271_warning
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.4:
	mov	w22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_wl1271_tx_reset_link_queues
	add	w22, w22, #1
	ldr	w8, [x19, #8]
	cmp	w22, w8
	b.lt	LBB0_5
LBB0_6:
Lloh13:
	adrp	x8, _WLCORE_QUEUE_STOP_REASON_FLUSH@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WLCORE_QUEUE_STOP_REASON_FLUSH@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wlcore_wake_queues
LBB0_7:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_mutex_unlock
LBB0_8:
	add	x23, x19, #20
Lloh16:
	adrp	x27, _DEBUG_MAC80211@GOTPAGE
Lloh17:
	ldr	x27, [x27, _DEBUG_MAC80211@GOTPAGEOFF]
Lloh18:
	adrp	x24, l_.str@PAGE
Lloh19:
	add	x24, x24, l_.str@PAGEOFF
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x0, [x28]
	mov	x1, x22
	bl	_time_after
	cbnz	w0, LBB0_3
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w25, [x27]
	ldr	x26, [x19]
	mov	x0, x19
	bl	_wl1271_tx_total_queue_count
	str	x0, [sp]
	mov	x0, x25
	mov	x1, x24
	mov	x2, x26
	bl	_wl1271_debug
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x19
	bl	_wl1271_tx_total_queue_count
	cbz	x0, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x23
	bl	_wl1271_tx_work
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #20
	bl	_msleep
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19]
	cbnz	x8, LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x19
	bl	_wl1271_tx_total_queue_count
	cbnz	x0, LBB0_9
; %bb.14:
	ldr	w22, [x27]
	ldr	x8, [x28]
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	sub	x0, x8, x9
	bl	_jiffies_to_msecs
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x2, w0
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_wl1271_debug
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_WL1271_TX_FLUSH_TIMEOUT,4,2    ; @WL1271_TX_FLUSH_TIMEOUT
	.comm	_WLCORE_QUEUE_STOP_REASON_FLUSH,4,2 ; @WLCORE_QUEUE_STOP_REASON_FLUSH
	.comm	_DEBUG_MAC80211,4,2             ; @DEBUG_MAC80211
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"flushing tx buffer: %d %d"

l_.str.1:                               ; @.str.1
	.asciz	"tx flush took %d ms"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to flush all TX buffers, timed out (timeout %d ms"

.subsections_via_symbols
