	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function ioat_free_chan_resources
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_ioat_free_chan_resources:              ## @ioat_free_chan_resources
	.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, %r12
	callq	_to_ioat_chan
	movq	%rax, %rbx
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	cmpq	$0, 48(%rbx)
	je	LBB0_15
## %bb.1:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %r14
	movq	88(%rbx), %r15
	movq	%rbx, %rdi
	callq	_ioat_stop
	movq	%rbx, %rdi
	callq	_ioat_reset_hw
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movq	_IOAT_VER_3_4@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_3
## %bb.2:
	movq	_IOAT_CHAN_LTR_SWSEL_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IOAT_CHAN_LTR_SWSEL_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	80(%r14), %rsi
	callq	_writeb
LBB0_3:
	leaq	32(%rbx), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_bh
	addq	$36, %rbx
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_spin_lock_bh
	movq	%r14, %rdi
	callq	_ioat_ring_space
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_to_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%r15d, %edx
	callq	_dev_dbg
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.4:
	movl	%r15d, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	72(%r14), %rsi
	addq	%r13, %rsi
	movq	%r14, %rdi
	callq	_ioat_get_ring_ent
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_ioat_free_ring_ent
	incq	%r13
	cmpq	%r13, %rbx
	jne	LBB0_5
LBB0_6:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %eax
	subl	%r15d, %eax
	jle	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_to_dev
	subl	%r15d, %ebx
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	movl	%ebx, %edx
	callq	_dev_err
	movl	%ebx, %eax
LBB0_8:
	testl	%eax, %eax
	jle	LBB0_11
## %bb.9:
	movl	%eax, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	64(%r14), %rsi
	addq	%rbx, %rsi
	movq	%r14, %rdi
	callq	_ioat_get_ring_ent
	movq	%rax, %r13
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_dump_desc_dbg
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ioat_free_ring_ent
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_10
LBB0_11:
	cmpl	$0, 4(%r14)
	jle	LBB0_14
## %bb.12:
	xorl	%ebx, %ebx
	movq	_SZ_2M@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_to_dev
	movl	(%r15), %esi
	movq	56(%r14), %rdx
	movq	(%rdx,%rbx), %rcx
	movq	8(%rdx,%rbx), %rdx
	movl	%eax, %edi
	callq	_dma_free_coherent
	movq	56(%r14), %rax
	incq	%r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax,%rbx)
	movslq	4(%r14), %rax
	addq	$16, %rbx
	cmpq	%rax, %r12
	jl	LBB0_13
LBB0_14:
	movl	$0, 4(%r14)
	movq	48(%r14), %rdi
	callq	_kfree
	movq	$0, 48(%r14)
	movl	$0, (%r14)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	movl	40(%r14), %esi
	movq	16(%r14), %rdx
	callq	_dma_pool_free
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_bh
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_bh
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r14)
	movq	$0, 24(%r14)
LBB0_15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IOAT_VER_3_4,8,3               ## @IOAT_VER_3_4
	.comm	_IOAT_CHAN_LTR_SWSEL_IDLE,4,2   ## @IOAT_CHAN_LTR_SWSEL_IDLE
	.comm	_IOAT_CHAN_LTR_SWSEL_OFFSET,8,3 ## @IOAT_CHAN_LTR_SWSEL_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"freeing %d idle descriptors\n"

L_.str.1:                               ## @.str.1
	.asciz	"Freeing %d in use descriptors!\n"

	.comm	_SZ_2M,4,2                      ## @SZ_2M
	.no_dead_strip	_ioat_free_chan_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ioat_free_chan_resources
