	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	movq	%rsi, %r12
	cmpl	$4, %edi
	jne	LBB0_1
## %bb.3:
	movq	_AV_HWDEVICE_TYPE_VAAPI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_hw_device_ctx@GOTPCREL(%rip), %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_av_hwdevice_ctx_create
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	8(%r12), %rdi
	callq	_open_input_file
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	16(%r12), %rdi
	callq	_avcodec_find_encoder_by_name
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r15
	movq	24(%r12), %rcx
	movq	_ofmt_ctx@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_avformat_alloc_output_context2
	testl	%eax, %eax
	js	LBB0_10
## %bb.12:
	movq	%r15, %rdi
	callq	_avcodec_alloc_context3
	movq	_encoder_ctx@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:
	movq	(%r14), %rdi
	movq	24(%r12), %rsi
	movq	_AVIO_FLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_avio_open
	testl	%eax, %eax
	js	LBB0_23
## %bb.15:
	movq	_ifmt_ctx@GOTPCREL(%rip), %r13
	leaq	-64(%rbp), %r12
	movq	_video_stream@GOTPCREL(%rip), %r14
	jmp	LBB0_16
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12), %rdx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	%r12, %rdi
	callq	_av_packet_unref
	testl	%ebx, %ebx
	js	LBB0_20
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	movq	%r12, %rsi
	callq	_av_read_frame
	testl	%eax, %eax
	js	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%eax, %ebx
	movq	(%r14), %rax
	cmpq	-64(%rbp), %rax
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_dec_enc
	movl	%eax, %ebx
	jmp	LBB0_19
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%eax, %edi
	callq	_av_err2str
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
LBB0_2:
	callq	_fprintf
	movl	$-1, %ebx
	jmp	LBB0_22
LBB0_6:
	movl	%eax, %ebx
	jmp	LBB0_21
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%r12), %rdx
	leaq	L_.str.2(%rip), %rsi
	callq	_fprintf
	movl	$-1, %ebx
	jmp	LBB0_21
LBB0_10:
	movl	%eax, %ebx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_av_err2str
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_11
LBB0_20:
	xorps	%xmm0, %xmm0
	movups	%xmm0, -56(%rbp)
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_dec_enc
	movq	%rbx, %rdi
	callq	_av_packet_unref
	xorl	%edi, %edi
	callq	_encode_write
	movl	%eax, %ebx
	movq	_ofmt_ctx@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_av_write_trailer
	jmp	LBB0_21
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	jmp	LBB0_21
LBB0_23:
	movl	%eax, %ebx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_av_err2str
	leaq	L_.str.4(%rip), %rsi
LBB0_11:
	movl	%r14d, %edi
	movq	%rax, %rdx
	callq	_fprintf
LBB0_21:
	movq	_ifmt_ctx@GOTPCREL(%rip), %rdi
	callq	_avformat_close_input
	movq	_ofmt_ctx@GOTPCREL(%rip), %rdi
	callq	_avformat_close_input
	movq	_decoder_ctx@GOTPCREL(%rip), %rdi
	callq	_avcodec_free_context
	movq	_encoder_ctx@GOTPCREL(%rip), %rdi
	callq	_avcodec_free_context
	movq	_hw_device_ctx@GOTPCREL(%rip), %rdi
	callq	_av_buffer_unref
LBB0_22:
	movl	%ebx, %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	"Usage: %s <input file> <encode codec> <output file>\nThe output format is guessed according to the file extension.\n\n"

	.comm	_hw_device_ctx,4,2              ## @hw_device_ctx
	.comm	_AV_HWDEVICE_TYPE_VAAPI,4,2     ## @AV_HWDEVICE_TYPE_VAAPI
L_.str.1:                               ## @.str.1
	.asciz	"Failed to create a VAAPI device. Error code: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"Could not find encoder '%s'\n"

	.comm	_ofmt_ctx,8,3                   ## @ofmt_ctx
L_.str.3:                               ## @.str.3
	.asciz	"Failed to deduce output format from file extension. Error code: %s\n"

	.comm	_encoder_ctx,4,2                ## @encoder_ctx
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVIO_FLAG_WRITE,4,2            ## @AVIO_FLAG_WRITE
L_.str.4:                               ## @.str.4
	.asciz	"Cannot open output file. Error code: %s\n"

	.comm	_ifmt_ctx,8,3                   ## @ifmt_ctx
	.comm	_video_stream,8,3               ## @video_stream
	.comm	_decoder_ctx,4,2                ## @decoder_ctx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.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	x22, x1
	cmp	w0, #4
	b.ne	LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _AV_HWDEVICE_TYPE_VAAPI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_HWDEVICE_TYPE_VAAPI@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _hw_device_ctx@GOTPAGE
Lloh4:
	ldr	x0, [x0, _hw_device_ctx@GOTPAGEOFF]
	mov	x2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_av_hwdevice_ctx_create
	tbnz	w0, #31, LBB0_13
