	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ofw_pcibus_enum_devtree
_ofw_pcibus_enum_devtree:               ## @ofw_pcibus_enum_devtree
	.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	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, %r14d
	movl	%edi, %ebx
	callq	_device_get_parent
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_ofw_bus_get_node
	movq	%rax, %rdi
	callq	_OF_child
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %r13
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	jmp	LBB0_2
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_pci_freecfg
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_OF_peer
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r13, %rsi
	leaq	-56(%rbp), %rdx
	movl	$4, %ecx
	callq	_OF_getencprop
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-56(%rbp), %edi
	callq	_OFW_PCI_PHYS_HI_DEVICE
	movl	%eax, %r15d
	movl	-56(%rbp), %edi
	callq	_OFW_PCI_PHYS_HI_FUNCTION
	movl	%eax, %r12d
	movl	%r14d, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_pci_find_dbsf
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_PCI_INVALID_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_OF_getproplen
	testq	%rax, %rax
	movl	$0, %eax
	cmovgl	%eax, %r14d
	movq	_PCIR_INTLINE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$1, (%rsp)
	movl	-64(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	%r14d, %r9d
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	callq	_PCIB_WRITE_CONFIG
	movl	%r13d, %edi
	leaq	L_.str(%rip), %r13
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%r15d, %r8d
	movl	%r12d, %r9d
	callq	_pci_read_device
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r15
	movq	%rax, %rdi
	addq	$24, %rdi
	movq	%rbx, %rsi
	callq	_ofw_bus_gen_setup_devinfo
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, 16(%r15)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r15, %rsi
	callq	_pci_add_child
	cmpq	$0, 8(%r15)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%rbx, %rsi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	callq	_ofw_bus_intr_to_rl
	jmp	LBB0_9
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

	.comm	_PCI_INVALID_IRQ,4,2            ## @PCI_INVALID_IRQ
L_.str.1:                               ## @.str.1
	.asciz	"interrupts"

	.comm	_PCIR_INTLINE,4,2               ## @PCIR_INTLINE
	.no_dead_strip	_ofw_pcibus_enum_devtree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ofw_pcibus_enum_devtree
_ofw_pcibus_enum_devtree:               ; @ofw_pcibus_enum_devtree
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_device_get_parent
	mov	x22, x0
	mov	x0, x21
	bl	_ofw_bus_get_node
	bl	_OF_child
	cbz	x0, LBB0_10
; %bb.1:
	mov	x23, x0
Lloh0:
	adrp	x24, l_.str@PAGE
Lloh1:
	add	x24, x24, l_.str@PAGEOFF
Lloh2:
	adrp	x25, l_.str.1@PAGE
Lloh3:
	add	x25, x25, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x26
	bl	_pci_freecfg
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	bl	_OF_peer
	mov	x23, x0
	cbz	x0, LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #8
	mov	x0, x23
	mov	x1, x24
	mov	w3, #4
	bl	_OF_getencprop
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [sp, #8]
	bl	_OFW_PCI_PHYS_HI_DEVICE
	mov	x26, x0
	ldr	w0, [sp, #8]
	bl	_OFW_PCI_PHYS_HI_FUNCTION
	mov	x27, x0
	mov	x0, x20
	mov	x1, x19
	mov	x2, x26
	mov	x3, x27
	bl	_pci_find_dbsf
	cbnz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh4:
	adrp	x8, _PCI_INVALID_IRQ@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PCI_INVALID_IRQ@GOTPAGEOFF]
Lloh6:
	ldr	w28, [x8]
	mov	x0, x23
	mov	x1, x25
	bl	_OF_getproplen
	cmp	x0, #0
	csel	w5, wzr, w28, gt
Lloh7:
	adrp	x8, _PCIR_INTLINE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCIR_INTLINE@GOTPAGEOFF]
Lloh9:
	ldr	w4, [x8]
	mov	x0, x22
	mov	x1, x19
	mov	x2, x26
	mov	x3, x27
	mov	w6, #1
	bl	_PCIB_WRITE_CONFIG
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	mov	x4, x26
	mov	x5, x27
	bl	_pci_read_device
	cbz	x0, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x26, x0
	add	x0, x0, #24
	mov	x1, x23
	bl	_ofw_bus_gen_setup_devinfo
	cbnz	x0, LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	str	xzr, [x26, #16]
	mov	x0, x21
	mov	x1, x26
	bl	_pci_add_child
	ldr	x8, [x26, #8]
	cbnz	x8, LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	mov	x1, x23
	mov	x2, x26
	mov	x3, #0
	bl	_ofw_bus_intr_to_rl
	b	LBB0_3
LBB0_10:
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

	.comm	_PCI_INVALID_IRQ,4,2            ; @PCI_INVALID_IRQ
l_.str.1:                               ; @.str.1
	.asciz	"interrupts"

	.comm	_PCIR_INTLINE,4,2               ; @PCIR_INTLINE
	.no_dead_strip	_ofw_pcibus_enum_devtree
.subsections_via_symbols
