	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_svr_write_handler       ## -- Begin function vlapic_svr_write_handler
	.p2align	4, 0x90
_vlapic_svr_write_handler:              ## @vlapic_svr_write_handler
	.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
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	8(%rdi), %rax
	movl	(%rax), %eax
	movl	(%rdi), %edx
	xorl	%eax, %edx
	movl	%eax, (%rdi)
	movq	_APIC_SVR_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%edx, %ecx
	je	LBB0_3
## %bb.1:
	movq	%rdi, %rbx
	testl	%eax, %ecx
	je	LBB0_4
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_VLAPIC_CTR0
	movq	%rbx, %rdi
	callq	_vlapic_periodic_timer
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_vlapic_icrtmr_write_handler    ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_VLAPIC_CTR0
	movq	%rbx, %rdi
	callq	_VLAPIC_TIMER_LOCK
	leaq	4(%rbx), %rdi
	callq	_callout_stop
	movq	%rbx, %rdi
	callq	_VLAPIC_TIMER_UNLOCK
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_vlapic_mask_lvts               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_APIC_SVR_ENABLE,4,2            ## @APIC_SVR_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vlapic is software-disabled"

L_.str.1:                               ## @.str.1
	.asciz	"vlapic is software-enabled"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vlapic_svr_write_handler       ; -- Begin function vlapic_svr_write_handler
	.p2align	2
_vlapic_svr_write_handler:              ; @vlapic_svr_write_handler
	.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
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	ldr	w9, [x0]
	str	w8, [x0]
	eor	w10, w9, w8
Lloh0:
	adrp	x9, _APIC_SVR_ENABLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _APIC_SVR_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w10
	b.eq	LBB0_4
; %bb.1:
	mov	x19, x0
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_VLAPIC_CTR0
	mov	x0, x19
	bl	_vlapic_periodic_timer
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_vlapic_icrtmr_write_handler
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_VLAPIC_CTR0
	mov	x0, x19
	bl	_VLAPIC_TIMER_LOCK
	add	x0, x19, #4
	bl	_callout_stop
	mov	x0, x19
	bl	_VLAPIC_TIMER_UNLOCK
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_vlapic_mask_lvts
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_APIC_SVR_ENABLE,4,2            ; @APIC_SVR_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vlapic is software-disabled"

l_.str.1:                               ; @.str.1
	.asciz	"vlapic is software-enabled"

.subsections_via_symbols
