	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flush_channel
_flush_channel:                         ## @flush_channel
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, %r14d
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_dev_get_drvdata
	movq	%rax, %r15
	movq	8(%rax), %rax
	movslq	%r14d, %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	leaq	(,%rcx,8), %rcx
	leaq	(%rcx,%rcx,2), %rbx
	leaq	(%rax,%rbx), %rdi
	addq	$4, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %rax
	movl	(%rax,%rbx), %ecx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	16(%rax,%rbx), %r14
	movl	%ecx, %ebx
	movslq	%ecx, %r13
	movq	%r13, %rcx
	shlq	$5, %rcx
	cmpq	$0, 8(%r14,%rcx)
	je	LBB0_7
## %bb.1:
	leaq	(%r14,%rcx), %r15
	addq	$8, %r15
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	setne	%al
	testl	%r12d, %r12d
	sete	%cl
	andb	%al, %cl
	movb	%cl, -41(%rbp)                  ## 1-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_rmb
	movq	(%r15), %rcx
	movq	_DESC_HDR_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	cmpl	%eax, %ecx
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%eax, %ecx
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movl	$0, %eax
	cmovel	%eax, %r12d
	shlq	$5, %r13
	movl	24(%r14,%r13), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_dma_unmap_single
	movq	(%r15), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	16(%r14,%r13), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	(%r14,%r13), %r14d
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	$0, (%r15)
	incl	%ebx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %eax
	decl	%eax
	andl	%ebx, %eax
	movq	8(%r15), %rcx
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rcx,%rbx)
	leaq	(%rcx,%rbx), %rdi
	addq	$4, %rdi
	callq	_spin_unlock_irqrestore
	movq	8(%r15), %rax
	leaq	(%rax,%rbx), %rdi
	addq	$8, %rdi
	callq	_atomic_dec
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	movl	%r12d, %ecx
	callq	*-96(%rbp)                      ## 8-byte Folded Reload
	cmpl	-48(%rbp), %r12d                ## 4-byte Folded Reload
	sete	%al
	testb	%al, -41(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rax
	leaq	(%rax,%rbx), %rdi
	addq	$4, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r15), %rax
	movl	(%rax,%rbx), %ecx
	movq	16(%rax,%rbx), %r14
	movl	%ecx, %ebx
	movslq	%ecx, %r13
	movq	%r13, %rcx
	shlq	$5, %rcx
	leaq	(%r14,%rcx), %r15
	addq	$8, %r15
	cmpq	$0, 8(%r14,%rcx)
	jne	LBB0_2
	jmp	LBB0_7
LBB0_4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
LBB0_7:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%rax,%rcx,8), %rdi
	addq	$4, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_8:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DESC_HDR_DONE,4,2              ## @DESC_HDR_DONE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.no_dead_strip	_flush_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flush_channel
_flush_channel:                         ; @flush_channel
	.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	x22, x3
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
	bl	_dev_get_drvdata
	mov	x21, x0
	ldr	x8, [x0, #8]
	sxtw	x9, w23
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	add	x9, x9, w23, sxtw #1
	lsl	x23, x9, #3
	add	x8, x8, x23
	add	x0, x8, #4
	bl	_spin_lock_irqsave
	ldr	x8, [x21, #8]
	add	x9, x8, x23
	ldr	w27, [x9]
	ldr	x23, [x9, #16]
	sxtw	x24, w27
	add	x28, x23, x24, lsl #5
	ldr	x9, [x28, #8]!
	cbz	x9, LBB0_6
; %bb.1:
	cmp	w19, #0
	ccmp	w22, #0, #0, ne
	cset	w26, eq
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_rmb
	ldr	x8, [x28]
	ldr	w9, [x8]
Lloh0:
	adrp	x8, _DESC_HDR_DONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DESC_HDR_DONE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w9, w8, w9
	cmp	w9, w8
	ccmp	w19, #0, #0, ne
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w9, w8
	csel	w22, wzr, w19, eq
	add	x24, x23, x24, lsl #5
	ldr	w1, [x24, #24]
Lloh3:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w2, #4
	bl	_dma_unmap_single
	ldr	x23, [x28]
	ldr	x25, [x24, #16]
	ldr	w24, [x24]
	bl	_smp_wmb
	str	xzr, [x28]
	add	w8, w27, #1
	ldr	w9, [x21]
	sub	w9, w9, #1
	and	w8, w9, w8
	ldr	x9, [x21, #8]
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	add	x10, x10, x10, lsl #1
	lsl	x27, x10, #3
	add	x0, x9, x27
	str	w8, [x0], #4
	bl	_spin_unlock_irqrestore
	ldr	x8, [x21, #8]
	add	x8, x8, x27
	add	x0, x8, #8
	bl	_atomic_dec
	mov	x0, x20
	mov	x1, x23
	mov	x2, x24
	mov	x3, x22
	blr	x25
	cmp	w22, w19
	cset	w8, eq
	and	w8, w26, w8
	tbnz	w8, #0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x21, #8]
	add	x8, x8, x27
	add	x0, x8, #4
	bl	_spin_lock_irqsave
	ldr	x8, [x21, #8]
	add	x9, x8, x27
	ldr	w27, [x9]
	ldr	x23, [x9, #16]
	sxtw	x24, w27
	add	x28, x23, x24, lsl #5
	ldr	x9, [x28, #8]!
	cbnz	x9, LBB0_2
	b	LBB0_6
LBB0_5:
	ldr	x8, [x21, #8]
LBB0_6:
	mov	w9, #24
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	madd	x8, x10, x9, x8
	add	x0, x8, #4
	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	_spin_unlock_irqrestore
LBB0_7:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DESC_HDR_DONE,4,2              ; @DESC_HDR_DONE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.no_dead_strip	_flush_channel
.subsections_via_symbols
