	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_stop_v4l2_encode_stream   ## -- Begin function cx18_stop_v4l2_encode_stream
	.p2align	4, 0x90
_cx18_stop_v4l2_encode_stream:          ## @cx18_stop_v4l2_encode_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
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	callq	_cx18_stream_enabled
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	_CX18_F_S_STOPPING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	12(%rbx), %r12
	movq	%r12, %rsi
	callq	_set_bit
	movq	(%rbx), %rax
	movq	_CX18_ENC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rdx
	movq	_CX18_CPU_CAPTURE_STOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	16(%rbx), %ecx
	cmpq	(%rdx), %rax
	jne	LBB0_6
## %bb.5:
	xorl	%r8d, %r8d
	testl	%r13d, %r13d
	sete	%r8b
	movq	%r14, %rdi
	movl	$2, %edx
	xorl	%eax, %eax
	callq	_cx18_vapi
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_3:
	xorl	%r13d, %r13d
	jmp	LBB0_14
LBB0_6:
	movq	%r14, %rdi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_cx18_vapi
LBB0_7:
	movq	(%rbx), %rax
	testl	%r13d, %r13d
	je	LBB0_10
## %bb.8:
	movq	_CX18_ENC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_INFO
	movq	(%rbx), %rax
LBB0_10:
	movq	_CX18_ENC_STREAM_TYPE_TS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.11:
	leaq	8(%r14), %rdi
	callq	_atomic_dec
LBB0_12:
	movq	%r15, %rdi
	callq	_atomic_dec
	movq	_CX18_F_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_clear_bit
	movq	_CX18_CPU_DE_RELEASE_MDL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%rbx), %ecx
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_cx18_vapi
	movq	_CX18_DESTROY_TASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%rbx), %ecx
	movq	%r14, %rdi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_cx18_vapi
	movq	_CX18_INVALID_TASK_HANDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_CX18_F_S_STOPPING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_clear_bit
	movq	%r15, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jg	LBB0_14
## %bb.13:
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cx2341x_handler_set_busy
	movq	_CX18_DSP0_INTERRUPT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$5, %esi
	callq	_cx18_write_reg
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_wake_up
LBB0_14:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Stop Capture\n"

	.comm	_CX18_F_S_STOPPING,4,2          ## @CX18_F_S_STOPPING
	.comm	_CX18_ENC_STREAM_TYPE_MPG,8,3   ## @CX18_ENC_STREAM_TYPE_MPG
	.comm	_CX18_CPU_CAPTURE_STOP,4,2      ## @CX18_CPU_CAPTURE_STOP
L_.str.1:                               ## @.str.1
	.asciz	"ignoring gop_end: not (yet?) supported by the firmware\n"

	.comm	_CX18_ENC_STREAM_TYPE_TS,8,3    ## @CX18_ENC_STREAM_TYPE_TS
	.comm	_CX18_F_S_STREAMING,4,2         ## @CX18_F_S_STREAMING
	.comm	_CX18_CPU_DE_RELEASE_MDL,4,2    ## @CX18_CPU_DE_RELEASE_MDL
	.comm	_CX18_DESTROY_TASK,4,2          ## @CX18_DESTROY_TASK
	.comm	_CX18_INVALID_TASK_HANDLE,4,2   ## @CX18_INVALID_TASK_HANDLE
	.comm	_CX18_DSP0_INTERRUPT_MASK,4,2   ## @CX18_DSP0_INTERRUPT_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_stop_v4l2_encode_stream   ; -- Begin function cx18_stop_v4l2_encode_stream
	.p2align	2
