	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xen_hvm_cpu_init
_xen_hvm_cpu_init:                      ## @xen_hvm_cpu_init
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	xorl	%eax, %eax
	callq	_xen_domain
	testl	%eax, %eax
	je	LBB0_14
## %bb.1:
	callq	_DPCPU_GET
	testq	%rax, %rax
	jne	LBB0_14
## %bb.2:
	movq	_cpuid_base@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	(%rbx), %rdi
	addq	$4, %rdi
	leaq	-48(%rbp), %rdx
	xorl	%esi, %esi
	callq	_cpuid_count
	movq	_XEN_HVM_CPUID_VCPU_ID_PRESENT@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movl	$1, %edi
	testl	%eax, -48(%rbp)
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_xen_pv_domain
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movq	_vcpu_id@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	movl	(%r15), %eax
	testl	%eax, -48(%rbp)
	je	LBB0_6
## %bb.5:
	movl	-44(%rbp), %esi
	jmp	LBB0_7
LBB0_6:
	movq	_acpi_id@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movl	%eax, %esi
LBB0_7:
	movl	%ebx, %edi
	callq	_PCPU_SET
	movq	_xen_evtchn_needs_ack@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.8:
	xorl	%eax, %eax
	callq	_IS_BSP
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movl	(%r14), %edi
	callq	_PCPU_GET
	movl	%eax, %edi
	callq	_set_percpu_callback
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_panic
LBB0_11:
	movq	_vcpu_local_info@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DPCPU_PTR
	movq	%rax, %r15
	movl	(%r14), %edi
	callq	_PCPU_GET
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_vtophys
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, -64(%rbp)
	movq	%r15, %rdi
	callq	_vtophys
	movslq	%eax, %rbx
	movq	%r15, %rdi
	callq	_vtophys
	movl	%eax, %edi
	callq	_trunc_page
	subq	%rax, %rbx
	movq	%rbx, -56(%rbp)
	movq	_VCPUOP_register_vcpu_info@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-64(%rbp), %rdx
	movl	%r14d, %esi
	callq	_HYPERVISOR_vcpu_op
	movq	%r15, %rsi
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movq	_HYPERVISOR_shared_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r14d, %rsi
	shlq	$2, %rsi
	addq	(%rax), %rsi
LBB0_13:
	movq	%r15, %rdi
	callq	_DPCPU_SET
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_cpuid_base,8,3                 ## @cpuid_base
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid base Xen CPUID leaf"

	.comm	_XEN_HVM_CPUID_VCPU_ID_PRESENT,4,2 ## @XEN_HVM_CPUID_VCPU_ID_PRESENT
L_.str.1:                               ## @.str.1
	.asciz	"Xen PV domain without vcpu_id in cpuid"

	.comm	_vcpu_id,4,2                    ## @vcpu_id
	.comm	_acpi_id,4,2                    ## @acpi_id
	.comm	_xen_evtchn_needs_ack,8,3       ## @xen_evtchn_needs_ack
L_.str.2:                               ## @.str.2
	.asciz	"Event channel upcall vector setup failed: %d"

	.comm	_vcpu_local_info,4,2            ## @vcpu_local_info
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_VCPUOP_register_vcpu_info,4,2  ## @VCPUOP_register_vcpu_info
	.comm	_HYPERVISOR_shared_info,8,3     ## @HYPERVISOR_shared_info
	.no_dead_strip	_xen_hvm_cpu_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xen_hvm_cpu_init
_xen_hvm_cpu_init:                      ; @xen_hvm_cpu_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_xen_domain
	cbz	w0, LBB0_15
; %bb.1:
	bl	_DPCPU_GET
	cbnz	x0, LBB0_15
; %bb.2:
Lloh3:
	adrp	x19, _cpuid_base@GOTPAGE
