	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar5523_flush_tx
_ar5523_flush_tx:                       ## @ar5523_flush_tx
	.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
	callq	_ar5523_tx_work_locked
	movq	_AR5523_USB_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	12(%rbx), %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movl	8(%rbx), %r14d
	movq	%rbx, %rdi
	callq	_atomic_read
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
	movq	_AR5523_FLUSH_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	_wait_event_timeout
	testl	%eax, %eax
	je	LBB0_3
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	leaq	4(%rbx), %rdi
	callq	_atomic_read
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_atomic_read
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	movl	%eax, %ecx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ar5523_err                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5523_USB_DISCONNECTED,4,2    ## @AR5523_USB_DISCONNECTED
	.comm	_AR5523_FLUSH_TIMEOUT,4,2       ## @AR5523_FLUSH_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"flush timeout (tot %d pend %d)\n"

	.no_dead_strip	_ar5523_flush_tx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar5523_flush_tx
_ar5523_flush_tx:                       ; @ar5523_flush_tx
	.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
	mov	x19, x0
	bl	_ar5523_tx_work_locked
Lloh0:
	adrp	x8, _AR5523_USB_DISCONNECTED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR5523_USB_DISCONNECTED@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, x19, #12
	bl	_test_bit
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w20, [x19, #8]
	mov	x0, x19
	bl	_atomic_read
	cmp	w0, #0
	cset	w1, eq
Lloh3:
	adrp	x8, _AR5523_FLUSH_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR5523_FLUSH_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_wait_event_timeout
	cbz	w0, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	add	x0, x19, #4
	bl	_atomic_read
	mov	x20, x0
	mov	x0, x19
	bl	_atomic_read
	mov	x3, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ar5523_err
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5523_USB_DISCONNECTED,4,2    ; @AR5523_USB_DISCONNECTED
	.comm	_AR5523_FLUSH_TIMEOUT,4,2       ; @AR5523_FLUSH_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"flush timeout (tot %d pend %d)\n"

	.no_dead_strip	_ar5523_flush_tx
.subsections_via_symbols
