	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opal_settime
_opal_settime:                          ## @opal_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	%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	%rsi, %rdi
	leaq	-80(%rbp), %rsi
	callq	_clock_ts_to_ct
	movl	-56(%rbp), %edi
	callq	_bin2bcd
	movq	%rax, %rbx
	movl	-60(%rbp), %edi
	callq	_bin2bcd
	shll	$8, %eax
	orl	%eax, %ebx
	movl	-80(%rbp), %edi
	callq	_bin2bcd32
	shll	$16, %eax
	orl	%eax, %ebx
	movslq	-76(%rbp), %rax
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_bin2bcd32
	movl	-64(%rbp), %edi
	callq	_bin2bcd
	movl	-68(%rbp), %edi
	callq	_bin2bcd
	movl	-72(%rbp), %edi
	callq	_bin2bcd
	callq	_htobe64
	movl	%eax, -44(%rbp)
	movl	%ebx, %edi
	callq	_htobe32
	movl	%eax, -48(%rbp)
	leaq	-48(%rbp), %r14
	leaq	-44(%rbp), %r12
	movq	_OPAL_BUSY_EVENT@GOTPCREL(%rip), %r15
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%eax, %ebx
	jne	LBB0_4
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_OPAL_RTC_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r14, %rdi
	callq	_vtophys
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_vtophys
	movl	%r13d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_opal_call
	movl	%eax, %ebx
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_OPAL_POLL_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_opal_call
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	$1, %esi
	callq	_pause
	movl	(%r15), %eax
	jmp	LBB0_3
LBB0_4:
	movq	_OPAL_SUCCESS@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	(%rcx), %ebx
	je	LBB0_6
## %bb.5:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPAL_RTC_WRITE,4,2             ## @OPAL_RTC_WRITE
	.comm	_OPAL_BUSY_EVENT,4,2            ## @OPAL_BUSY_EVENT
	.comm	_OPAL_POLL_EVENTS,4,2           ## @OPAL_POLL_EVENTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"opalrtc"

	.comm	_OPAL_SUCCESS,4,2               ## @OPAL_SUCCESS
	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_opal_settime
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opal_settime
_opal_settime:                          ; @opal_settime
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x0, x1
	add	x1, sp, #16
	bl	_clock_ts_to_ct
	ldr	w0, [sp, #40]
	bl	_bin2bcd
	mov	x19, x0
	ldr	w0, [sp, #36]
	bl	_bin2bcd
	orr	w19, w19, w0, lsl #8
	ldr	w0, [sp, #16]
	bl	_bin2bcd32
	orr	w19, w19, w0, lsl #16
	ldrsw	x8, [sp, #20]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	bl	_bin2bcd32
	ldr	w0, [sp, #32]
	bl	_bin2bcd
	ldr	w0, [sp, #28]
	bl	_bin2bcd
	ldr	w0, [sp, #24]
	bl	_bin2bcd
	bl	_htobe64
	str	w0, [sp, #8]
	mov	x0, x19
	bl	_htobe32
	str	w0, [sp, #12]
Lloh0:
	adrp	x22, _OPAL_RTC_WRITE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _OPAL_RTC_WRITE@GOTPAGEOFF]
Lloh2:
	adrp	x23, _OPAL_BUSY_EVENT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _OPAL_BUSY_EVENT@GOTPAGEOFF]
Lloh4:
	adrp	x24, _OPAL_POLL_EVENTS@GOTPAGE
Lloh5:
	ldr	x24, [x24, _OPAL_POLL_EVENTS@GOTPAGEOFF]
Lloh6:
	adrp	x19, l_.str@PAGE
Lloh7:
	add	x19, x19, l_.str@PAGEOFF
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x24]
	mov	w1, #0
	bl	_opal_call
	mov	x20, x0
	mov	x0, x19
	mov	w1, #1
	bl	_pause
	ldr	w8, [x23]
	cmp	w20, w8
	b.ne	LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x22]
	add	x0, sp, #12
	bl	_vtophys
	mov	x21, x0
	add	x0, sp, #8
	bl	_vtophys
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x20
	mov	x1, x21
	bl	_opal_call
	ldr	w8, [x23]
	cmp	w0, w8
	b.eq	LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x20, x0
	cmp	w20, w8
	b.eq	LBB0_2
LBB0_4:
Lloh8:
	adrp	x8, _OPAL_SUCCESS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OPAL_SUCCESS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _ENXIO@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ENXIO@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w20, w8
	csel	w0, wzr, w9, eq
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_OPAL_RTC_WRITE,4,2             ; @OPAL_RTC_WRITE
	.comm	_OPAL_BUSY_EVENT,4,2            ; @OPAL_BUSY_EVENT
	.comm	_OPAL_POLL_EVENTS,4,2           ; @OPAL_POLL_EVENTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"opalrtc"

	.comm	_OPAL_SUCCESS,4,2               ; @OPAL_SUCCESS
	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_opal_settime
.subsections_via_symbols
