	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iobus_attach
_iobus_attach:                          ## @iobus_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
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_device_get_softc
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_ofw_bus_get_node
	movq	%rax, (%r15)
	leaq	L_.str(%rip), %rsi
	leaq	-64(%rbp), %rdx
	movq	%rax, %rdi
	movl	$16, %ecx
	callq	_OF_getprop
	cmpl	$16, %eax
	jne	LBB0_3
## %bb.1:
	movq	-64(%rbp), %rax
	movq	%rax, 8(%r15)
	movq	-56(%rbp), %rax
	movq	%rax, 16(%r15)
	movq	_RMAN_ARRAY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r15, %rbx
	addq	$24, %rbx
	movl	%eax, 32(%r15)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 24(%r15)
	movq	%rbx, %rdi
	callq	_rman_init
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_device_printf
LBB0_3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_13
## %bb.12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	16(%r15), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_rman_manage_region
	movq	(%r15), %rdi
	callq	_OF_child
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	%rax, %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-72(%rbp), %rdi
	callq	_OF_prop_free
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_OF_peer
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.3(%rip), %rsi
	leaq	-72(%rbp), %rdx
	callq	_OF_getprop_alloc
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$-1, %edx
	callq	_device_add_child
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %r12
	movq	_M_IOBUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$24, %edi
	callq	_malloc
	movq	%rax, %r13
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	leaq	16(%r13), %rdi
	callq	_resource_list_init
	movq	%rbx, 8(%r13)
	movq	-72(%rbp), %rax
	movq	%rax, (%r13)
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_iobus_add_intr
	movq	8(%r15), %rdx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_iobus_add_reg
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_device_set_ivars
	jmp	LBB0_9
LBB0_10:
	movq	%r14, %rdi
	callq	_bus_generic_attach
	jmp	LBB0_11
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_RMAN_ARRAY,4,2                 ## @RMAN_ARRAY
L_.str.1:                               ## @.str.1
	.asciz	"IOBus Device Memory"

L_.str.2:                               ## @.str.2
	.asciz	"failed to init mem range resources\n"

L_.str.3:                               ## @.str.3
	.asciz	"name"

	.comm	_M_IOBUS,4,2                    ## @M_IOBUS
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.no_dead_strip	_iobus_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iobus_attach
_iobus_attach:                          ; @iobus_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_device_get_softc
	mov	x20, x0
	mov	x0, x19
	bl	_ofw_bus_get_node
	str	x0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #8
	mov	w3, #16
	bl	_OF_getprop
	cmp	w0, #16
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [sp, #8]
Lloh5:
	adrp	x9, l_.str.1@PAGE
Lloh6:
	add	x9, x9, l_.str.1@PAGEOFF
	mov	x21, x20
	str	x9, [x21, #24]!
	stur	x8, [x21, #-16]
	ldr	x8, [sp, #16]
	stur	x8, [x21, #-8]
Lloh7:
	adrp	x8, _RMAN_ARRAY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RMAN_ARRAY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x21, #8]
	mov	x0, x21
	bl	_rman_init
	cbz	x0, LBB0_6
; %bb.2:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_3:
Lloh12:
	adrp	x8, _ENXIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
LBB0_4:
	ldr	x8, [sp, #24]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.5:
	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
	add	sp, sp, #112
	ret
LBB0_6:
	ldr	x2, [x20, #16]
	mov	x0, x21
	mov	w1, #0
	bl	_rman_manage_region
	ldr	x0, [x20]
	bl	_OF_child
	cbz	x0, LBB0_12
; %bb.7:
	mov	x21, x0
Lloh18:
	adrp	x22, l_.str.3@PAGE
Lloh19:
	add	x22, x22, l_.str.3@PAGEOFF
Lloh20:
	adrp	x25, _M_IOBUS@GOTPAGE
Lloh21:
	ldr	x25, [x25, _M_IOBUS@GOTPAGEOFF]
Lloh22:
	adrp	x26, _M_WAITOK@GOTPAGE
Lloh23:
	ldr	x26, [x26, _M_WAITOK@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x0, [sp]
	bl	_OF_prop_free
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x21
	bl	_OF_peer
	mov	x21, x0
	cbz	x0, LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x2, sp
	mov	x0, x21
	mov	x1, x22
	bl	_OF_getprop_alloc
	mov	x0, x19
	mov	x1, #0
	mov	w2, #-1
	bl	_device_add_child
	cbz	x0, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x23, x0
	ldr	w1, [x25]
	ldr	w2, [x26]
	mov	w0, #24
	bl	_malloc
	mov	x24, x0
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	add	x0, x24, #16
	bl	_resource_list_init
	ldr	x8, [sp]
	stp	x8, x21, [x24]
	mov	x0, x21
	mov	x1, x24
	bl	_iobus_add_intr
	ldr	x2, [x20, #8]
	mov	x0, x21
	mov	x1, x24
	bl	_iobus_add_reg
	mov	x0, x23
	mov	x1, x24
	bl	_device_set_ivars
	b	LBB0_9
LBB0_12:
	mov	x0, x19
	bl	_bus_generic_attach
	b	LBB0_4
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_RMAN_ARRAY,4,2                 ; @RMAN_ARRAY
l_.str.1:                               ; @.str.1
	.asciz	"IOBus Device Memory"

l_.str.2:                               ; @.str.2
	.asciz	"failed to init mem range resources\n"

l_.str.3:                               ; @.str.3
	.asciz	"name"

	.comm	_M_IOBUS,4,2                    ; @M_IOBUS
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.no_dead_strip	_iobus_attach
.subsections_via_symbols
