	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_install_p2mtop_page            ## -- Begin function install_p2mtop_page
	.p2align	4, 0x90
_install_p2mtop_page:                   ## @install_p2mtop_page
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_p2m_top_index
	movq	_p2m_top@GOTPCREL(%rip), %rcx
	movl	%eax, %r14d
	leaq	(,%r14,8), %rdi
	addq	(%rcx), %rdi
	movq	_p2m_top_mfn@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_P2M_ENTRIES_PER_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	testq	%r10, %r10
	je	LBB0_18
## %bb.1:
	cmpl	$4, %r10d
	jb	LBB0_2
## %bb.3:
	movq	_INVALID_P2M_ENTRY@GOTPCREL(%rip), %r8
	leaq	8(%r8), %rcx
	cmpq	%rcx, %rbx
	jae	LBB0_6
## %bb.4:
	leaq	(%rbx,%r10,8), %rcx
	cmpq	_INVALID_P2M_ENTRY@GOTPCREL(%rip), %rcx
	jbe	LBB0_6
LBB0_2:
	xorl	%ecx, %ecx
LBB0_12:
	movq	%rcx, %r8
	notq	%r8
	addq	%r10, %r8
	movq	%r10, %rsi
	andq	$3, %rsi
	je	LBB0_15
## %bb.13:
	movq	_INVALID_P2M_ENTRY@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %rax
	movq	%rax, (%rbx,%rcx,8)
	incq	%rcx
	decq	%rsi
	jne	LBB0_14
LBB0_15:
	cmpq	$3, %r8
	jb	LBB0_18
## %bb.16:
	movq	_INVALID_P2M_ENTRY@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %rax
	movq	%rax, (%rbx,%rcx,8)
	movq	(%rdx), %rax
	movq	%rax, 8(%rbx,%rcx,8)
	movq	(%rdx), %rax
	movq	%rax, 16(%rbx,%rcx,8)
	movq	(%rdx), %rax
	movq	%rax, 24(%rbx,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %r10
	jne	LBB0_17
	jmp	LBB0_18
LBB0_6:
	movl	%r10d, %ecx
	andl	$-4, %ecx
	leaq	-4(%rcx), %rdx
	movq	%rdx, %r9
	shrq	$2, %r9
	incq	%r9
	testq	%rdx, %rdx
	je	LBB0_21
## %bb.7:
	movq	%r9, %rsi
	andq	$-2, %rsi
	movq	(%r8), %xmm0                    ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rbx,%rdx,8)
	movdqu	%xmm0, 16(%rbx,%rdx,8)
	movdqu	%xmm0, 32(%rbx,%rdx,8)
	movdqu	%xmm0, 48(%rbx,%rdx,8)
	addq	$8, %rdx
	addq	$-2, %rsi
	jne	LBB0_8
## %bb.9:
	testb	$1, %r9b
	je	LBB0_11
LBB0_10:
	movq	(%r8), %xmm0                    ## xmm0 = mem[0],zero
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	movdqu	%xmm0, (%rbx,%rdx,8)
	movdqu	%xmm0, 16(%rbx,%rdx,8)
LBB0_11:
	cmpq	%r10, %rcx
	jne	LBB0_12
LBB0_18:
	movq	_p2m_missing@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	%rbx, %rdx
	callq	_cmpxchg
	movq	%rax, %rcx
	xorl	%eax, %eax
	cmpq	(%r12), %rcx
	jne	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_virt_to_mfn
	movq	%rax, (%r15,%r14,8)
	movl	$1, %eax
LBB0_20:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	xorl	%edx, %edx
	testb	$1, %r9b
	jne	LBB0_10
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_p2m_top,8,3                    ## @p2m_top
	.comm	_p2m_top_mfn,8,3                ## @p2m_top_mfn
	.comm	_P2M_ENTRIES_PER_PAGE,4,2       ## @P2M_ENTRIES_PER_PAGE
	.comm	_INVALID_P2M_ENTRY,8,3          ## @INVALID_P2M_ENTRY
	.comm	_p2m_missing,8,3                ## @p2m_missing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_install_p2mtop_page            ; -- Begin function install_p2mtop_page
	.p2align	2
_install_p2mtop_page:                   ; @install_p2mtop_page
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	bl	_p2m_top_index
	mov	x20, x0
Lloh0:
	adrp	x8, _p2m_top@GOTPAGE
Lloh1:
	ldr	x8, [x8, _p2m_top@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x0, x8, w0, uxtw #3
Lloh3:
	adrp	x8, _p2m_top_mfn@GOTPAGE
Lloh4:
	ldr	x8, [x8, _p2m_top_mfn@GOTPAGEOFF]
Lloh5:
	ldr	x21, [x8]
Lloh6:
	adrp	x8, _P2M_ENTRIES_PER_PAGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _P2M_ENTRIES_PER_PAGE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x8]
	cbz	w9, LBB0_9
; %bb.1:
Lloh9:
	adrp	x8, _INVALID_P2M_ENTRY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _INVALID_P2M_ENTRY@GOTPAGEOFF]
	cmp	w9, #8
	b.lo	LBB0_6
; %bb.2:
	add	x10, x19, x9, lsl #3
	add	x11, x8, #8
	cmp	x19, x11
	ccmp	x10, x8, #0, lo
	b.hi	LBB0_6
; %bb.3:
	and	x10, x9, #0xfffffff8
	ld1r.2d	{ v0 }, [x8]
	add	x11, x19, #32
	mov	x12, x10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	d1, [x8]
	dup.2d	v1, v1[0]
	stp	q0, q0, [x11, #-32]
	stp	q0, q1, [x11], #64
	subs	x12, x12, #8
	b.ne	LBB0_4
; %bb.5:
	cmp	x10, x9
	b.ne	LBB0_7
	b	LBB0_9
LBB0_6:
	mov	x10, #0
LBB0_7:
	add	x11, x19, x10, lsl #3
	sub	x9, x9, x10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8]
	str	x10, [x11], #8
	subs	x9, x9, #1
	b.ne	LBB0_8
LBB0_9:
Lloh11:
	adrp	x22, _p2m_missing@GOTPAGE
Lloh12:
	ldr	x22, [x22, _p2m_missing@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x2, x19
	bl	_cmpxchg
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.10:
	mov	w20, w20
	mov	x0, x19
	bl	_virt_to_mfn
	str	x0, [x21, x20, lsl #3]
	mov	w0, #1
	b	LBB0_12
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_p2m_top,8,3                    ; @p2m_top
	.comm	_p2m_top_mfn,8,3                ; @p2m_top_mfn
	.comm	_P2M_ENTRIES_PER_PAGE,4,2       ; @P2M_ENTRIES_PER_PAGE
	.comm	_INVALID_P2M_ENTRY,8,3          ; @INVALID_P2M_ENTRY
	.comm	_p2m_missing,8,3                ; @p2m_missing
.subsections_via_symbols
