	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opal_gettime
_opal_gettime:                          ## @opal_gettime
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	_OPAL_RTC_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	-48(%rbp), %rdi
	callq	_vtophys
	movl	%eax, %ebx
	leaq	-44(%rbp), %rdi
	callq	_vtophys
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_opal_call
	movq	_OPAL_BUSY_EVENT@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jne	LBB0_4
## %bb.1:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %r12
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_OPAL_POLL_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_opal_call
	leaq	L_.str(%rip), %rdi
	movl	$1, %esi
	callq	_pause
	movq	_OPAL_RTC_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_vtophys
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_vtophys
	movl	%ebx, %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_opal_call
	cmpl	(%r15), %eax
	je	LBB0_2
## %bb.3:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_4:
	movq	_OPAL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.6:
	movl	-44(%rbp), %edi
	callq	_be64toh
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %edi
	callq	_be32toh
	movl	%eax, -48(%rbp)
	movswl	-42(%rbp), %edi
	andl	$16777215, %edi                 ## imm = 0xFFFFFF
	callq	_bcd2bin32
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	movl	%eax, -104(%rbp)
	movslq	-44(%rbp), %rax
	shrq	$40, %rax
	movzbl	%al, %edi
	callq	_bcd2bin
	movq	%rax, -64(%rbp)
	movslq	-44(%rbp), %rax
	shrq	$48, %rax
	movzbl	%al, %edi
	callq	_bcd2bin
	movq	%rax, -72(%rbp)
	movslq	-44(%rbp), %rdi
	shrq	$56, %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_bcd2bin
	movq	%rax, -80(%rbp)
	movzbl	-48(%rbp), %edi
	callq	_bcd2bin
	movq	%rax, -88(%rbp)
	movzbl	-47(%rbp), %edi
	callq	_bcd2bin
	movq	%rax, -96(%rbp)
	movzwl	-46(%rbp), %edi
	callq	_bcd2bin32
	movl	%eax, -100(%rbp)
	leaq	-104(%rbp), %rdi
	movq	%r14, %rsi
	callq	_clock_ct_to_ts
	jmp	LBB0_7
LBB0_5:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPAL_RTC_READ,4,2              ## @OPAL_RTC_READ
	.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_gettime
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opal_gettime
_opal_gettime:                          ; @opal_gettime
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x1
Lloh0:
	adrp	x23, _OPAL_RTC_READ@GOTPAGE
Lloh1:
	ldr	x23, [x23, _OPAL_RTC_READ@GOTPAGEOFF]
	ldr	w20, [x23]
	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
Lloh2:
	adrp	x24, _OPAL_BUSY_EVENT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _OPAL_BUSY_EVENT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.1:
Lloh4:
	adrp	x25, _OPAL_POLL_EVENTS@GOTPAGE
Lloh5:
	ldr	x25, [x25, _OPAL_POLL_EVENTS@GOTPAGEOFF]
Lloh6:
	adrp	x20, l_.str@PAGE
Lloh7:
	add	x20, x20, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	mov	w1, #0
	bl	_opal_call
	mov	x0, x20
	mov	w1, #1
	bl	_pause
	ldr	w21, [x23]
	add	x0, sp, #12
	bl	_vtophys
	mov	x22, x0
	add	x0, sp, #8
	bl	_vtophys
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x21
	mov	x1, x22
	bl	_opal_call
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_2
LBB0_3:
Lloh8:
	adrp	x8, _OPAL_SUCCESS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OPAL_SUCCESS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
	ldr	w0, [sp, #8]
	bl	_be64toh
	str	w0, [sp, #8]
	ldr	w0, [sp, #12]
	bl	_be32toh
	str	w0, [sp, #12]
	ldrsh	w8, [sp, #10]
	and	w0, w8, #0xffffff
	bl	_bcd2bin32
	mov	w8, #1000
	mul	w8, w0, w8
	str	w8, [sp, #16]
	ldrsw	x8, [sp, #8]
	ubfx	x0, x8, #40, #8
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_bcd2bin
	str	x0, [sp, #56]
	ldrsw	x8, [sp, #8]
	ubfx	x0, x8, #48, #8
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_bcd2bin
	str	x0, [sp, #48]
	ldrsw	x8, [sp, #8]
	lsr	x0, x8, #56
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_bcd2bin
	str	x0, [sp, #40]
	ldrb	w0, [sp, #12]
	bl	_bcd2bin
	str	x0, [sp, #32]
	ldrb	w0, [sp, #13]
	bl	_bcd2bin
	str	x0, [sp, #24]
	ldrh	w0, [sp, #14]
	bl	_bcd2bin32
	str	w0, [sp, #20]
	add	x0, sp, #16
	mov	x1, x19
	bl	_clock_ct_to_ts
	b	LBB0_6
LBB0_5:
Lloh11:
	adrp	x8, _ENXIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_OPAL_RTC_READ,4,2              ; @OPAL_RTC_READ
	.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_gettime
.subsections_via_symbols
