	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xen_hvm_init_shared_info_page
_xen_hvm_init_shared_info_page:         ## @xen_hvm_init_shared_info_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	xorl	%eax, %eax
	callq	_xen_pv_domain
	testq	%rax, %rax
	jne	LBB0_6
## %bb.1:
	movq	_HYPERVISOR_shared_info@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	jne	LBB0_4
## %bb.2:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_M_XENHVM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_malloc
	movq	%rax, %rdi
	movq	%rax, (%rbx)
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_panic
	movq	(%rbx), %rdi
LBB0_4:
	movq	_DOMID_SELF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -16(%rbp)
	movq	$0, -24(%rbp)
	movq	_XENMAPSPACE_shared_info@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	callq	_vtophys
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, -32(%rbp)
	movq	_XENMEM_add_to_physmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-32(%rbp), %rsi
	callq	_HYPERVISOR_memory_op
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_panic
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HYPERVISOR_shared_info,8,3     ## @HYPERVISOR_shared_info
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_M_XENHVM,4,2                   ## @M_XENHVM
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to allocate Xen shared info page"

	.comm	_DOMID_SELF,4,2                 ## @DOMID_SELF
	.comm	_XENMAPSPACE_shared_info,4,2    ## @XENMAPSPACE_shared_info
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_XENMEM_add_to_physmap,4,2      ## @XENMEM_add_to_physmap
L_.str.1:                               ## @.str.1
	.asciz	"HYPERVISOR_memory_op failed"

	.no_dead_strip	_xen_hvm_init_shared_info_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xen_hvm_init_shared_info_page
_xen_hvm_init_shared_info_page:         ; @xen_hvm_init_shared_info_page
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	bl	_xen_pv_domain
	cbnz	x0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x19, _HYPERVISOR_shared_info@GOTPAGE
Lloh1:
	ldr	x19, [x19, _HYPERVISOR_shared_info@GOTPAGEOFF]
	ldr	x0, [x19]
	cbnz	x0, LBB0_4
; %bb.2:
Lloh2:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _M_XENHVM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M_XENHVM@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_malloc
	str	x0, [x19]
	cbnz	x0, LBB0_4
; %bb.3:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
	ldr	x0, [x19]
LBB0_4:
Lloh13:
	adrp	x8, _DOMID_SELF@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DOMID_SELF@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	str	xzr, [sp, #16]
Lloh16:
	adrp	x8, _XENMAPSPACE_shared_info@GOTPAGE
Lloh17:
	ldr	x8, [x8, _XENMAPSPACE_shared_info@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	bl	_vtophys
Lloh19:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	asr	w8, w0, w8
	str	w8, [sp, #8]
Lloh22:
	adrp	x8, _XENMEM_add_to_physmap@GOTPAGE
Lloh23:
	ldr	x8, [x8, _XENMEM_add_to_physmap@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_HYPERVISOR_memory_op
	cbz	x0, LBB0_6
; %bb.5:
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_panic
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_HYPERVISOR_shared_info,8,3     ; @HYPERVISOR_shared_info
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_M_XENHVM,4,2                   ; @M_XENHVM
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to allocate Xen shared info page"

	.comm	_DOMID_SELF,4,2                 ; @DOMID_SELF
	.comm	_XENMAPSPACE_shared_info,4,2    ; @XENMAPSPACE_shared_info
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_XENMEM_add_to_physmap,4,2      ; @XENMEM_add_to_physmap
l_.str.1:                               ; @.str.1
	.asciz	"HYPERVISOR_memory_op failed"

	.no_dead_strip	_xen_hvm_init_shared_info_page
.subsections_via_symbols
