	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_input_file
_open_input_file:                       ## @open_input_file
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	$0, -40(%rbp)
	movq	_ifmt_ctx@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_avformat_open_input
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	(%r14), %rdi
	xorl	%esi, %esi
	callq	_avformat_find_stream_info
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	(%r14), %rdi
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %r8
	movl	$-1, %edx
	movl	$-1, %ecx
	xorl	%r9d, %r9d
	callq	_av_find_best_stream
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	%r15d, %eax
	movq	_video_stream@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	-40(%rbp), %rdi
	callq	_avcodec_alloc_context3
	movq	_decoder_ctx@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	(%r14), %rcx
	movq	(%rcx), %rcx
	movq	(%rbx), %rdx
	movq	(%rcx,%rdx,8), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_avcodec_parameters_to_context
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movq	_hw_device_ctx@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_av_buffer_ref
	movq	(%r12), %rdi
	movl	%eax, 4(%rdi)
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movq	_get_vaapi_format@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdi)
	movq	-40(%rbp), %rsi
	xorl	%edx, %edx
	callq	_avcodec_open2
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_15
## %bb.13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_av_err2str
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_14
LBB0_1:
	movl	%eax, %r15d
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r15d, %edi
	callq	_av_err2str
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movq	%rbx, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_15
LBB0_3:
	movl	%eax, %r15d
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_av_err2str
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_14
LBB0_5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_av_err2str
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_14
LBB0_9:
	movl	%eax, %r15d
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_av_err2str
	leaq	L_.str.3(%rip), %rsi
LBB0_14:
	movl	%ebx, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_15
LBB0_11:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r15d
LBB0_15:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ifmt_ctx,8,3                   ## @ifmt_ctx
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot open input file '%s', Error code: %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot find input stream information. Error code: %s\n"

	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ## @AVMEDIA_TYPE_VIDEO
L_.str.2:                               ## @.str.2
	.asciz	"Cannot find a video stream in the input file. Error code: %s\n"

	.comm	_video_stream,8,3               ## @video_stream
	.comm	_decoder_ctx,8,3                ## @decoder_ctx
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"avcodec_parameters_to_context error. Error code: %s\n"

	.comm	_hw_device_ctx,4,2              ## @hw_device_ctx
L_.str.4:                               ## @.str.4
	.asciz	"A hardware device reference create failed.\n"

	.comm	_get_vaapi_format,4,2           ## @get_vaapi_format
L_.str.5:                               ## @.str.5
	.asciz	"Failed to open codec for decoding. Error code: %s\n"

	.no_dead_strip	_open_input_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_input_file
_open_input_file:                       ; @open_input_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x0
	str	xzr, [sp, #24]
Lloh0:
	adrp	x20, _ifmt_ctx@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ifmt_ctx@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x21
	mov	x2, #0
	mov	x3, #0
	bl	_avformat_open_input
	tbnz	w0, #31, LBB0_8
; %bb.1:
	ldr	x0, [x20]
	mov	x1, #0
	bl	_avformat_find_stream_info
	tbnz	w0, #31, LBB0_9
; %bb.2:
	ldr	x0, [x20]
Lloh2:
	adrp	x8, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x4, sp, #24
	mov	w2, #-1
	mov	w3, #-1
	mov	w5, #0
	bl	_av_find_best_stream
	mov	x19, x0
	tbnz	w0, #31, LBB0_10
; %bb.3:
	mov	w8, w19
Lloh5:
	adrp	x19, _video_stream@GOTPAGE
Lloh6:
	ldr	x19, [x19, _video_stream@GOTPAGEOFF]
	str	x8, [x19]
	ldr	x0, [sp, #24]
	bl	_avcodec_alloc_context3
Lloh7:
	adrp	x21, _decoder_ctx@GOTPAGE
Lloh8:
	ldr	x21, [x21, _decoder_ctx@GOTPAGEOFF]
	str	x0, [x21]
	cbz	x0, LBB0_15
; %bb.4:
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x9, [x19]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w1, [x8]
	bl	_avcodec_parameters_to_context
	tbnz	w0, #31, LBB0_11
; %bb.5:
Lloh9:
	adrp	x8, _hw_device_ctx@GOTPAGE
Lloh10:
	ldr	x8, [x8, _hw_device_ctx@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_av_buffer_ref
	mov	x8, x0
	ldr	x0, [x21]
	str	w8, [x0, #4]
	cbz	w8, LBB0_14
; %bb.6:
Lloh12:
	adrp	x8, _get_vaapi_format@GOTPAGE
Lloh13:
	ldr	x8, [x8, _get_vaapi_format@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x0]
	ldr	x1, [sp, #24]
	mov	x2, #0
	bl	_avcodec_open2
	mov	x19, x0
	tbz	w0, #31, LBB0_13
; %bb.7:
Lloh15:
	adrp	x8, _stderr@GOTPAGE
Lloh16:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh17:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_av_err2str
	str	x0, [sp]
Lloh18:
	adrp	x1, l_.str.5@PAGE
Lloh19:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_12
LBB0_8:
	mov	x19, x0
Lloh20:
	adrp	x8, _stderr@GOTPAGE
Lloh21:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh22:
	ldr	w20, [x8]
	bl	_av_err2str
	stp	x21, x0, [sp]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_12
LBB0_9:
	mov	x19, x0
Lloh25:
	adrp	x8, _stderr@GOTPAGE
Lloh26:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh27:
	ldr	w20, [x8]
	bl	_av_err2str
	str	x0, [sp]
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_10:
Lloh30:
	adrp	x8, _stderr@GOTPAGE
Lloh31:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh32:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_av_err2str
	str	x0, [sp]
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_11:
	mov	x19, x0
Lloh35:
	adrp	x8, _stderr@GOTPAGE
Lloh36:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh37:
	ldr	w20, [x8]
	bl	_av_err2str
	str	x0, [sp]
Lloh38:
	adrp	x1, l_.str.3@PAGE
Lloh39:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_fprintf
LBB0_13:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
LBB0_14:
Lloh40:
	adrp	x8, _stderr@GOTPAGE
Lloh41:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh42:
	ldr	w0, [x8]
Lloh43:
	adrp	x1, l_.str.4@PAGE
Lloh44:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
LBB0_15:
Lloh45:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x19, x0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_ifmt_ctx,8,3                   ; @ifmt_ctx
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot open input file '%s', Error code: %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot find input stream information. Error code: %s\n"

	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ; @AVMEDIA_TYPE_VIDEO
l_.str.2:                               ; @.str.2
	.asciz	"Cannot find a video stream in the input file. Error code: %s\n"

	.comm	_video_stream,8,3               ; @video_stream
	.comm	_decoder_ctx,8,3                ; @decoder_ctx
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"avcodec_parameters_to_context error. Error code: %s\n"

	.comm	_hw_device_ctx,4,2              ; @hw_device_ctx
l_.str.4:                               ; @.str.4
	.asciz	"A hardware device reference create failed.\n"

	.comm	_get_vaapi_format,4,2           ; @get_vaapi_format
l_.str.5:                               ; @.str.5
	.asciz	"Failed to open codec for decoding. Error code: %s\n"

	.no_dead_strip	_open_input_file
.subsections_via_symbols
