	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv_rtc_settime
_mv_rtc_settime:                        ## @mv_rtc_settime
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %r15d
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	(%r14), %rax
	movq	_HALF_OF_SEC_NS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_2
## %bb.1:
	incl	8(%r14)
LBB0_2:
	movq	$0, (%r14)
	movq	%rbx, %rdi
	callq	_MV_RTC_LOCK
	movq	_RTC_CLOCK_CORR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mv_rtc_reg_read
	movq	_RTC_NOMINAL_TIMING_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_RTC_NOMINAL_TIMING@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_4
## %bb.3:
	movl	%r15d, %edi
	callq	_mv_rtc_reset
LBB0_4:
	movq	_RTC_STATUS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mv_rtc_reg_write
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mv_rtc_reg_write
	movq	_RTC_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	movq	%rbx, %rdi
	callq	_mv_rtc_reg_write
	movq	%rbx, %rdi
	callq	_MV_RTC_UNLOCK
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HALF_OF_SEC_NS,8,3             ## @HALF_OF_SEC_NS
	.comm	_RTC_CLOCK_CORR,4,2             ## @RTC_CLOCK_CORR
	.comm	_RTC_NOMINAL_TIMING_MASK,4,2    ## @RTC_NOMINAL_TIMING_MASK
	.comm	_RTC_NOMINAL_TIMING,4,2         ## @RTC_NOMINAL_TIMING
	.comm	_RTC_STATUS,4,2                 ## @RTC_STATUS
	.comm	_RTC_TIME,4,2                   ## @RTC_TIME
	.no_dead_strip	_mv_rtc_settime
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv_rtc_settime
_mv_rtc_settime:                        ; @mv_rtc_settime
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x21, x0
	bl	_device_get_softc
	mov	x19, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _HALF_OF_SEC_NS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HALF_OF_SEC_NS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_2
; %bb.1:
	ldr	w8, [x20, #8]
	add	w8, w8, #1
	str	w8, [x20, #8]
LBB0_2:
	str	xzr, [x20]
	mov	x0, x19
	bl	_MV_RTC_LOCK
Lloh3:
	adrp	x8, _RTC_CLOCK_CORR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RTC_CLOCK_CORR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mv_rtc_reg_read
Lloh6:
	adrp	x8, _RTC_NOMINAL_TIMING_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RTC_NOMINAL_TIMING_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh9:
	adrp	x9, _RTC_NOMINAL_TIMING@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RTC_NOMINAL_TIMING@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_mv_rtc_reset
LBB0_4:
Lloh12:
	adrp	x21, _RTC_STATUS@GOTPAGE
Lloh13:
	ldr	x21, [x21, _RTC_STATUS@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_mv_rtc_reg_write
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_mv_rtc_reg_write
Lloh14:
	adrp	x8, _RTC_TIME@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RTC_TIME@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	w2, [x20, #8]
	mov	x0, x19
	bl	_mv_rtc_reg_write
	mov	x0, x19
	bl	_MV_RTC_UNLOCK
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_HALF_OF_SEC_NS,8,3             ; @HALF_OF_SEC_NS
	.comm	_RTC_CLOCK_CORR,4,2             ; @RTC_CLOCK_CORR
	.comm	_RTC_NOMINAL_TIMING_MASK,4,2    ; @RTC_NOMINAL_TIMING_MASK
	.comm	_RTC_NOMINAL_TIMING,4,2         ; @RTC_NOMINAL_TIMING
	.comm	_RTC_STATUS,4,2                 ; @RTC_STATUS
	.comm	_RTC_TIME,4,2                   ; @RTC_TIME
	.no_dead_strip	_mv_rtc_settime
.subsections_via_symbols
