	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xenpv_alloc_physmem
_xenpv_alloc_physmem:                   ## @xenpv_alloc_physmem
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_LOW_MEM_LIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	%r14d, %edi
	movl	$-1, %r8d
	movq	%r12, %r9
	callq	_bus_alloc_resource
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_rman_get_start
	addq	%rax, %r12
	movq	_VM_MEMATTR_DEFAULT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_vm_phys_fictitious_reg_range
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	(%r13), %esi
	movl	(%r15), %edx
	movl	%r14d, %edi
	movq	%rbx, %rcx
	callq	_bus_release_resource
LBB0_3:
	xorl	%ebx, %ebx
LBB0_4:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_LOW_MEM_LIMIT,4,2              ## @LOW_MEM_LIMIT
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_VM_MEMATTR_DEFAULT,4,2         ## @VM_MEMATTR_DEFAULT
	.no_dead_strip	_xenpv_alloc_physmem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xenpv_alloc_physmem
_xenpv_alloc_physmem:                   ; @xenpv_alloc_physmem
	.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	x22, x3
	mov	x20, x2
	mov	x19, x1
Lloh0:
	adrp	x23, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _LOW_MEM_LIMIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LOW_MEM_LIMIT@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
Lloh5:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh7:
	ldr	w6, [x8]
	mov	x0, x19
	mov	w4, #-1
	mov	x5, x22
	bl	_bus_alloc_resource
	mov	x21, x0
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x21
	bl	_rman_get_start
	add	x1, x0, x22
Lloh8:
	adrp	x8, _VM_MEMATTR_DEFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VM_MEMATTR_DEFAULT@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_vm_phys_fictitious_reg_range
	cbz	w0, LBB0_3
; %bb.2:
	ldr	w1, [x23]
	ldr	w2, [x20]
	mov	x0, x19
	mov	x3, x21
	bl	_bus_release_resource
	mov	x21, #0
LBB0_3:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_LOW_MEM_LIMIT,4,2              ; @LOW_MEM_LIMIT
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_VM_MEMATTR_DEFAULT,4,2         ; @VM_MEMATTR_DEFAULT
	.no_dead_strip	_xenpv_alloc_physmem
.subsections_via_symbols
