	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_codec_context
_open_codec_context:                    ## @open_codec_context
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	$0, -56(%rbp)
	movq	%rdx, %rdi
	movl	%ecx, %esi
	movl	$-1, %edx
	movl	$-1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_av_find_best_stream
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movl	%r15d, %ecx
	movq	(%rax,%rcx,8), %rbx
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_avcodec_find_decoder
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_avcodec_alloc_context3
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	(%rbx), %rsi
	movq	%rax, %rdi
	callq	_avcodec_parameters_to_context
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:
	movq	_refcount@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.5(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.4(%rip), %rsi
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_av_dict_set
	movq	(%r12), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_avcodec_open2
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_av_get_media_type_string
	movq	_src_filename@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_13
LBB0_3:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_av_get_media_type_string
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_av_get_media_type_string
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_8:
	movl	%eax, %ebx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r14d, %edi
	callq	_av_get_media_type_string
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_11:
	movl	%eax, %ebx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r14d, %edi
	callq	_av_get_media_type_string
	leaq	L_.str.7(%rip), %rsi
LBB0_9:
	movl	%r15d, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movl	%ebx, %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not find %s stream in input file '%s'\n"

	.comm	_src_filename,8,3               ## @src_filename
L_.str.1:                               ## @.str.1
	.asciz	"Failed to find %s codec\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate the %s codec context\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"Failed to copy %s codec parameters to decoder context\n"

L_.str.4:                               ## @.str.4
	.asciz	"refcounted_frames"

	.comm	_refcount,8,3                   ## @refcount
L_.str.5:                               ## @.str.5
	.asciz	"1"

L_.str.6:                               ## @.str.6
	.asciz	"0"

L_.str.7:                               ## @.str.7
	.asciz	"Failed to open %s codec\n"

	.no_dead_strip	_open_codec_context
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_codec_context
_open_codec_context:                    ; @open_codec_context
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x3
	mov	x23, x2
	mov	x22, x1
	mov	x21, x0
	str	xzr, [sp, #8]
	mov	x0, x2
	mov	x1, x3
	mov	w2, #-1
	mov	w3, #-1
	mov	x4, #0
	mov	w5, #0
	bl	_av_find_best_stream
	mov	x20, x0
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	x8, [x23]
	ldr	x24, [x8, w20, uxtw #3]
	ldr	x8, [x24]
	ldr	w0, [x8]
	bl	_avcodec_find_decoder
	cbz	x0, LBB0_8
; %bb.2:
	mov	x23, x0
	bl	_avcodec_alloc_context3
	str	x0, [x22]
	cbz	x0, LBB0_9
; %bb.3:
	ldr	x1, [x24]
	bl	_avcodec_parameters_to_context
	tbnz	w0, #31, LBB0_11
; %bb.4:
Lloh0:
	adrp	x8, _refcount@GOTPAGE
Lloh1:
	ldr	x8, [x8, _refcount@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, l_.str.5@PAGE
Lloh4:
	add	x9, x9, l_.str.5@PAGEOFF
Lloh5:
	adrp	x10, l_.str.6@PAGE
Lloh6:
	add	x10, x10, l_.str.6@PAGEOFF
	cmp	x8, #0
	csel	x2, x10, x9, eq
Lloh7:
	adrp	x1, l_.str.4@PAGE
Lloh8:
	add	x1, x1, l_.str.4@PAGEOFF
	add	x0, sp, #8
	mov	w3, #0
	bl	_av_dict_set
	ldr	x0, [x22]
	add	x2, sp, #8
	mov	x1, x23
	bl	_avcodec_open2
	tbnz	w0, #31, LBB0_12
; %bb.5:
	str	w20, [x21]
	mov	w20, #0
	b	LBB0_7
LBB0_6:
Lloh9:
	adrp	x8, _stderr@GOTPAGE
Lloh10:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_av_get_media_type_string
	mov	x2, x0
Lloh12:
	adrp	x8, _src_filename@GOTPAGE
Lloh13:
	ldr	x8, [x8, _src_filename@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_fprintf
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_8:
Lloh17:
	adrp	x8, _stderr@GOTPAGE
Lloh18:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh19:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_av_get_media_type_string
	mov	x2, x0
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fprintf
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh24:
	adrp	x8, _stderr@GOTPAGE
Lloh25:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh26:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_av_get_media_type_string
	mov	x2, x0
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_fprintf
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_AVERROR
LBB0_11:
	mov	x24, x0
Lloh31:
	adrp	x8, _stderr@GOTPAGE
Lloh32:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh33:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_av_get_media_type_string
	mov	x2, x0
Lloh34:
	adrp	x1, l_.str.3@PAGE
Lloh35:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_fprintf
	mov	x20, x24
	b	LBB0_7
LBB0_12:
	mov	x22, x0
Lloh36:
	adrp	x8, _stderr@GOTPAGE
Lloh37:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh38:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_av_get_media_type_string
	mov	x2, x0
Lloh39:
	adrp	x1, l_.str.7@PAGE
Lloh40:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	bl	_fprintf
	mov	x20, x22
	b	LBB0_7
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not find %s stream in input file '%s'\n"

	.comm	_src_filename,8,3               ; @src_filename
l_.str.1:                               ; @.str.1
	.asciz	"Failed to find %s codec\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate the %s codec context\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"Failed to copy %s codec parameters to decoder context\n"

l_.str.4:                               ; @.str.4
	.asciz	"refcounted_frames"

	.comm	_refcount,8,3                   ; @refcount
l_.str.5:                               ; @.str.5
	.asciz	"1"

l_.str.6:                               ; @.str.6
	.asciz	"0"

l_.str.7:                               ; @.str.7
	.asciz	"Failed to open %s codec\n"

	.no_dead_strip	_open_codec_context
.subsections_via_symbols
