	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_stream_free               ## -- Begin function ivtv_stream_free
	.p2align	4, 0x90
_ivtv_stream_free:                      ## @ivtv_stream_free
	.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, %r15
	callq	_ivtv_flush_queues
	leaq	68(%r15), %r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ivtv_dequeue
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	movl	$256, %r12d                     ## imm = 0x100
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_kfree
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ivtv_dequeue
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_ivtv_might_use_dma
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	56(%r15), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rsi
	movl	(%r15), %edx
	addl	%r12d, %edx
	movl	64(%r15), %ecx
	callq	_pci_unmap_single
	jmp	LBB0_4
LBB0_5:
	cmpq	$0, 32(%r15)
	je	LBB0_9
## %bb.6:
	movq	8(%r15), %rsi
	movq	_IVTV_DMA_UNMAPPED@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rsi
	je	LBB0_8
## %bb.7:
	movq	56(%r15), %rax
	movl	(%rax), %edi
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$4, %edx
	callq	_pci_unmap_single
	movq	(%rbx), %rax
	movq	%rax, 8(%r15)
LBB0_8:
	movq	48(%r15), %rdi
	callq	_kfree
	movq	40(%r15), %rdi
	callq	_kfree
	movq	32(%r15), %rdi
	callq	_kfree
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r15)
	movups	%xmm0, 32(%r15)
	movq	$0, 48(%r15)
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IVTV_DMA_UNMAPPED,8,3          ## @IVTV_DMA_UNMAPPED
	.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_stream_free               ; -- Begin function ivtv_stream_free
	.p2align	2
_ivtv_stream_free:                      ; @ivtv_stream_free
	.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, x0
	bl	_ivtv_flush_queues
	add	x20, x19, #68
	mov	x0, x19
	mov	x1, x20
	bl	_ivtv_dequeue
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x21, #8]
	bl	_kfree
	mov	x0, x21
	bl	_kfree
	mov	x0, x19
	mov	x1, x20
	bl	_ivtv_dequeue
	mov	x21, x0
	cbz	x0, LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_ivtv_might_use_dma
	cbz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #56]
	ldr	w0, [x8]
	ldr	x1, [x21]
	ldr	w8, [x19]
	add	w2, w8, #256
	ldr	w3, [x19, #64]
	bl	_pci_unmap_single
	b	LBB0_2
LBB0_5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_9
; %bb.6:
	ldr	x1, [x19, #8]
Lloh0:
	adrp	x20, _IVTV_DMA_UNMAPPED@GOTPAGE
Lloh1:
	ldr	x20, [x20, _IVTV_DMA_UNMAPPED@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x1, x8
	b.eq	LBB0_8
; %bb.7:
	ldr	x8, [x19, #56]
	ldr	w0, [x8]
Lloh2:
	adrp	x8, _PCI_DMA_TODEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_DMA_TODEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	mov	w2, #4
	bl	_pci_unmap_single
	ldr	x8, [x20]
	str	x8, [x19, #8]
LBB0_8:
	ldr	x0, [x19, #48]
	bl	_kfree
	ldr	x0, [x19, #40]
	bl	_kfree
	ldr	x0, [x19, #32]
	bl	_kfree
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x19, #16]
	str	xzr, [x19, #48]
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_IVTV_DMA_UNMAPPED,8,3          ; @IVTV_DMA_UNMAPPED
	.comm	_PCI_DMA_TODEVICE,4,2           ; @PCI_DMA_TODEVICE
.subsections_via_symbols
