	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qsv_init_session
_qsv_init_session:                      ## @qsv_init_session
	.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
	movq	%r8, %r12
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	_MFX_GPUCOPY_ON@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_MFX_IOPATTERN_OUT_SYSTEM_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	je	LBB0_9
LBB0_2:
	testq	%rbx, %rbx
	jne	LBB0_15
LBB0_3:
	testq	%r13, %r13
	je	LBB0_10
## %bb.4:
	leaq	24(%r15), %rbx
	movq	24(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_MFXClose
	movq	$0, (%rbx)
LBB0_6:
	leaq	36(%r15), %r12
	movq	%r12, %rdi
	callq	_av_buffer_unref
	movq	%r13, %rdi
	callq	_av_buffer_ref
	movl	%eax, 36(%r15)
	testl	%eax, %eax
	je	LBB0_17
## %bb.7:
	movl	32(%r15), %ecx
	movl	8(%r15), %eax
	movq	_MFX_IOPATTERN_OUT_OPAQUE_MEMORY@GOTPCREL(%rip), %rdx
	xorl	%r8d, %r8d
	cmpl	(%rdx), %eax
	sete	%r8b
	movq	(%r15), %r9
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_ff_qsv_init_session_frames
	movq	%rbx, %r13
	testl	%eax, %eax
	jns	LBB0_14
## %bb.8:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_av_buffer_unref
	jmp	LBB0_16
LBB0_9:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	testq	%rbx, %rbx
	jne	LBB0_15
	jmp	LBB0_3
LBB0_10:
	testq	%r12, %r12
	je	LBB0_18
## %bb.11:
	leaq	24(%r15), %r13
	movq	24(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:
	callq	_MFXClose
	movq	$0, (%r13)
LBB0_13:
	movl	32(%r15), %ecx
	movq	(%r15), %r8
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_ff_qsv_init_session_device
	testl	%eax, %eax
	js	LBB0_21
LBB0_14:
	movq	(%r13), %rbx
LBB0_15:
	movq	%rbx, 16(%r15)
	movq	%rbx, %rdi
	callq	_MFXVideoDECODE_Close
	xorl	%ebx, %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_18:
	movq	24(%r15), %rbx
	testq	%rbx, %rbx
	jne	LBB0_15
## %bb.19:
	leaq	24(%r15), %r13
	movl	32(%r15), %edx
	movq	(%r15), %rcx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_ff_qsv_init_internal_session
	testl	%eax, %eax
	jns	LBB0_14
LBB0_21:
	movl	%eax, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_MFX_GPUCOPY_ON,8,3             ## @MFX_GPUCOPY_ON
	.comm	_MFX_IOPATTERN_OUT_SYSTEM_MEMORY,4,2 ## @MFX_IOPATTERN_OUT_SYSTEM_MEMORY
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPU-accelerated memory copy only works in MFX_IOPATTERN_OUT_SYSTEM_MEMORY.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MFX_IOPATTERN_OUT_OPAQUE_MEMORY,4,2 ## @MFX_IOPATTERN_OUT_OPAQUE_MEMORY
	.no_dead_strip	_qsv_init_session
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qsv_init_session
_qsv_init_session:                      ; @qsv_init_session
	.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
	mov	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _MFX_GPUCOPY_ON@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MFX_GPUCOPY_ON@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _MFX_IOPATTERN_OUT_SYSTEM_MEMORY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MFX_IOPATTERN_OUT_SYSTEM_MEMORY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
LBB0_2:
	cbnz	x24, LBB0_15
LBB0_3:
	mov	x21, x19
	cbz	x23, LBB0_10
; %bb.4:
	ldr	x0, [x21, #24]!
	cbz	x0, LBB0_6
; %bb.5:
	bl	_MFXClose
	str	xzr, [x21]
LBB0_6:
	add	x22, x19, #36
	mov	x0, x22
	bl	_av_buffer_unref
	mov	x0, x23
	bl	_av_buffer_ref
	str	w0, [x19, #36]
	cbz	w0, LBB0_17
; %bb.7:
	ldr	w3, [x19, #32]
	ldr	w8, [x19, #8]
Lloh6:
	adrp	x9, _MFX_IOPATTERN_OUT_OPAQUE_MEMORY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MFX_IOPATTERN_OUT_OPAQUE_MEMORY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w4, eq
	ldr	x5, [x19]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_ff_qsv_init_session_frames
	tbz	w0, #31, LBB0_14
; %bb.8:
	mov	x20, x0
	mov	x0, x22
	bl	_av_buffer_unref
	b	LBB0_16
LBB0_9:
Lloh9:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
	cbnz	x24, LBB0_15
	b	LBB0_3
LBB0_10:
	cbz	x22, LBB0_18
; %bb.11:
	ldr	x0, [x21, #24]!
	cbz	x0, LBB0_13
; %bb.12:
	bl	_MFXClose
	str	xzr, [x21]
LBB0_13:
	ldr	w3, [x19, #32]
	ldr	x4, [x19]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_ff_qsv_init_session_device
	tbnz	w0, #31, LBB0_20
LBB0_14:
	ldr	x24, [x21]
LBB0_15:
	str	x24, [x19, #16]
	mov	x0, x24
	bl	_MFXVideoDECODE_Close
	mov	w20, #0
LBB0_16:
	mov	x0, x20
	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
LBB0_17:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	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
	b	_AVERROR
LBB0_18:
	ldr	x24, [x21, #24]!
	cbnz	x24, LBB0_15
; %bb.19:
	ldr	w2, [x19, #32]
	ldr	x3, [x19]
	mov	x0, x20
	mov	x1, x21
	bl	_ff_qsv_init_internal_session
	tbz	w0, #31, LBB0_14
LBB0_20:
	mov	x20, x0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MFX_GPUCOPY_ON,8,3             ; @MFX_GPUCOPY_ON
	.comm	_MFX_IOPATTERN_OUT_SYSTEM_MEMORY,4,2 ; @MFX_IOPATTERN_OUT_SYSTEM_MEMORY
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPU-accelerated memory copy only works in MFX_IOPATTERN_OUT_SYSTEM_MEMORY.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MFX_IOPATTERN_OUT_OPAQUE_MEMORY,4,2 ; @MFX_IOPATTERN_OUT_OPAQUE_MEMORY
	.no_dead_strip	_qsv_init_session
.subsections_via_symbols
