	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function unmap_rx_buf
_unmap_rx_buf:                          ## @unmap_rx_buf
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rsi), %rbx
	shlq	$3, %rbx
	addq	24(%rsi), %rbx
	movq	%rbx, %rdi
	callq	_is_buf_mapped
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%r15), %r12d
	movq	%rbx, %rdi
	callq	_get_buf_addr
	movl	%eax, %r13d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_get_buf_size
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_dma_unmap_page
LBB0_2:
	movq	$0, (%rbx)
	movq	(%r14), %rax
	incq	%rax
	xorl	%ecx, %ecx
	cmpq	8(%r14), %rax
	cmovneq	%rax, %rcx
	movq	%rcx, (%r14)
	decl	16(%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.no_dead_strip	_unmap_rx_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function unmap_rx_buf
_unmap_rx_buf:                          ; @unmap_rx_buf
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x21, x0
	ldr	x8, [x1, #24]
	ldr	x9, [x1]
	add	x20, x8, x9, lsl #3
	mov	x0, x20
	bl	_is_buf_mapped
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w22, [x21]
	mov	x0, x20
	bl	_get_buf_addr
	mov	x23, x0
	mov	x0, x21
	mov	x1, x20
	bl	_get_buf_size
	mov	x2, x0
Lloh0:
	adrp	x8, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x22
	mov	x1, x23
	bl	_dma_unmap_page
LBB0_2:
	str	xzr, [x20]
	ldp	x8, x9, [x19]
	add	x10, x8, #1
	cmp	x10, x9
	csinc	x8, xzr, x8, eq
	str	x8, [x19]
	ldr	w8, [x19, #16]
	sub	w8, w8, #1
	str	w8, [x19, #16]
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.no_dead_strip	_unmap_rx_buf
.subsections_via_symbols
