	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function macio_alloc_resource
_macio_alloc_resource:                  ## @macio_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, %r13
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movl	%esi, %ebx
	movl	%edi, %r15d
	callq	_device_get_softc
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_device_get_ivars
	movq	%rax, %r14
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ebx
	notl	%ebx
	andl	24(%rbp), %ebx
	cmpl	$130, %r12d
	je	LBB0_3
## %bb.1:
	cmpl	$129, %r12d
	je	LBB0_11
## %bb.2:
	cmpl	$128, %r12d
	jne	LBB0_19
LBB0_3:
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	addq	$4, %r14
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$128, %esi
	callq	_resource_list_find
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	(%rax), %r14
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, %r14
	ja	LBB0_7
## %bb.6:
	movq	8(%rax), %rcx
	cmpq	%rdx, %rcx
	cmovbq	%rcx, %rdx
	movq	%rdx, %rsi
LBB0_7:
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, %r14
	ja	LBB0_9
## %bb.8:
	movq	8(%rax), %rax
	cmpq	%rcx, %rax
	cmovbq	%rax, %rcx
	movq	%rcx, %r14
LBB0_9:
	movq	%r14, %r15
	subq	%rsi, %r15
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdx
	movq	%r15, %rcx
	movl	%ebx, %r8d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r9d
	callq	_rman_reserve_resource
	testq	%rax, %rax
	je	LBB0_10
## %bb.20:
	movq	%rax, %r13
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %esi
	movq	%rax, %rdi
	callq	_rman_set_rid
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, 24(%rbp)
	je	LBB0_23
## %bb.21:
	movl	(%rbx), %edx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	movl	%r12d, %esi
	movq	%r13, %rcx
	callq	_bus_activate_resource
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	movl	%r14d, %edi
	callq	_device_get_nameunit
	movslq	%eax, %rdx
	leaq	L_.str.4(%rip), %rsi
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_device_printf
	movq	%r13, %rdi
	callq	_rman_release_resource
	xorl	%r13d, %r13d
	jmp	LBB0_23
LBB0_11:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	callq	_device_get_parent
	cmpl	%r15d, %eax
	jne	LBB0_12
## %bb.13:
	movl	%r15d, %r13d
	leaq	4(%r14), %r15
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	(%r12), %edx
	movq	%r15, %rdi
	movl	$129, %esi
	callq	_resource_list_find
	testq	%rax, %rax
	jne	LBB0_18
## %bb.14:
	movl	(%r14), %edx
	cmpl	$6, %edx
	jl	LBB0_17
## %bb.15:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_device_get_nameunit
	movslq	%eax, %rdx
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edi
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_19:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_device_get_nameunit
	movslq	%eax, %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%r15d, %edi
LBB0_16:
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_23
LBB0_4:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_device_get_nameunit
	movslq	%eax, %rdx
	movl	(%r13), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%r15d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_23
LBB0_12:
	movl	%r15d, %edi
	callq	_device_get_parent
	movl	%eax, %edi
	movl	%r13d, %esi
	movl	$129, %edx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	pushq	%rbx
	pushq	16(%rbp)
	callq	_BUS_ALLOC_RESOURCE
	addq	$72, %rsp
	jmp	LBB0_24
LBB0_10:
	movl	%ebx, %edi
	callq	_device_get_nameunit
	leaq	L_.str.3(%rip), %rsi
	xorl	%r13d, %r13d
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	movq	%r15, %r8
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_device_printf
LBB0_23:
	movq	%r13, %rax
	addq	$56, %rsp
LBB0_24:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	%r15, %rdi
	movl	$129, %esi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rcx
	movq	%r12, %r8
	movl	$1, %r9d
	callq	_resource_list_add
	movq	8(%r14), %rax
	movslq	(%r14), %rcx
	movq	%r12, (%rax,%rcx,8)
	leal	1(%rcx), %eax
	movl	%eax, (%r14)
	movq	-64(%rbp), %r12                 ## 8-byte Reload
LBB0_18:
	subq	$8, %rsp
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	$129, %ecx
	movq	%r12, %r8
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	pushq	%rbx
	pushq	16(%rbp)
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	callq	_resource_list_alloc
	addq	$88, %rsp
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no rle for %s memory %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s has more than 6 interrupts\n"

L_.str.2:                               ## @.str.2
	.asciz	"unknown resource request from %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to reserve resource %#lx - %#lx (%#lx) for %s\n"

L_.str.4:                               ## @.str.4
	.asciz	"failed to activate resource for %s\n"

	.no_dead_strip	_macio_alloc_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function macio_alloc_resource
