	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mvneta_bm_pool_destroy         ## -- Begin function mvneta_bm_pool_destroy
	.p2align	4, 0x90
_mvneta_bm_pool_destroy:                ## @mvneta_bm_pool_destroy
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %eax
	notl	%eax
	andl	%eax, (%rsi)
	je	LBB0_1
## %bb.6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_MVNETA_BM_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rsi)
	callq	_mvneta_bm_bufs_free
	cmpq	$0, 32(%rbx)
	je	LBB0_3
## %bb.2:
	movl	4(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
LBB0_3:
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.4:
	movq	(%r14), %rdi
	movl	16(%rbx), %ecx
	movl	24(%rbx), %esi
	shll	$2, %esi
	callq	_dma_free_coherent
	movq	$0, 8(%rbx)
LBB0_5:
	movl	4(%rbx), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mvneta_bm_pool_disable         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MVNETA_BM_FREE,4,2             ## @MVNETA_BM_FREE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot free all buffers in pool %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mvneta_bm_pool_destroy         ; -- Begin function mvneta_bm_pool_destroy
	.p2align	2
_mvneta_bm_pool_destroy:                ; @mvneta_bm_pool_destroy
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x1]
	bics	w8, w8, w2
	str	w8, [x1]
	b.eq	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MVNETA_BM_FREE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MVNETA_BM_FREE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x1, #20]
	bl	_mvneta_bm_bufs_free
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w2, [x20, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN
LBB0_4:
	ldr	x2, [x20, #8]
	cbz	x2, LBB0_6
; %bb.5:
	ldr	x0, [x19]
	ldr	w8, [x20, #24]
	lsl	w1, w8, #2
	ldr	w3, [x20, #16]
	bl	_dma_free_coherent
	str	xzr, [x20, #8]
LBB0_6:
	ldr	w1, [x20, #4]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mvneta_bm_pool_disable
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MVNETA_BM_FREE,4,2             ; @MVNETA_BM_FREE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot free all buffers in pool %d\n"

.subsections_via_symbols
