	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function yuv4_write_packet
_yuv4_write_packet:                     ## @yuv4_write_packet
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	%rsp, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %rax
	movq	(%rsi), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rbx
	movq	8(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_Y4M_LINE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	8(%r12), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rbx)
	je	LBB0_3
## %bb.1:
	movl	$0, (%rbx)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_yuv4_generate_header
	testq	%rax, %rax
	js	LBB0_18
## %bb.2:
	movq	%r15, %rdi
	callq	_strlen
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_avio_write
LBB0_3:
	movq	8(%r14), %rdi
	movq	_Y4M_FRAME_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_avio_printf
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	8(%rax), %edi
	leal	-128(%rdi), %ecx
	cmpl	$26, %ecx
	ja	LBB0_23
## %bb.4:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movl	(%rax), %r13d
	movl	4(%rax), %r14d
	movl	$122666744, %eax                ## imm = 0x74FBEF8
	btl	%ecx, %eax
	jae	LBB0_6
## %bb.5:
	addl	%r13d, %r13d
LBB0_6:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	testl	%r14d, %r14d
	jle	LBB0_10
## %bb.7:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	(%r15), %rax
	movq	(%rax), %rbx
	movl	%r14d, -84(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	_avio_write
	movq	8(%r15), %rax
	movslq	(%rax), %rax
	addq	%rax, %rbx
	decl	%r14d
	jne	LBB0_8
## %bb.9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	8(%rax), %edi
	movl	-84(%rbp), %r14d                ## 4-byte Reload
LBB0_10:
	leal	-150(%rdi), %eax
	xorl	%ebx, %ebx
	cmpl	$5, %eax
	jb	LBB0_20
## %bb.12:
	leaq	-92(%rbp), %rsi
	leaq	-88(%rbp), %rdx
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_av_pix_fmt_get_chroma_sub_sample
	movl	-92(%rbp), %esi
	movl	%r13d, %edi
	callq	_AV_CEIL_RSHIFT
	movl	%eax, %r15d
	movl	-88(%rbp), %esi
	movl	%r14d, %edi
	callq	_AV_CEIL_RSHIFT
	testl	%eax, %eax
	jle	LBB0_20
## %bb.13:
	movl	%eax, %r12d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	16(%rax), %rbx
	movq	8(%rax), %r14
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	movl	%r12d, %r15d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_avio_write
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movslq	4(%rax), %rax
	addq	%rax, %r14
	decl	%r15d
	jne	LBB0_14
## %bb.15:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_avio_write
	movq	8(%r14), %rax
	movslq	8(%rax), %rax
	addq	%rax, %rbx
	decl	%r12d
	jne	LBB0_16
## %bb.17:
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_20:
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_21
LBB0_18:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
LBB0_21:
	movq	%r13, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_24
## %bb.22:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_av_get_pix_fmt_name
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_24:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_Y4M_LINE_MAX,4,2               ## @Y4M_LINE_MAX
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error. YUV4MPEG stream header write failed.\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"%s\n"

	.comm	_Y4M_FRAME_MAGIC,4,2            ## @Y4M_FRAME_MAGIC
L_.str.2:                               ## @.str.2
	.asciz	"The pixel format '%s' is not supported.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_yuv4_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function yuv4_write_packet
_yuv4_write_packet:                     ; @yuv4_write_packet
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x20, x0
	mov	x24, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldp	x19, x8, [x0, #8]
	ldr	x9, [x1]
	ldr	x23, [x8, x9, lsl #3]
	ldr	x12, [x0]
Lloh3:
	adrp	x8, _Y4M_LINE_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Y4M_LINE_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, #1
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	x25, [x1, #8]
	ldr	w8, [x12]
	cbz	w8, LBB0_3
; %bb.1:
	str	wzr, [x12]
	mov	x0, x20
	mov	x1, x21
	bl	_yuv4_generate_header
	tbnz	x0, #63, LBB0_14
; %bb.2:
	mov	x0, x21
	bl	_strlen
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_avio_write
LBB0_3:
	ldr	x0, [x20, #8]
Lloh8:
	adrp	x8, _Y4M_FRAME_MAGIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _Y4M_FRAME_MAGIC@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_avio_printf
	ldr	x9, [x23]
	ldr	w0, [x9, #8]
	sub	w8, w0, #128
	cmp	w8, #26
	b.hi	LBB0_18
; %bb.4:
	ldp	w10, w20, [x9]
	ldr	x9, [x25]
	ldr	x22, [x9]
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #48888
	movk	w9, #1871, lsl #16
	tst	w8, w9
	lsl	w8, w10, #1
	csel	w21, w8, w10, ne
	cmp	w20, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x26, x20
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_avio_write
	ldr	x8, [x25, #8]
	ldrsw	x8, [x8]
	add	x22, x22, x8
	subs	w26, w26, #1
	b.ne	LBB0_6
; %bb.7:
	ldr	x8, [x23]
	ldr	w0, [x8, #8]
LBB0_8:
	sub	w8, w0, #150
	cmp	w8, #5
	b.lo	LBB0_13
; %bb.9:
	sub	x1, x29, #76
	sub	x2, x29, #80
	bl	_av_pix_fmt_get_chroma_sub_sample
	ldur	w1, [x29, #-76]
	mov	x0, x21
	bl	_AV_CEIL_RSHIFT
	mov	x21, x0
	ldur	w1, [x29, #-80]
	mov	x0, x20
	bl	_AV_CEIL_RSHIFT
	cmp	w0, #1
	b.lt	LBB0_13
; %bb.10:
	mov	x20, x0
	ldr	x8, [x25]
	ldp	x23, x22, [x8, #8]
	mov	x26, x0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	bl	_avio_write
	ldr	x8, [x25, #8]
	ldrsw	x8, [x8, #4]
	add	x23, x23, x8
	subs	w26, w26, #1
	b.ne	LBB0_11
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_avio_write
	ldr	x8, [x25, #8]
	ldrsw	x8, [x8, #8]
	add	x22, x22, x8
	subs	w20, w20, #1
	b.ne	LBB0_12
LBB0_13:
	mov	w0, #0
	b	LBB0_16
LBB0_14:
Lloh13:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, l_.str@PAGE
Lloh17:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_15:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_16:
	mov	sp, x24
	ldur	x8, [x29, #-72]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.17:
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_18:
Lloh23:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	w19, [x8]
	bl	_av_get_pix_fmt_name
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp, #-16]!
Lloh26:
	adrp	x2, l_.str.2@PAGE
Lloh27:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	_av_log
	add	sp, sp, #16
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_Y4M_LINE_MAX,4,2               ; @Y4M_LINE_MAX
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error. YUV4MPEG stream header write failed.\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"%s\n"

	.comm	_Y4M_FRAME_MAGIC,4,2            ; @Y4M_FRAME_MAGIC
l_.str.2:                               ; @.str.2
	.asciz	"The pixel format '%s' is not supported.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_yuv4_write_packet
.subsections_via_symbols
