	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdec_session_release
_vdec_session_release:                  ## @vdec_session_release
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	callq	_mutex_lock
	movq	_VENUS_DEC_STATE_DEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	callq	_hfi_session_stop
	movq	%rbx, %rdi
	callq	_hfi_session_unload_res
	movq	%rbx, %rdi
	callq	_venus_helper_unregister_bufs
	movq	%rbx, %rdi
	callq	_venus_helper_intbufs_free
	movq	%rbx, %rdi
	callq	_hfi_session_deinit
	cmpq	$0, 8(%rbx)
	je	LBB0_1
LBB0_3:
	movq	%rbx, %rdi
	callq	_hfi_session_abort
LBB0_4:
	movq	%rbx, %rdi
	callq	_venus_helper_free_dpb_bufs
	movq	%r14, %rdi
	callq	_venus_helper_load_scale_clocks
	leaq	4(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_1:
	testl	%eax, %eax
	sete	%cl
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	addl	%eax, %edx
	sete	%al
	cmpq	$0, (%r14)
	jne	LBB0_3
## %bb.2:
	orb	%al, %cl
	jne	LBB0_4
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_VENUS_DEC_STATE_DEINIT,4,2     ## @VENUS_DEC_STATE_DEINIT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_vdec_session_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdec_session_release
_vdec_session_release:                  ; @vdec_session_release
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #24]
	bl	_mutex_lock
Lloh0:
	adrp	x8, _VENUS_DEC_STATE_DEINIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VENUS_DEC_STATE_DEINIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_hfi_session_stop
	mov	x0, x19
	bl	_hfi_session_unload_res
	mov	x0, x19
	bl	_venus_helper_unregister_bufs
	mov	x0, x19
	bl	_venus_helper_intbufs_free
	mov	x0, x19
	bl	_hfi_session_deinit
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
LBB0_1:
	mov	x0, x19
	bl	_hfi_session_abort
LBB0_2:
	mov	x0, x19
	bl	_venus_helper_free_dpb_bufs
	mov	x0, x20
	bl	_venus_helper_load_scale_clocks
	add	x0, x19, #4
	bl	_INIT_LIST_HEAD
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mutex_unlock
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	ccmp	w0, #0, #4, ne
	cset	w8, eq
	ldr	x9, [x20]
	cbnz	x9, LBB0_1
; %bb.4:
	tbnz	w8, #0, LBB0_2
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_VENUS_DEC_STATE_DEINIT,4,2     ; @VENUS_DEC_STATE_DEINIT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_vdec_session_release
.subsections_via_symbols
