	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vhpet_timer_update_config
_vhpet_timer_update_config:             ## @vhpet_timer_update_config
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_vhpet_timer_msi_enabled
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_timer_edge_trig
	testq	%rax, %rax
	je	LBB0_4
LBB0_2:
	movl	(%r14), %eax
	btl	%ebx, %eax
	jae	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_panic
LBB0_4:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_timer_ioapic_pin
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	8(%r14), %rax
	movslq	%ebx, %r15
	shlq	$4, %r15
	movl	(%rax,%r15), %r12d
	movl	%r12d, -44(%rbp)
	leaq	-44(%rbp), %rdi
	movl	%r13d, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_update_register
	movq	_HPET_TCAP_RO_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_HPET_TCNF_32MODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	notl	%ecx
	andl	-44(%rbp), %ecx
	andl	%r12d, %eax
	orl	%ecx, %eax
	movl	%eax, -44(%rbp)
	cmpl	%r12d, %eax
	je	LBB0_13
## %bb.5:
	movq	8(%r14), %rcx
	movl	%eax, (%rcx,%r15)
	movl	4(%r14), %edi
	movl	-44(%rbp), %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_VM_CTR2
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_timer_ioapic_pin
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_periodic_timer
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	8(%r14), %rax
	movq	$0, 8(%rax,%r15)
LBB0_7:
	movl	(%r14), %eax
	movl	$1, %r12d
	movl	%ebx, %ecx
	shll	%cl, %r12d
	btl	%ebx, %eax
	jae	LBB0_13
## %bb.8:
	xorl	%edi, %edi
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	setne	%dil
	movslq	%eax, %rsi
	callq	_KASSERT
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_timer_interrupt_enabled
	testl	%eax, %eax
	je	LBB0_12
## %bb.9:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_timer_msi_enabled
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_timer_edge_trig
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vhpet_timer_ioapic_pin
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_13
LBB0_12:
	movl	4(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edx
	callq	_VM_CTR1
	movl	4(%r14), %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_vioapic_deassert_irq
	notl	%r12d
	andl	%r12d, (%r14)
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vhpet timer %d isr should not be asserted"

	.comm	_HPET_TCAP_RO_MASK,4,2          ## @HPET_TCAP_RO_MASK
	.comm	_HPET_TCNF_32MODE,4,2           ## @HPET_TCNF_32MODE
L_.str.1:                               ## @.str.1
	.asciz	"hpet t%d cap_config set to 0x%016x"

	.comm	_HPET_TCNF_INT_ROUTE,4,2        ## @HPET_TCNF_INT_ROUTE
L_.str.4:                               ## @.str.4
	.asciz	"hpet t%d isr cleared due to configuration change"

	.no_dead_strip	_vhpet_timer_update_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vhpet_timer_update_config
_vhpet_timer_update_config:             ; @vhpet_timer_update_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	bl	_vhpet_timer_msi_enabled
	cbnz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_timer_edge_trig
	cbz	x0, LBB0_4
LBB0_2:
	ldr	w8, [x19]
	lsr	w8, w8, w20
	tbz	w8, #0, LBB0_4
; %bb.3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_panic
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_timer_ioapic_pin
	mov	x21, x0
	ldr	x8, [x19, #8]
	sbfiz	x9, x20, #4, #32
	ldr	w24, [x8, x9]
	str	w24, [sp, #12]
	add	x0, sp, #12
	mov	x1, x23
	mov	x2, x22
	bl	_update_register
Lloh2:
	adrp	x8, _HPET_TCAP_RO_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HPET_TCAP_RO_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _HPET_TCNF_32MODE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HPET_TCNF_32MODE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w9, w9, w8
	ldr	w10, [sp, #12]
	bic	w9, w10, w9
	and	w8, w8, w24
	orr	w8, w9, w8
	str	w8, [sp, #12]
	cmp	w8, w24
	b.eq	LBB0_13
; %bb.5:
	sxtw	x22, w20
	ldr	x9, [x19, #8]
	lsl	x10, x22, #4
	str	w8, [x9, x10]
	ldr	w0, [x19, #4]
	ldr	w3, [sp, #12]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_VM_CTR2
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_timer_ioapic_pin
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_periodic_timer
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x8, [x19, #8]
	add	x8, x8, x22, lsl #4
	str	xzr, [x8, #8]
LBB0_7:
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w22, w9, w20
	tst	w8, w22
	b.eq	LBB0_13
; %bb.8:
	cmp	w21, #0
	cset	w0, ne
	sxtw	x1, w21
	bl	_KASSERT
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_timer_interrupt_enabled
	cbz	w0, LBB0_12
; %bb.9:
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_timer_msi_enabled
	cbnz	x0, LBB0_12
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_timer_edge_trig
	cbnz	x0, LBB0_12
; %bb.11:
	mov	x0, x19
	mov	x1, x20
	bl	_vhpet_timer_ioapic_pin
	cmp	w0, w21
	b.eq	LBB0_13
LBB0_12:
	ldr	w0, [x19, #4]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x20
	bl	_VM_CTR1
	ldr	w0, [x19, #4]
	mov	x1, x21
	bl	_vioapic_deassert_irq
	ldr	w8, [x19]
	bic	w8, w8, w22
	str	w8, [x19]
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vhpet timer %d isr should not be asserted"

	.comm	_HPET_TCAP_RO_MASK,4,2          ; @HPET_TCAP_RO_MASK
	.comm	_HPET_TCNF_32MODE,4,2           ; @HPET_TCNF_32MODE
l_.str.1:                               ; @.str.1
	.asciz	"hpet t%d cap_config set to 0x%016x"

	.comm	_HPET_TCNF_INT_ROUTE,4,2        ; @HPET_TCNF_INT_ROUTE
l_.str.4:                               ; @.str.4
	.asciz	"hpet t%d isr cleared due to configuration change"

	.no_dead_strip	_vhpet_timer_update_config
.subsections_via_symbols
