	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_qsv_enc_close               ## -- Begin function ff_qsv_enc_close
	.p2align	4, 0x90
_ff_qsv_enc_close:                      ## @ff_qsv_enc_close
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	56(%rsi), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_MFXVideoENCODE_Close
LBB0_2:
	movq	$0, 56(%rbx)
	leaq	48(%rbx), %rdi
	callq	_ff_qsv_close_internal_session
	leaq	40(%rbx), %r14
	leaq	44(%rbx), %rdi
	callq	_av_buffer_unref
	movq	%r14, %rdi
	callq	_av_buffer_unref
	movq	32(%rbx), %rdi
	movq	%rdi, -48(%rbp)
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.3:
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rdi), %rax
	movq	%rax, 32(%rbx)
	addq	$4, %rdi
	callq	_av_frame_free
	movq	-48(%rbp), %rax
	movl	(%rax), %edi
	callq	_av_free
	movq	%r14, %rdi
	callq	_av_freep
	movq	32(%rbx), %rdi
	movq	%rdi, -48(%rbp)
	testq	%rdi, %rdi
	jne	LBB0_4
LBB0_5:
	movq	24(%rbx), %rdi
	xorl	%r14d, %r14d
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.6:
	leaq	-72(%rbp), %r15
	leaq	-64(%rbp), %r12
	leaq	-56(%rbp), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	callq	_av_fifo_size
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	24(%rbx), %rdi
	movq	%r15, %rsi
	movl	$8, %edx
	xorl	%ecx, %ecx
	callq	_av_fifo_generic_read
	movq	24(%rbx), %rdi
	movq	%r12, %rsi
	movl	$8, %edx
	xorl	%ecx, %ecx
	callq	_av_fifo_generic_read
	movq	24(%rbx), %rdi
	movq	%r13, %rsi
	movl	$8, %edx
	xorl	%ecx, %ecx
	callq	_av_fifo_generic_read
	movq	%r12, %rdi
	callq	_av_freep
	movq	%r13, %rdi
	callq	_av_freep
	movq	%r15, %rdi
	callq	_av_packet_unref
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	jne	LBB0_7
	jmp	LBB0_10
LBB0_8:
	movq	24(%rbx), %r14
LBB0_10:
	movq	%r14, %rdi
	callq	_av_fifo_free
	movq	$0, 24(%rbx)
	leaq	16(%rbx), %rdi
	callq	_av_freep
	leaq	8(%rbx), %rdi
	callq	_av_buffer_unref
	movq	%rbx, %rdi
	callq	_av_freep
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_qsv_enc_close               ; -- Begin function ff_qsv_enc_close
	.p2align	2
_ff_qsv_enc_close:                      ; @ff_qsv_enc_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	ldr	x0, [x1, #56]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_MFXVideoENCODE_Close
LBB0_2:
	str	xzr, [x19, #56]
	add	x0, x19, #48
	bl	_ff_qsv_close_internal_session
	add	x20, x19, #40
	add	x0, x19, #44
	bl	_av_buffer_unref
	mov	x0, x20
	bl	_av_buffer_unref
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	str	x8, [sp, #24]
	cbz	x8, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x8, #8]
	str	x9, [x19, #32]
	add	x0, x8, #4
	bl	_av_frame_free
	ldr	x8, [sp, #24]
	ldr	w0, [x8]
	bl	_av_free
	add	x0, sp, #24
	bl	_av_freep
	b	LBB0_3
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	bl	_av_fifo_size
	cbz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x0, [x19, #24]
	add	x1, sp, #16
	mov	w2, #8
	mov	x3, #0
	bl	_av_fifo_generic_read
	ldr	x0, [x19, #24]
	add	x1, sp, #8
	mov	w2, #8
	mov	x3, #0
	bl	_av_fifo_generic_read
	ldr	x0, [x19, #24]
	mov	x1, sp
	mov	w2, #8
	mov	x3, #0
	bl	_av_fifo_generic_read
	add	x0, sp, #8
	bl	_av_freep
	mov	x0, sp
	bl	_av_freep
	add	x0, sp, #16
	bl	_av_packet_unref
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #24]
	cbnz	x0, LBB0_5
	b	LBB0_9
LBB0_8:
	ldr	x0, [x19, #24]
LBB0_9:
	bl	_av_fifo_free
	str	xzr, [x19, #24]
	add	x0, x19, #16
	bl	_av_freep
	add	x0, x19, #8
	bl	_av_buffer_unref
	mov	x0, x19
	bl	_av_freep
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
