	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function clkbrd_attach
_clkbrd_attach:                         ## @clkbrd_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	$40, %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
	movl	%r14d, 40(%rax)
	movq	_CLKBRD_CF@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	movq	_CLKBRD_CLKVER@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jle	LBB0_1
LBB0_9:
	movq	16(%rbx), %rax
	movq	24(%rbx), %rcx
	movq	_CLKBRD_CLK@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	movl	(%rcx,%rdx,4), %edi
	movl	(%rax,%rdx,4), %esi
	movq	_CLK_STS1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_space_read_1
	movq	_CLK_STS1_SLOTS_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmpl	$128, %eax
	je	LBB0_13
## %bb.10:
	movl	$4, %r14d
	cmpl	$129, %eax
	je	LBB0_14
## %bb.11:
	cmpl	$130, %eax
	jne	LBB0_17
## %bb.12:
	movl	$16, %r14d
	jmp	LBB0_17
LBB0_1:
	movq	%rdx, %rcx
	movl	%ecx, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%ecx, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	-1(%rdx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,4), %r12
	shlq	$3, %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r12, %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_CLKBRD_CLKVER@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_4
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %eax
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	cltq
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addq	%r14, %rcx
	incq	%rcx
	incq	%r14
	addq	$4, %r13
	cmpq	%rax, %rcx
	jge	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	leaq	(%rax,%r13), %rdx
	addq	%r12, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r14), %r15
	movl	%r15d, (%rax,%r14,4)
	movl	40(%rbx), %edi
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_bus_alloc_resource_any
	movq	48(%rbx), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	addq	%rdx, %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	48(%rbx), %rax
	addq	%rdx, %rax
	movq	(%rax,%r14,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_rman_get_bustag
	movq	24(%rbx), %rcx
	addq	%r12, %rcx
	movl	%eax, (%rcx,%r14,4)
	movq	48(%rbx), %rax
	addq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	movq	(%rax,%r14,8), %rdi
	callq	_rman_get_bushandle
	movq	16(%rbx), %rcx
	addq	%r12, %rcx
	movl	%eax, (%rcx,%r14,4)
	movq	_CLKBRD_CLKVER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r15d
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_CLKBRD_HAS_CLKVER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%rbx)
	jmp	LBB0_7
LBB0_13:
	movl	$8, %r14d
	jmp	LBB0_17
LBB0_14:
	movq	_CLKBRD_HAS_CLKVER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_17
## %bb.15:
	movq	16(%rbx), %rax
	movq	24(%rbx), %rcx
	movq	_CLKBRD_CLKVER@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	movl	(%rcx,%rdx,4), %edi
	movl	(%rax,%rdx,4), %esi
	movq	_CLKVER_SLOTS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_space_read_1
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movq	_CLKVER_SLOTS_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_CLKVER_SLOTS_PLUS@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpl	(%rcx), %eax
	sete	%r14b
	orl	$4, %r14d
