	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbbc_pci_attach
_sbbc_pci_attach:                       ## @sbbc_pci_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
	movq	%rdi, %r13
	leaq	L_.str(%rip), %rdi
	callq	_OF_finddevice
	movl	%eax, -48(%rbp)
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	leaq	-48(%rbp), %rdx
	movl	%eax, %edi
	movl	$4, %ecx
	callq	_OF_getprop
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:
	movl	-48(%rbp), %ebx
	movq	%r13, %rdi
	callq	_ofw_bus_get_node
	xorl	%r14d, %r14d
	cmpl	%eax, %ebx
	jne	LBB0_26
## %bb.6:
	movq	%r13, %rdi
	callq	_device_get_softc
	movq	%rax, %r15
	movq	_SBBC_PCI_BAR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_bus_alloc_resource_any
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, %r12d
	movq	(%r15), %rdi
	callq	_rman_get_bushandle
	movq	_sbbc_console@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_19
## %bb.9:
	movq	%r13, %rdi
	callq	_pci_get_intpin
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_pci_set_intpin
LBB0_11:
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$-1, %edx
	callq	_device_add_child
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	leaq	L_.str.5(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_13:
	movq	%r13, %rdi
	callq	_bus_generic_attach
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.6(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_15
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_2
LBB0_7:
	leaq	L_.str.4(%rip), %rsi
LBB0_2:
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_26:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_sbbc_parse_toc
	testl	%eax, %eax
	je	LBB0_15
## %bb.20:
	movl	%eax, %r12d
	leaq	L_.str.7(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_device_printf
	cmpq	$0, (%rbx)
	je	LBB0_15
## %bb.21:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edx
	movq	(%r15), %rcx
	movq	%r13, %rdi
	callq	_bus_release_resource
	movl	%r12d, %r14d
	jmp	LBB0_26
LBB0_15:
	movq	_sbbc_toddata@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_26
## %bb.16:
	movq	_tod_magic@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SBBC_TOD_OFF
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_SBBC_SRAM_READ_4
	movq	_SBBC_TOD_MAGIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_17
## %bb.22:
	movq	(%r15), %rbx
	movq	_tod_version@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SBBC_TOD_OFF
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_SBBC_SRAM_READ_4
	movq	_SBBC_TOD_VERSION@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_24
## %bb.23:
	leaq	L_.str.9(%rip), %rsi
	jmp	LBB0_18
LBB0_17:
	leaq	L_.str.8(%rip), %rsi
LBB0_18:
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_26
LBB0_24:
	movq	%r13, %rdi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_clock_register
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_26
## %bb.25:
	leaq	-64(%rbp), %rsi
	movq	%r13, %rdi
	callq	_sbbc_tod_gettime
	movq	-56(%rbp), %rdx
	movl	-64(%rbp), %ecx
	leaq	L_.str.10(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/chosen"

L_.str.1:                               ## @.str.1
	.asciz	"failed to find /chosen\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.2:                               ## @.str.2
	.asciz	"iosram"

L_.str.3:                               ## @.str.3
	.asciz	"failed to get iosram\n"

	.comm	_SBBC_PCI_BAR,4,2               ## @SBBC_PCI_BAR
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.4:                               ## @.str.4
	.asciz	"failed to allocate resources\n"

	.comm	_sbbc_console,8,3               ## @sbbc_console
L_.str.5:                               ## @.str.5
	.asciz	"failed to add UART device\n"

L_.str.6:                               ## @.str.6
	.asciz	"failed to attach UART device\n"

L_.str.7:                               ## @.str.7
	.asciz	"failed to parse TOC\n"

	.comm	_sbbc_toddata,8,3               ## @sbbc_toddata
	.comm	_tod_magic,4,2                  ## @tod_magic
	.comm	_SBBC_TOD_MAGIC,4,2             ## @SBBC_TOD_MAGIC
L_.str.8:                               ## @.str.8
	.asciz	"invalid TOD magic %#x\n"

	.comm	_tod_version,4,2                ## @tod_version
	.comm	_SBBC_TOD_VERSION,4,2           ## @SBBC_TOD_VERSION
L_.str.9:                               ## @.str.9
	.asciz	"invalid TOD version %#x\n"

	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.10:                              ## @.str.10
	.asciz	"current time: %ld.%09ld\n"

	.no_dead_strip	_sbbc_pci_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbbc_pci_attach
_sbbc_pci_attach:                       ; @sbbc_pci_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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_OF_finddevice
	str	w0, [sp, #28]
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.1:
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #28
	mov	w3, #4
	bl	_OF_getprop
	cmn	w0, #1
	b.eq	LBB0_12
; %bb.2:
	ldr	w20, [sp, #28]
	mov	x0, x19
	bl	_ofw_bus_get_node
	cmp	w20, w0
	b.ne	LBB0_26
; %bb.3:
	mov	x0, x19
	bl	_device_get_softc
	mov	x20, x0
Lloh4:
	adrp	x8, _SBBC_PCI_BAR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SBBC_PCI_BAR@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [sp, #24]
Lloh7:
	adrp	x22, _SYS_RES_MEMORY@GOTPAGE
Lloh8:
	ldr	x22, [x22, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh9:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20]
	cbz	x0, LBB0_13
; %bb.4:
	bl	_rman_get_bustag
	mov	x21, x0
	ldr	x0, [x20]
	bl	_rman_get_bushandle
Lloh12:
	adrp	x23, _sbbc_console@GOTPAGE
Lloh13:
	ldr	x23, [x23, _sbbc_console@GOTPAGEOFF]
	ldr	x8, [x23]
	cbz	x8, LBB0_15
; %bb.5:
	mov	x0, x19
	bl	_pci_get_intpin
	cbnz	x0, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	w1, #1
	bl	_pci_set_intpin
LBB0_7:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #-1
	bl	_device_add_child
	cbnz	x0, LBB0_9
; %bb.8:
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_9:
	mov	x0, x19
	bl	_bus_generic_attach
	cbz	w0, LBB0_18
; %bb.10:
Lloh16:
	adrp	x1, l_.str.6@PAGE
Lloh17:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_18
LBB0_11:
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_12:
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_14:
	mov	x0, x19
	bl	_device_printf
Lloh24:
	adrp	x8, _ENXIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh26:
	ldr	w21, [x8]
	b	LBB0_27
LBB0_15:
	mov	x1, x0
	mov	x0, x21
	bl	_sbbc_parse_toc
	cbz	w0, LBB0_18
; %bb.16:
	mov	x21, x0
Lloh27:
	adrp	x1, l_.str.7@PAGE
Lloh28:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	ldr	x8, [x23]
	cbz	x8, LBB0_18
; %bb.17:
	ldr	w1, [x22]
	ldr	w2, [sp, #24]
	ldr	x3, [x20]
	mov	x0, x19
	bl	_bus_release_resource
	b	LBB0_27
LBB0_18:
Lloh29:
	adrp	x20, _sbbc_toddata@GOTPAGE
Lloh30:
	ldr	x20, [x20, _sbbc_toddata@GOTPAGEOFF]
	ldr	x21, [x20]
	cbz	x21, LBB0_27
; %bb.19:
Lloh31:
	adrp	x8, _tod_magic@GOTPAGE
Lloh32:
	ldr	x8, [x8, _tod_magic@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_SBBC_TOD_OFF
	add	x0, x0, x21
	bl	_SBBC_SRAM_READ_4
                                        ; kill: def $w0 killed $w0 def $x0
Lloh34:
	adrp	x8, _SBBC_TOD_MAGIC@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SBBC_TOD_MAGIC@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_22
; %bb.20:
	ldr	x20, [x20]
Lloh37:
	adrp	x8, _tod_version@GOTPAGE
Lloh38:
	ldr	x8, [x8, _tod_version@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	bl	_SBBC_TOD_OFF
	add	x0, x0, x20
	bl	_SBBC_SRAM_READ_4
                                        ; kill: def $w0 killed $w0 def $x0
Lloh40:
	adrp	x8, _SBBC_TOD_VERSION@GOTPAGE
Lloh41:
	ldr	x8, [x8, _SBBC_TOD_VERSION@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_23
; %bb.21:
	str	x0, [sp]
Lloh43:
	adrp	x1, l_.str.9@PAGE
Lloh44:
	add	x1, x1, l_.str.9@PAGEOFF
	b	LBB0_25
LBB0_22:
	str	x0, [sp]
Lloh45:
	adrp	x1, l_.str.8@PAGE
Lloh46:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_25
LBB0_23:
	mov	x0, x19
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_clock_register
Lloh47:
	adrp	x8, _bootverbose@GOTPAGE
Lloh48:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh49:
	ldr	x8, [x8]
	cbz	x8, LBB0_26
; %bb.24:
	add	x1, sp, #32
	mov	x0, x19
	bl	_sbbc_tod_gettime
	ldr	x8, [sp, #40]
	ldr	w9, [sp, #32]
	stp	x8, x9, [sp]
Lloh50:
	adrp	x1, l_.str.10@PAGE
Lloh51:
	add	x1, x1, l_.str.10@PAGEOFF
LBB0_25:
	mov	x0, x19
	bl	_device_printf
LBB0_26:
	mov	w21, #0
LBB0_27:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/chosen"

l_.str.1:                               ; @.str.1
	.asciz	"failed to find /chosen\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.2:                               ; @.str.2
	.asciz	"iosram"

l_.str.3:                               ; @.str.3
	.asciz	"failed to get iosram\n"

	.comm	_SBBC_PCI_BAR,4,2               ; @SBBC_PCI_BAR
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.4:                               ; @.str.4
	.asciz	"failed to allocate resources\n"

	.comm	_sbbc_console,8,3               ; @sbbc_console
l_.str.5:                               ; @.str.5
	.asciz	"failed to add UART device\n"

l_.str.6:                               ; @.str.6
	.asciz	"failed to attach UART device\n"

l_.str.7:                               ; @.str.7
	.asciz	"failed to parse TOC\n"

	.comm	_sbbc_toddata,8,3               ; @sbbc_toddata
	.comm	_tod_magic,4,2                  ; @tod_magic
	.comm	_SBBC_TOD_MAGIC,4,2             ; @SBBC_TOD_MAGIC
l_.str.8:                               ; @.str.8
	.asciz	"invalid TOD magic %#x\n"

	.comm	_tod_version,4,2                ; @tod_version
	.comm	_SBBC_TOD_VERSION,4,2           ; @SBBC_TOD_VERSION
l_.str.9:                               ; @.str.9
	.asciz	"invalid TOD version %#x\n"

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

	.no_dead_strip	_sbbc_pci_attach
.subsections_via_symbols
