	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vrtc_data_handler              ## -- Begin function vrtc_data_handler
	.p2align	4, 0x90
_vrtc_data_handler:                     ## @vrtc_data_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movl	%r8d, %ebx
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_vm_rtc
	movq	%rax, %r13
	movl	$-1, %eax
	cmpl	$1, %ebx
	jne	LBB0_12
## %bb.1:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_VRTC_LOCK
	movslq	(%r13), %r12
	cmpq	$4, %r12
	jb	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	callq	_VRTC_UNLOCK
	movl	$-1, %eax
	jmp	LBB0_12
LBB0_3:
	leaq	-60(%rbp), %rsi
	movq	%r13, %rdi
	callq	_vrtc_curtime
	movq	%rax, %rbx
	movl	-60(%rbp), %edx
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_vrtc_time_update
	movq	%rbx, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_secs_to_rtc
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	movl	4(%r13,%r12,4), %ecx
	movl	%ecx, (%r14)
	leaq	L_.str(%rip), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %r8d
	callq	_VCPU_CTR2
	jmp	LBB0_10
LBB0_5:
	movq	%r14, %r15
	movl	(%r14), %r8d
	testl	%r12d, %r12d
	jne	LBB0_7
## %bb.6:
	andl	$127, %r8d
	movl	%r8d, (%r15)
LBB0_7:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.5(%rip), %rdx
	movl	%r12d, %ecx
	callq	_VCPU_CTR2
	movl	(%r15), %eax
	movl	%eax, 4(%r13,%r12,4)
	movq	_RTC_CENTURY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_10
## %bb.8:
	movq	%r13, %rdi
	callq	_rtc_halted
	testl	%eax, %eax
	movl	$0, %ebx
	jne	LBB0_11
## %bb.9:
	movq	%r13, %rdi
	callq	_rtc_to_secs
	movq	%rax, %r14
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_sbinuptime
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_vrtc_time_update
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	movslq	%eax, %r15
	movq	%r15, %rsi
	callq	_KASSERT
	movq	_rtc_flag_broken_time@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	movq	_VRTC_BROKEN_TIME@GOTPCREL(%rip), %rax
	sbbl	%ebx, %ebx
	orl	%r15d, %ebx
	cmpq	(%rax), %r14
	cmovnel	%r15d, %ebx
	jmp	LBB0_11
LBB0_10:
	xorl	%ebx, %ebx
LBB0_11:
	movq	%r13, %rdi
	callq	_VRTC_UNLOCK
	movq	%rbx, %rax
LBB0_12:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RTC_CENTURY,4,2                ## @RTC_CENTURY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Read value %#x from RTC offset %#x"

L_.str.5:                               ## @.str.5
	.asciz	"RTC offset %#x set to %#x"

	.comm	_VRTC_BROKEN_TIME,8,3           ## @VRTC_BROKEN_TIME
	.comm	_rtc_flag_broken_time,8,3       ## @rtc_flag_broken_time
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vrtc_data_handler              ; -- Begin function vrtc_data_handler
	.p2align	2
_vrtc_data_handler:                     ; @vrtc_data_handler
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x5
	mov	x22, x4
	mov	x24, x2
	mov	x21, x1
	mov	x23, x0
	bl	_vm_rtc
	cmp	w22, #1
	b.ne	LBB0_3
; %bb.1:
	mov	x19, x0
	bl	_VRTC_LOCK
	ldrsw	x22, [x19]
	cmp	w22, #4
	b.lo	LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_VRTC_UNLOCK
LBB0_3:
	mov	w20, #-1
	b	LBB0_13
LBB0_4:
	add	x26, x19, #4
	add	x1, sp, #12
	mov	x0, x19
	bl	_vrtc_curtime
	mov	x25, x0
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x25
	bl	_vrtc_time_update
	mov	x0, x25
	mov	x1, x19
	mov	w2, #0
	bl	_secs_to_rtc
	cbz	w24, LBB0_6
; %bb.5:
	ldr	w3, [x26, x22, lsl #2]
	str	w3, [x20]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	mov	x1, x21
	mov	x4, x22
	bl	_VCPU_CTR2
	mov	w20, #0
	b	LBB0_12
LBB0_6:
	ldr	w4, [x20]
	cbnz	w22, LBB0_8
; %bb.7:
	and	w4, w4, #0x7f
	str	w4, [x20]
LBB0_8:
Lloh2:
	adrp	x2, l_.str.5@PAGE
Lloh3:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x23
	mov	x1, x21
	mov	x3, x22
	bl	_VCPU_CTR2
	ldr	w8, [x20]
	str	w8, [x26, x22, lsl #2]
Lloh4:
	adrp	x8, _RTC_CENTURY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _RTC_CENTURY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_rtc_halted
	cbz	w0, LBB0_11
LBB0_10:
	mov	w20, #0
	b	LBB0_12
LBB0_11:
	mov	x0, x19
	bl	_rtc_to_secs
	mov	x20, x0
	bl	_sbinuptime
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_vrtc_time_update
	mov	x21, x0
	cmp	w0, #0
	cset	w0, eq
	sxtw	x1, w21
	bl	_KASSERT
Lloh7:
	adrp	x8, _VRTC_BROKEN_TIME@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VRTC_BROKEN_TIME@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _rtc_flag_broken_time@GOTPAGE
Lloh11:
	ldr	x9, [x9, _rtc_flag_broken_time@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, #0
	ccmp	x20, x8, #0, ne
	csinv	w20, w21, wzr, ne
LBB0_12:
	mov	x0, x19
	bl	_VRTC_UNLOCK
LBB0_13:
	mov	x0, x20
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_RTC_CENTURY,4,2                ; @RTC_CENTURY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Read value %#x from RTC offset %#x"

l_.str.5:                               ; @.str.5
	.asciz	"RTC offset %#x set to %#x"

	.comm	_VRTC_BROKEN_TIME,8,3           ; @VRTC_BROKEN_TIME
	.comm	_rtc_flag_broken_time,8,3       ; @rtc_flag_broken_time
.subsections_via_symbols
