	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___reserve_free_pmem            ## -- Begin function __reserve_free_pmem
	.p2align	4, 0x90
___reserve_free_pmem:                   ## @__reserve_free_pmem
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_is_memory
	xorl	%r15d, %r15d
	testl	%eax, %eax
	je	LBB0_9
## %bb.1:
	movq	%rbx, %rdi
	callq	_to_nd_region
	cmpl	$0, (%rax)
	je	LBB0_9
## %bb.2:
	movq	%rax, %r12
	leaq	-40(%rbp), %rdi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	-40(%rbp), %edi
	leaq	L_.str(%rip), %rsi
	callq	_strcat
	cmpl	$0, (%r12)
	jle	LBB0_9
## %bb.3:
	movq	8(%r12), %rbx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, -48(%rbp)
	cmpq	%r14, (%rbx)
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rax
	movslq	(%r12), %rcx
	addq	$8, %rbx
	cmpq	%rcx, %rax
	jl	LBB0_4
	jmp	LBB0_8
LBB0_5:
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_nd_pmem_available_dpa
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%rax, %r14
	leaq	-40(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rcx
	callq	_scan_allocate
	movq	%rax, -48(%rbp)
	addq	$4, %r12
	movq	%r14, %rcx
	subq	%rax, %rcx
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r14, %r8
	callq	_dev_WARN_ONCE
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	cmpq	$0, -48(%rbp)
	cmovel	%ecx, %r15d
	jmp	LBB0_9
LBB0_8:
	xorl	%r15d, %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pmem-reserve"

L_.str.1:                               ## @.str.1
	.asciz	"pmem reserve underrun: %#llx of %#llx bytes\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___reserve_free_pmem            ; -- Begin function __reserve_free_pmem
	.p2align	2
___reserve_free_pmem:                   ; @__reserve_free_pmem
	.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	x20, x1
	mov	x19, x0
	bl	_is_memory
	cbz	w0, LBB0_7
; %bb.1:
	mov	x0, x19
	bl	_to_nd_region
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.2:
	mov	x19, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w0, [sp, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcat
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x8, #0
	ldr	x21, [x19, #8]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [sp]
	ldr	x9, [x21]
	cmp	x9, x20
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #1
	ldrsw	x9, [x19]
	add	x21, x21, #8
	cmp	x8, x9
	b.lt	LBB0_4
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
LBB0_8:
	mov	x2, sp
	mov	x0, x19
	mov	x1, x21
	bl	_nd_pmem_available_dpa
	cbz	x0, LBB0_7
; %bb.9:
	mov	x20, x0
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	x3, x20
	bl	_scan_allocate
	mov	x1, x0
	str	x0, [sp]
	add	x0, x19, #4
	sub	x3, x20, x1
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x4, x20
	bl	_dev_WARN_ONCE
	ldr	x8, [sp]
Lloh4:
	adrp	x9, _ENXIO@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ENXIO@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	cmp	x8, #0
	csneg	w0, wzr, w9, eq
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pmem-reserve"

l_.str.1:                               ; @.str.1
	.asciz	"pmem reserve underrun: %#llx of %#llx bytes\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
.subsections_via_symbols
