	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_rtc_initialize
_aml8726_rtc_initialize:                ## @aml8726_rtc_initialize
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_AML_RTC_0_REG@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movl	%r14d, %esi
	callq	_CSR_READ_4
	movq	_AML_RTC_SCLK@GOTPCREL(%rip), %rcx
	movq	_AML_RTC_SEN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_AML_RTC_SDI@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_CSR_WRITE_4
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_CSR_BARRIER
	movl	$-39, %ebx
	movq	_AML_RTC_1_REG@GOTPCREL(%rip), %r12
	movq	_AML_RTC_SRDY@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$5, %edi
	callq	_DELAY
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_CSR_READ_4
	testl	%eax, (%r14)
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rbx), %eax
	testl	%ebx, %ebx
	movl	%eax, %ebx
	jne	LBB0_1
LBB0_3:
	movq	(%r13), %rax
	movq	_TRUE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_CSR_READ_4
	testl	%eax, (%r14)
	jne	LBB0_9
LBB0_5:
	movq	_AML_RTC_4_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	9(%r13), %edx
	movq	%r13, %rdi
	callq	_CSR_WRITE_4
	movl	(%r15), %r14d
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_CSR_READ_4
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	movl	8(%r13), %edx
	shll	$24, %edx
	orl	%eax, %edx
	movq	_AML_RTC_AS@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_AML_RTC_IRQ_DIS@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_CSR_WRITE_4
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_CSR_READ_4
	movq	_AML_RTC_ABSY@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	je	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_cpu_spinwait
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_CSR_READ_4
	testl	%eax, (%rbx)
	jne	LBB0_6
LBB0_8:
	movl	$2, %edi
	callq	_DELAY
	movq	_AML_RTC_GPO_SREG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%r13), %edx
	movq	%r13, %rdi
	callq	_aml8726_rtc_sreg_write
	testl	%eax, %eax
	jne	LBB0_10
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AML_RTC_0_REG,4,2              ## @AML_RTC_0_REG
	.comm	_AML_RTC_SCLK,4,2               ## @AML_RTC_SCLK
	.comm	_AML_RTC_SEN,4,2                ## @AML_RTC_SEN
	.comm	_AML_RTC_SDI,4,2                ## @AML_RTC_SDI
	.comm	_AML_RTC_1_REG,4,2              ## @AML_RTC_1_REG
	.comm	_AML_RTC_SRDY,4,2               ## @AML_RTC_SRDY
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_AML_RTC_4_REG,4,2              ## @AML_RTC_4_REG
	.comm	_AML_RTC_AS,4,2                 ## @AML_RTC_AS
	.comm	_AML_RTC_IRQ_DIS,4,2            ## @AML_RTC_IRQ_DIS
	.comm	_AML_RTC_ABSY,4,2               ## @AML_RTC_ABSY
	.comm	_AML_RTC_GPO_SREG,4,2           ## @AML_RTC_GPO_SREG
	.no_dead_strip	_aml8726_rtc_initialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aml8726_rtc_initialize
_aml8726_rtc_initialize:                ; @aml8726_rtc_initialize
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
Lloh0:
	adrp	x21, _AML_RTC_0_REG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AML_RTC_0_REG@GOTPAGEOFF]
	ldr	w20, [x21]
	mov	x1, x20
	bl	_CSR_READ_4
Lloh2:
	adrp	x8, _AML_RTC_SCLK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AML_RTC_SCLK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _AML_RTC_SEN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AML_RTC_SEN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _AML_RTC_SDI@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AML_RTC_SDI@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w2, w0, w8
	mov	x0, x19
	mov	x1, x20
	bl	_CSR_WRITE_4
	ldr	w1, [x21]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w23, #-39
Lloh11:
	adrp	x22, _AML_RTC_1_REG@GOTPAGE
Lloh12:
	ldr	x22, [x22, _AML_RTC_1_REG@GOTPAGEOFF]
Lloh13:
	adrp	x20, _AML_RTC_SRDY@GOTPAGE
Lloh14:
	ldr	x20, [x20, _AML_RTC_SRDY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #5
	bl	_DELAY
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_READ_4
	ldr	w8, [x20]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w23, #0, #4, eq
	add	w23, w23, #1
	b.ne	LBB0_1
; %bb.2:
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _TRUE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _TRUE@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.3:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_READ_4
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_8
LBB0_4:
Lloh18:
	adrp	x8, _AML_RTC_4_REG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AML_RTC_4_REG@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldrb	w2, [x19, #9]
	mov	x0, x19
	bl	_CSR_WRITE_4
	ldr	w20, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_CSR_READ_4
	ldr	w8, [x19, #8]
	bfi	w0, w8, #24, #8
Lloh21:
	adrp	x8, _AML_RTC_AS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AML_RTC_AS@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	orr	w8, w0, w8
Lloh24:
	adrp	x9, _AML_RTC_IRQ_DIS@GOTPAGE
Lloh25:
	ldr	x9, [x9, _AML_RTC_IRQ_DIS@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	mov	x1, x20
	bl	_CSR_WRITE_4
	ldr	w1, [x21]
	mov	x0, x19
	bl	_CSR_READ_4
Lloh27:
	adrp	x20, _AML_RTC_ABSY@GOTPAGE
Lloh28:
	ldr	x20, [x20, _AML_RTC_ABSY@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_cpu_spinwait
	ldr	w1, [x21]
	mov	x0, x19
	bl	_CSR_READ_4
	b	LBB0_5
LBB0_7:
	mov	w0, #2
	bl	_DELAY
Lloh29:
	adrp	x8, _AML_RTC_GPO_SREG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AML_RTC_GPO_SREG@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	ldr	w2, [x19, #12]
	mov	x0, x19
	bl	_aml8726_rtc_sreg_write
	cbnz	w0, LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_AML_RTC_0_REG,4,2              ; @AML_RTC_0_REG
	.comm	_AML_RTC_SCLK,4,2               ; @AML_RTC_SCLK
	.comm	_AML_RTC_SEN,4,2                ; @AML_RTC_SEN
	.comm	_AML_RTC_SDI,4,2                ; @AML_RTC_SDI
	.comm	_AML_RTC_1_REG,4,2              ; @AML_RTC_1_REG
	.comm	_AML_RTC_SRDY,4,2               ; @AML_RTC_SRDY
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_AML_RTC_4_REG,4,2              ; @AML_RTC_4_REG
	.comm	_AML_RTC_AS,4,2                 ; @AML_RTC_AS
	.comm	_AML_RTC_IRQ_DIS,4,2            ; @AML_RTC_IRQ_DIS
	.comm	_AML_RTC_ABSY,4,2               ; @AML_RTC_ABSY
	.comm	_AML_RTC_GPO_SREG,4,2           ; @AML_RTC_GPO_SREG
	.no_dead_strip	_aml8726_rtc_initialize
.subsections_via_symbols
