	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vlapic_reset
_vlapic_reset:                          ## @vlapic_reset
	.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, %r14
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	movl	$32, %esi
	callq	_bzero
	movq	%r14, %rdi
	callq	_vlapic_get_id
	movl	%eax, 24(%rbx)
	movq	_VLAPIC_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	_VLAPIC_MAXLVT_INDEX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_MAXLVTSHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, (%rbx)
	movl	$-1, 4(%rbx)
	movq	_APIC_SVR_VECTOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%r14, %rdi
	callq	_vlapic_mask_lvts
	movq	%r14, %rdi
	callq	_vlapic_reset_tmr
	movq	$0, 16(%rbx)
	movq	%r14, %rdi
	callq	_vlapic_dcr_write_handler
	cmpq	$0, (%r14)
	jne	LBB0_1
## %bb.2:
	movq	_BS_RUNNING@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_BS_INIT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movl	8(%rbx), %eax
	movl	%eax, 8(%r14)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VLAPIC_VERSION,4,2             ## @VLAPIC_VERSION
	.comm	_VLAPIC_MAXLVT_INDEX,4,2        ## @VLAPIC_MAXLVT_INDEX
	.comm	_MAXLVTSHIFT,4,2                ## @MAXLVTSHIFT
	.comm	_APIC_SVR_VECTOR,4,2            ## @APIC_SVR_VECTOR
	.comm	_BS_RUNNING,4,2                 ## @BS_RUNNING
	.comm	_BS_INIT,4,2                    ## @BS_INIT
	.no_dead_strip	_vlapic_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vlapic_reset
_vlapic_reset:                          ; @vlapic_reset
	.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	x20, [x0, #16]
	mov	x0, x20
	mov	w1, #32
	bl	_bzero
	mov	x0, x19
	bl	_vlapic_get_id
Lloh0:
	adrp	x8, _VLAPIC_VERSION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VLAPIC_VERSION@GOTPAGEOFF]
	str	w0, [x20, #24]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _VLAPIC_MAXLVT_INDEX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VLAPIC_MAXLVT_INDEX@GOTPAGEOFF]
	mov	w10, #-1
	str	w8, [x20]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x11, _MAXLVTSHIFT@GOTPAGE
Lloh7:
	ldr	x11, [x11, _MAXLVTSHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	lsl	w9, w9, w11
	orr	w8, w9, w8
	stp	w8, w10, [x20]
Lloh9:
	adrp	x8, _APIC_SVR_VECTOR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _APIC_SVR_VECTOR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	mov	x0, x19
	bl	_vlapic_mask_lvts
	mov	x0, x19
	bl	_vlapic_reset_tmr
	str	xzr, [x20, #16]
	mov	x0, x19
	bl	_vlapic_dcr_write_handler
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _BS_RUNNING@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BS_RUNNING@GOTPAGEOFF]
Lloh14:
	adrp	x10, _BS_INIT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _BS_INIT@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x19, #12]
	ldr	w8, [x20, #8]
	str	w8, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VLAPIC_VERSION,4,2             ; @VLAPIC_VERSION
	.comm	_VLAPIC_MAXLVT_INDEX,4,2        ; @VLAPIC_MAXLVT_INDEX
	.comm	_MAXLVTSHIFT,4,2                ; @MAXLVTSHIFT
	.comm	_APIC_SVR_VECTOR,4,2            ; @APIC_SVR_VECTOR
	.comm	_BS_RUNNING,4,2                 ; @BS_RUNNING
	.comm	_BS_INIT,4,2                    ; @BS_INIT
	.no_dead_strip	_vlapic_reset
.subsections_via_symbols