LBB0_17:
	movl	40(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	callq	_device_printf
	movq	16(%rbx), %rax
	movq	24(%rbx), %rcx
	movq	(%r15), %rdx
	movl	(%rcx,%rdx,4), %edi
	movl	(%rax,%rdx,4), %esi
	movq	_CLK_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_space_read_1
	movq	%rax, 32(%rbx)
	movq	_clkbrd_led_func@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rsi
	callq	_led_create
	movl	%eax, 12(%rbx)
	xorl	%eax, %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	addl	%r14d, %edx
	movl	40(%rbx), %edi
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_device_printf
	movq	%rbx, %rdi
	callq	_clkbrd_free_resources
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_CLKBRD_CF,4,2                  ## @CLKBRD_CF
	.comm	_CLKBRD_CLKVER,4,2              ## @CLKBRD_CLKVER
	.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 resource %d\n"

	.comm	_CLKBRD_HAS_CLKVER,4,2          ## @CLKBRD_HAS_CLKVER
	.comm	_CLKBRD_CLK,8,3                 ## @CLKBRD_CLK
	.comm	_CLK_STS1,4,2                   ## @CLK_STS1
	.comm	_CLK_STS1_SLOTS_MASK,4,2        ## @CLK_STS1_SLOTS_MASK
	.comm	_CLKVER_SLOTS,4,2               ## @CLKVER_SLOTS
	.comm	_CLKVER_SLOTS_MASK,4,2          ## @CLKVER_SLOTS_MASK
	.comm	_CLKVER_SLOTS_PLUS,4,2          ## @CLKVER_SLOTS_PLUS
L_.str.1:                               ## @.str.1
	.asciz	"Sun Enterprise Exx00 machine: %d slots\n"

	.comm	_CLK_CTRL,4,2                   ## @CLK_CTRL
	.comm	_clkbrd_led_func,4,2            ## @clkbrd_led_func
L_.str.2:                               ## @.str.2
	.asciz	"clockboard"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_clkbrd_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function clkbrd_attach
_clkbrd_attach:                         ; @clkbrd_attach
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x8, _CLKBRD_CF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLKBRD_CF@GOTPAGEOFF]
	str	w20, [x0, #40]
Lloh2:
	ldrsw	x8, [x8]
Lloh3:
	adrp	x9, _CLKBRD_CLKVER@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CLKBRD_CLKVER@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_4
LBB0_1:
Lloh6:
	adrp	x21, _CLKBRD_CLK@GOTPAGE
Lloh7:
	ldr	x21, [x21, _CLKBRD_CLK@GOTPAGEOFF]
	ldr	x8, [x21]
	lsl	x8, x8, #2
	ldp	x10, x9, [x19, #16]
	ldr	w0, [x9, x8]
	ldr	w1, [x10, x8]
Lloh8:
	adrp	x8, _CLK_STS1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CLK_STS1@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_bus_space_read_1
Lloh11:
	adrp	x8, _CLK_STS1_SLOTS_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CLK_STS1_SLOTS_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	and	w8, w8, w0
	cmp	w8, #128
	b.eq	LBB0_11
; %bb.2:
	cmp	w8, #129
	b.eq	LBB0_12
; %bb.3:
	mov	w9, #4
	mov	w10, #16
	cmp	w8, #130
	csel	w2, w9, w10, ne
	b	LBB0_17
LBB0_4:
	mov	x21, #0
	and	x22, x8, #0xffffffff
	sub	x23, x8, #1
	lsl	x28, x8, #2
	lsl	x26, x8, #3
Lloh14:
	adrp	x27, _RF_ACTIVE@GOTPAGE
Lloh15:
	ldr	x27, [x27, _RF_ACTIVE@GOTPAGEOFF]
	mov	x24, x28
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
Lloh16:
	adrp	x8, _CLKBRD_CLKVER@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CLKBRD_CLKVER@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_15
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x8, x20
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #1
	add	x9, x23, x21
	add	x24, x24, #4
	cmp	x9, w8, sxtw
	b.ge	LBB0_1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	add	x2, x8, x24
	add	x8, x8, x28
	add	x20, x22, x21
	str	w20, [x8, x21, lsl #2]
	ldr	w0, [x19, #40]
Lloh19:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldr	w3, [x27]
	bl	_bus_alloc_resource_any
	ldr	x8, [x19, #48]
	add	x8, x8, x26
	lsl	x9, x21, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #48]
	add	x8, x8, x26
	ldr	x0, [x8, x9]
	cbz	x0, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_rman_get_bustag
	ldr	x8, [x19, #24]
	add	x8, x8, x28
	lsl	x25, x21, #2
	str	w0, [x8, x25]
	ldr	x8, [x19, #48]
	add	x8, x8, x26
	ldr	x0, [x8, x21, lsl #3]
	bl	_rman_get_bushandle
	ldr	x8, [x19, #16]
	add	x8, x8, x28
	str	w0, [x8, x25]
Lloh22:
	adrp	x8, _CLKBRD_CLKVER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CLKBRD_CLKVER@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
Lloh25:
	adrp	x8, _CLKBRD_HAS_CLKVER@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CLKBRD_HAS_CLKVER@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	b	LBB0_6
LBB0_11:
	mov	w2, #8
	b	LBB0_17
LBB0_12:
	ldr	w8, [x19, #8]
Lloh28:
	adrp	x9, _CLKBRD_HAS_CLKVER@GOTPAGE
Lloh29:
	ldr	x9, [x9, _CLKBRD_HAS_CLKVER@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.13:
Lloh31:
	adrp	x8, _CLKBRD_CLKVER@GOTPAGE
Lloh32:
	ldr	x8, [x8, _CLKBRD_CLKVER@GOTPAGEOFF]
Lloh33:
	ldrsw	x8, [x8]
	lsl	x8, x8, #2
	ldp	x10, x9, [x19, #16]
	ldr	w0, [x9, x8]
	ldr	w1, [x10, x8]
Lloh34:
	adrp	x8, _CLKVER_SLOTS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CLKVER_SLOTS@GOTPAGEOFF]
Lloh36:
	ldr	w2, [x8]
	bl	_bus_space_read_1
	mov	w2, #4
	cbz	w0, LBB0_17
; %bb.14:
Lloh37:
	adrp	x8, _CLKVER_SLOTS_MASK@GOTPAGE
Lloh38:
	ldr	x8, [x8, _CLKVER_SLOTS_MASK@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh40:
	adrp	x9, _CLKVER_SLOTS_PLUS@GOTPAGE
Lloh41:
	ldr	x9, [x9, _CLKVER_SLOTS_PLUS@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	cmp	w8, w9
	cinc	w2, w2, eq
	b	LBB0_17
LBB0_15:
	add	w2, w22, w21
	ldr	w0, [x19, #40]
Lloh43:
	adrp	x1, l_.str@PAGE
Lloh44:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
	mov	x0, x19
	bl	_clkbrd_free_resources
Lloh45:
	adrp	x8, _ENXIO@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	b	LBB0_18
LBB0_16:
	mov	w2, #4
LBB0_17:
	ldr	w0, [x19, #40]
Lloh48:
	adrp	x1, l_.str.1@PAGE
Lloh49:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_device_printf
	ldr	x8, [x21]
	lsl	x8, x8, #2
	ldp	x10, x9, [x19, #16]
	ldr	w0, [x9, x8]
	ldr	w1, [x10, x8]
Lloh50:
	adrp	x8, _CLK_CTRL@GOTPAGE
Lloh51:
	ldr	x8, [x8, _CLK_CTRL@GOTPAGEOFF]
Lloh52:
	ldr	w2, [x8]
	bl	_bus_space_read_1
	str	x0, [x19, #32]
Lloh53:
	adrp	x8, _clkbrd_led_func@GOTPAGE
Lloh54:
	ldr	x8, [x8, _clkbrd_led_func@GOTPAGEOFF]
Lloh55:
	ldr	w0, [x8]
Lloh56:
	adrp	x2, l_.str.2@PAGE
Lloh57:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_led_create
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #12]
LBB0_18:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_CLKBRD_CF,4,2                  ; @CLKBRD_CF
	.comm	_CLKBRD_CLKVER,4,2              ; @CLKBRD_CLKVER
	.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 resource %d\n"

	.comm	_CLKBRD_HAS_CLKVER,4,2          ; @CLKBRD_HAS_CLKVER
	.comm	_CLKBRD_CLK,8,3                 ; @CLKBRD_CLK
	.comm	_CLK_STS1,4,2                   ; @CLK_STS1
	.comm	_CLK_STS1_SLOTS_MASK,4,2        ; @CLK_STS1_SLOTS_MASK
	.comm	_CLKVER_SLOTS,4,2               ; @CLKVER_SLOTS
	.comm	_CLKVER_SLOTS_MASK,4,2          ; @CLKVER_SLOTS_MASK
	.comm	_CLKVER_SLOTS_PLUS,4,2          ; @CLKVER_SLOTS_PLUS
l_.str.1:                               ; @.str.1
	.asciz	"Sun Enterprise Exx00 machine: %d slots\n"

	.comm	_CLK_CTRL,4,2                   ; @CLK_CTRL
	.comm	_clkbrd_led_func,4,2            ; @clkbrd_led_func
l_.str.2:                               ; @.str.2
	.asciz	"clockboard"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_clkbrd_attach
.subsections_via_symbols
