	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bus_alloc_resources            ## -- Begin function bus_alloc_resources
	.p2align	4, 0x90
_bus_alloc_resources:                   ## @bus_alloc_resources
	.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
	movq	%rsi, %r12
	movl	%edi, %r13d
	movl	(%rsi), %esi
	xorl	%edi, %edi
	cmpl	$-1, %esi
	je	LBB0_10
## %bb.1:
	leaq	12(%r12), %rax
	movq	%rdx, %rcx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, (%rcx)
	addq	$8, %rcx
	cmpl	$-1, (%rax)
	leaq	12(%rax), %rax
	jne	LBB0_2
## %bb.3:
	cmpl	$-1, %esi
	je	LBB0_10
## %bb.4:
	leaq	8(%r12), %rbx
	movq	_RF_OPTIONAL@GOTPCREL(%rip), %r14
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%rbx), %esi
	addq	$12, %rbx
	addq	$8, %r15
	cmpl	$-1, %esi
	je	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%rbx), %ecx
	movl	%r13d, %edi
	movq	%rbx, %rdx
	callq	_bus_alloc_resource_any
	movq	%rax, (%r15)
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r14), %eax
	testl	%eax, -4(%rbx)
	jne	LBB0_8
## %bb.7:
	movl	%r13d, %edi
	movq	%r12, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_bus_release_resources
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jmp	LBB0_10
LBB0_9:
	xorl	%edi, %edi
LBB0_10:
	movl	%edi, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RF_OPTIONAL,4,2                ## @RF_OPTIONAL
	.comm	_ENXIO,4,2                      ## @ENXIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bus_alloc_resources            ; -- Begin function bus_alloc_resources
	.p2align	2
_bus_alloc_resources:                   ; @bus_alloc_resources
	.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, x1
	ldr	w1, [x1]
	cmn	w1, #1
	b.eq	LBB0_9
; %bb.1:
	mov	x19, x2
	mov	x21, x0
	mov	w8, #12
	mov	x9, x2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [x9], #8
	ldr	w10, [x20, x8]
	add	x8, x8, #12
	cmn	w10, #1
	b.ne	LBB0_2
; %bb.3:
	cmn	w1, #1
	b.eq	LBB0_9
; %bb.4:
	add	x22, x20, #8
Lloh0:
	adrp	x23, _RF_OPTIONAL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _RF_OPTIONAL@GOTPAGEOFF]
	mov	x24, x19
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x22, #4]
	add	x22, x22, #12
	add	x24, x24, #8
	cmn	w1, #1
	b.eq	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w3, [x22, #-4]
	mov	x0, x21
	mov	x2, x22
	bl	_bus_alloc_resource_any
	str	x0, [x24]
	cbnz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldur	w8, [x22, #-4]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.8:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_bus_release_resources
Lloh2:
	adrp	x8, _ENXIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_9:
	mov	w0, #0
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RF_OPTIONAL,4,2                ; @RF_OPTIONAL
	.comm	_ENXIO,4,2                      ; @ENXIO
.subsections_via_symbols
