	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ioat2_alloc_ring
_ioat2_alloc_ring:                      ## @ioat2_alloc_ring
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	$1, %ebx
	movl	%r14d, %ecx
	shll	%cl, %ebx
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_ioat_get_max_alloc_order
	cmpl	%r14d, %eax
	jl	LBB0_16
## %bb.1:
	movl	%ebx, %edi
	movl	$8, %esi
	movl	%r12d, %edx
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:
	movq	%rax, %r13
	cmpl	$31, %r14d
	jne	LBB0_6
LBB0_3:
	movq	(%r13), %rcx
	movq	%rcx, %r8
LBB0_4:
	movl	(%r8), %eax
	movq	8(%rcx), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_16
LBB0_6:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	cmpl	$2, %ebx
	movl	$1, %r12d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmovgel	%ebx, %r12d
	shlq	$3, %r12
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ioat2_alloc_ring_ent
	movq	%rax, (%r13,%r14)
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_set_desc_id
	addq	$8, %r14
	incl	%ebx
	cmpq	%r14, %r12
	jne	LBB0_7
## %bb.9:
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	cmpl	$1, %r9d
	jle	LBB0_3
## %bb.10:
	decl	%r9d
	movq	(%r13), %r8
	leaq	-1(%r9), %rdx
	movl	%r9d, %ecx
	andl	$3, %ecx
	cmpq	$3, %rdx
	jae	LBB0_17
## %bb.11:
	xorl	%edx, %edx
	movq	%r8, %rsi
	jmp	LBB0_19
LBB0_12:
	testl	%ebx, %ebx
	je	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	-8(%r13,%r14), %rdi
	movq	%r15, %rsi
	callq	_ioat2_free_ring_ent
	addq	$-8, %r14
	jne	LBB0_13
LBB0_14:
	movq	%r13, %rdi
	callq	_kfree
LBB0_15:
	xorl	%r13d, %r13d
LBB0_16:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	%r9d, %edi
	andl	$-4, %edi
	xorl	%edx, %edx
	movq	%r8, %rsi
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13,%rdx,8), %rbx
	movq	8(%rsi), %rsi
	movl	(%rbx), %eax
	movl	%eax, (%rsi)
	movq	16(%r13,%rdx,8), %rax
	movq	8(%rbx), %rsi
	movl	(%rax), %ebx
	movl	%ebx, (%rsi)
	movq	24(%r13,%rdx,8), %rbx
	movq	8(%rax), %rax
	movl	(%rbx), %esi
	movl	%esi, (%rax)
	movq	32(%r13,%rdx,8), %rsi
	addq	$4, %rdx
	movq	8(%rbx), %rax
	movl	(%rsi), %ebx
	movl	%ebx, (%rax)
	cmpq	%rdx, %rdi
	jne	LBB0_18
LBB0_19:
	testq	%rcx, %rcx
	je	LBB0_22
## %bb.20:
	leaq	8(,%rdx,8), %rdx
	addq	%r13, %rdx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rsi), %rax
	movq	(%rdx,%rdi,8), %rsi
	movl	(%rsi), %ebx
	movl	%ebx, (%rax)
	incq	%rdi
	cmpq	%rdi, %rcx
	jne	LBB0_21
LBB0_22:
	movq	(%r13,%r9,8), %rcx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ioat2_alloc_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ioat2_alloc_ring
_ioat2_alloc_ring:                      ; @ioat2_alloc_ring
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x2
	mov	x23, x1
	mov	x20, x0
	bl	_ioat_get_max_alloc_order
	cmp	w0, w23
	b.ge	LBB0_2
LBB0_1:
	mov	x19, #0
	b	LBB0_6
LBB0_2:
	mov	w8, #1
	lsl	w22, w8, w23
	mov	x0, x22
	mov	w1, #8
	mov	x2, x21
	bl	_kcalloc
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.3:
	cmp	w23, #31
	b.ne	LBB0_7
LBB0_4:
	ldr	x9, [x19]
	mov	x8, x9
LBB0_5:
	ldr	w8, [x8]
	ldr	x9, [x9, #8]
	str	w8, [x9]
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	w23, #0
	mov	x24, #0
	cmp	w22, #1
	csinc	w8, w22, wzr, gt
	lsl	x25, x8, #3
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_ioat2_alloc_ring_ent
	str	x0, [x19, x24]
	cbz	x0, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x1, x23
	bl	_set_desc_id
	add	x24, x24, #8
	add	w23, w23, #1
	cmp	x25, x24
	b.ne	LBB0_8
; %bb.10:
	subs	w9, w22, #1
	b.le	LBB0_4
; %bb.11:
	ldr	x8, [x19]
	cmp	w9, #4
	b.hs	LBB0_17
; %bb.12:
	mov	x10, #0
	mov	x11, x8
	b	LBB0_20
LBB0_13:
	cbz	w23, LBB0_16
; %bb.14:
	sub	x21, x19, #8
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21, x24]
	mov	x1, x20
	bl	_ioat2_free_ring_ent
	subs	x24, x24, #8
	b.ne	LBB0_15
LBB0_16:
	mov	x0, x19
	bl	_kfree
	b	LBB0_1
LBB0_17:
	and	x10, x9, #0xfffffffc
	add	x12, x19, #32
	mov	x13, x10
	mov	x11, x8
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldp	x14, x15, [x12, #-24]
	ldr	x17, [x11, #8]
	ldp	x16, x11, [x12, #-8]
	ldr	x0, [x14, #8]
	ldr	x1, [x15, #8]
	ldr	x2, [x16, #8]
	ldr	w14, [x14]
	ldr	w15, [x15]
	ldr	w16, [x16]
	ldr	w3, [x11]
	str	w14, [x17]
	str	w15, [x0]
	str	w16, [x1]
	str	w3, [x2]
	add	x12, x12, #32
	subs	x13, x13, #4
	b.ne	LBB0_18
; %bb.19:
	cmp	x10, x9
	b.eq	LBB0_22
LBB0_20:
	sub	x12, x9, x10
	add	x10, x19, x10, lsl #3
	add	x10, x10, #8
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x11, #8]
	ldr	x13, [x10], #8
	ldr	w14, [x13]
	str	w14, [x11]
	mov	x11, x13
	subs	x12, x12, #1
	b.ne	LBB0_21
LBB0_22:
	ldr	x9, [x19, x9, lsl #3]
	b	LBB0_5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ioat2_alloc_ring
.subsections_via_symbols
