	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtc_attach
_rtc_attach:                            ## @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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	_MTX_SPIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	movl	%r14d, %edi
	callq	_device_get_parent
	movl	%eax, %edi
	callq	_device_get_name
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_strcmp
	movq	%rax, %r15
	movl	$0, -44(%rbp)
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 40(%rbx)
	movq	%r12, %rdi
	callq	_rman_get_bushandle
	movl	%eax, 36(%rbx)
	movq	_RTC_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_RTC_WRITE@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rbx)
	movq	$0, 16(%rbx)
	movq	_MC146818_NO_CENT_ADJUST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	testq	%r15, %r15
	jne	LBB0_8
## %bb.7:
	movq	_MC_REGA@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_PC87317_APC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	_RTC_WRITE
	movq	_PC87317_APC_CADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PC87317_APC_CADDR_BANK1@GOTPCREL(%rip), %rax
	movq	_PC87317_RTC_CR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	%r14d, %edi
	callq	_RTC_WRITE
	movl	(%r13), %esi
	movq	_PC87317_COMMON@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	_RTC_WRITE
	movq	_pc87317_getcent@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_pc87317_setcent@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
LBB0_8:
	movl	%r14d, %edi
	callq	_mc146818_attach
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	movl	%eax, %r13d
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	testq	%r15, %r15
	jne	LBB0_10
