	.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	%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
	movq	%rax, %rdi
	movl	$32, %esi
	callq	_bzero
	movq	_MTX_SPIN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	16(%rbx), %rdx
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 24(%rbx)
	movq	8(%rbx), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 20(%rbx)
	movl	%r14d, %edi
	callq	_ds1553_attach
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movl	(%r12), %esi
	movl	16(%rbx), %edx
	movq	8(%rbx), %rcx
	movl	%r14d, %edi
	callq	_bus_release_resource
	movq	%rbx, %rdi
	callq	_mtx_destroy
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	%rbx, %rdi
	callq	_mtx_destroy
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_7
LBB0_4:
	movl	%r14d, %edi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_clock_register
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.6:
	leaq	-48(%rbp), %rsi
	movl	%r14d, %edi
	callq	_ds1553_gettime
	movq	-40(%rbp), %rdx
	movl	-48(%rbp), %ecx
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_7
LBB0_5:
	xorl	%r15d, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rtc_mtx"

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

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.2:                               ## @.str.2
	.asciz	"cannot attach time of day clock\n"

	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.3:                               ## @.str.3
	.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, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	w1, #32
	bl	_bzero
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	x0, x20
	mov	x2, #0
	bl	_mtx_init
Lloh5:
	adrp	x22, _SYS_RES_MEMORY@GOTPAGE
Lloh6:
	ldr	x22, [x22, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, x20, #16
Lloh7:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #8]
	cbz	x0, LBB0_3
; %bb.1:
	bl	_rman_get_bustag
	str	w0, [x20, #24]
	ldr	x0, [x20, #8]
	bl	_rman_get_bushandle
	str	w0, [x20, #20]
	mov	x0, x19
	bl	_ds1553_attach
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	ldr	w1, [x22]
	ldr	w2, [x20, #16]
	ldr	x3, [x20, #8]
	mov	x0, x19
	bl	_bus_release_resource
	mov	x0, x20
	bl	_mtx_destroy
	b	LBB0_7
LBB0_3:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	mov	x0, x20
	bl	_mtx_destroy
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_clock_register
Lloh17:
	adrp	x8, _bootverbose@GOTPAGE
Lloh18:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
	add	x1, sp, #16
	mov	x0, x19
	bl	_ds1553_gettime
	ldr	x8, [sp, #24]
	ldr	w9, [sp, #16]
	stp	x8, x9, [sp]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_6:
	mov	w21, #0
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rtc_mtx"

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

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.2:                               ; @.str.2
	.asciz	"cannot attach time of day clock\n"

	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.3:                               ; @.str.3
	.asciz	"current time: %ld.%09ld\n"

	.no_dead_strip	_rtc_attach
.subsections_via_symbols
