	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_helper_vb2_stop_streaming ## -- Begin function venus_helper_vb2_stop_streaming
	.p2align	4, 0x90
_venus_helper_vb2_stop_streaming:       ## @venus_helper_vb2_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	%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
	movq	%rdi, %r15
	callq	_vb2_get_drv_priv
	movq	%rax, %rbx
	movq	24(%rax), %r12
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	4(%rbx), %eax
	testl	%eax, (%rbx)
	je	LBB0_8
## %bb.1:
	movq	%rbx, %rdi
	callq	_hfi_session_stop
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_hfi_session_unload_res
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_venus_helper_unregister_bufs
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_venus_helper_intbufs_free
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_hfi_session_deinit
	cmpq	$0, 16(%rbx)
	jne	LBB0_4
## %bb.2:
	cmpq	$0, (%r12)
	je	LBB0_3
LBB0_4:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	testl	%r13d, %r13d
	je	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	callq	_hfi_session_abort
LBB0_7:
	movq	%rbx, %rdi
	callq	_venus_helper_free_dpb_bufs
	movq	%r12, %rdi
	callq	_venus_helper_load_scale_clocks
	movq	%rbx, %rdi
	addq	$12, %rdi
	callq	_INIT_LIST_HEAD
LBB0_8:
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_venus_helper_buffers_done
	movq	(%r15), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movl	$0, (%rbx)
	jmp	LBB0_11
LBB0_10:
	movl	$0, 4(%rbx)
LBB0_11:
	movq	%r14, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_3:
	orl	-52(%rbp), %r13d                ## 4-byte Folded Reload
	orl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	orl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	orl	%eax, %r13d
	testl	%r13d, %r13d
	jne	LBB0_6
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_VB2_BUF_STATE_ERROR,4,2        ## @VB2_BUF_STATE_ERROR
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,8,3 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_venus_helper_vb2_stop_streaming ; -- Begin function venus_helper_vb2_stop_streaming
	.p2align	2
_venus_helper_vb2_stop_streaming:       ; @venus_helper_vb2_stop_streaming
	.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	x21, x0
	bl	_vb2_get_drv_priv
	mov	x20, x0
	ldr	x22, [x0, #24]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldp	w8, w9, [x20]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.1:
	mov	x0, x20
	bl	_hfi_session_stop
	mov	x23, x0
	mov	x0, x20
	bl	_hfi_session_unload_res
	mov	x24, x0
	mov	x0, x20
	bl	_venus_helper_unregister_bufs
	mov	x25, x0
	mov	x0, x20
	bl	_venus_helper_intbufs_free
	mov	x26, x0
	mov	x0, x20
	bl	_hfi_session_deinit
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x22]
	cbz	x8, LBB0_10
LBB0_3:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w8, w8
	cbz	w8, LBB0_5
LBB0_4:
	mov	x0, x20
	bl	_hfi_session_abort
LBB0_5:
	mov	x0, x20
	bl	_venus_helper_free_dpb_bufs
	mov	x0, x22
	bl	_venus_helper_load_scale_clocks
	add	x0, x20, #12
	bl	_INIT_LIST_HEAD
LBB0_6:
Lloh3:
	adrp	x8, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_venus_helper_buffers_done
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	str	wzr, [x20]
	b	LBB0_9
LBB0_8:
	str	wzr, [x20, #4]
LBB0_9:
	mov	x0, x19
	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	_mutex_unlock
LBB0_10:
	orr	w8, w24, w23
	orr	w8, w8, w25
	orr	w8, w8, w26
	orr	w8, w8, w0
	cbnz	w8, LBB0_4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_VB2_BUF_STATE_ERROR,4,2        ; @VB2_BUF_STATE_ERROR
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,8,3 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
.subsections_via_symbols
