	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_cqp_rem_ref_callback
_nes_cqp_rem_ref_callback:              ## @nes_cqp_rem_ref_callback
	.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, %r12
	movq	(%rsi), %rbx
	movq	8(%rdi), %r14
	movq	_qps_destroyed@GOTPCREL(%rip), %rdi
	callq	_atomic_inc
	cmpq	$0, 48(%rbx)
	movl	(%r12), %edi
	movl	(%rbx), %esi
	je	LBB0_2
## %bb.1:
	movq	40(%rbx), %rdx
	movl	32(%rbx), %ecx
	callq	_pci_free_consistent
	leaq	12(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	incl	16(%r14)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r12), %edi
	movq	48(%rbx), %rdx
	movl	56(%rbx), %ecx
	movl	$256, %esi                      ## imm = 0x100
	callq	_pci_free_consistent
	movq	$0, 48(%rbx)
	jmp	LBB0_3
LBB0_2:
	movq	24(%rbx), %rdx
	movl	16(%rbx), %ecx
	callq	_pci_free_consistent
LBB0_3:
	movl	8(%r14), %esi
	movq	8(%rbx), %rdx
	movq	%r14, %rdi
	callq	_nes_free_resource
	movq	(%r14), %rax
	movq	8(%rbx), %rcx
	movq	_NES_FIRST_QPN@GOTPCREL(%rip), %rdx
	subq	(%rdx), %rcx
	movq	$0, (%rax,%rcx,8)
	movl	4(%rbx), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_qps_destroyed,4,2              ## @qps_destroyed
	.comm	_NES_FIRST_QPN,8,3              ## @NES_FIRST_QPN
	.no_dead_strip	_nes_cqp_rem_ref_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_cqp_rem_ref_callback
_nes_cqp_rem_ref_callback:              ; @nes_cqp_rem_ref_callback
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	ldr	x22, [x1]
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x0, _qps_destroyed@GOTPAGE
Lloh1:
	ldr	x0, [x0, _qps_destroyed@GOTPAGEOFF]
	bl	_atomic_inc
	ldr	x8, [x22, #48]
	ldr	w0, [x20]
	ldr	w1, [x22]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x2, [x22, #40]
	ldr	w3, [x22, #32]
	bl	_pci_free_consistent
	add	x21, x19, #12
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	w0, [x20]
	ldr	x2, [x22, #48]
	ldr	w3, [x22, #56]
	mov	w1, #256
	bl	_pci_free_consistent
	str	xzr, [x22, #48]
	b	LBB0_3
LBB0_2:
	ldr	x2, [x22, #24]
	ldr	w3, [x22, #16]
	bl	_pci_free_consistent
LBB0_3:
	ldr	w1, [x19, #8]
	ldr	x2, [x22, #8]
	mov	x0, x19
	bl	_nes_free_resource
	ldr	x8, [x19]
	ldr	x9, [x22, #8]
Lloh2:
	adrp	x10, _NES_FIRST_QPN@GOTPAGE
Lloh3:
	ldr	x10, [x10, _NES_FIRST_QPN@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	sub	x9, x9, x10
	str	xzr, [x8, x9, lsl #3]
	ldr	w0, [x22, #4]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_qps_destroyed,4,2              ; @qps_destroyed
	.comm	_NES_FIRST_QPN,8,3              ; @NES_FIRST_QPN
	.no_dead_strip	_nes_cqp_rem_ref_callback
.subsections_via_symbols
