	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ebus_setup_dinfo
_ebus_setup_dinfo:                      ## @ebus_setup_dinfo
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r14
	movl	%edi, %r15d
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_ZERO@GOTPCREL(%rip), %rax
	movq	_M_WAITOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$8, %edi
	callq	_malloc
	movq	%rax, %r12
	movq	%rax, %r13
	addq	$4, %r13
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_ofw_bus_gen_setup_devinfo
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_free
LBB0_2:
	xorl	%r12d, %r12d
LBB0_3:
	movq	%r12, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_resource_list_init
	leaq	L_.str(%rip), %rsi
	leaq	-72(%rbp), %rcx
	movl	%ebx, %edi
	movl	$8, %edx
	callq	_OF_getprop_alloc_multi
	cmpl	$-1, %eax
	je	LBB0_21
## %bb.5:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	%ebx, -80(%rbp)                 ## 4-byte Spill
	movl	%r15d, -76(%rbp)                ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_8
## %bb.6:
	movl	%eax, %r15d
	shlq	$3, %r15
	xorl	%r14d, %r14d
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rdi
	addq	%r14, %rdi
	callq	_ISA_REG_PHYS
	movl	(%r13), %esi
	movq	-72(%rbp), %rcx
	movq	(%rcx,%r14), %r9
	leaq	(%rax,%r9), %r8
	decq	%r8
	movq	%r12, %rdi
	movl	%ebx, %edx
	movq	%rax, %rcx
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_resource_list_add
	incl	%ebx
	addq	$8, %r14
	cmpq	%r14, %r15
	jne	LBB0_7
