	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lbc_alloc_resource
_lbc_alloc_resource:                    ## @lbc_alloc_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r12
	movq	%r8, %rbx
	movq	%rcx, %r13
	movl	%edx, %r15d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%edi, %r14d
	movq	%r8, %rdi
	movq	%r9, %rsi
	callq	_RMAN_IS_DEFAULT_RANGE
	testl	%eax, %eax
	je	LBB0_13
## %bb.1:
	movl	%r14d, %edi
	callq	_device_get_softc
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	16(%rbp), %r9
	movl	24(%rbp), %eax
	movl	%eax, (%rsp)
	movl	%r14d, %edi
	movl	%r15d, %esi
	movq	%r13, %rdx
	movq	%rbx, %rcx
	movq	%r12, %r8
	callq	_bus_alloc_resource
	jmp	LBB0_15
LBB0_3:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_device_get_ivars
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movq	%rax, %rbx
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_6:
	movq	%rbx, %rdi
	addq	$4, %rdi
	movl	(%rbx), %edx
	movl	%r15d, %esi
	callq	_resource_list_find
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r13
	movq	8(%rax), %r12
	leaq	(%r12,%r13), %rbx
	decq	%rbx
	movl	%r14d, %edi
	callq	_device_get_softc
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	notl	%r8d
	andl	24(%rbp), %r8d
	movq	%rax, %rdi
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rsi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdx
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rcx
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	callq	_rman_reserve_resource
	movl	24(%rbp), %r13d
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %r12
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %esi
	movq	%rax, %rdi
	callq	_rman_set_rid
	movq	_bs_be_tag@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_rman_set_bustag
	movq	%r12, %rdi
	callq	_rman_get_start
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_rman_set_bushandle
	testl	%r13d, -48(%rbp)                ## 4-byte Folded Reload
	je	LBB0_14
## %bb.11:
	movl	(%rbx), %edx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	movl	%r15d, %esi
	movq	%r12, %rcx
	callq	_bus_activate_resource
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	%r12, %rdi
	callq	_rman_release_resource
LBB0_13:
	xorl	%r12d, %r12d
LBB0_14:
	movq	%r12, %rax
LBB0_15:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%r14d, %edi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_14
LBB0_9:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%r14d, %edi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_SYS_RES_IOPORT,4,2             ## @SYS_RES_IOPORT
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no default resources for rid = %d, type = %d\n"

	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.1:                               ## @.str.1
	.asciz	"failed to reserve resource %#jx - %#jx (%#jx)\n"

	.comm	_bs_be_tag,4,2                  ## @bs_be_tag
L_.str.2:                               ## @.str.2
	.asciz	"resource activation failed\n"

	.no_dead_strip	_lbc_alloc_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lbc_alloc_resource
_lbc_alloc_resource:                    ; @lbc_alloc_resource
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x7
	mov	x22, x6
	mov	x24, x5
	mov	x25, x4
	mov	x26, x3
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x4
	mov	x1, x5
	bl	_RMAN_IS_DEFAULT_RANGE
	cbz	w0, LBB0_10
; %bb.1:
	mov	x0, x20
	bl	_device_get_softc
Lloh0:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x26
	mov	x3, x25
	mov	x4, x24
	mov	x5, x22
	mov	x6, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_bus_alloc_resource
LBB0_3:
	mov	x0, x19
	bl	_device_get_ivars
	cbz	x0, LBB0_10
; %bb.4:
	mov	x22, x0
Lloh3:
	adrp	x8, _SYS_RES_IOPORT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SYS_RES_IOPORT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _SYS_RES_MEMORY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w23
	csel	w23, w9, w23, eq
	ldr	w2, [x0], #4
	mov	x1, x23
	bl	_resource_list_find
	cbz	x0, LBB0_9
; %bb.5:
	ldp	x26, x25, [x0]
	add	x8, x25, x26
	sub	x27, x8, #1
	mov	x0, x20
	bl	_device_get_softc
Lloh9:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh11:
	ldr	w28, [x8]
	bic	w4, w21, w28
	mov	x1, x25
	mov	x2, x27
	mov	x3, x26
	mov	x5, x19
	bl	_rman_reserve_resource
	mov	x24, x0
	cbz	x0, LBB0_12
; %bb.6:
	and	w20, w28, w21
	ldr	w1, [x22]
	mov	x0, x24
	bl	_rman_set_rid
Lloh12:
	adrp	x1, _bs_be_tag@GOTPAGE
Lloh13:
	ldr	x1, [x1, _bs_be_tag@GOTPAGEOFF]
	mov	x0, x24
	bl	_rman_set_bustag
	mov	x0, x24
	bl	_rman_get_start
	mov	x1, x0
	mov	x0, x24
	bl	_rman_set_bushandle
	cbz	w20, LBB0_11
; %bb.7:
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x23
	mov	x3, x24
	bl	_bus_activate_resource
	cbz	x0, LBB0_11
; %bb.8:
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	mov	x0, x24
	bl	_rman_release_resource
	b	LBB0_10
LBB0_9:
	ldr	w8, [x22]
	stp	x8, x23, [sp]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_10:
	mov	x24, #0
LBB0_11:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_12:
	stp	x27, x26, [sp, #8]
	str	x25, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_device_printf
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no default resources for rid = %d, type = %d\n"

	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.1:                               ; @.str.1
	.asciz	"failed to reserve resource %#jx - %#jx (%#jx)\n"

	.comm	_bs_be_tag,4,2                  ; @bs_be_tag
l_.str.2:                               ; @.str.2
	.asciz	"resource activation failed\n"

	.no_dead_strip	_lbc_alloc_resource
.subsections_via_symbols
