	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_video_frame
_write_video_frame:                     ## @write_video_frame
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movl	$0, -44(%rbp)
	movl	$0, -48(%rbp)
	movq	8(%rsi), %r12
	movq	%rsi, %rdi
	callq	_get_video_frame
	movq	%rax, %r15
	leaq	-48(%rbp), %r13
	movq	%r13, %rdi
	callq	_av_init_packet
	leaq	-44(%rbp), %rcx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_avcodec_encode_video2
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	cmpl	$0, -44(%rbp)
	je	LBB0_4
## %bb.5:
	movl	(%rbx), %edx
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_write_frame
	testl	%eax, %eax
	js	LBB0_8
## %bb.6:
	cmpl	$0, -44(%rbp)
	sete	%al
	jmp	LBB0_7
LBB0_4:
	movb	$1, %al
LBB0_7:
	testq	%r15, %r15
	sete	%cl
	andb	%al, %cl
	movzbl	%cl, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%eax, %edi
	callq	_av_err2str
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%eax, %edi
	callq	_av_err2str
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error encoding video frame: %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error while writing video frame: %s\n"

	.no_dead_strip	_write_video_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_video_frame
_write_video_frame:                     ; @write_video_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x22, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	x21, [x1, #8]
	mov	x0, x1
	bl	_get_video_frame
	mov	x19, x0
	add	x0, sp, #8
	bl	_av_init_packet
	add	x1, sp, #8
	add	x3, sp, #12
	mov	x0, x21
	mov	x2, x19
	bl	_avcodec_encode_video2
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_4
; %bb.2:
	ldr	w2, [x22]
	add	x3, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	_write_frame
	tbnz	w0, #31, LBB0_7
; %bb.3:
	ldr	w8, [sp, #12]
	cmp	w8, #0
	cset	w8, eq
	b	LBB0_5
LBB0_4:
	mov	w8, #1
LBB0_5:
	cmp	x19, #0
	cset	w9, eq
	and	w0, w9, w8
	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
	add	sp, sp, #64
	ret
LBB0_6:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	bl	_av_err2str
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh5:
	adrp	x8, _stderr@GOTPAGE
Lloh6:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh7:
	ldr	w19, [x8]
	bl	_av_err2str
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_fprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error encoding video frame: %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error while writing video frame: %s\n"

	.no_dead_strip	_write_video_frame
.subsections_via_symbols
