	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AllocateRingBuffers
_AllocateRingBuffers:                   ## @AllocateRingBuffers
	.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
	movl	%r8d, %r13d
	movl	%ecx, %r14d
	testl	%r8d, %r8d
	setne	%cl
	movq	_NUM_SCATTER_GATHER_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	%cl, %eax
	movq	%rdx, %rbx
	imull	(%rdx), %eax
	shll	$3, %eax
	cmpl	$4097, %eax                     ## imm = 0x1001
	movl	$4096, %r12d                    ## imm = 0x1000
	cmovgel	%eax, %r12d
	leaq	-48(%rbp), %rdx
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, %esi
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdx
	movl	-48(%rbp), %r15d
	movq	%rax, 32(%rbx)
	movl	%r15d, 4(%rbx)
	movl	%r12d, 8(%rbx)
	movl	%r14d, 12(%rbx)
	movl	%r13d, 16(%rbx)
	cmpl	$0, (%rbx)
	jle	LBB0_10
## %bb.3:
	movl	%r14d, %r8d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	addq	$24, %rbx
	xorl	%ecx, %ecx
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%r14d, %r8d
	movq	%rdi, %rdx
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	incl	%ecx
	addq	$48, %rbx
	movl	%esi, %r15d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %ecx
	jge	LBB0_10
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movq	(%rbx), %rbx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r8d, %r14d
	movl	%r8d, %esi
	leaq	-48(%rbp), %rdx
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdx
	leaq	8(%r12), %rdi
	leal	8(%r15), %esi
	movl	-48(%rbp), %ecx
	movq	%rax, 40(%rbx)
	movl	%ecx, (%r12)
	movl	%r14d, 4(%r12)
	movq	%r12, 32(%rbx)
	movl	%r15d, (%rbx)
	movq	_NUM_SCATTER_GATHER_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	testl	%r13d, %r13d
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rdi, %r14
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	leaq	-48(%rbp), %rdx
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_1
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %ecx
	movq	%rax, 24(%rbx)
	movq	%r12, %rdx
	movl	%ecx, 8(%r12)
	movl	%r13d, 12(%r12)
	movq	%r14, 16(%rbx)
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%rbx)
	movq	_NUM_SCATTER_GATHER_ENTRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	addq	$16, %rdx
	addl	$16, %r15d
	movl	%r15d, %esi
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_SCATTER_GATHER_ENTRIES,4,2 ## @NUM_SCATTER_GATHER_ENTRIES
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_OVERFLOW_BUFFER_SIZE,8,3       ## @OVERFLOW_BUFFER_SIZE
	.no_dead_strip	_AllocateRingBuffers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AllocateRingBuffers
_AllocateRingBuffers:                   ; @AllocateRingBuffers
	.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, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x0
	ldr	w8, [x2]
	cmp	w4, #0
	cset	w9, ne
Lloh0:
	adrp	x10, _NUM_SCATTER_GATHER_ENTRIES@GOTPAGE
Lloh1:
	ldr	x10, [x10, _NUM_SCATTER_GATHER_ENTRIES@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	lsl	w9, w10, w9
	mul	w8, w8, w9
	lsl	w8, w8, #3
	mov	w9, #4096
	cmp	w8, #1, lsl #12                 ; =4096
	csel	w24, w8, w9, gt
	add	x2, sp, #8
	mov	x1, x24
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_8
; %bb.1:
	mov	x23, x0
	ldr	w26, [sp, #8]
	str	x0, [x21, #32]
	stp	w26, w24, [x21, #4]
	stp	w20, w19, [x21, #12]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.2:
	mov	w24, #0
	add	x8, x21, #24
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w24, w24, #1
	add	x8, x27, #48
	ldr	w9, [x21]
	mov	x26, x25
	mov	x23, x28
	cmp	w24, w9
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x8]
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x20
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	stp	w8, w20, [x23]
	stp	x23, x0, [x27, #32]
	str	w26, [x27]
Lloh3:
	adrp	x8, _NUM_SCATTER_GATHER_ENTRIES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NUM_SCATTER_GATHER_ENTRIES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x27, #4]
	add	x28, x23, #8
	add	w25, w26, #8
	cbz	w19, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x19
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [sp, #8]
	stp	w8, w19, [x23, #8]
	stp	x28, x0, [x27, #16]
Lloh6:
	adrp	x8, _NUM_SCATTER_GATHER_ENTRIES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NUM_SCATTER_GATHER_ENTRIES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	stp	w25, w8, [x27, #8]
	add	x28, x23, #16
	add	w25, w26, #16
	b	LBB0_3
LBB0_8:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_9:
	mov	w0, #0
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_SCATTER_GATHER_ENTRIES,4,2 ; @NUM_SCATTER_GATHER_ENTRIES
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_OVERFLOW_BUFFER_SIZE,8,3       ; @OVERFLOW_BUFFER_SIZE
	.no_dead_strip	_AllocateRingBuffers
.subsections_via_symbols
