	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_stop_capture              ## -- Begin function ivtv_stop_capture
	.p2align	4, 0x90
_ivtv_stop_capture:                     ## @ivtv_stop_capture
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	8(%rdi), %r13
	movq	(%r13), %rcx
	leaq	(%rax,%rax,2), %r14
	leaq	(%rcx,%r14,8), %r15
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	16(%rcx,%r14,8), %esi
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_FILE
	movq	_IVTV_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_IVTV_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rbx
	shlq	$3, %rbx
	addq	(%r13), %rbx
	leaq	L_.str.1(%rip), %rdi
	callq	_IVTV_DEBUG_INFO
	movq	(%r12), %rax
	movq	_IVTV_ENC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	movq	_IVTV_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	_IVTV_F_S_APPL_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	callq	_IVTV_DEBUG_INFO
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ivtv_stop_v4l2_encode_stream
LBB0_5:
	movq	(%r12), %rax
	movq	_IVTV_DEC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_IVTV_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
LBB0_7:
	movq	_IVTV_F_S_INTERNAL_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, 8(%rax,%r14,8)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_10:
	testl	%ebx, %ebx
	je	LBB0_12
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	callq	_ivtv_stop_v4l2_encode_stream
	testl	%ebx, %ebx
	jne	LBB0_11
LBB0_12:
	movq	_IVTV_F_S_APPL_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_clear_bit
	movq	_IVTV_F_S_STREAMOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_clear_bit
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ivtv_release_stream            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"close() of %s\n"

	.comm	_IVTV_F_S_STREAMING,4,2         ## @IVTV_F_S_STREAMING
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ## @IVTV_ENC_STREAM_TYPE_VBI
L_.str.1:                               ## @.str.1
	.asciz	"close stopping capture\n"

	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ## @IVTV_ENC_STREAM_TYPE_MPG
	.comm	_IVTV_F_S_APPL_IO,4,2           ## @IVTV_F_S_APPL_IO
L_.str.2:                               ## @.str.2
	.asciz	"close stopping embedded VBI capture\n"

	.comm	_IVTV_DEC_STREAM_TYPE_VBI,8,3   ## @IVTV_DEC_STREAM_TYPE_VBI
	.comm	_IVTV_F_S_INTERNAL_USE,4,2      ## @IVTV_F_S_INTERNAL_USE
	.comm	_IVTV_F_S_STREAMOFF,4,2         ## @IVTV_F_S_STREAMOFF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_stop_capture              ; -- Begin function ivtv_stop_capture
	.p2align	2
_ivtv_stop_capture:                     ; @ivtv_stop_capture
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
	ldp	x23, x22, [x0]
	ldr	x24, [x22]
	mov	w8, #24
	madd	x19, x23, x8, x24
	ldr	w1, [x19, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_FILE
Lloh2:
	adrp	x26, _IVTV_F_S_STREAMING@GOTPAGE
Lloh3:
	ldr	x26, [x26, _IVTV_F_S_STREAMING@GOTPAGEOFF]
	ldr	w0, [x26]
	mov	x1, x19
	bl	_test_bit
	cbz	x0, LBB0_8
; %bb.1:
	ldr	x22, [x22]
Lloh4:
	adrp	x25, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh5:
	ldr	x25, [x25, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
	ldr	x27, [x25]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	ldr	x8, [x21]
Lloh8:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	mov	w8, #24
	madd	x22, x27, x8, x22
	ldr	w0, [x26]
	mov	x1, x22
	bl	_test_bit
	cbz	x0, LBB0_5
; %bb.3:
Lloh11:
	adrp	x8, _IVTV_F_S_APPL_IO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IVTV_F_S_APPL_IO@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_test_bit
	cbnz	x0, LBB0_5
; %bb.4:
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	mov	x0, x22
	mov	w1, #0
	bl	_ivtv_stop_v4l2_encode_stream
LBB0_5:
	ldr	x8, [x21]
Lloh16:
	adrp	x9, _IVTV_DEC_STREAM_TYPE_VBI@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IVTV_DEC_STREAM_TYPE_VBI@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	ldr	x10, [x25]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_10
; %bb.6:
Lloh19:
	adrp	x8, _IVTV_F_S_INTERNAL_USE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IVTV_F_S_INTERNAL_USE@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_bit
	cbz	x0, LBB0_10
; %bb.7:
	mov	w8, #24
	madd	x8, x23, x8, x24
	str	xzr, [x8, #8]
LBB0_8:
	cbz	w20, LBB0_11
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x19
	mov	x1, x20
	bl	_ivtv_stop_v4l2_encode_stream
	cbnz	w20, LBB0_9
LBB0_11:
Lloh22:
	adrp	x8, _IVTV_F_S_APPL_IO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IVTV_F_S_APPL_IO@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_clear_bit
Lloh25:
	adrp	x8, _IVTV_F_S_STREAMOFF@GOTPAGE
Lloh26:
	ldr	x8, [x8, _IVTV_F_S_STREAMOFF@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_clear_bit
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ivtv_release_stream
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"close() of %s\n"

	.comm	_IVTV_F_S_STREAMING,4,2         ; @IVTV_F_S_STREAMING
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ; @IVTV_ENC_STREAM_TYPE_VBI
l_.str.1:                               ; @.str.1
	.asciz	"close stopping capture\n"

	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ; @IVTV_ENC_STREAM_TYPE_MPG
	.comm	_IVTV_F_S_APPL_IO,4,2           ; @IVTV_F_S_APPL_IO
l_.str.2:                               ; @.str.2
	.asciz	"close stopping embedded VBI capture\n"

	.comm	_IVTV_DEC_STREAM_TYPE_VBI,8,3   ; @IVTV_DEC_STREAM_TYPE_VBI
	.comm	_IVTV_F_S_INTERNAL_USE,4,2      ; @IVTV_F_S_INTERNAL_USE
	.comm	_IVTV_F_S_STREAMOFF,4,2         ; @IVTV_F_S_STREAMOFF
.subsections_via_symbols
