	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_release_stream            ## -- Begin function ivtv_release_stream
	.p2align	4, 0x90
_ivtv_release_stream:                   ## @ivtv_release_stream
	.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	%rdi, %rbx
	movq	(%rdi), %rax
	movq	32(%rdi), %r14
	movq	$0, 16(%rdi)
	movq	_IVTV_DEC_STREAM_TYPE_VBI@GOTPCREL(%rip), %r15
	movq	_IVTV_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %r13
	cmpq	(%r15), %rax
	je	LBB0_2
## %bb.1:
	cmpq	(%r13), %rax
	jne	LBB0_3
LBB0_2:
	movq	_IVTV_F_S_INTERNAL_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_13
LBB0_3:
	movq	_IVTV_F_S_CLAIMED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %rsi
	callq	_test_and_clear_bit
	testl	%eax, %eax
	je	LBB0_14
## %bb.4:
	movq	%rbx, %rdi
	callq	_ivtv_flush_queues
	movq	(%rbx), %rax
	cmpq	(%r15), %rax
	jne	LBB0_6
## %bb.5:
	movq	_IVTV_IRQ_DEC_VBI_RE_INSERT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ivtv_set_irq_mask
	movq	(%rbx), %rax
LBB0_6:
	movq	_IVTV_DEC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.7:
	movq	_IVTV_ENC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rcx
	movq	%r13, %r15
	cmpq	(%rcx), %rax
	jne	LBB0_13
LBB0_8:
	movq	(%r14), %r12
	movq	(%r15), %rax
	leaq	(%rax,%rax,4), %rbx
	movq	_IVTV_F_S_INTERNAL_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	(%r12,%rbx,8), %r13
	addq	$8, %r13
	movq	%r13, %rsi
	callq	_test_and_clear_bit
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	cmpq	$0, 16(%r12,%rbx,8)
	je	LBB0_10
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	24(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_IVTV_DEBUG_WARN                ## TAILCALL
LBB0_10:
	leaq	(%r12,%rbx,8), %r15
	movq	(%r15), %rax
	movq	_IVTV_DEC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.11:
	movq	_IVTV_IRQ_DEC_VBI_RE_INSERT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ivtv_set_irq_mask
LBB0_12:
	movq	_IVTV_F_S_CLAIMED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_clear_bit
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ivtv_flush_queues              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IVTV_DEC_STREAM_TYPE_VBI,8,3   ## @IVTV_DEC_STREAM_TYPE_VBI
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ## @IVTV_ENC_STREAM_TYPE_VBI
	.comm	_IVTV_F_S_INTERNAL_USE,4,2      ## @IVTV_F_S_INTERNAL_USE
	.comm	_IVTV_F_S_CLAIMED,4,2           ## @IVTV_F_S_CLAIMED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Release stream %s not in use!\n"

	.comm	_IVTV_IRQ_DEC_VBI_RE_INSERT,4,2 ## @IVTV_IRQ_DEC_VBI_RE_INSERT
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,8,3   ## @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ## @IVTV_ENC_STREAM_TYPE_MPG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_release_stream            ; -- Begin function ivtv_release_stream
	.p2align	2
_ivtv_release_stream:                   ; @ivtv_release_stream
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x0
	ldr	x19, [x0, #32]
	str	xzr, [x0, #16]
	ldr	x8, [x0]
Lloh0:
	adrp	x21, _IVTV_DEC_STREAM_TYPE_VBI@GOTPAGE
Lloh1:
	ldr	x21, [x21, _IVTV_DEC_STREAM_TYPE_VBI@GOTPAGEOFF]
	ldr	x9, [x21]
Lloh2:
	adrp	x10, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh3:
	ldr	x10, [x10, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _IVTV_F_S_INTERNAL_USE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IVTV_F_S_INTERNAL_USE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x20, #8
	bl	_test_bit
	cbnz	x0, LBB0_10
LBB0_2:
Lloh8:
	adrp	x22, _IVTV_F_S_CLAIMED@GOTPAGE
Lloh9:
	ldr	x22, [x22, _IVTV_F_S_CLAIMED@GOTPAGEOFF]
	ldr	w0, [x22]
	add	x1, x20, #8
	bl	_test_and_clear_bit
	cbz	w0, LBB0_11
; %bb.3:
	mov	x0, x20
	bl	_ivtv_flush_queues
	ldr	x8, [x20]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
Lloh10:
	adrp	x8, _IVTV_IRQ_DEC_VBI_RE_INSERT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IVTV_IRQ_DEC_VBI_RE_INSERT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ivtv_set_irq_mask
	ldr	x8, [x20]
LBB0_5:
Lloh13:
	adrp	x9, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x9]
Lloh16:
	adrp	x23, _IVTV_DEC_STREAM_TYPE_VBI@GOTPAGE
Lloh17:
	ldr	x23, [x23, _IVTV_DEC_STREAM_TYPE_VBI@GOTPAGEOFF]
	mov	x9, x23
	cmp	x8, x10
	b.eq	LBB0_8
; %bb.6:
Lloh18:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
Lloh21:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
LBB0_8:
	ldr	x24, [x19]
	ldr	x25, [x9]
	mov	w8, #40
	madd	x20, x25, x8, x24
Lloh23:
	adrp	x8, _IVTV_F_S_INTERNAL_USE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IVTV_F_S_INTERNAL_USE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	add	x21, x20, #8
	mov	x1, x21
	bl	_test_and_clear_bit
	cbz	w0, LBB0_10
; %bb.9:
	mov	w8, #40
	madd	x8, x25, x8, x24
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_12
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	w1, [x20, #24]
Lloh26:
	adrp	x0, l_.str@PAGE
Lloh27:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_IVTV_DEBUG_WARN
LBB0_12:
	ldr	x8, [x20]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
Lloh28:
	adrp	x8, _IVTV_IRQ_DEC_VBI_RE_INSERT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _IVTV_IRQ_DEC_VBI_RE_INSERT@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ivtv_set_irq_mask
LBB0_14:
	ldr	w0, [x22]
	mov	x1, x21
	bl	_clear_bit
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ivtv_flush_queues
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_IVTV_DEC_STREAM_TYPE_VBI,8,3   ; @IVTV_DEC_STREAM_TYPE_VBI
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ; @IVTV_ENC_STREAM_TYPE_VBI
	.comm	_IVTV_F_S_INTERNAL_USE,4,2      ; @IVTV_F_S_INTERNAL_USE
	.comm	_IVTV_F_S_CLAIMED,4,2           ; @IVTV_F_S_CLAIMED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Release stream %s not in use!\n"

	.comm	_IVTV_IRQ_DEC_VBI_RE_INSERT,4,2 ; @IVTV_IRQ_DEC_VBI_RE_INSERT
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,8,3   ; @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ; @IVTV_ENC_STREAM_TYPE_MPG
.subsections_via_symbols