_ioat_free_chan_resources:              ; @ioat_free_chan_resources
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x0
	bl	_to_ioat_chan
	ldr	x8, [x0, #48]
	cbz	x8, LBB0_15
; %bb.1:
	mov	x19, x0
	ldr	x24, [x0, #88]
	ldr	w20, [x0]
	mov	w21, #1
	bl	_ioat_stop
	mov	x0, x19
	bl	_ioat_reset_hw
	ldr	x8, [x24]
Lloh0:
	adrp	x9, _IOAT_VER_3_4@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IOAT_VER_3_4@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _IOAT_CHAN_LTR_SWSEL_IDLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IOAT_CHAN_LTR_SWSEL_IDLE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	x8, [x19, #80]
Lloh6:
	adrp	x9, _IOAT_CHAN_LTR_SWSEL_OFFSET@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IOAT_CHAN_LTR_SWSEL_OFFSET@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
LBB0_3:
	lsl	w25, w21, w20
	add	x20, x19, #32
	mov	x0, x20
	bl	_spin_lock_bh
	add	x21, x19, #36
	mov	x0, x21
	bl	_spin_lock_bh
	mov	x0, x19
	bl	_ioat_ring_space
	mov	x23, x0
	mov	x0, x19
	bl	_to_dev
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	bl	_dev_dbg
	cmp	w23, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x26, #0
	mov	w27, w23
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #72]
	add	x1, x26, x8
	mov	x0, x19
	bl	_ioat_get_ring_ent
	mov	x1, x22
	bl	_ioat_free_ring_ent
	add	x26, x26, #1
	cmp	x27, x26
	b.ne	LBB0_5
LBB0_6:
	subs	w23, w25, w23
	b.le	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_to_dev
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x23
	bl	_dev_err
LBB0_8:
	cmp	w23, #1
	b.lt	LBB0_11
; %bb.9:
	mov	x25, #0
	mov	w26, w23
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #64]
	add	x1, x25, x8
	mov	x0, x19
	bl	_ioat_get_ring_ent
	mov	x23, x0
	mov	x0, x19
	mov	x1, x23
	bl	_dump_desc_dbg
	mov	x0, x23
	mov	x1, x22
	bl	_ioat_free_ring_ent
	add	x25, x25, #1
	cmp	x26, x25
	b.ne	LBB0_10
LBB0_11:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.12:
	mov	x22, #0
	mov	x23, #0
Lloh13:
	adrp	x25, _SZ_2M@GOTPAGE
Lloh14:
	ldr	x25, [x25, _SZ_2M@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_to_dev
	ldr	w1, [x25]
	ldr	x8, [x19, #56]
	add	x8, x8, x22
	ldp	x3, x2, [x8]
	bl	_dma_free_coherent
	ldr	x8, [x19, #56]
	add	x23, x23, #1
	add	x8, x8, x22
	stp	xzr, xzr, [x8]
	ldrsw	x8, [x19, #4]
	add	x22, x22, #16
	cmp	x23, x8
	b.lt	LBB0_13
LBB0_14:
	str	wzr, [x19, #4]
	ldr	x0, [x19, #48]
	bl	_kfree
	str	xzr, [x19, #48]
	str	wzr, [x19]
	ldr	w0, [x24, #8]
	ldr	w1, [x19, #40]
	ldr	x2, [x19, #16]
	bl	_dma_pool_free
	mov	x0, x21
	bl	_spin_unlock_bh
	mov	x0, x20
	bl	_spin_unlock_bh
	stp	xzr, xzr, [x19, #16]
	str	xzr, [x19, #8]
LBB0_15:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IOAT_VER_3_4,8,3               ; @IOAT_VER_3_4
	.comm	_IOAT_CHAN_LTR_SWSEL_IDLE,4,2   ; @IOAT_CHAN_LTR_SWSEL_IDLE
	.comm	_IOAT_CHAN_LTR_SWSEL_OFFSET,8,3 ; @IOAT_CHAN_LTR_SWSEL_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"freeing %d idle descriptors\n"

l_.str.1:                               ; @.str.1
	.asciz	"Freeing %d in use descriptors!\n"

	.comm	_SZ_2M,4,2                      ; @SZ_2M
	.no_dead_strip	_ioat_free_chan_resources
.subsections_via_symbols
