	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_rtc_attach
_aw_rtc_attach:                         ## @aw_rtc_attach
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	$0, -36(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-36(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_compat_data@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_ofw_bus_search_compatible
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	_LOSC_CTRL_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_RTC_READ
	movq	_LOSC_AUTO_SW_EN@GOTPCREL(%rip), %rcx
	movq	_LOSC_MAGIC@GOTPCREL(%rip), %rdx
	movq	_LOSC_GSM@GOTPCREL(%rip), %rsi
	orl	(%rcx), %eax
	orl	(%rdx), %eax
	orl	(%rsi), %eax
	movq	_LOSC_OSC_SRC@GOTPCREL(%rip), %r15
	orl	(%r15), %eax
	movl	(%r12), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_RTC_WRITE
	movl	$100, %edi
	callq	_DELAY
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_RTC_READ
	andl	(%r15), %eax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	%r14d, %edi
	callq	_device_printf
LBB0_4:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_aw_rtc_install_clocks
	movq	_RTC_RES_US@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_clock_register
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_compat_data,4,2                ## @compat_data
	.comm	_LOSC_CTRL_REG,4,2              ## @LOSC_CTRL_REG
	.comm	_LOSC_AUTO_SW_EN,4,2            ## @LOSC_AUTO_SW_EN
	.comm	_LOSC_MAGIC,4,2                 ## @LOSC_MAGIC
	.comm	_LOSC_GSM,4,2                   ## @LOSC_GSM
	.comm	_LOSC_OSC_SRC,4,2               ## @LOSC_OSC_SRC
	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.1:                               ## @.str.1
	.asciz	"Using internal oscillator\n"

L_.str.2:                               ## @.str.2
	.asciz	"Using external oscillator\n"

	.comm	_RTC_RES_US,4,2                 ## @RTC_RES_US
	.no_dead_strip	_aw_rtc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aw_rtc_attach
_aw_rtc_attach:                         ; @aw_rtc_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	w0, [x20, #8]
	cbz	w0, LBB0_4
; %bb.1:
Lloh6:
	adrp	x8, _compat_data@GOTPAGE
Lloh7:
	ldr	x8, [x8, _compat_data@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ofw_bus_search_compatible
	ldr	x8, [x0]
	str	x8, [x20]
Lloh9:
	adrp	x22, _LOSC_CTRL_REG@GOTPAGE
Lloh10:
	ldr	x22, [x22, _LOSC_CTRL_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_RTC_READ
Lloh11:
	adrp	x8, _LOSC_AUTO_SW_EN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LOSC_AUTO_SW_EN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _LOSC_MAGIC@GOTPAGE
Lloh15:
	ldr	x9, [x9, _LOSC_MAGIC@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _LOSC_GSM@GOTPAGE
Lloh18:
	ldr	x10, [x10, _LOSC_GSM@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
Lloh20:
	adrp	x21, _LOSC_OSC_SRC@GOTPAGE
Lloh21:
	ldr	x21, [x21, _LOSC_OSC_SRC@GOTPAGEOFF]
	ldr	w11, [x21]
	orr	w8, w8, w0
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w2, w8, w11
	ldr	w1, [x22]
	mov	x0, x20
	bl	_RTC_WRITE
	mov	w0, #100
	bl	_DELAY
Lloh22:
	adrp	x8, _bootverbose@GOTPAGE
Lloh23:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x20]
	ldr	w1, [x8]
	mov	x0, x20
	bl	_RTC_READ
	ldr	w8, [x21]
Lloh25:
	adrp	x9, l_.str.2@PAGE
Lloh26:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh27:
	adrp	x10, l_.str.1@PAGE
Lloh28:
	add	x10, x10, l_.str.1@PAGEOFF
	tst	w8, w0
	csel	x1, x10, x9, eq
	mov	x0, x19
	bl	_device_printf
LBB0_3:
	mov	x0, x20
	mov	x1, x19
	bl	_aw_rtc_install_clocks
Lloh29:
	adrp	x8, _RTC_RES_US@GOTPAGE
Lloh30:
	ldr	x8, [x8, _RTC_RES_US@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_clock_register
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh34:
	adrp	x8, _ENXIO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_compat_data,4,2                ; @compat_data
	.comm	_LOSC_CTRL_REG,4,2              ; @LOSC_CTRL_REG
	.comm	_LOSC_AUTO_SW_EN,4,2            ; @LOSC_AUTO_SW_EN
	.comm	_LOSC_MAGIC,4,2                 ; @LOSC_MAGIC
	.comm	_LOSC_GSM,4,2                   ; @LOSC_GSM
	.comm	_LOSC_OSC_SRC,4,2               ; @LOSC_OSC_SRC
	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.1:                               ; @.str.1
	.asciz	"Using internal oscillator\n"

l_.str.2:                               ; @.str.2
	.asciz	"Using external oscillator\n"

	.comm	_RTC_RES_US,4,2                 ; @RTC_RES_US
	.no_dead_strip	_aw_rtc_attach
.subsections_via_symbols
