	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pnp_assign_mem
_pnp_assign_mem:                        ## @pnp_assign_mem
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	(%rsi), %esi
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %ecx
	callq	_pnp_find_resource
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	(%rax), %rcx
	movq	8(%rax), %r8
	movl	16(%rax), %r9d
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_pnp_dbg
	jmp	LBB0_17
LBB0_2:
	movl	(%rbx), %eax
	movq	_IORESOURCE_AUTO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	orl	%eax, %r12d
	movl	%r12d, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	_IORESOURCE_MEM_WRITEABLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_4
## %bb.3:
	movq	_IORESOURCE_READONLY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r12d
	movl	%r12d, -48(%rbp)
LBB0_4:
	movq	_IORESOURCE_MEM_RANGELENGTH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_IORESOURCE_RANGELENGTH@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r12d
	movl	%r12d, -48(%rbp)
LBB0_6:
	movq	_IORESOURCE_MEM_SHADOWABLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_IORESOURCE_SHADOWABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	%r12d, -48(%rbp)
LBB0_8:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	16(%rbx), %rcx
	movq	%rcx, -64(%rbp)
	addq	%rcx, %rax
	decq	%rax
	movq	%rax, -56(%rbp)
	leaq	-64(%rbp), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_pnp_check_mem
	testl	%eax, %eax
	jne	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	24(%rbx), %rcx
	movq	-64(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, -64(%rbp)
	movq	8(%rbx), %rdx
	addq	%rax, %rdx
	decq	%rdx
	movq	%rdx, -56(%rbp)
	movq	32(%rbx), %r8
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r8, %rax
	jle	LBB0_11
LBB0_14:
	movq	16(%rbx), %rcx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_pnp_dbg
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_9:
	movq	_IORESOURCE_DISABLED@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	%r12d, -48(%rbp)
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_pnp_dbg
	xorl	%esi, %esi
	jmp	LBB0_16
LBB0_15:
	movq	-64(%rbp), %rsi
	movq	-56(%rbp), %rbx
	movl	-48(%rbp), %r12d
LBB0_16:
	movq	%r15, %rdi
	movq	%rbx, %rdx
	movl	%r12d, %ecx
	callq	_pnp_add_mem_resource
	xorl	%ebx, %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"  mem %d already set to %#llx-%#llx flags %#lx\n"

	.comm	_IORESOURCE_AUTO,4,2            ## @IORESOURCE_AUTO
	.comm	_IORESOURCE_MEM_WRITEABLE,4,2   ## @IORESOURCE_MEM_WRITEABLE
	.comm	_IORESOURCE_READONLY,4,2        ## @IORESOURCE_READONLY
	.comm	_IORESOURCE_MEM_RANGELENGTH,4,2 ## @IORESOURCE_MEM_RANGELENGTH
	.comm	_IORESOURCE_RANGELENGTH,4,2     ## @IORESOURCE_RANGELENGTH
	.comm	_IORESOURCE_MEM_SHADOWABLE,4,2  ## @IORESOURCE_MEM_SHADOWABLE
	.comm	_IORESOURCE_SHADOWABLE,4,2      ## @IORESOURCE_SHADOWABLE
	.comm	_IORESOURCE_DISABLED,4,2        ## @IORESOURCE_DISABLED
L_.str.1:                               ## @.str.1
	.asciz	"  mem %d disabled\n"

L_.str.2:                               ## @.str.2
	.asciz	"  couldn't assign mem %d (min %#llx max %#llx)\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_pnp_assign_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pnp_assign_mem
_pnp_assign_mem:                        ; @pnp_assign_mem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w1, [x1]
Lloh0:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x3, x20
	bl	_pnp_find_resource
	cbz	x0, LBB0_2
; %bb.1:
	ldp	x8, x9, [x0]
	ldr	w10, [x0, #16]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_pnp_dbg
	b	LBB0_16
LBB0_2:
	ldr	w9, [x21]
Lloh5:
	adrp	x8, _IORESOURCE_AUTO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IORESOURCE_AUTO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w8, w8, w9
	str	w8, [sp, #40]
	stp	xzr, xzr, [sp, #24]
Lloh8:
	adrp	x10, _IORESOURCE_MEM_WRITEABLE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _IORESOURCE_MEM_WRITEABLE@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_4
; %bb.3:
Lloh11:
	adrp	x10, _IORESOURCE_READONLY@GOTPAGE
Lloh12:
	ldr	x10, [x10, _IORESOURCE_READONLY@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w8, [sp, #40]
LBB0_4:
Lloh14:
	adrp	x10, _IORESOURCE_MEM_RANGELENGTH@GOTPAGE
Lloh15:
	ldr	x10, [x10, _IORESOURCE_MEM_RANGELENGTH@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_6
; %bb.5:
Lloh17:
	adrp	x10, _IORESOURCE_RANGELENGTH@GOTPAGE
Lloh18:
	ldr	x10, [x10, _IORESOURCE_RANGELENGTH@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w8, w8, w10
	str	w8, [sp, #40]
LBB0_6:
Lloh20:
	adrp	x10, _IORESOURCE_MEM_SHADOWABLE@GOTPAGE
Lloh21:
	ldr	x10, [x10, _IORESOURCE_MEM_SHADOWABLE@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_8
; %bb.7:
Lloh23:
	adrp	x9, _IORESOURCE_SHADOWABLE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IORESOURCE_SHADOWABLE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [sp, #40]
LBB0_8:
	ldr	x9, [x21, #8]
	cbz	x9, LBB0_13
; %bb.9:
	ldr	x8, [x21, #16]
	add	x9, x9, x8
	sub	x9, x9, #1
	stp	x8, x9, [sp, #24]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #24
	mov	x0, x19
	bl	_pnp_check_mem
	cbnz	w0, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x9, [sp, #24]
	ldr	x10, [x21, #8]
	ldp	x11, x8, [x21, #24]
	add	x9, x9, x11
	add	x10, x9, x10
	sub	x10, x10, #1
	stp	x9, x10, [sp, #24]
	cmp	x11, #0
	ccmp	x9, x8, #0, ne
	b.le	LBB0_10
; %bb.12:
	ldr	x9, [x21, #16]
	stp	x9, x8, [sp]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_pnp_dbg
Lloh28:
	adrp	x8, _EBUSY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_13:
Lloh31:
	adrp	x9, _IORESOURCE_DISABLED@GOTPAGE
Lloh32:
	ldr	x9, [x9, _IORESOURCE_DISABLED@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w21, w8, w9
	str	w21, [sp, #40]
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_pnp_dbg
	mov	x2, #0
	mov	x1, #0
	b	LBB0_15
LBB0_14:
	ldp	x1, x2, [sp, #24]
	ldr	w21, [sp, #40]
LBB0_15:
	mov	x0, x19
	mov	x3, x21
	bl	_pnp_add_mem_resource
LBB0_16:
	mov	w0, #0
LBB0_17:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"  mem %d already set to %#llx-%#llx flags %#lx\n"

	.comm	_IORESOURCE_AUTO,4,2            ; @IORESOURCE_AUTO
	.comm	_IORESOURCE_MEM_WRITEABLE,4,2   ; @IORESOURCE_MEM_WRITEABLE
	.comm	_IORESOURCE_READONLY,4,2        ; @IORESOURCE_READONLY
	.comm	_IORESOURCE_MEM_RANGELENGTH,4,2 ; @IORESOURCE_MEM_RANGELENGTH
	.comm	_IORESOURCE_RANGELENGTH,4,2     ; @IORESOURCE_RANGELENGTH
	.comm	_IORESOURCE_MEM_SHADOWABLE,4,2  ; @IORESOURCE_MEM_SHADOWABLE
	.comm	_IORESOURCE_SHADOWABLE,4,2      ; @IORESOURCE_SHADOWABLE
	.comm	_IORESOURCE_DISABLED,4,2        ; @IORESOURCE_DISABLED
l_.str.1:                               ; @.str.1
	.asciz	"  mem %d disabled\n"

l_.str.2:                               ; @.str.2
	.asciz	"  couldn't assign mem %d (min %#llx max %#llx)\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_pnp_assign_mem
.subsections_via_symbols