LBB0_8:
	movq	-72(%rbp), %rdi
	callq	_OF_prop_free
	leaq	L_.str.2(%rip), %rsi
	leaq	-64(%rbp), %rcx
	movl	-80(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	movl	$8, %edx
	callq	_OF_getprop_alloc_multi
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.9:
	testl	%eax, %eax
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_22
## %bb.10:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	$8, %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%r15d, %r15d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	(%r14), %edx
	movq	-64(%rbp), %rax
	movq	(%rax,%r15,8), %rcx
	movl	%ebx, %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_12:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r15
	cmpq	%r15, -104(%rbp)                ## 8-byte Folded Reload
	je	LBB0_22
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	_EBUS_PCI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx
	movq	(%rcx,%r15,8), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	testl	%eax, (%rdx)
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ebx, %edi
	movl	%r13d, %esi
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	callq	_ofw_isa_route_intr
	movq	%rax, -56(%rbp)
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_EBUS_PCI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-56(%rbp), %rcx
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%rcx, -112(%rbp)
	subq	$8, %rsp
	movl	%r13d, %edi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	leaq	-120(%rbp), %rdx
	movl	$8, %ecx
	leaq	-112(%rbp), %r8
	movl	$8, %r9d
	pushq	$0
	pushq	$8
	leaq	-56(%rbp), %rax
	pushq	%rax
	callq	_ofw_bus_lookup_imap
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	4(%r14), %edi
	movq	-56(%rbp), %rsi
	callq	_INTMAP_VEC
	movq	%rax, %rcx
	movq	%rax, -56(%rbp)
	movq	_EBUS_PCI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_PCI_INVALID_IRQ@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	je	LBB0_11
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movq	%rcx, %r8
	movl	$1, %r9d
	callq	_resource_list_add
	jmp	LBB0_12
LBB0_21:
	movl	4(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	%r12, %rdi
	callq	_ebus_destroy_dinfo
	jmp	LBB0_2
LBB0_22:
	movq	-64(%rbp), %rdi
	callq	_OF_prop_free
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

L_.str.1:                               ## @.str.1
	.asciz	"<%s>: incomplete\n"

	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
L_.str.2:                               ## @.str.2
	.asciz	"interrupts"

	.comm	_EBUS_PCI,4,2                   ## @EBUS_PCI
	.comm	_PCI_INVALID_IRQ,8,3            ## @PCI_INVALID_IRQ
L_.str.3:                               ## @.str.3
	.asciz	"<%s>: could not map EBus interrupt %d\n"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.no_dead_strip	_ebus_setup_dinfo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ebus_setup_dinfo
_ebus_setup_dinfo:                      ; @ebus_setup_dinfo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _M_DEVBUF@GOTPAGE
Lloh1:
	ldr	x24, [x24, _M_DEVBUF@GOTPAGEOFF]
Lloh2:
	adrp	x8, _M_ZERO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _M_ZERO@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #8
	bl	_malloc
	mov	x19, x0
	add	x23, x0, #4
	mov	x0, x23
	mov	x1, x21
	bl	_ofw_bus_gen_setup_devinfo
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_free
LBB0_2:
	mov	x19, #0
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_4:
	mov	x0, x19
	bl	_resource_list_init
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	add	x3, sp, #32
	mov	x0, x21
	mov	w2, #8
	bl	_OF_getprop_alloc_multi
	cmn	w0, #1
	b.eq	LBB0_21
; %bb.5:
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x25, #0
	mov	w24, #0
	mov	w8, w0
	lsl	x26, x8, #3
Lloh10:
	adrp	x27, _SYS_RES_MEMORY@GOTPAGE
Lloh11:
	ldr	x27, [x27, _SYS_RES_MEMORY@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #32]
	add	x0, x8, x25
	bl	_ISA_REG_PHYS
	mov	x3, x0
	ldr	w1, [x27]
	ldr	x8, [sp, #32]
	ldr	x5, [x8, x25]
	add	x8, x0, x5
	sub	x4, x8, #1
	mov	x0, x19
	mov	x2, x24
                                        ; kill: def $w5 killed $w5 killed $x5
	bl	_resource_list_add
	add	w24, w24, #1
	add	x25, x25, #8
	cmp	x26, x25
	b.ne	LBB0_7
LBB0_8:
	ldr	x0, [sp, #32]
	bl	_OF_prop_free
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x3, sp, #16
	mov	x0, x21
	mov	w2, #8
	bl	_OF_getprop_alloc_multi
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.9:
	cmp	w0, #1
	b.lt	LBB0_22
; %bb.10:
	mov	x24, #0
	add	x25, x22, #8
	mov	w27, w0
Lloh14:
	adrp	x28, _EBUS_PCI@GOTPAGE
Lloh15:
	ldr	x28, [x28, _EBUS_PCI@GOTPAGEOFF]
Lloh16:
	adrp	x26, _PCI_INVALID_IRQ@GOTPAGE
Lloh17:
	ldr	x26, [x26, _PCI_INVALID_IRQ@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w2, [x23]
	ldr	x8, [sp, #16]
	ldr	x8, [x8, x24, lsl #3]
	str	x8, [sp]
	mov	x0, x20
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_device_printf
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x24, x24, #1
	cmp	x27, x24
	b.eq	LBB0_22
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	ldr	w9, [x28]
	ldr	x10, [sp, #16]
	ldr	x3, [x10, x24, lsl #3]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x25
	bl	_ofw_isa_route_intr
	str	x0, [sp, #8]
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x22]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x3, [sp, #8]
	b	LBB0_19
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
	str	x3, [sp, #24]
	str	xzr, [sp]
	add	x2, sp, #40
	add	x4, sp, #24
	add	x6, sp, #8
	mov	x0, x21
	mov	x1, x25
	mov	w3, #8
	mov	w5, #8
	mov	w7, #8
	bl	_ofw_bus_lookup_imap
	cbz	w0, LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x22, #4]
	ldr	x1, [sp, #8]
	bl	_INTMAP_VEC
	mov	x3, x0
	str	x0, [sp, #8]
	ldr	w8, [x22]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x26]
	cmp	x3, x8
	b.eq	LBB0_11
LBB0_20:                                ;   in Loop: Header=BB0_13 Depth=1
Lloh20:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x24
	mov	x4, x3
	mov	w5, #1
	bl	_resource_list_add
	b	LBB0_12
LBB0_21:
	ldr	w2, [x19, #4]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	mov	x0, x19
	bl	_ebus_destroy_dinfo
	b	LBB0_2
LBB0_22:
	ldr	x0, [sp, #16]
	bl	_OF_prop_free
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

l_.str.1:                               ; @.str.1
	.asciz	"<%s>: incomplete\n"

	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
l_.str.2:                               ; @.str.2
	.asciz	"interrupts"

	.comm	_EBUS_PCI,4,2                   ; @EBUS_PCI
	.comm	_PCI_INVALID_IRQ,8,3            ; @PCI_INVALID_IRQ
l_.str.3:                               ; @.str.3
	.asciz	"<%s>: could not map EBus interrupt %d\n"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.no_dead_strip	_ebus_setup_dinfo
.subsections_via_symbols
