	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv_pcib_alloc_resource
_mv_pcib_alloc_resource:                ## @mv_pcib_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movl	%r8d, %r14d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	%edi, %r15d
	movl	24(%rbp), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	16(%rbp), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	callq	_device_get_softc
	movq	%rax, %r13
	cmpl	$128, %ebx
	je	LBB0_6
## %bb.1:
	cmpl	$130, %ebx
	je	LBB0_4
## %bb.2:
	cmpl	$129, %ebx
	jne	LBB0_5
## %bb.3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %r15
	addq	$16, %r15
	jmp	LBB0_7
LBB0_6:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %r15
	addq	$12, %r15
LBB0_7:
	movq	%r14, %rbx
	movl	%ebx, %edi
	movl	%r12d, %esi
	callq	_RMAN_IS_DEFAULT_RANGE
	movl	(%r13), %edx
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	4(%r13), %ecx
	leal	(%rdx,%rcx), %r12d
	decl	%r12d
	movl	%edx, %ebx
	jmp	LBB0_10
LBB0_4:
	movl	8(%r13), %edi
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	movq	-72(%rbp), %r9                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_pci_domain_alloc_bus
	jmp	LBB0_18
LBB0_5:
	movl	%r15d, %edi
	callq	_device_get_parent
	movl	%eax, %edi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%r14d, %r8d
	movl	%r12d, %r9d
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_BUS_ALLOC_RESOURCE             ## TAILCALL
LBB0_9:
	cmpl	%ebx, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	jg	LBB0_16
LBB0_10:
	leal	(%rcx,%rbx), %eax
	decl	%eax
	cmpl	%r12d, %eax
	jne	LBB0_16
## %bb.11:
	addl	4(%r13), %edx
	cmpl	%edx, %r12d
	jge	LBB0_16
## %bb.12:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %r8d
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %r9d
	callq	_rman_reserve_resource
	testq	%rax, %rax
	je	LBB0_16
## %bb.13:
	movq	%rax, %r14
	movl	%r12d, %r15d
	movq	%rbx, %r12
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %esi
	movq	%rax, %rdi
	callq	_rman_set_rid
	movq	_fdtbus_bs_tag@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rman_set_bustag
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_rman_set_bushandle
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_17
## %bb.14:
	movl	(%rbx), %edx
	movl	%r13d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%r14, %rcx
	callq	_bus_activate_resource
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movq	%r14, %rdi
	callq	_rman_release_resource
LBB0_16:
	xorl	%r14d, %r14d
LBB0_17:
	movq	%r14, %rax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fdtbus_bs_tag,4,2              ## @fdtbus_bs_tag
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.no_dead_strip	_mv_pcib_alloc_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv_pcib_alloc_resource
_mv_pcib_alloc_resource:                ; @mv_pcib_alloc_resource
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x7
	mov	x24, x6
	mov	x25, x5
	mov	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x27, x0
	bl	_device_get_softc
	mov	x26, x0
	cmp	w21, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w21, #130
	b.eq	LBB0_7
; %bb.2:
	cmp	w21, #129
	b.ne	LBB0_8
; %bb.3:
	add	x27, x26, #16
	b	LBB0_5
LBB0_4:
	add	x27, x26, #12
LBB0_5:
	mov	x0, x23
	mov	x1, x25
	bl	_RMAN_IS_DEFAULT_RANGE
	ldr	w8, [x26]
	cbz	x0, LBB0_9
; %bb.6:
	ldr	w24, [x26, #4]
	add	w9, w8, w24
	sub	w25, w9, #1
	mov	x23, x8
	b	LBB0_10
LBB0_7:
	ldr	w0, [x26, #8]
	mov	x1, x22
	mov	x2, x20
	mov	x3, x23
	mov	x4, x25
	mov	x5, x24
	mov	x6, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_pci_domain_alloc_bus
LBB0_8:
	mov	x0, x27
	bl	_device_get_parent
	mov	x1, x27
	mov	x2, x21
	mov	x3, x20
	mov	x4, x23
	mov	x5, x25
	mov	x6, x24
	mov	x7, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_BUS_ALLOC_RESOURCE
LBB0_9:
	cmp	w8, w23
	b.gt	LBB0_16
LBB0_10:
	add	w9, w24, w23
	sub	w9, w9, #1
	cmp	w9, w25
	b.ne	LBB0_16
; %bb.11:
	ldr	w9, [x26, #4]
	add	w8, w9, w8
	cmp	w25, w8
	b.ge	LBB0_16
; %bb.12:
	mov	x0, x27
	mov	x1, x23
	mov	x2, x25
	mov	x3, x24
	mov	x4, x19
	mov	x5, x22
	bl	_rman_reserve_resource
	mov	x24, x0
	cbz	x0, LBB0_17
; %bb.13:
	ldr	w1, [x20]
	mov	x0, x24
	bl	_rman_set_rid
Lloh0:
	adrp	x8, _fdtbus_bs_tag@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fdtbus_bs_tag@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_rman_set_bustag
	mov	x0, x24
	mov	x1, x23
	bl	_rman_set_bushandle
Lloh3:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_17
; %bb.14:
	ldr	w2, [x20]
	mov	x0, x22
	mov	x1, x21
	mov	x3, x24
	bl	_bus_activate_resource
	cbz	x0, LBB0_17
; %bb.15:
	mov	x0, x24
	bl	_rman_release_resource
LBB0_16:
	mov	x24, #0
LBB0_17:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_fdtbus_bs_tag,4,2              ; @fdtbus_bs_tag
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.no_dead_strip	_mv_pcib_alloc_resource
.subsections_via_symbols