Lloh4:
	ldr	x19, [x19, _cpuid_base@GOTPAGEOFF]
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, ne
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x8, [x19]
	add	x0, x8, #4
	add	x2, sp, #24
	mov	w1, #0
	bl	_cpuid_count
	ldr	w8, [sp, #24]
Lloh7:
	adrp	x21, _XEN_HVM_CPUID_VCPU_ID_PRESENT@GOTPAGE
Lloh8:
	ldr	x21, [x21, _XEN_HVM_CPUID_VCPU_ID_PRESENT@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	w0, #1
	b	LBB0_5
LBB0_4:
	bl	_xen_pv_domain
	cmp	w0, #0
	cset	w0, eq
LBB0_5:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
Lloh11:
	adrp	x20, _vcpu_id@GOTPAGE
Lloh12:
	ldr	x20, [x20, _vcpu_id@GOTPAGEOFF]
	ldr	w19, [x20]
	ldr	w8, [sp, #24]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	ldr	w1, [sp, #28]
	b	LBB0_8
LBB0_7:
Lloh13:
	adrp	x8, _acpi_id@GOTPAGE
Lloh14:
	ldr	x8, [x8, _acpi_id@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_PCPU_GET
	mov	x1, x0
LBB0_8:
	mov	x0, x19
	bl	_PCPU_SET
Lloh16:
	adrp	x8, _xen_evtchn_needs_ack@GOTPAGE
Lloh17:
	ldr	x8, [x8, _xen_evtchn_needs_ack@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cbz	x8, LBB0_12
; %bb.9:
	bl	_IS_BSP
	cbnz	w0, LBB0_12
; %bb.10:
	ldr	w0, [x20]
	bl	_PCPU_GET
	bl	_set_percpu_callback
	cbz	w0, LBB0_12
; %bb.11:
	mov	x1, x0
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_panic
LBB0_12:
Lloh21:
	adrp	x8, _vcpu_local_info@GOTPAGE
Lloh22:
	ldr	x8, [x8, _vcpu_local_info@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_DPCPU_PTR
	mov	x19, x0
	ldr	w0, [x20]
	bl	_PCPU_GET
	mov	x20, x0
	mov	x0, x19
	bl	_vtophys
Lloh24:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	asr	w8, w0, w8
	str	w8, [sp, #8]
	mov	x0, x19
	bl	_vtophys
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x21, w0
	mov	x0, x19
	bl	_vtophys
	bl	_trunc_page
	sub	x8, x21, x0
	str	x8, [sp, #16]
Lloh27:
	adrp	x8, _VCPUOP_register_vcpu_info@GOTPAGE
Lloh28:
	ldr	x8, [x8, _VCPUOP_register_vcpu_info@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	add	x2, sp, #8
	mov	x1, x20
	bl	_HYPERVISOR_vcpu_op
	mov	x1, x19
	cbz	w0, LBB0_14
; %bb.13:
Lloh30:
	adrp	x8, _HYPERVISOR_shared_info@GOTPAGE
Lloh31:
	ldr	x8, [x8, _HYPERVISOR_shared_info@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	ldr	x8, [x8]
	add	x1, x8, w20, sxtw #2
LBB0_14:
	mov	x0, x19
	bl	_DPCPU_SET
LBB0_15:
	ldr	x8, [sp, #40]
Lloh33:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh34:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_cpuid_base,8,3                 ; @cpuid_base
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid base Xen CPUID leaf"

	.comm	_XEN_HVM_CPUID_VCPU_ID_PRESENT,4,2 ; @XEN_HVM_CPUID_VCPU_ID_PRESENT
l_.str.1:                               ; @.str.1
	.asciz	"Xen PV domain without vcpu_id in cpuid"

	.comm	_vcpu_id,4,2                    ; @vcpu_id
	.comm	_acpi_id,4,2                    ; @acpi_id
	.comm	_xen_evtchn_needs_ack,8,3       ; @xen_evtchn_needs_ack
l_.str.2:                               ; @.str.2
	.asciz	"Event channel upcall vector setup failed: %d"

	.comm	_vcpu_local_info,4,2            ; @vcpu_local_info
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_VCPUOP_register_vcpu_info,4,2  ; @VCPUOP_register_vcpu_info
	.comm	_HYPERVISOR_shared_info,8,3     ; @HYPERVISOR_shared_info
	.no_dead_strip	_xen_hvm_cpu_init
.subsections_via_symbols