_cx18_stop_v4l2_encode_stream:          ; @cx18_stop_v4l2_encode_stream
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x23, x1
	mov	x19, x0
	ldr	x20, [x0, #24]
	bl	_cx18_stream_enabled
	cbz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_INFO
	add	x21, x20, #4
	mov	x0, x21
	bl	_atomic_read
	cbz	x0, LBB0_14
; %bb.2:
Lloh2:
	adrp	x24, _CX18_F_S_STOPPING@GOTPAGE
Lloh3:
	ldr	x24, [x24, _CX18_F_S_STOPPING@GOTPAGEOFF]
	ldr	w0, [x24]
	add	x22, x19, #12
	mov	x1, x22
	bl	_set_bit
	ldr	x8, [x19]
Lloh4:
	adrp	x25, _CX18_ENC_STREAM_TYPE_MPG@GOTPAGE
Lloh5:
	ldr	x25, [x25, _CX18_ENC_STREAM_TYPE_MPG@GOTPAGEOFF]
	ldr	x9, [x25]
Lloh6:
	adrp	x10, _CX18_CPU_CAPTURE_STOP@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CX18_CPU_CAPTURE_STOP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x10]
	ldr	w3, [x19, #16]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	cmp	w23, #0
	cset	w8, eq
	str	x8, [sp]
	mov	x0, x20
	mov	w2, #2
	b	LBB0_6
LBB0_4:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_5:
	mov	x0, x20
	mov	w2, #1
LBB0_6:
	bl	_cx18_vapi
	ldr	x8, [x19]
	cbz	w23, LBB0_9
; %bb.7:
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_INFO
	ldr	x8, [x19]
LBB0_9:
Lloh14:
	adrp	x9, _CX18_ENC_STREAM_TYPE_TS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CX18_ENC_STREAM_TYPE_TS@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
	add	x0, x20, #8
	bl	_atomic_dec
LBB0_11:
	mov	x0, x21
	bl	_atomic_dec
Lloh17:
	adrp	x8, _CX18_F_S_STREAMING@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CX18_F_S_STREAMING@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_clear_bit
Lloh20:
	adrp	x8, _CX18_CPU_DE_RELEASE_MDL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CX18_CPU_DE_RELEASE_MDL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w3, [x19, #16]
	mov	x0, x20
	mov	w2, #1
	bl	_cx18_vapi
Lloh23:
	adrp	x8, _CX18_DESTROY_TASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CX18_DESTROY_TASK@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w3, [x19, #16]
	mov	x0, x20
	mov	w2, #1
	bl	_cx18_vapi
Lloh26:
	adrp	x8, _CX18_INVALID_TASK_HANDLE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CX18_INVALID_TASK_HANDLE@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	w0, [x24]
	mov	x1, x22
	bl	_clear_bit
	mov	x0, x21
	bl	_atomic_read
	cmp	x0, #0
	b.gt	LBB0_13
; %bb.12:
	mov	x0, x20
	mov	w1, #0
	bl	_cx2341x_handler_set_busy
Lloh29:
	adrp	x8, _CX18_DSP0_INTERRUPT_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CX18_DSP0_INTERRUPT_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #5
	bl	_cx18_write_reg
	add	x0, x19, #8
	bl	_wake_up
LBB0_13:
	mov	w0, #0
LBB0_14:
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Stop Capture\n"

	.comm	_CX18_F_S_STOPPING,4,2          ; @CX18_F_S_STOPPING
	.comm	_CX18_ENC_STREAM_TYPE_MPG,8,3   ; @CX18_ENC_STREAM_TYPE_MPG
	.comm	_CX18_CPU_CAPTURE_STOP,4,2      ; @CX18_CPU_CAPTURE_STOP
l_.str.1:                               ; @.str.1
	.asciz	"ignoring gop_end: not (yet?) supported by the firmware\n"

	.comm	_CX18_ENC_STREAM_TYPE_TS,8,3    ; @CX18_ENC_STREAM_TYPE_TS
	.comm	_CX18_F_S_STREAMING,4,2         ; @CX18_F_S_STREAMING
	.comm	_CX18_CPU_DE_RELEASE_MDL,4,2    ; @CX18_CPU_DE_RELEASE_MDL
	.comm	_CX18_DESTROY_TASK,4,2          ; @CX18_DESTROY_TASK
	.comm	_CX18_INVALID_TASK_HANDLE,4,2   ; @CX18_INVALID_TASK_HANDLE
	.comm	_CX18_DSP0_INTERRUPT_MASK,4,2   ; @CX18_DSP0_INTERRUPT_MASK
.subsections_via_symbols
