	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_init                    ## -- Begin function vlapic_init
	.p2align	4, 0x90
_vlapic_init:                           ## @vlapic_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpq	$0, 32(%rbx)
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	(%rbx), %r14
	testq	%r14, %r14
	js	LBB0_1
## %bb.2:
	movq	32(%rbx), %rdi
	callq	_vm_get_maxcpus
	xorl	%edi, %edi
	cmpq	%rax, %r14
	setl	%dil
	jmp	LBB0_3
LBB0_1:
	xorl	%edi, %edi
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	xorl	%edi, %edi
	cmpq	$0, 24(%rbx)
	setne	%dil
	leaq	L_.str.2(%rip), %rsi
	callq	_KASSERT
	leaq	16(%rbx), %rdi
	movq	_MTX_SPIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rsi
	xorl	%edx, %edx
	callq	_mtx_init
	leaq	12(%rbx), %rdi
	movl	$1, %esi
	callq	_callout_init
	movq	_DEFAULT_APIC_BASE@GOTPCREL(%rip), %rcx
	movq	_APICBASE_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movl	%eax, 8(%rbx)
	cmpq	$0, (%rbx)
	jne	LBB0_5
## %bb.4:
	movq	_APICBASE_BSP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 8(%rbx)
LBB0_5:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_vlapic_reset                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vlapic_init: vm is not initialized"

L_.str.1:                               ## @.str.1
	.asciz	"vlapic_init: vcpuid is not initialized"

L_.str.2:                               ## @.str.2
	.asciz	"vlapic_init: apic_page is not initialized"

L_.str.3:                               ## @.str.3
	.asciz	"vlapic timer mtx"

	.comm	_MTX_SPIN,4,2                   ## @MTX_SPIN
	.comm	_DEFAULT_APIC_BASE,4,2          ## @DEFAULT_APIC_BASE
	.comm	_APICBASE_ENABLED,4,2           ## @APICBASE_ENABLED
	.comm	_APICBASE_BSP,4,2               ## @APICBASE_BSP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_init                    ; -- Begin function vlapic_init
	.p2align	2
_vlapic_init:                           ; @vlapic_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #32]
	cmp	x8, #0
	cset	w0, ne
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x20, [x19]
	tbnz	x20, #63, LBB0_2
; %bb.1:
	ldr	x0, [x19, #32]
	bl	_vm_get_maxcpus
	cmp	x20, x0
	cset	w0, lt
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	ldr	x8, [x19, #24]
	cmp	x8, #0
	cset	w0, ne
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
	add	x0, x19, #16
Lloh6:
	adrp	x8, _MTX_SPIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTX_SPIN@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	add	x0, x19, #12
	mov	w1, #1
	bl	_callout_init
Lloh11:
	adrp	x8, _DEFAULT_APIC_BASE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DEFAULT_APIC_BASE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _APICBASE_ENABLED@GOTPAGE
Lloh15:
	ldr	x9, [x9, _APICBASE_ENABLED@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	ldr	x9, [x19]
	cbnz	x9, LBB0_5
; %bb.4:
Lloh17:
	adrp	x9, _APICBASE_BSP@GOTPAGE
Lloh18:
	ldr	x9, [x9, _APICBASE_BSP@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #8]
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_vlapic_reset
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vlapic_init: vm is not initialized"

l_.str.1:                               ; @.str.1
	.asciz	"vlapic_init: vcpuid is not initialized"

l_.str.2:                               ; @.str.2
	.asciz	"vlapic_init: apic_page is not initialized"

l_.str.3:                               ; @.str.3
	.asciz	"vlapic timer mtx"

	.comm	_MTX_SPIN,4,2                   ; @MTX_SPIN
	.comm	_DEFAULT_APIC_BASE,4,2          ; @DEFAULT_APIC_BASE
	.comm	_APICBASE_ENABLED,4,2           ; @APICBASE_ENABLED
	.comm	_APICBASE_BSP,4,2               ; @APICBASE_BSP
.subsections_via_symbols
