	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_stop_capture              ## -- Begin function cx18_stop_capture
	.p2align	4, 0x90
_cx18_stop_capture:                     ## @cx18_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	(%rcx), %r14
	leaq	(%rax,%rax,2), %rbx
	leaq	(%r14,%rbx,4), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_CX18_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_CX18_ENC_STREAM_TYPE_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movl	8(%r14,%rbx,4), %esi
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_IOCTL
	movq	_CX18_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	(%r14,%rbx,4), %rbx
	addq	$4, %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	(%r12), %rax
	movq	_CX18_ENC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rax,2), %rbx
	leaq	(%r15,%r15,2), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_CX18_F_S_STREAMING@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	(%r14,%rbx,4), %r13
	addq	$4, %r13
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	_CX18_F_S_APPL_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	leaq	(%r14,%rbx,4), %r13
	leaq	L_.str.2(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_cx18_stop_v4l2_encode_stream
LBB0_5:
	movl	(%r15), %edi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%r14,%rbx,4), %rsi
	addq	$4, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	(%r14,%rbx,4), %r13
	leaq	L_.str.3(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_cx18_stop_v4l2_encode_stream
LBB0_7:
	movq	(%r12), %rax
	movq	_CX18_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_10
## %bb.8:
	movq	_CX18_F_S_INTERNAL_USE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$-1, (%rax)
	movl	-44(%rbp), %r13d                ## 4-byte Reload
LBB0_11:
	testl	%r13d, %r13d
	je	LBB0_13
LBB0_12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_cx18_stop_v4l2_encode_stream
	testl	%r13d, %r13d
	jne	LBB0_12
LBB0_13:
	movq	_CX18_F_S_APPL_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_CX18_F_S_STREAMOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cx18_release_stream            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CX18_ENC_STREAM_TYPE_VBI,8,3   ## @CX18_ENC_STREAM_TYPE_VBI
	.comm	_CX18_ENC_STREAM_TYPE_IDX,8,3   ## @CX18_ENC_STREAM_TYPE_IDX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"close() of %s\n"

	.comm	_CX18_F_S_STREAMING,4,2         ## @CX18_F_S_STREAMING
L_.str.1:                               ## @.str.1
	.asciz	"close stopping capture\n"

	.comm	_CX18_ENC_STREAM_TYPE_MPG,8,3   ## @CX18_ENC_STREAM_TYPE_MPG
	.comm	_CX18_F_S_APPL_IO,4,2           ## @CX18_F_S_APPL_IO
L_.str.2:                               ## @.str.2
	.asciz	"close stopping embedded VBI capture\n"

L_.str.3:                               ## @.str.3
	.asciz	"close stopping IDX capture\n"

	.comm	_CX18_F_S_INTERNAL_USE,4,2      ## @CX18_F_S_INTERNAL_USE
	.comm	_CX18_F_S_STREAMOFF,4,2         ## @CX18_F_S_STREAMOFF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_stop_capture              ; -- Begin function cx18_stop_capture
	.p2align	2
_cx18_stop_capture:                     ; @cx18_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	x22, x0
	ldp	x9, x8, [x0]
	ldr	x25, [x8]
	mov	w8, #12
Lloh0:
	adrp	x24, _CX18_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh1:
	ldr	x24, [x24, _CX18_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
	madd	x19, x9, x8, x25
	ldr	x26, [x24]
Lloh2:
	adrp	x8, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGEOFF]
Lloh4:
	ldr	x27, [x8]
	ldr	w1, [x19, #8]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_IOCTL
Lloh7:
	adrp	x28, _CX18_F_S_STREAMING@GOTPAGE
Lloh8:
	ldr	x28, [x28, _CX18_F_S_STREAMING@GOTPAGEOFF]
	ldr	w0, [x28]
	add	x21, x19, #4
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_10
; %bb.1:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_DEBUG_INFO
	ldr	x8, [x22]
Lloh11:
	adrp	x9, _CX18_ENC_STREAM_TYPE_MPG@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CX18_ENC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	ldr	w0, [x28]
	mov	w8, #12
	madd	x8, x26, x8, x25
	add	x23, x8, #4
	mov	x1, x23
	bl	_test_bit
	cbz	x0, LBB0_5
; %bb.3:
Lloh14:
	adrp	x8, _CX18_F_S_APPL_IO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CX18_F_S_APPL_IO@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_test_bit
	cbnz	x0, LBB0_5
; %bb.4:
	mov	w8, #12
	madd	x23, x26, x8, x25
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_DEBUG_INFO
	mov	x0, x23
	mov	w1, #0
	bl	_cx18_stop_v4l2_encode_stream
LBB0_5:
	ldr	w0, [x28]
	mov	w8, #12
	madd	x8, x27, x8, x25
	add	x1, x8, #4
	bl	_test_bit
	mov	w8, #12
	cbz	x0, LBB0_7
; %bb.6:
	madd	x23, x27, x8, x25
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_CX18_DEBUG_INFO
	mov	x0, x23
	mov	w1, #0
	bl	_cx18_stop_v4l2_encode_stream
LBB0_7:
	ldr	x8, [x22]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.8:
Lloh21:
	adrp	x8, _CX18_F_S_INTERNAL_USE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CX18_F_S_INTERNAL_USE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_12
; %bb.9:
	mov	w8, #-1
	str	w8, [x19]
LBB0_10:
	cbz	w20, LBB0_13
LBB0_11:
	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_12:
	mov	x0, x19
	mov	x1, x20
	bl	_cx18_stop_v4l2_encode_stream
	cbnz	w20, LBB0_11
LBB0_13:
Lloh24:
	adrp	x8, _CX18_F_S_APPL_IO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CX18_F_S_APPL_IO@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_clear_bit
Lloh27:
	adrp	x8, _CX18_F_S_STREAMOFF@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CX18_F_S_STREAMOFF@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	mov	x1, x21
	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	_cx18_release_stream
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_CX18_ENC_STREAM_TYPE_VBI,8,3   ; @CX18_ENC_STREAM_TYPE_VBI
	.comm	_CX18_ENC_STREAM_TYPE_IDX,8,3   ; @CX18_ENC_STREAM_TYPE_IDX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"close() of %s\n"

	.comm	_CX18_F_S_STREAMING,4,2         ; @CX18_F_S_STREAMING
l_.str.1:                               ; @.str.1
	.asciz	"close stopping capture\n"

	.comm	_CX18_ENC_STREAM_TYPE_MPG,8,3   ; @CX18_ENC_STREAM_TYPE_MPG
	.comm	_CX18_F_S_APPL_IO,4,2           ; @CX18_F_S_APPL_IO
l_.str.2:                               ; @.str.2
	.asciz	"close stopping embedded VBI capture\n"

l_.str.3:                               ; @.str.3
	.asciz	"close stopping IDX capture\n"

	.comm	_CX18_F_S_INTERNAL_USE,4,2      ; @CX18_F_S_INTERNAL_USE
	.comm	_CX18_F_S_STREAMOFF,4,2         ; @CX18_F_S_STREAMOFF
.subsections_via_symbols
