	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qsv_frame_lock
_qsv_frame_lock:                        ## @qsv_frame_lock
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rsi)
	je	LBB0_2
## %bb.1:
	movq	_MFX_ERR_UNDEFINED_BEHAVIOR@GOTPCREL(%rip), %r15
	jmp	LBB0_9
LBB0_2:
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	32(%rsi), %rax
	movq	(%rax), %r13
	movq	16(%r13), %r12
	xorl	%eax, %eax
	callq	_av_frame_alloc
	movq	%rax, (%rbx)
	movq	_MFX_ERR_MEMORY_ALLOC@GOTPCREL(%rip), %r15
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movl	8(%r13), %ecx
	movl	%ecx, 40(%rax)
	xorl	%eax, %eax
	callq	_av_frame_alloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	leaq	20(%rbx), %rcx
	movq	(%rax), %rax
	movq	%rcx, 24(%rax)
	movq	_AV_PIX_FMT_QSV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%rbx), %rcx
	movl	%eax, 40(%rcx)
	movl	$1, %edi
	callq	_av_buffer_alloc
	movq	8(%rbx), %rcx
	movq	32(%rcx), %rdx
	movl	%eax, (%rdx)
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	movl	4(%r13), %eax
	movl	%eax, 24(%rcx)
	movl	(%r13), %eax
	movl	%eax, 20(%rcx)
	movq	32(%rbx), %rdi
	callq	_av_buffer_ref
	movq	8(%rbx), %rsi
	movl	%eax, 16(%rsi)
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movq	(%r12), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	16(%rbx), %eax
	movl	%eax, 20(%rbx)
	movq	(%rbx), %rdi
	movq	_AV_HWFRAME_MAP_DIRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_av_hwframe_map
	testl	%eax, %eax
	js	LBB0_8
## %bb.7:
	movq	(%rbx), %rax
	movq	8(%rax), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%r14)
	movq	(%rax), %rax
	movq	(%rax), %rcx
	movq	%rcx, 16(%r14)
	movq	8(%rax), %rcx
	movq	%rcx, 8(%r14)
	movq	8(%rax), %rax
	addq	$4, %rax
	movq	%rax, (%r14)
	movq	_MFX_ERR_NONE@GOTPCREL(%rip), %r15
	jmp	LBB0_9
LBB0_8:
	leaq	8(%rbx), %rdi
	callq	_av_frame_free
	movq	%rbx, %rdi
	callq	_av_frame_free
LBB0_9:
	movl	(%r15), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MFX_ERR_UNDEFINED_BEHAVIOR,4,2 ## @MFX_ERR_UNDEFINED_BEHAVIOR
	.comm	_MFX_ERR_MEMORY_ALLOC,4,2       ## @MFX_ERR_MEMORY_ALLOC
	.comm	_AV_PIX_FMT_QSV,4,2             ## @AV_PIX_FMT_QSV
	.comm	_AV_HWFRAME_MAP_DIRECT,4,2      ## @AV_HWFRAME_MAP_DIRECT
	.comm	_MFX_ERR_NONE,4,2               ## @MFX_ERR_NONE
	.no_dead_strip	_qsv_frame_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qsv_frame_lock
_qsv_frame_lock:                        ; @qsv_frame_lock
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	x8, [x1]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _MFX_ERR_UNDEFINED_BEHAVIOR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MFX_ERR_UNDEFINED_BEHAVIOR@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
	mov	x19, x2
	mov	x20, x1
	ldr	x8, [x1, #32]
	ldr	x23, [x8]
	ldr	x22, [x23, #16]
	bl	_av_frame_alloc
	str	x0, [x20]
	cbz	x0, LBB0_9
; %bb.3:
	ldr	w8, [x23, #8]
	str	w8, [x0, #40]
	bl	_av_frame_alloc
	mov	x21, x20
	str	x0, [x21, #8]!
	cbz	x0, LBB0_8
; %bb.4:
	add	x8, x20, #20
	ldr	x9, [x0]
	str	x8, [x9, #24]
Lloh2:
	adrp	x8, _AV_PIX_FMT_QSV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_PIX_FMT_QSV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	x9, [x20, #8]
	str	w8, [x9, #40]
	mov	w0, #1
	bl	_av_buffer_alloc
	ldr	x8, [x20, #8]
	ldr	x9, [x8, #32]
	str	w0, [x9]
	cbz	w0, LBB0_8
; %bb.5:
	ldr	d0, [x23]
	stur	d0, [x8, #20]
	ldr	x0, [x20, #32]
	bl	_av_buffer_ref
	ldr	x1, [x20, #8]
	str	w0, [x1, #16]
	cbz	w0, LBB0_8
; %bb.6:
	ldr	x8, [x22]
	ldr	w8, [x8]
	ldr	w9, [x20, #16]
	stp	w9, w8, [x20, #20]
	ldr	x0, [x20]
Lloh5:
	adrp	x8, _AV_HWFRAME_MAP_DIRECT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_HWFRAME_MAP_DIRECT@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_av_hwframe_map
	tbnz	w0, #31, LBB0_8
; %bb.7:
	ldr	x8, [x20]
	ldp	x8, x9, [x8]
	ldr	w9, [x9]
	str	w9, [x19, #24]
	ldr	x9, [x8]
	str	x9, [x19, #16]
	ldr	x9, [x8, #8]
	str	x9, [x19, #8]
	ldr	x8, [x8, #8]
	add	x8, x8, #4
	str	x8, [x19]
Lloh8:
	adrp	x8, _MFX_ERR_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MFX_ERR_NONE@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	mov	x0, x21
	bl	_av_frame_free
	mov	x0, x20
	bl	_av_frame_free
LBB0_9:
Lloh10:
	adrp	x8, _MFX_ERR_MEMORY_ALLOC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MFX_ERR_MEMORY_ALLOC@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MFX_ERR_UNDEFINED_BEHAVIOR,4,2 ; @MFX_ERR_UNDEFINED_BEHAVIOR
	.comm	_MFX_ERR_MEMORY_ALLOC,4,2       ; @MFX_ERR_MEMORY_ALLOC
	.comm	_AV_PIX_FMT_QSV,4,2             ; @AV_PIX_FMT_QSV
	.comm	_AV_HWFRAME_MAP_DIRECT,4,2      ; @AV_HWFRAME_MAP_DIRECT
	.comm	_MFX_ERR_NONE,4,2               ; @MFX_ERR_NONE
	.no_dead_strip	_qsv_frame_lock
.subsections_via_symbols