## %bb.11:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_4:
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_5
LBB0_13:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.15:
	leaq	-64(%rbp), %rsi
	movl	%r14d, %edi
	callq	_mc146818_gettime
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	leaq	L_.str.4(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_18
LBB0_10:
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %esi
	movl	-44(%rbp), %edx
	movl	%r14d, %edi
	movq	%r12, %rcx
	callq	_bus_release_resource
LBB0_5:
	movq	%rbx, %rdi
	callq	_mtx_destroy
LBB0_18:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	xorl	%r13d, %r13d
	jmp	LBB0_18
LBB0_17:
	movq	-56(%rbp), %rdx
	movl	-64(%rbp), %ecx
	leaq	L_.str.5(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rtc_mtx"

	.comm	_MTX_SPIN,4,2                   ## @MTX_SPIN
L_.str.1:                               ## @.str.1
	.asciz	"ebus"

	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_SYS_RES_IOPORT,4,2             ## @SYS_RES_IOPORT
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.2:                               ## @.str.2
	.asciz	"cannot allocate resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_RTC_READ,4,2                   ## @RTC_READ
	.comm	_MC146818_NO_CENT_ADJUST,4,2    ## @MC146818_NO_CENT_ADJUST
	.comm	_MC_REGA,4,2                    ## @MC_REGA
	.comm	_PC87317_APC,4,2                ## @PC87317_APC
	.comm	_PC87317_APC_CADDR,4,2          ## @PC87317_APC_CADDR
	.comm	_PC87317_APC_CADDR_BANK1,4,2    ## @PC87317_APC_CADDR_BANK1
	.comm	_PC87317_RTC_CR,4,2             ## @PC87317_RTC_CR
	.comm	_PC87317_COMMON,4,2             ## @PC87317_COMMON
	.comm	_pc87317_getcent,4,2            ## @pc87317_getcent
	.comm	_pc87317_setcent,4,2            ## @pc87317_setcent
L_.str.3:                               ## @.str.3
	.asciz	"cannot attach time of day clock\n"

	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.4:                               ## @.str.4
	.asciz	"invalid time"

L_.str.5:                               ## @.str.5
	.asciz	"current time: %ld.%09ld\n"

	.no_dead_strip	_rtc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtc_attach
_rtc_attach:                            ; @rtc_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x0
	bl	_device_get_softc
	mov	x20, x0
Lloh0:
	adrp	x8, _MTX_SPIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTX_SPIN@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	mov	x0, x19
	bl	_device_get_parent
	bl	_device_get_name
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcmp
	mov	x21, x0
	str	wzr, [sp, #28]
Lloh7:
	adrp	x24, _SYS_RES_MEMORY@GOTPAGE
Lloh8:
	ldr	x24, [x24, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh9:
	adrp	x25, _SYS_RES_IOPORT@GOTPAGE
Lloh10:
	ldr	x25, [x25, _SYS_RES_IOPORT@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x24, x25, eq
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	add	x2, sp, #28
	mov	x0, x19
	bl	_bus_alloc_resource_any
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	bl	_rman_get_bustag
	str	w0, [x20, #40]
	mov	x0, x22
	bl	_rman_get_bushandle
Lloh14:
	adrp	x8, _RTC_READ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RTC_READ@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	stp	w8, w0, [x20, #32]
Lloh17:
	adrp	x8, _RTC_WRITE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RTC_WRITE@GOTPAGEOFF]
	stp	xzr, x8, [x20, #16]
Lloh19:
	adrp	x8, _MC146818_NO_CENT_ADJUST@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MC146818_NO_CENT_ADJUST@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x20, #12]
	cbnz	x21, LBB0_3
; %bb.2:
Lloh22:
	adrp	x23, _MC_REGA@GOTPAGE
Lloh23:
	ldr	x23, [x23, _MC_REGA@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh24:
	adrp	x8, _PC87317_APC@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PC87317_APC@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_RTC_WRITE
Lloh27:
	adrp	x8, _PC87317_APC_CADDR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PC87317_APC_CADDR@GOTPAGEOFF]
Lloh29:
	adrp	x9, _PC87317_APC_CADDR_BANK1@GOTPAGE
Lloh30:
	ldr	x9, [x9, _PC87317_APC_CADDR_BANK1@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	ldr	w8, [x9]
Lloh33:
	adrp	x9, _PC87317_RTC_CR@GOTPAGE
Lloh34:
	ldr	x9, [x9, _PC87317_RTC_CR@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_RTC_WRITE
	ldr	w1, [x23]
Lloh36:
	adrp	x8, _PC87317_COMMON@GOTPAGE
Lloh37:
	ldr	x8, [x8, _PC87317_COMMON@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_RTC_WRITE
Lloh39:
	adrp	x8, _pc87317_getcent@GOTPAGE
Lloh40:
	ldr	x8, [x8, _pc87317_getcent@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
Lloh42:
	adrp	x9, _pc87317_setcent@GOTPAGE
Lloh43:
	ldr	x9, [x9, _pc87317_setcent@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #4]
LBB0_3:
	mov	x0, x19
	bl	_mc146818_attach
	cbz	w0, LBB0_8
; %bb.4:
	mov	x23, x0
Lloh45:
	adrp	x1, l_.str.3@PAGE
Lloh46:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	cmp	x21, #0
	csel	x8, x24, x25, eq
	ldr	w1, [x8]
	ldr	w2, [sp, #28]
	mov	x0, x19
	mov	x3, x22
	bl	_bus_release_resource
	b	LBB0_6
LBB0_5:
Lloh47:
	adrp	x1, l_.str.2@PAGE
Lloh48:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh49:
	adrp	x8, _ENXIO@GOTPAGE
Lloh50:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh51:
	ldr	w23, [x8]
LBB0_6:
	mov	x0, x20
	bl	_mtx_destroy
LBB0_7:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_8:
Lloh52:
	adrp	x8, _bootverbose@GOTPAGE
Lloh53:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh54:
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.9:
	add	x1, sp, #32
	mov	x0, x19
	bl	_mc146818_gettime
	cbz	x0, LBB0_12
; %bb.10:
Lloh55:
	adrp	x1, l_.str.4@PAGE
Lloh56:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_13
LBB0_11:
	mov	w23, #0
	b	LBB0_7
LBB0_12:
	ldr	x8, [sp, #40]
	ldr	w9, [sp, #32]
	stp	x8, x9, [sp]
Lloh57:
	adrp	x1, l_.str.5@PAGE
Lloh58:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_device_printf
	mov	w23, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rtc_mtx"

	.comm	_MTX_SPIN,4,2                   ; @MTX_SPIN
l_.str.1:                               ; @.str.1
	.asciz	"ebus"

	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.2:                               ; @.str.2
	.asciz	"cannot allocate resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_RTC_READ,4,2                   ; @RTC_READ
	.comm	_MC146818_NO_CENT_ADJUST,4,2    ; @MC146818_NO_CENT_ADJUST
	.comm	_MC_REGA,4,2                    ; @MC_REGA
	.comm	_PC87317_APC,4,2                ; @PC87317_APC
	.comm	_PC87317_APC_CADDR,4,2          ; @PC87317_APC_CADDR
	.comm	_PC87317_APC_CADDR_BANK1,4,2    ; @PC87317_APC_CADDR_BANK1
	.comm	_PC87317_RTC_CR,4,2             ; @PC87317_RTC_CR
	.comm	_PC87317_COMMON,4,2             ; @PC87317_COMMON
	.comm	_pc87317_getcent,4,2            ; @pc87317_getcent
	.comm	_pc87317_setcent,4,2            ; @pc87317_setcent
l_.str.3:                               ; @.str.3
	.asciz	"cannot attach time of day clock\n"

	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.4:                               ; @.str.4
	.asciz	"invalid time"

l_.str.5:                               ; @.str.5
	.asciz	"current time: %ld.%09ld\n"

	.no_dead_strip	_rtc_attach
.subsections_via_symbols
