	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vicodec_stop_streaming
_vicodec_stop_streaming:                ## @vicodec_stop_streaming
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_vb2_get_drv_priv
	movq	%rax, %rbx
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_vicodec_return_bufs
	movl	(%r14), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	cmpl	$0, (%rbx)
	je	LBB0_7
## %bb.2:
	movl	108(%rbx), %edi
	callq	_spin_lock
	movq	$0, 120(%rbx)
	movl	112(%rbx), %edi
	callq	_v4l2_m2m_dst_buf_remove
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	_V4L2_BUF_FLAG_LAST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 4(%rax)
	movq	%rbx, %r15
	addq	$112, %r15
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_vb2_buffer_done
	movl	$0, (%rbx)
	movl	$1, 8(%rbx)
	movq	_vicodec_eos_event@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_v4l2_event_queue_fh
	jmp	LBB0_5
LBB0_6:
	movq	$0, (%rbx)
	movl	$0, 8(%rbx)
LBB0_7:
	cmpq	$0, 72(%rbx)
	jne	LBB0_10
	jmp	LBB0_8
LBB0_3:
	movl	$1, 4(%rbx)
LBB0_5:
	movl	108(%rbx), %edi
	callq	_spin_unlock
	cmpq	$0, 72(%rbx)
	jne	LBB0_10
LBB0_8:
	movl	(%r14), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	$0, 12(%rbx)
LBB0_10:
	movl	(%r14), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	cmpq	$0, 72(%rbx)
	je	LBB0_14
LBB0_12:
	movl	(%r14), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:
	cmpq	$0, 72(%rbx)
	je	LBB0_17
LBB0_14:
	cmpl	$0, 104(%rbx)
	jne	LBB0_16
## %bb.15:
	movq	96(%rbx), %rdi
	callq	_kvfree
LBB0_16:
	movl	$0, 16(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 80(%rbx)
	movq	$0, 96(%rbx)
LBB0_17:
	movl	(%r14), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	je	LBB0_20
## %bb.18:
	cmpq	$0, 72(%rbx)
	jne	LBB0_20
## %bb.19:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%rbx)
	movups	%xmm0, 40(%rbx)
	movups	%xmm0, 24(%rbx)
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VB2_BUF_STATE_ERROR,4,2        ## @VB2_BUF_STATE_ERROR
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ## @V4L2_BUF_FLAG_LAST
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.comm	_vicodec_eos_event,4,2          ## @vicodec_eos_event
	.no_dead_strip	_vicodec_stop_streaming
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vicodec_stop_streaming
_vicodec_stop_streaming:                ; @vicodec_stop_streaming
	.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	x20, x0
	bl	_vb2_get_drv_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_vicodec_return_bufs
	ldr	w0, [x20]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.2:
	ldr	w0, [x19, #108]
	bl	_spin_lock
	mov	x21, x19
	ldr	w0, [x21, #112]!
	str	xzr, [x21, #8]
	bl	_v4l2_m2m_dst_buf_remove
	cbz	x0, LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _V4L2_BUF_FLAG_LAST@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_BUF_FLAG_LAST@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x0, #4]
	orr	w8, w9, w8
	str	w8, [x0, #4]
Lloh6:
	adrp	x8, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_vb2_buffer_done
	str	wzr, [x19]
	mov	w8, #1
	str	w8, [x19, #8]
Lloh9:
	adrp	x1, _vicodec_eos_event@GOTPAGE
Lloh10:
	ldr	x1, [x1, _vicodec_eos_event@GOTPAGEOFF]
	mov	x0, x21
	bl	_v4l2_event_queue_fh
	b	LBB0_7
LBB0_4:
	str	wzr, [x19, #8]
	str	xzr, [x19]
LBB0_5:
	ldr	x8, [x19, #72]
	cbnz	x8, LBB0_10
	b	LBB0_8
LBB0_6:
	mov	w8, #1
	str	w8, [x19, #4]
LBB0_7:
	ldr	w0, [x19, #108]
	bl	_spin_unlock
	ldr	x8, [x19, #72]
	cbnz	x8, LBB0_10
LBB0_8:
	ldr	w0, [x20]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbz	x0, LBB0_10
; %bb.9:
	str	wzr, [x19, #12]
LBB0_10:
	ldr	w0, [x20]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbnz	x0, LBB0_12
; %bb.11:
	ldr	x8, [x19, #72]
	cbz	x8, LBB0_14
LBB0_12:
	ldr	w0, [x20]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbz	x0, LBB0_17
; %bb.13:
	ldr	x8, [x19, #72]
	cbz	x8, LBB0_17
LBB0_14:
	ldr	w8, [x19, #104]
	cbnz	w8, LBB0_16
; %bb.15:
	ldr	x0, [x19, #96]
	bl	_kvfree
LBB0_16:
	str	wzr, [x19, #16]
	stp	xzr, xzr, [x19, #88]
	str	xzr, [x19, #80]
LBB0_17:
	ldr	w0, [x20]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbz	x0, LBB0_20
; %bb.18:
	ldr	x8, [x19, #72]
	cbnz	x8, LBB0_20
; %bb.19:
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #56]
	stur	q0, [x19, #40]
	stur	q0, [x19, #24]
LBB0_20:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_VB2_BUF_STATE_ERROR,4,2        ; @VB2_BUF_STATE_ERROR
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ; @V4L2_BUF_FLAG_LAST
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.comm	_vicodec_eos_event,4,2          ; @vicodec_eos_event
	.no_dead_strip	_vicodec_stop_streaming
.subsections_via_symbols
