	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_udma_unmap                ## -- Begin function ivtv_udma_unmap
	.p2align	4, 0x90
_ivtv_udma_unmap:                       ## @ivtv_udma_unmap
	.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
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_INFO
	movl	8(%r14), %edx
	testl	%edx, %edx
	je	LBB0_7
## %bb.1:
	cmpq	$0, 24(%r14)
	je	LBB0_3
## %bb.2:
	movl	(%r14), %edi
	movl	32(%r14), %esi
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_pci_unmap_sg
	movq	$0, 24(%r14)
LBB0_3:
	movq	%r14, %rdi
	callq	_ivtv_udma_sync_for_cpu
	cmpl	$0, 8(%r14)
	jle	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_put_page
	incq	%rbx
	movslq	8(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_5
LBB0_6:
	movl	$0, 8(%r14)
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ivtv_unmap_user_dma\n"

	.comm	_PCI_DMA_TODEVICE,4,2           ## @PCI_DMA_TODEVICE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_udma_unmap                ; -- Begin function ivtv_udma_unmap
	.p2align	2
_ivtv_udma_unmap:                       ; @ivtv_udma_unmap
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	ldr	w2, [x19, #8]
	cbz	w2, LBB0_7
; %bb.1:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w0, [x19]
	ldr	w1, [x19, #32]
Lloh2:
	adrp	x8, _PCI_DMA_TODEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_DMA_TODEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	bl	_pci_unmap_sg
	str	xzr, [x19, #24]
LBB0_3:
	mov	x0, x19
	bl	_ivtv_udma_sync_for_cpu
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x20, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x20, lsl #2]
	bl	_put_page
	add	x20, x20, #1
	ldrsw	x8, [x19, #8]
	cmp	x20, x8
	b.lt	LBB0_5
LBB0_6:
	str	wzr, [x19, #8]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ivtv_unmap_user_dma\n"

	.comm	_PCI_DMA_TODEVICE,4,2           ; @PCI_DMA_TODEVICE
.subsections_via_symbols
