	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function eeprom_attach
_eeprom_attach:                         ## @eeprom_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, %ebx
	callq	_device_get_softc
	movq	%rax, %r15
	leaq	8(%rax), %r14
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	%ebx, %edi
	callq	_ofw_bus_get_model
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	$1968, (%r15)                   ## imm = 0x7B0
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edi
	callq	_OF_getproplen
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.5:
	movq	_sparc64_model@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%r12), %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_8
LBB0_7:
	movq	_MK48TXX_WDOG_REGISTER@GOTPCREL(%rip), %rax
	movq	_MK48TXX_WDOG_ENABLE_WDS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 4(%r15)
LBB0_8:
	movl	%ebx, %edi
	callq	_mk48txx_attach
	testl	%eax, %eax
	je	LBB0_12
## %bb.9:
	movl	%eax, %r12d
	leaq	L_.str.6(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_10:
	movl	(%r13), %esi
	movl	-44(%rbp), %edx
	movq	16(%r15), %rcx
	movl	%ebx, %edi
	callq	_bus_release_resource
LBB0_11:
	movq	%r14, %rdi
	callq	_mtx_destroy
LBB0_17:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.14:
	leaq	-64(%rbp), %rsi
	movl	%ebx, %edi
	callq	_mk48txx_gettime
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.7(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_17
LBB0_13:
	xorl	%r12d, %r12d
	jmp	LBB0_17
LBB0_16:
	movq	-56(%rbp), %rdx
	movl	-64(%rbp), %ecx
	leaq	L_.str.8(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"eeprom_mtx"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.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 determine model\n"

L_.str.3:                               ## @.str.3
	.asciz	"watchdog-enable"

	.comm	_sparc64_model,4,2              ## @sparc64_model
L_.str.4:                               ## @.str.4
	.asciz	"SUNW,Ultra-250"

L_.str.5:                               ## @.str.5
	.asciz	"SUNW,Ultra-4"

	.comm	_MK48TXX_WDOG_REGISTER,4,2      ## @MK48TXX_WDOG_REGISTER
	.comm	_MK48TXX_WDOG_ENABLE_WDS,4,2    ## @MK48TXX_WDOG_ENABLE_WDS
L_.str.6:                               ## @.str.6
	.asciz	"cannot attach time of day clock\n"

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

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

	.no_dead_strip	_eeprom_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function eeprom_attach
lCPI0_0:
	.long	1968                            ; 0x7b0
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_eeprom_attach:                         ; @eeprom_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	bl	_device_get_softc
	mov	x21, x0
	add	x20, x0, #8
Lloh0:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTX_DEF@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
	str	wzr, [sp, #28]
Lloh5:
	adrp	x23, _SYS_RES_MEMORY@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh7:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	add	x2, sp, #28
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x21, #16]
	cbz	x0, LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_ofw_bus_get_model
	str	x0, [x21, #24]
	cbz	x0, LBB0_9
; %bb.2:
Lloh10:
	adrp	x8, lCPI0_0@PAGE
Lloh11:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x21]
	mov	x0, x19
	bl	_ofw_bus_get_node
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_OF_getproplen
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.3:
Lloh14:
	adrp	x22, _sparc64_model@GOTPAGE
Lloh15:
	ldr	x22, [x22, _sparc64_model@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w0, [x22]
Lloh18:
	adrp	x1, l_.str.5@PAGE
Lloh19:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strcmp
	cbnz	x0, LBB0_6
LBB0_5:
Lloh20:
	adrp	x8, _MK48TXX_WDOG_REGISTER@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MK48TXX_WDOG_REGISTER@GOTPAGEOFF]
Lloh22:
	adrp	x9, _MK48TXX_WDOG_ENABLE_WDS@GOTPAGE
Lloh23:
	ldr	x9, [x9, _MK48TXX_WDOG_ENABLE_WDS@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x21, #4]
	orr	w8, w8, w9
	str	w8, [x21, #4]
LBB0_6:
	mov	x0, x19
	bl	_mk48txx_attach
	cbz	w0, LBB0_13
; %bb.7:
	mov	x22, x0
Lloh26:
	adrp	x1, l_.str.6@PAGE
Lloh27:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_10
LBB0_8:
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh30:
	adrp	x8, _ENXIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh32:
	ldr	w22, [x8]
	b	LBB0_11
LBB0_9:
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh35:
	adrp	x8, _ENXIO@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh37:
	ldr	w22, [x8]
LBB0_10:
	ldr	w1, [x23]
	ldr	w2, [sp, #28]
	ldr	x3, [x21, #16]
	mov	x0, x19
	bl	_bus_release_resource
LBB0_11:
	mov	x0, x20
	bl	_mtx_destroy
LBB0_12:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
Lloh38:
	adrp	x8, _bootverbose@GOTPAGE
Lloh39:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	cbz	x8, LBB0_16
; %bb.14:
	add	x1, sp, #32
	mov	x0, x19
	bl	_mk48txx_gettime
	cbz	x0, LBB0_17
; %bb.15:
Lloh41:
	adrp	x1, l_.str.7@PAGE
Lloh42:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_18
LBB0_16:
	mov	w22, #0
	b	LBB0_12
LBB0_17:
	ldr	x8, [sp, #40]
	ldr	w9, [sp, #32]
	stp	x8, x9, [sp]
Lloh43:
	adrp	x1, l_.str.8@PAGE
Lloh44:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_18:
	mov	x0, x19
	bl	_device_printf
	mov	w22, #0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"eeprom_mtx"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.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 determine model\n"

l_.str.3:                               ; @.str.3
	.asciz	"watchdog-enable"

	.comm	_sparc64_model,4,2              ; @sparc64_model
l_.str.4:                               ; @.str.4
	.asciz	"SUNW,Ultra-250"

l_.str.5:                               ; @.str.5
	.asciz	"SUNW,Ultra-4"

	.comm	_MK48TXX_WDOG_REGISTER,4,2      ; @MK48TXX_WDOG_REGISTER
	.comm	_MK48TXX_WDOG_ENABLE_WDS,4,2    ; @MK48TXX_WDOG_ENABLE_WDS
l_.str.6:                               ; @.str.6
	.asciz	"cannot attach time of day clock\n"

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

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

	.no_dead_strip	_eeprom_attach
.subsections_via_symbols
