	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_free_qp_mem
_nes_free_qp_mem:                       ## @nes_free_qp_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	testl	%edx, %edx
	je	LBB0_3
## %bb.1:
	movq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	incl	4(%r15)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r14), %edi
	movq	40(%rbx), %rdx
	movl	(%rbx), %esi
	movl	32(%rbx), %ecx
	callq	_pci_free_consistent
	movl	(%r14), %edi
	movq	16(%rbx), %rdx
	movl	24(%rbx), %ecx
	movl	$256, %esi                      ## imm = 0x100
	callq	_pci_free_consistent
	movq	$0, 16(%rbx)
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.4:
	movq	$0, 8(%rbx)
	movl	4(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kunmap                         ## TAILCALL
LBB0_3:
	movl	(%r14), %edi
	movq	56(%rbx), %rdx
	movl	(%rbx), %esi
	movl	48(%rbx), %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_free_consistent            ## TAILCALL
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_nes_free_qp_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_free_qp_mem
_nes_free_qp_mem:                       ; @nes_free_qp_mem
	.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	x19, x1
	mov	x20, x0
	cbz	w2, LBB0_3
; %bb.1:
	ldr	x21, [x20, #8]
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w8, [x21, #4]
	add	w8, w8, #1
	str	w8, [x21, #4]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	w0, [x20]
	ldr	w1, [x19]
	ldr	x2, [x19, #40]
	ldr	w3, [x19, #32]
	bl	_pci_free_consistent
	ldr	w0, [x20]
	ldr	x2, [x19, #16]
	ldr	w3, [x19, #24]
	mov	w1, #256
	bl	_pci_free_consistent
	str	xzr, [x19, #16]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.2:
	str	xzr, [x19, #8]
	ldr	w0, [x19, #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	_kunmap
LBB0_3:
	ldr	w0, [x20]
	ldr	w1, [x19]
	ldr	x2, [x19, #56]
	ldr	w3, [x19, #48]
	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	_pci_free_consistent
LBB0_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
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_nes_free_qp_mem
.subsections_via_symbols
