	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsb_attach
_rsb_attach:                            ## @rsb_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r13d
	callq	_device_get_softc
	movq	%rax, %r14
	movl	%r13d, %edi
	callq	_device_get_nameunit
	movq	_MTX_DEF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mtx_init
	movq	_compat_data@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_ofw_bus_search_compatible
	movl	(%rax), %eax
	movl	%eax, 40(%r14)
	leaq	8(%r14), %r15
	movl	%r13d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%r15, %rcx
	callq	_clk_get_by_ofw_index
	testq	%rax, %rax
	je	LBB0_1
LBB0_9:
	leaq	16(%r14), %rbx
	movl	%r13d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%rbx, %rcx
	callq	_hwreset_get_by_ofw_idx
	testq	%rax, %rax
	je	LBB0_10
LBB0_12:
	movq	_rsb_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	24(%r14), %rdx
	movl	%r13d, %edi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
LBB0_14:
	movl	%r13d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_4
LBB0_1:
	movq	(%r15), %rdi
	callq	_clk_enable
	testl	%eax, %eax
	je	LBB0_9
## %bb.2:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_10:
	movq	(%rbx), %rdi
	callq	_hwreset_deassert
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rsi
LBB0_3:
	movl	%r13d, %edi
	callq	_device_printf
LBB0_4:
	movq	_rsb_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	addq	$24, %rdx
	movl	%r13d, %edi
	callq	_bus_release_resources
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_hwreset_release
LBB0_6:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_clk_release
LBB0_8:
	movq	%r14, %rdi
	callq	_mtx_destroy
LBB0_18:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	leaq	L_.str.4(%rip), %rsi
	movl	%r13d, %edi
	movl	$-1, %edx
	callq	_device_add_child
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:
	movl	%r13d, %edi
	callq	_bus_generic_attach
	xorl	%r12d, %r12d
	jmp	LBB0_18
LBB0_16:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rsb"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_compat_data,4,2                ## @compat_data
L_.str.1:                               ## @.str.1
	.asciz	"cannot enable clock\n"

L_.str.2:                               ## @.str.2
	.asciz	"cannot de-assert reset\n"

	.comm	_rsb_spec,4,2                   ## @rsb_spec
L_.str.3:                               ## @.str.3
	.asciz	"cannot allocate resources for device\n"

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

L_.str.5:                               ## @.str.5
	.asciz	"cannot add iicbus child device\n"

	.no_dead_strip	_rsb_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsb_attach
_rsb_attach:                            ; @rsb_attach
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	mov	x0, x20
	bl	_device_get_nameunit
	mov	x1, x0
Lloh0:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mtx_init
Lloh5:
	adrp	x8, _compat_data@GOTPAGE
Lloh6:
	ldr	x8, [x8, _compat_data@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ofw_bus_search_compatible
	ldr	w8, [x0]
	str	w8, [x19, #40]
	add	x21, x19, #8
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	mov	x3, x21
	bl	_clk_get_by_ofw_index
Lloh8:
	adrp	x23, _rsb_spec@GOTPAGE
Lloh9:
	ldr	x23, [x23, _rsb_spec@GOTPAGEOFF]
	cbz	x0, LBB0_5
LBB0_1:
	add	x22, x19, #16
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	mov	x3, x22
	bl	_hwreset_get_by_ofw_idx
	cbz	x0, LBB0_7
LBB0_2:
	ldr	w1, [x23]
	add	x2, x19, #24
	mov	x0, x20
	bl	_bus_alloc_resources
	cbz	x0, LBB0_16
; %bb.3:
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_device_printf
Lloh12:
	adrp	x8, _ENXIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	b	LBB0_10
LBB0_5:
	ldr	x0, [x21]
	bl	_clk_enable
	cbz	w0, LBB0_1
; %bb.6:
	mov	x22, x0
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
	ldr	x0, [x22]
	bl	_hwreset_deassert
	cbz	w0, LBB0_2
; %bb.8:
	mov	x22, x0
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x0, x20
	bl	_device_printf
LBB0_10:
	ldr	w1, [x23]
	add	x2, x19, #24
	mov	x0, x20
	bl	_bus_release_resources
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_12
; %bb.11:
	bl	_hwreset_release
LBB0_12:
	ldr	x0, [x21]
	cbz	x0, LBB0_14
; %bb.13:
	bl	_clk_release
LBB0_14:
	mov	x0, x19
	bl	_mtx_destroy
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	mov	w2, #-1
	bl	_device_add_child
	str	x0, [x19, #32]
	cbz	x0, LBB0_18
; %bb.17:
	mov	x0, x20
	bl	_bus_generic_attach
	mov	w22, #0
	b	LBB0_15
LBB0_18:
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rsb"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_compat_data,4,2                ; @compat_data
l_.str.1:                               ; @.str.1
	.asciz	"cannot enable clock\n"

l_.str.2:                               ; @.str.2
	.asciz	"cannot de-assert reset\n"

	.comm	_rsb_spec,4,2                   ; @rsb_spec
l_.str.3:                               ; @.str.3
	.asciz	"cannot allocate resources for device\n"

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

l_.str.5:                               ; @.str.5
	.asciz	"cannot add iicbus child device\n"

	.no_dead_strip	_rsb_attach
.subsections_via_symbols
