	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sc_buffer_alloc                ## -- Begin function sc_buffer_alloc
	.p2align	4, 0x90
_sc_buffer_alloc:                       ## @sc_buffer_alloc
	.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	%rcx, %r12
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_dwords_to_blocks
	movq	%rax, %r13
	leaq	72(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_SCF_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_11
## %bb.1:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	8(%rbx), %rax
	subq	16(%rbx), %rax
	addq	24(%rbx), %rax
	cmpq	%rax, %r13
	jbe	LBB0_7
## %bb.2:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	96(%rbx), %edi
	callq	_READ_ONCE
	movq	%rax, 24(%rbx)
	addq	8(%rbx), %rax
	subq	16(%rbx), %rax
	cmpq	%rax, %r13
	jbe	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_sc_release_update
	movl	96(%rbx), %edi
	callq	_READ_ONCE
	movq	%rax, 24(%rbx)
	incl	%r15d
	movq	8(%rbx), %rcx
	subq	16(%rbx), %rcx
	addq	%rax, %rcx
	cmpq	%rcx, %r13
	ja	LBB0_3
LBB0_7:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_preempt_disable
	movq	88(%rbx), %rax
	movl	(%rax), %edi
	callq	_this_cpu_inc
	movq	8(%rbx), %rcx
	movq	32(%rbx), %r14
	movq	16(%rbx), %rax
	addq	%r13, %rax
	movq	%rax, 16(%rbx)
	movq	40(%rbx), %r12
	addq	%r12, %r13
	movq	%r13, 40(%rbx)
	subq	%rcx, %r13
	jb	LBB0_9
## %bb.8:
	movq	%r13, 40(%rbx)
LBB0_9:
	movq	80(%rbx), %r13
	leaq	(%r14,%r14,8), %r15
	leaq	(,%r15,8), %rcx
	addq	%r13, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, (%r13,%r15,8)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 64(%r13,%r15,8)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 56(%r13,%r15,8)
	movq	%rbx, 48(%r13,%r15,8)
	incq	%r14
	xorl	%eax, %eax
	cmpq	48(%rbx), %r14
	cmovaeq	%rax, %r14
	xorl	%eax, %eax
	callq	_smp_wmb
	movq	%r14, 32(%rbx)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movq	_PIO_BLOCK_SIZE@GOTPCREL(%rip), %rax
	imulq	(%rax), %r12
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movdqu	56(%rbx), %xmm0
	movq	%r12, %xmm1
	palignr	$8, %xmm0, %xmm1                ## xmm1 = xmm0[8,9,10,11,12,13,14,15],xmm1[0,1,2,3,4,5,6,7]
	paddq	%xmm0, %xmm1
	movdqu	%xmm1, 32(%r13,%r15,8)
	pxor	%xmm0, %xmm0
	movdqu	%xmm0, 8(%r13,%r15,8)
	movq	$0, 24(%r13,%r15,8)
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	_ECOMM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_SCF_ENABLED,4,2                ## @SCF_ENABLED
	.comm	_ECOMM,4,2                      ## @ECOMM
	.comm	_PIO_BLOCK_SIZE,8,3             ## @PIO_BLOCK_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sc_buffer_alloc                ; -- Begin function sc_buffer_alloc
	.p2align	2
_sc_buffer_alloc:                       ; @sc_buffer_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x3
	mov	x22, x2
	mov	x19, x0
	mov	x0, x1
	bl	_dwords_to_blocks
	mov	x23, x0
	add	x20, x19, #72
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _SCF_ENABLED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SCF_ENABLED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.1:
	ldp	x8, x9, [x19, #8]
	ldr	x10, [x19, #24]
	sub	x8, x8, x9
	add	x8, x8, x10
	cmp	x23, x8
	b.ls	LBB0_6
; %bb.2:
	mov	w24, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_unlikely
	cbnz	x0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #96]
	bl	_READ_ONCE
	str	x0, [x19, #24]
	ldp	x8, x9, [x19, #8]
	add	x8, x8, x0
	sub	x8, x8, x9
	cmp	x23, x8
	b.ls	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_sc_release_update
	ldr	w0, [x19, #96]
	bl	_READ_ONCE
	str	x0, [x19, #24]
	add	w24, w24, #1
	ldp	x8, x9, [x19, #8]
	sub	x8, x8, x9
	add	x8, x8, x0
	cmp	x23, x8
	b.hi	LBB0_3
LBB0_6:
	bl	_preempt_disable
	ldr	x8, [x19, #88]
	ldr	w0, [x8]
	bl	_this_cpu_inc
	ldp	x10, x8, [x19, #8]
	add	x9, x8, x23
	str	x9, [x19, #16]
	ldp	x8, x24, [x19, #32]
	add	x11, x24, x23
	subs	x10, x11, x10
	str	x11, [x19, #40]
	b.lo	LBB0_8
; %bb.7:
	str	x10, [x19, #40]
LBB0_8:
	ldr	x10, [x19, #80]
	mov	w11, #72
	madd	x23, x8, x11, x10
	str	x9, [x23]
	str	w22, [x23, #64]
	stp	x19, x21, [x23, #48]
	add	x9, x8, #1
	ldr	x10, [x19, #48]
	cmp	x9, x10
	csinc	x21, xzr, x8, hs
	bl	_smp_wmb
	str	x21, [x19, #32]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh3:
	adrp	x8, _PIO_BLOCK_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PIO_BLOCK_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldp	x10, x9, [x19, #56]
	madd	x11, x8, x24, x9
	add	x8, x10, x9
	stp	x8, x11, [x23, #32]
	stp	xzr, xzr, [x23, #16]
	str	xzr, [x23, #8]
LBB0_9:
	mov	x0, x23
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh6:
	adrp	x8, _ECOMM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ECOMM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_11:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x23, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SCF_ENABLED,4,2                ; @SCF_ENABLED
	.comm	_ECOMM,4,2                      ; @ECOMM
	.comm	_PIO_BLOCK_SIZE,8,3             ; @PIO_BLOCK_SIZE
.subsections_via_symbols