; %bb.2:
	ldr	x0, [x22, #8]
	bl	_open_input_file
	tbnz	w0, #31, LBB0_15
; %bb.3:
	ldr	x0, [x22, #16]
	bl	_avcodec_find_encoder_by_name
	cbz	x0, LBB0_16
; %bb.4:
	mov	x21, x0
	ldr	x3, [x22, #24]
Lloh5:
	adrp	x20, _ofmt_ctx@GOTPAGE
Lloh6:
	ldr	x20, [x20, _ofmt_ctx@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, #0
	mov	x2, #0
	bl	_avformat_alloc_output_context2
	tbnz	w0, #31, LBB0_17
; %bb.5:
	mov	x0, x21
	bl	_avcodec_alloc_context3
Lloh7:
	adrp	x8, _encoder_ctx@GOTPAGE
Lloh8:
	ldr	x8, [x8, _encoder_ctx@GOTPAGEOFF]
Lloh9:
	str	w0, [x8]
	cbz	w0, LBB0_19
; %bb.6:
	ldr	x0, [x20]
	ldr	x1, [x22, #24]
Lloh10:
	adrp	x8, _AVIO_FLAG_WRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AVIO_FLAG_WRITE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	bl	_avio_open
	tbnz	w0, #31, LBB0_20
; %bb.7:
Lloh13:
	adrp	x22, _ifmt_ctx@GOTPAGE
Lloh14:
	ldr	x22, [x22, _ifmt_ctx@GOTPAGEOFF]
Lloh15:
	adrp	x23, _video_stream@GOTPAGE
Lloh16:
	ldr	x23, [x23, _video_stream@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh17:
	adrp	x8, _stderr@GOTPAGE
Lloh18:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	x2, [x22]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x0, sp, #8
	bl	_av_packet_unref
	tbnz	w19, #31, LBB0_18
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	add	x1, sp, #8
	bl	_av_read_frame
	tbnz	w0, #31, LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x19, x0
	ldr	x8, [x23]
	ldr	x9, [sp, #8]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x0, sp, #8
	mov	x1, x21
	bl	_dec_enc
	mov	x19, x0
	b	LBB0_9
LBB0_13:
Lloh22:
	adrp	x8, _stderr@GOTPAGE
Lloh23:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh24:
	ldr	w19, [x8]
	bl	_av_err2str
	mov	x2, x0
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
LBB0_14:
	bl	_fprintf
	mov	w19, #-1
	b	LBB0_23
LBB0_15:
	mov	x19, x0
	b	LBB0_22
LBB0_16:
Lloh27:
	adrp	x8, _stderr@GOTPAGE
Lloh28:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	ldr	x2, [x22, #16]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
	mov	w19, #-1
	b	LBB0_22
LBB0_17:
	mov	x19, x0
Lloh32:
	adrp	x8, _stderr@GOTPAGE
Lloh33:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh34:
	ldr	w20, [x8]
	bl	_av_err2str
	mov	x2, x0
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_21
LBB0_18:
	stp	xzr, xzr, [sp, #16]
	add	x0, sp, #8
	mov	x1, x21
	bl	_dec_enc
	add	x0, sp, #8
	bl	_av_packet_unref
	mov	x0, #0
	bl	_encode_write
	mov	x19, x0
	ldr	x0, [x20]
	bl	_av_write_trailer
	b	LBB0_22
LBB0_19:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x19, x0
	b	LBB0_22
LBB0_20:
	mov	x19, x0
Lloh40:
	adrp	x8, _stderr@GOTPAGE
Lloh41:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh42:
	ldr	w20, [x8]
	bl	_av_err2str
	mov	x2, x0
Lloh43:
	adrp	x1, l_.str.4@PAGE
Lloh44:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_21:
	mov	x0, x20
	bl	_fprintf
LBB0_22:
Lloh45:
	adrp	x0, _ifmt_ctx@GOTPAGE
Lloh46:
	ldr	x0, [x0, _ifmt_ctx@GOTPAGEOFF]
	bl	_avformat_close_input
Lloh47:
	adrp	x0, _ofmt_ctx@GOTPAGE
Lloh48:
	ldr	x0, [x0, _ofmt_ctx@GOTPAGEOFF]
	bl	_avformat_close_input
Lloh49:
	adrp	x0, _decoder_ctx@GOTPAGE
Lloh50:
	ldr	x0, [x0, _decoder_ctx@GOTPAGEOFF]
	bl	_avcodec_free_context
Lloh51:
	adrp	x0, _encoder_ctx@GOTPAGE
Lloh52:
	ldr	x0, [x0, _encoder_ctx@GOTPAGEOFF]
	bl	_avcodec_free_context
Lloh53:
	adrp	x0, _hw_device_ctx@GOTPAGE
Lloh54:
	ldr	x0, [x0, _hw_device_ctx@GOTPAGEOFF]
	bl	_av_buffer_unref
LBB0_23:
	mov	x0, x19
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Usage: %s <input file> <encode codec> <output file>\nThe output format is guessed according to the file extension.\n\n"

	.comm	_hw_device_ctx,4,2              ; @hw_device_ctx
	.comm	_AV_HWDEVICE_TYPE_VAAPI,4,2     ; @AV_HWDEVICE_TYPE_VAAPI
l_.str.1:                               ; @.str.1
	.asciz	"Failed to create a VAAPI device. Error code: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"Could not find encoder '%s'\n"

	.comm	_ofmt_ctx,8,3                   ; @ofmt_ctx
l_.str.3:                               ; @.str.3
	.asciz	"Failed to deduce output format from file extension. Error code: %s\n"

	.comm	_encoder_ctx,4,2                ; @encoder_ctx
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVIO_FLAG_WRITE,4,2            ; @AVIO_FLAG_WRITE
l_.str.4:                               ; @.str.4
	.asciz	"Cannot open output file. Error code: %s\n"

	.comm	_ifmt_ctx,8,3                   ; @ifmt_ctx
	.comm	_video_stream,8,3               ; @video_stream
	.comm	_decoder_ctx,4,2                ; @decoder_ctx
.subsections_via_symbols
