	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvdec_decoder_create
_nvdec_decoder_create:                  ## @nvdec_decoder_create
	.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	%rcx, %r12
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	(%rax), %r14
	movl	$40, %edi
	callq	_av_mallocz
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	%rax, %rbx
	movq	_nvdec_decoder_free@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AV_BUFFER_FLAG_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	movl	$40, %esi
	xorl	%ecx, %ecx
	callq	_av_buffer_create
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%r13, %rdi
	callq	_av_buffer_ref
	movl	%eax, 32(%rbx)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	16(%r14), %eax
	movl	%eax, 24(%rbx)
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movl	(%r14), %eax
	movq	-56(%rbp), %r13
	movl	%eax, 28(%r13)
	leaq	16(%r13), %rdi
	movq	%r12, %rsi
	callq	_cuvid_load_functions
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	(%r13), %rax
	movl	24(%r13), %edi
	callq	*8(%rax)
	movl	%eax, %edi
	callq	_CHECK_CU
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_nvdec_test_capabilities
	testl	%eax, %eax
	js	LBB0_10
## %bb.12:
	movq	16(%r13), %rax
	leaq	8(%r13), %rdi
	movq	%r15, %rsi
	callq	*(%rax)
	movl	%eax, %edi
	callq	_CHECK_CU
	movl	%eax, %ebx
	movq	(%r13), %rax
	leaq	-44(%rbp), %rdi
	callq	*(%rax)
	movl	%eax, %edi
	callq	_CHECK_CU
	testl	%ebx, %ebx
	js	LBB0_11
## %bb.13:
	movq	-64(%rbp), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_2:
	leaq	-56(%rbp), %rdi
	callq	_av_freep
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_6:
	movl	%eax, %ebx
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	jmp	LBB0_11
LBB0_8:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_10:
	movl	%eax, %ebx
	movq	(%r13), %rax
	leaq	-44(%rbp), %rdi
	callq	*(%rax)
	movl	%eax, %edi
	callq	_CHECK_CU
LBB0_11:
	leaq	-64(%rbp), %rdi
	callq	_av_buffer_unref
LBB0_14:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_nvdec_decoder_free,4,2         ## @nvdec_decoder_free
	.comm	_AV_BUFFER_FLAG_READONLY,4,2    ## @AV_BUFFER_FLAG_READONLY
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed loading nvcuvid.\n"

	.no_dead_strip	_nvdec_decoder_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvdec_decoder_create
_nvdec_decoder_create:                  ; @nvdec_decoder_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x8, [x1]
	ldr	x24, [x8]
	mov	w0, #40
	bl	_av_mallocz
	str	x0, [sp, #16]
	cbz	x0, LBB0_8
; %bb.1:
	mov	x22, x0
Lloh0:
	adrp	x8, _nvdec_decoder_free@GOTPAGE
Lloh1:
	ldr	x8, [x8, _nvdec_decoder_free@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _AV_BUFFER_FLAG_READONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_BUFFER_FLAG_READONLY@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	mov	w1, #40
	mov	x3, #0
	bl	_av_buffer_create
	str	x0, [sp, #24]
	cbz	x0, LBB0_9
; %bb.2:
	mov	x0, x23
	bl	_av_buffer_ref
	str	w0, [x22, #32]
	cbz	w0, LBB0_10
; %bb.3:
	ldr	w8, [x24, #16]
	str	w8, [x22, #24]
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
	str	x8, [x22]
	ldr	w8, [x24]
	ldr	x23, [sp, #16]
	str	w8, [x23, #28]
	add	x0, x23, #16
	mov	x1, x21
	bl	_cuvid_load_functions
	tbnz	w0, #31, LBB0_11
; %bb.4:
	ldr	x8, [x23]
	ldr	x8, [x8, #8]
	ldr	w0, [x23, #24]
	blr	x8
	bl	_CHECK_CU
	tbnz	w0, #31, LBB0_12
; %bb.5:
	mov	x0, x23
	mov	x1, x20
	mov	x2, x21
	bl	_nvdec_test_capabilities
	tbnz	w0, #31, LBB0_13
; %bb.6:
	ldr	x8, [x23, #16]
	ldr	x8, [x8]
	add	x0, x23, #8
	mov	x1, x20
	blr	x8
	bl	_CHECK_CU
	mov	x22, x0
	ldr	x8, [x23]
	ldr	x8, [x8]
	add	x0, sp, #12
	blr	x8
	bl	_CHECK_CU
	tbnz	w22, #31, LBB0_14
; %bb.7:
	mov	w22, #0
	ldr	x8, [sp, #24]
	str	x8, [x19]
	b	LBB0_15
LBB0_8:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_AVERROR
LBB0_9:
	add	x0, sp, #16
	bl	_av_freep
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x22, x0
	b	LBB0_15
LBB0_10:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x22, x0
	b	LBB0_14
LBB0_11:
	mov	x22, x0
Lloh15:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x2, l_.str@PAGE
Lloh19:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_av_log
	b	LBB0_14
LBB0_12:
	mov	x22, x0
	b	LBB0_14
LBB0_13:
	mov	x22, x0
	ldr	x8, [x23]
	ldr	x8, [x8]
	add	x0, sp, #12
	blr	x8
	bl	_CHECK_CU
LBB0_14:
	add	x0, sp, #24
	bl	_av_buffer_unref
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_nvdec_decoder_free,4,2         ; @nvdec_decoder_free
	.comm	_AV_BUFFER_FLAG_READONLY,4,2    ; @AV_BUFFER_FLAG_READONLY
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed loading nvcuvid.\n"

	.no_dead_strip	_nvdec_decoder_create
.subsections_via_symbols
