	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qsv_init                       ## -- Begin function qsv_init
	.p2align	4, 0x90
_qsv_init:                              ## @qsv_init
	.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	%rdi, %r12
	movq	24(%rdi), %r14
	movq	_hw_device_ctx@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jne	LBB0_3
## %bb.1:
	movq	%r14, %rdi
	callq	_qsv_device_init
	testl	%eax, %eax
	js	LBB0_2
LBB0_3:
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_av_buffer_unref
	movl	(%r13), %edi
	callq	_av_hwframe_ctx_alloc
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	(%rax), %rbx
	movq	32(%rbx), %r13
	movl	16(%r12), %edi
	movl	$32, %esi
	callq	_FFALIGN
	movq	%rax, 24(%rbx)
	movl	12(%r12), %edi
	movl	$32, %esi
	callq	_FFALIGN
	movq	%rax, 16(%rbx)
	movq	_AV_PIX_FMT_QSV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movl	8(%r12), %eax
	movl	%eax, 8(%rbx)
	movq	(%r12), %rax
	addq	$64, %rax
	movq	%rax, (%rbx)
	movq	_MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movq	(%r15), %rdi
	callq	_av_hwframe_ctx_init
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	_qsv_get_buffer@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_qsv_uninit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_8:
	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_5:
	movl	%eax, %ebx
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%edi, %edi
	callq	_av_log
	jmp	LBB0_7
LBB0_2:
	movl	%eax, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hw_device_ctx,4,2              ## @hw_device_ctx
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_PIX_FMT_QSV,4,2             ## @AV_PIX_FMT_QSV
	.comm	_MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET,4,2 ## @MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error initializing a QSV frame pool\n"

	.comm	_qsv_get_buffer,4,2             ## @qsv_get_buffer
	.comm	_qsv_uninit,4,2                 ## @qsv_uninit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qsv_init                       ; -- Begin function qsv_init
	.p2align	2
_qsv_init:                              ; @qsv_init
	.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	x20, x0
	ldr	x19, [x0, #24]
Lloh0:
	adrp	x22, _hw_device_ctx@GOTPAGE
Lloh1:
	ldr	x22, [x22, _hw_device_ctx@GOTPAGEOFF]
	ldr	w8, [x22]
	cbnz	w8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_qsv_device_init
	tbnz	w0, #31, LBB0_7
LBB0_2:
	add	x21, x19, #8
	mov	x0, x21
	bl	_av_buffer_unref
	ldr	w0, [x22]
	bl	_av_hwframe_ctx_alloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x22, [x0]
	ldr	x23, [x22, #32]
	ldr	w0, [x20, #16]
	mov	w1, #32
	bl	_FFALIGN
	str	x0, [x22, #24]
	ldr	w0, [x20, #12]
	mov	w1, #32
	bl	_FFALIGN
	str	x0, [x22, #16]
Lloh2:
	adrp	x8, _AV_PIX_FMT_QSV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_PIX_FMT_QSV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	stp	w9, w8, [x22, #8]
	ldr	x8, [x20]
	add	x8, x8, #64
	str	x8, [x22]
Lloh5:
	adrp	x8, _MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x23]
	ldr	x0, [x21]
	bl	_av_hwframe_ctx_init
	tbnz	w0, #31, LBB0_6
; %bb.4:
	mov	w21, #0
Lloh8:
	adrp	x8, _qsv_get_buffer@GOTPAGE
Lloh9:
	ldr	x8, [x8, _qsv_get_buffer@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _qsv_uninit@GOTPAGE
Lloh12:
	ldr	x9, [x9, _qsv_uninit@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	stp	w9, w8, [x19]
	b	LBB0_8
LBB0_5:
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_6:
	mov	x21, x0
Lloh17:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str@PAGE
Lloh21:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	bl	_av_log
	b	LBB0_8
LBB0_7:
	mov	x21, x0
LBB0_8:
	mov	x0, x21
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_hw_device_ctx,4,2              ; @hw_device_ctx
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_PIX_FMT_QSV,4,2             ; @AV_PIX_FMT_QSV
	.comm	_MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET,4,2 ; @MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error initializing a QSV frame pool\n"

	.comm	_qsv_get_buffer,4,2             ; @qsv_get_buffer
	.comm	_qsv_uninit,4,2                 ; @qsv_uninit
.subsections_via_symbols
