	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_ring_buffer
_create_ring_buffer:                    ## @create_ring_buffer
	.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	%edx, %r15d
	movq	_SIZEOF_SBufferHeader@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	imull	%edx, %eax
	cmpl	$4097, %eax                     ## imm = 0x1001
	movl	$4096, %r13d                    ## imm = 0x1000
	cmovgel	%eax, %r13d
	movq	%rsi, %r14
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsi)
	movq	$0, 16(%rsi)
	leaq	-96(%rbp), %rdx
	movl	%r13d, %esi
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	-96(%rbp), %r8
	movq	%rax, %rsi
	cmpl	$2, %r15d
	jl	LBB0_9
## %bb.2:
	movslq	(%rbx), %rdx
	leal	-2(%r15), %ebx
	leal	-1(%r15), %esi
	movl	%esi, %ecx
	andl	$7, %ecx
	movq	%rax, %r12
	movq	%r8, %rdi
	cmpl	$7, %ebx
	jb	LBB0_6
## %bb.3:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	andl	$-8, %esi
	leaq	(,%rdx,4), %rbx
	movq	%rdx, %rdi
	shlq	$5, %rdi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,8), %r14
	leaq	(%rbx,%rbx,2), %r13
	movq	%rdx, %r9
	shlq	$4, %r9
	movq	%rax, %r12
	movq	%r8, %rdi
	movq	%rbx, %r10
	leaq	(%rbx,%rbx,4), %r8
	movq	%r14, %r11
	leaq	(%r14,%r14,2), %r14
	leaq	(%rdx,%rdx,8), %rax
	leaq	(%rax,%rax,2), %r15
	addq	%rdx, %r15
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rax
	leaq	(%r12,%r10), %rbx
	addq	%rdx, %rdi
	movq	%rbx, 8(%r12)
	movq	%rdi, (%r12)
	leaq	(%r12,%r11), %rbx
	addq	%rdx, %rdi
	movq	%rbx, 8(%r12,%rdx,4)
	movq	%rdi, (%r12,%rdx,4)
	leaq	(%r12,%r13), %rbx
	addq	%rdx, %rdi
	movq	%rbx, 8(%r12,%rdx,8)
	movq	%rdi, (%r12,%rdx,8)
	leaq	(%r12,%r9), %rbx
	addq	%rdx, %rdi
	movq	%rbx, 8(%r12,%r13)
	movq	%rdi, (%r12,%r13)
	leaq	(%r12,%r8), %rbx
	addq	%rdx, %rdi
	movq	%rbx, 8(%r12,%r9)
	movq	%rdi, (%r12,%r9)
	leaq	(%r12,%r14), %rbx
	addq	%rdx, %rdi
	movq	%rbx, 8(%r12,%r8)
	movq	%rdi, (%r12,%r8)
	leaq	(%r12,%r15), %rbx
	addq	%rdx, %rdi
	movq	%rbx, 8(%r12,%r14)
	movq	%rdi, (%r12,%r14)
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	addq	%rbx, %r12
	addq	%rdx, %rdi
	movq	%r12, 8(%rax,%r15)
	movq	%rdi, (%rax,%r15)
	addl	$-8, %esi
	jne	LBB0_4
## %bb.5:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %r8                  ## 8-byte Reload
LBB0_6:
	movq	%r12, %rsi
	testl	%ecx, %ecx
	je	LBB0_9
## %bb.7:
	leaq	(,%rdx,4), %rbx
	addq	%rdx, %rdi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r12,%rbx), %rsi
	movq	%rsi, 8(%r12)
	movq	%rdi, (%r12)
	addq	%rdx, %rdi
	movq	%rsi, %r12
	decl	%ecx
	jne	LBB0_8
LBB0_9:
	movq	%rax, 8(%rsi)
	movq	%r8, (%rsi)
	movq	%rax, 16(%r14)
	movl	%r13d, (%r14)
	movq	%r8, 8(%r14)
	movl	%r15d, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIZEOF_SBufferHeader,4,2       ## @SIZEOF_SBufferHeader
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_create_ring_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_ring_buffer
_create_ring_buffer:                    ; @create_ring_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x20, x1
Lloh0:
	adrp	x22, _SIZEOF_SBufferHeader@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SIZEOF_SBufferHeader@GOTPAGEOFF]
	ldr	w8, [x22]
	mul	w8, w8, w2
	mov	w9, #4096
	cmp	w8, #1, lsl #12                 ; =4096
	csel	w21, w8, w9, gt
	stp	xzr, xzr, [x1]
	str	xzr, [x1, #16]
	add	x2, sp, #8
	mov	x1, x21
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_5
; %bb.1:
	ldr	x9, [sp, #8]
	mov	x13, x0
	cmp	w19, #2
	b.lt	LBB0_4
; %bb.2:
	ldrsw	x8, [x22]
	lsl	x10, x8, #2
	sub	w11, w19, #1
	add	x12, x9, x8
	mov	x14, x0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x13, x14, x10
	stp	x12, x13, [x14]
	add	x12, x12, x8
	mov	x14, x13
	subs	w11, w11, #1
	b.ne	LBB0_3
LBB0_4:
	mov	w8, #0
	stp	x9, x0, [x13]
	stp	x9, x0, [x20, #8]
	stp	w21, w19, [x20]
	b	LBB0_6
LBB0_5:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_6:
	mov	x0, x8
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SIZEOF_SBufferHeader,4,2       ; @SIZEOF_SBufferHeader
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_create_ring_buffer
.subsections_via_symbols
