	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vaapi_encode_free
_vaapi_encode_free:                     ## @vaapi_encode_free
	.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	%rsi, %r15
	cmpq	$0, 64(%rsi)
	je	LBB0_2
## %bb.1:
	movq	%r15, %rsi
	callq	_vaapi_encode_discard
LBB0_2:
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	movl	$8, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r14
	movslq	%eax, %rcx
	addq	$16, %rbx
	cmpq	%rcx, %r14
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	40(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	%rbx, %rdi
	callq	_av_freep
	movq	40(%r15), %rax
	leaq	(%rax,%rbx), %rdi
	addq	$-8, %rdi
	callq	_av_freep
	movl	(%r15), %eax
	jmp	LBB0_6
LBB0_7:
	leaq	24(%r15), %r14
	movq	%r14, %rdi
	callq	_av_freep
	leaq	60(%r15), %rdi
	callq	_av_frame_free
	leaq	56(%r15), %rdi
	callq	_av_frame_free
	leaq	48(%r15), %rdi
	callq	_av_freep
	leaq	40(%r15), %rdi
	callq	_av_freep
	movq	8(%r15), %rax
	movq	_VA_INVALID_ID@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_av_assert0
	leaq	32(%r15), %rdi
	callq	_av_freep
	movq	%r14, %rdi
	callq	_av_freep
	leaq	16(%r15), %rdi
	callq	_av_freep
	movq	%r15, %rdi
	callq	_av_free
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VA_INVALID_ID,8,3              ## @VA_INVALID_ID
	.no_dead_strip	_vaapi_encode_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vaapi_encode_free
_vaapi_encode_free:                     ; @vaapi_encode_free
	.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	x19, x1
	ldr	x8, [x1, #64]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x1, x19
	bl	_vaapi_encode_discard
LBB0_2:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x20, #0
	mov	w21, #8
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x20, x20, #1
	add	x21, x21, #16
	cmp	x20, w8, sxtw
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #40]
	cbz	x9, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x0, x9, x21
	bl	_av_freep
	ldr	x8, [x19, #40]
	add	x8, x8, x21
	sub	x0, x8, #8
	bl	_av_freep
	ldr	w8, [x19]
	b	LBB0_4
LBB0_7:
	add	x20, x19, #24
	mov	x0, x20
	bl	_av_freep
	add	x0, x19, #60
	bl	_av_frame_free
	add	x0, x19, #56
	bl	_av_frame_free
	add	x0, x19, #48
	bl	_av_freep
	add	x0, x19, #40
	bl	_av_freep
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _VA_INVALID_ID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VA_INVALID_ID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_av_assert0
	add	x0, x19, #32
	bl	_av_freep
	mov	x0, x20
	bl	_av_freep
	add	x0, x19, #16
	bl	_av_freep
	mov	x0, x19
	bl	_av_free
	mov	w0, #0
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_VA_INVALID_ID,8,3              ; @VA_INVALID_ID
	.no_dead_strip	_vaapi_encode_free
.subsections_via_symbols