_macio_alloc_resource:                  ; @macio_alloc_resource
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x27, x7
	stp	x6, x5, [sp, #32]               ; 16-byte Folded Spill
	mov	x24, x4
	mov	x23, x3
	mov	x26, x2
	mov	x20, x1
	mov	x19, x0
	bl	_device_get_softc
	mov	x28, x0
	mov	x0, x20
	bl	_device_get_ivars
	mov	x25, x0
Lloh0:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bic	w22, w27, w21
	cmp	w26, #130
	b.eq	LBB0_3
; %bb.1:
	cmp	w26, #129
	b.eq	LBB0_12
; %bb.2:
	cmp	w26, #128
	b.ne	LBB0_16
LBB0_3:
	add	x0, x25, #4
	ldr	w2, [x23]
	mov	w1, #128
	bl	_resource_list_find
	cbz	x0, LBB0_17
; %bb.4:
	str	x23, [sp, #32]                  ; 8-byte Folded Spill
	ldr	x25, [x0]
	mov	x23, x25
	cmp	x25, x24
	b.hi	LBB0_6
; %bb.5:
	ldr	x8, [x0, #8]
	cmp	x8, x24
	csel	x23, x8, x24, lo
LBB0_6:
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	cmp	x25, x9
	b.hi	LBB0_8
; %bb.7:
	ldr	x8, [x0, #8]
	cmp	x8, x9
	csel	x25, x8, x9, lo
LBB0_8:
	sub	x24, x25, x23
	mov	x0, x28
	mov	x1, x23
	mov	x2, x25
	mov	x3, x24
	mov	x4, x22
	mov	x5, x20
	bl	_rman_reserve_resource
	mov	x22, x0
	cbz	x0, LBB0_23
; %bb.9:
	and	w21, w21, w27
	ldr	x23, [sp, #32]                  ; 8-byte Folded Reload
	ldr	w1, [x23]
	mov	x0, x22
	bl	_rman_set_rid
	cbz	w21, LBB0_20
; %bb.10:
	ldr	w2, [x23]
	mov	x0, x20
	mov	x1, x26
	mov	x3, x22
	bl	_bus_activate_resource
	cbz	x0, LBB0_20
; %bb.11:
	mov	x0, x20
	bl	_device_get_nameunit
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x2, w0
Lloh3:
	adrp	x1, l_.str.4@PAGE
Lloh4:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	mov	x0, x22
	bl	_rman_release_resource
	b	LBB0_19
LBB0_12:
	mov	x0, x20
	bl	_device_get_parent
	cmp	w0, w19
	b.ne	LBB0_22
; %bb.13:
	mov	x21, x23
	add	x23, x25, #4
	ldr	w2, [x21]
	mov	x0, x23
	mov	w1, #129
	bl	_resource_list_find
	cbnz	x0, LBB0_25
; %bb.14:
	ldr	w2, [x25]
	cmp	w2, #6
	b.lt	LBB0_24
; %bb.15:
	mov	x0, x20
	bl	_device_get_nameunit
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x2, w0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_16:
	mov	x0, x20
	bl	_device_get_nameunit
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x2, w0
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_17:
	mov	x0, x20
	bl	_device_get_nameunit
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x2, w0
	ldr	w8, [x23]
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
LBB0_18:
	mov	x0, x19
	bl	_device_printf
LBB0_19:
	mov	x22, #0
LBB0_20:
	mov	x0, x22
LBB0_21:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_22:
	mov	x0, x19
	bl	_device_get_parent
	mov	x1, x20
	mov	w2, #129
	mov	x3, x23
	mov	x4, x24
	ldp	x6, x5, [sp, #32]               ; 16-byte Folded Reload
	mov	x7, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_BUS_ALLOC_RESOURCE
LBB0_23:
	mov	x0, x20
	bl	_device_get_nameunit
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x24, x0, [sp, #8]
	str	x25, [sp]
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x2, x23
	bl	_device_printf
	b	LBB0_20
LBB0_24:
	mov	x0, x23
	mov	w1, #129
	mov	x3, x24
	mov	x4, x24
	mov	w5, #1
	bl	_resource_list_add
	ldr	x8, [x25, #8]
	ldrsw	x9, [x25]
	str	x24, [x8, x9, lsl #3]
	add	w8, w9, #1
	str	w8, [x25]
LBB0_25:
	str	w22, [sp]
	mov	x0, x23
	mov	x1, x19
	mov	x2, x20
	mov	w3, #129
	mov	x4, x21
	mov	x5, x24
	ldp	x7, x6, [sp, #32]               ; 16-byte Folded Reload
	bl	_resource_list_alloc
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no rle for %s memory %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s has more than 6 interrupts\n"

l_.str.2:                               ; @.str.2
	.asciz	"unknown resource request from %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to reserve resource %#lx - %#lx (%#lx) for %s\n"

l_.str.4:                               ; @.str.4
	.asciz	"failed to activate resource for %s\n"

	.no_dead_strip	_macio_alloc_resource
.subsections_via_symbols
