	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_dealloc_pd
_nes_dealloc_pd:                        ## @nes_dealloc_pd
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_nespd
	movq	%rax, %r12
	movl	8(%rbx), %edi
	callq	_to_nesvnic
	movq	(%rax), %rax
	movq	(%rax), %r14
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.2:
	callq	_to_nesucontext
	movq	%rax, %r15
	movq	_NES_DBG_PD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_nes_debug
	movq	(%r12), %rdi
	movl	16(%r15), %esi
	callq	_clear_bit
	movq	8(%r15), %rax
	movq	(%r12), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	(%r12), %rax
	cmpq	%rax, (%r15)
	jbe	LBB0_4
## %bb.3:
	movq	%rax, (%r15)
LBB0_4:
	movq	_NES_DBG_PD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_nes_debug
	movl	4(%r14), %esi
	movl	8(%r12), %edx
	subl	(%r14), %edx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	addb	$-12, %cl
	sarl	%cl, %edx
	movq	%r14, %rdi
	callq	_nes_free_resource
	movq	%r12, %rdi
	callq	_kfree
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NES_DBG_PD,4,2                 ## @NES_DBG_PD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Clearing bit %u from allocated doorbells\n"

L_.str.1:                               ## @.str.1
	.asciz	"Deallocating PD%u structure located @%p.\n"

	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_nes_dealloc_pd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_dealloc_pd
_nes_dealloc_pd:                        ; @nes_dealloc_pd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x0
	bl	_to_nespd
	mov	x19, x0
	ldr	w0, [x21, #8]
	bl	_to_nesvnic
	ldr	x8, [x0]
	ldr	x20, [x8]
	ldr	x8, [x21]
Lloh0:
	adrp	x22, _NES_DBG_PD@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NES_DBG_PD@GOTPAGEOFF]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x0, [x8]
	cbz	x0, LBB0_4
; %bb.2:
	bl	_to_nesucontext
	mov	x21, x0
	ldr	w0, [x22]
	ldr	w2, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_nes_debug
	ldr	x0, [x19]
	ldr	w1, [x21, #16]
	bl	_clear_bit
	ldr	x8, [x21, #8]
	ldr	x9, [x19]
	str	xzr, [x8, x9, lsl #3]
	ldr	x9, [x21]
	ldr	x8, [x19]
	cmp	x9, x8
	b.ls	LBB0_4
; %bb.3:
	str	x8, [x21]
LBB0_4:
	ldr	w0, [x22]
	ldr	w2, [x19, #8]
	str	x19, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_nes_debug
	ldr	w8, [x19, #8]
	ldp	w9, w1, [x20]
	sub	w8, w8, w9
Lloh6:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	sub	w9, w9, #12
	asr	w2, w8, w9
	mov	x0, x20
	bl	_nes_free_resource
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_NES_DBG_PD,4,2                 ; @NES_DBG_PD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Clearing bit %u from allocated doorbells\n"

l_.str.1:                               ; @.str.1
	.asciz	"Deallocating PD%u structure located @%p.\n"

	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_nes_dealloc_pd
.subsections_via_symbols
