	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbus_activate_resource
_sbus_activate_resource:                ## @sbus_activate_resource
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	cmpl	$128, %edx
	je	LBB0_3
## %bb.1:
	cmpl	$129, %edx
	jne	LBB0_10
## %bb.2:
	movl	$129, %edx
	movq	%r14, %r8
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bus_generic_activate_resource  ## TAILCALL
LBB0_3:
	callq	_device_get_softc
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.4:
	movq	%rax, %r15
	movl	$8, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rsi
	addq	%r12, %rsi
	movq	%r14, %rdi
	callq	_rman_is_region_manager
	testl	%eax, %eax
	jne	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	addq	$16, %r12
	cmpq	%rax, %rbx
	jl	LBB0_5
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_SBUS_BUS_SPACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sparc64_alloc_bus_tag
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_rman_set_bustag
	movq	8(%r15), %rax
	movq	-8(%rax,%r12), %rbx
	movq	%r14, %rdi
	callq	_rman_get_start
	addq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_rman_set_bushandle
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rman_activate_resource         ## TAILCALL
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SBUS_BUS_SPACE,4,2             ## @SBUS_BUS_SPACE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sbus_activate_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbus_activate_resource
_sbus_activate_resource:                ; @sbus_activate_resource
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x4
	cmp	w2, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w2, #129
	b.ne	LBB0_7
; %bb.2:
	mov	x4, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_bus_generic_activate_resource
LBB0_3:
	bl	_device_get_softc
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x20, x0
	mov	x21, #0
	mov	x22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x8, x8, x21
	add	x1, x8, #8
	mov	x0, x19
	bl	_rman_is_region_manager
	cbnz	w0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x21, x21, #16
	cmp	x22, x8
	b.lt	LBB0_5
LBB0_7:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh2:
	adrp	x8, _SBUS_BUS_SPACE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SBUS_BUS_SPACE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sparc64_alloc_bus_tag
	cbz	x0, LBB0_11
; %bb.10:
	mov	x1, x0
	mov	x0, x19
	bl	_rman_set_bustag
	ldr	x8, [x20, #8]
	ldr	x20, [x8, x21]
	mov	x0, x19
	bl	_rman_get_start
	add	x1, x0, x20
	mov	x0, x19
	bl	_rman_set_bushandle
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_rman_activate_resource
LBB0_11:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SBUS_BUS_SPACE,4,2             ; @SBUS_BUS_SPACE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sbus_activate_resource
.subsections_via_symbols
