	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_422_bitstream
_encode_422_bitstream:                  ## @encode_422_bitstream
	.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
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	56(%rdi), %rax
	movl	%esi, %ecx
	shrl	$31, %ecx
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	addl	%esi, %ecx
	sarl	%ecx
	movslq	%ecx, %r12
	shlq	$2, %r12
	movq	8(%rax), %rcx
	addq	%r12, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	addq	16(%rax), %r12
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	24(%rdi), %r15
	movl	24(%rdi), %ebx
	movl	28(%rdi), %r14d
	movq	%r15, %rdi
	callq	_put_bits_count
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	sarl	$3, %eax
	addl	%r14d, %eax
	subl	%eax, %ebx
	leal	(,%rcx,8), %eax
	cmpl	%eax, %ebx
	jge	LBB0_2
## %bb.1:
	movq	48(%r13), %rdi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	movl	$-1, %eax
	jmp	LBB0_15
LBB0_2:
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movslq	-64(%rbp), %rax                 ## 4-byte Folded Reload
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%ecx, %r9d
	shrl	$31, %r9d
	movq	%rcx, %r8
	addl	%ecx, %r9d
	sarl	%r9d
	movq	_AV_CODEC_FLAG_PASS1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_6
## %bb.3:
	cmpl	$2, %r8d
	jl	LBB0_6
## %bb.4:
	movq	32(%r13), %rax
	movq	(%rax), %r15
	movq	8(%rax), %r10
	movq	16(%rax), %r11
	movl	%r9d, %r14d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rcx
	addq	$4, %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movslq	-4(%rcx,%rbx,8), %rsi
	movslq	(%rcx,%rbx,8), %rdi
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax,%rbx,4), %rax
	movslq	(%r12,%rbx,4), %rdx
	incl	(%r15,%rsi,4)
	incl	(%r10,%rax,4)
	incl	(%r15,%rdi,4)
	incl	(%r11,%rdx,4)
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_5
LBB0_6:
	movq	48(%r13), %rsi
	movq	_AV_CODEC_FLAG2_NO_OUTPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%eax, %eax
	testl	%ecx, (%rsi)
	jne	LBB0_15
## %bb.7:
	cmpq	$0, 40(%r13)
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_11
## %bb.8:
	cmpl	$2, %r8d
	jl	LBB0_15
## %bb.9:
	movl	%r9d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rax
	addq	$4, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movslq	-4(%rcx,%r15,8), %rax
	movslq	(%rcx,%r15,8), %r14
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx,%r15,4), %rbx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx,%r15,4), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	32(%r13), %rcx
	movq	(%rcx), %rcx
	incl	(%rcx,%rax,4)
	movq	8(%r13), %rcx
	movq	16(%r13), %rdx
	movq	(%rdx), %rdx
	movl	(%rdx,%rax,4), %esi
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	movq	32(%r13), %rax
	movq	8(%rax), %rax
	incl	(%rax,%rbx,4)
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movq	8(%rcx), %rcx
	movl	(%rcx,%rbx,4), %esi
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	movq	32(%r13), %rax
	movq	(%rax), %rax
	incl	(%rax,%r14,4)
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r14,4), %esi
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	movq	32(%r13), %rax
	movq	16(%rax), %rax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	incl	(%rax,%rdx,4)
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movq	16(%rcx), %rcx
	movl	(%rcx,%rdx,4), %esi
	movq	16(%rax), %rax
	movl	(%rax,%rdx,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	incq	%r15
	cmpq	%r15, -80(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_10
	jmp	LBB0_14
LBB0_11:
	cmpl	$2, %r8d
	jl	LBB0_15
## %bb.12:
	movl	%r9d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rax
	addq	$4, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movslq	-4(%rcx,%r15,8), %rax
	movslq	(%rcx,%r15,8), %r14
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx,%r15,4), %rbx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx,%r15,4), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rcx
	movq	16(%r13), %rdx
	movq	(%rdx), %rdx
	movl	(%rdx,%rax,4), %esi
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movq	8(%rcx), %rcx
	movl	(%rcx,%rbx,4), %esi
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%r14,4), %esi
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movq	16(%rcx), %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rcx,%rdx,4), %esi
	movq	16(%rax), %rax
	movl	(%rax,%rdx,4), %edx
	movq	%r12, %rdi
	callq	_put_bits
	incq	%r15
	cmpq	%r15, -80(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_13
LBB0_14:
	xorl	%eax, %eax
LBB0_15:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"encoded frame too large\n"

	.comm	_AV_CODEC_FLAG_PASS1,4,2        ## @AV_CODEC_FLAG_PASS1
	.comm	_AV_CODEC_FLAG2_NO_OUTPUT,4,2   ## @AV_CODEC_FLAG2_NO_OUTPUT
	.comm	_LOAD4,4,2                      ## @LOAD4
	.comm	_u0,8,3                         ## @u0
	.comm	_v0,8,3                         ## @v0
	.comm	_y0,8,3                         ## @y0
	.comm	_y1,8,3                         ## @y1
	.no_dead_strip	_encode_422_bitstream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_422_bitstream
_encode_422_bitstream:                  ; @encode_422_bitstream
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	mov	x20, x0
	ldr	w27, [x20, #24]!
	ldr	x8, [x20, #32]
	ldp	x25, x23, [x8]
	cmp	w1, #0
	cinc	w26, w1, lt
	ldr	x24, [x8, #16]
	ldr	w28, [x20, #4]
	mov	x0, x20
	bl	_put_bits_count
	add	w8, w28, w0, asr #3
	sub	w8, w27, w8
	cmp	w8, w21, lsl #3
	b.ge	LBB0_2
; %bb.1:
	ldr	x0, [x19, #48]
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
	mov	w0, #-1
	b	LBB0_7
LBB0_2:
	sxtw	x8, w22
	asr	w9, w26, #1
	sbfiz	x9, x9, #2, #32
	add	x22, x23, x9
	add	x23, x24, x9
	cmp	w21, #0
	cinc	w9, w21, lt
	asr	w24, w9, #1
	ldr	w9, [x19]
Lloh5:
	adrp	x10, _AV_CODEC_FLAG_PASS1@GOTPAGE
Lloh6:
	ldr	x10, [x10, _AV_CODEC_FLAG_PASS1@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	and	w9, w10, w9
	cmp	w9, #0
	ccmp	w21, #2, #8, ne
	b.lt	LBB0_5
; %bb.3:
	ldr	x11, [x19, #32]
	ldp	x9, x10, [x11]
	add	x12, x25, x8, lsl #2
	ldr	x11, [x11, #16]
	add	x12, x12, #4
	mov	x13, x24
	mov	x14, x22
	mov	x15, x23
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldpsw	x16, x0, [x12, #-4]
	ldrsw	x17, [x14], #4
	ldrsw	x1, [x15], #4
	lsl	x16, x16, #2
	ldr	w2, [x9, x16]
	add	w2, w2, #1
	str	w2, [x9, x16]
	lsl	x16, x17, #2
	ldr	w17, [x10, x16]
	add	w17, w17, #1
	str	w17, [x10, x16]
	lsl	x16, x0, #2
	ldr	w17, [x9, x16]
	add	w17, w17, #1
	str	w17, [x9, x16]
	lsl	x16, x1, #2
	ldr	w17, [x11, x16]
	add	w17, w17, #1
	str	w17, [x11, x16]
	add	x12, x12, #8
	subs	x13, x13, #1
	b.ne	LBB0_4
LBB0_5:
	ldr	x9, [x19, #48]
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _AV_CODEC_FLAG2_NO_OUTPUT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AV_CODEC_FLAG2_NO_OUTPUT@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_8
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	x9, [x19, #40]
	cbz	x9, LBB0_12
; %bb.9:
	cmp	w21, #2
	b.lt	LBB0_6
; %bb.10:
	add	x8, x25, x8, lsl #2
	add	x21, x8, #4
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x25, [x22], #4
	ldrsw	x26, [x23], #4
	ldpsw	x8, x27, [x21, #-4]
	ldr	x9, [x19, #32]
	ldr	x9, [x9]
	lsl	x8, x8, #2
	ldr	w10, [x9, x8]
	add	w10, w10, #1
	str	w10, [x9, x8]
	ldp	x10, x9, [x19, #8]
	ldr	x9, [x9]
	ldr	w1, [x9, x8]
	ldr	x9, [x10]
	ldr	w2, [x9, x8]
	mov	x0, x20
	bl	_put_bits
	ldr	x8, [x19, #32]
	ldr	x8, [x8, #8]
	lsl	x9, x25, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	ldp	x10, x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldr	w1, [x8, x9]
	ldr	x8, [x10, #8]
	ldr	w2, [x8, x9]
	mov	x0, x20
	bl	_put_bits
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	lsl	x9, x27, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	ldp	x10, x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w1, [x8, x9]
	ldr	x8, [x10]
	ldr	w2, [x8, x9]
	mov	x0, x20
	bl	_put_bits
	ldr	x8, [x19, #32]
	ldr	x8, [x8, #16]
	lsl	x9, x26, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	ldp	x10, x8, [x19, #8]
	ldr	x8, [x8, #16]
	ldr	w1, [x8, x9]
	ldr	x8, [x10, #16]
	ldr	w2, [x8, x9]
	mov	x0, x20
	bl	_put_bits
	add	x21, x21, #8
	subs	x24, x24, #1
	b.ne	LBB0_11
	b	LBB0_6
LBB0_12:
	cmp	w21, #2
	b.lt	LBB0_6
; %bb.13:
	add	x8, x25, x8, lsl #2
	add	x21, x8, #4
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldpsw	x8, x26, [x21, #-4]
	ldrsw	x25, [x22], #4
	ldrsw	x27, [x23], #4
	ldp	x10, x9, [x19, #8]
	ldr	x9, [x9]
	lsl	x8, x8, #2
	ldr	w1, [x9, x8]
	ldr	x9, [x10]
	ldr	w2, [x9, x8]
	mov	x0, x20
	bl	_put_bits
	ldp	x9, x8, [x19, #8]
	ldr	x8, [x8, #8]
	lsl	x10, x25, #2
	ldr	w1, [x8, x10]
	ldr	x8, [x9, #8]
	ldr	w2, [x8, x10]
	mov	x0, x20
	bl	_put_bits
	ldp	x9, x8, [x19, #8]
	ldr	x8, [x8]
	lsl	x10, x26, #2
	ldr	w1, [x8, x10]
	ldr	x8, [x9]
	ldr	w2, [x8, x10]
	mov	x0, x20
	bl	_put_bits
	ldp	x9, x8, [x19, #8]
	ldr	x8, [x8, #16]
	lsl	x10, x27, #2
	ldr	w1, [x8, x10]
	ldr	x8, [x9, #16]
	ldr	w2, [x8, x10]
	mov	x0, x20
	bl	_put_bits
	add	x21, x21, #8
	subs	x24, x24, #1
	b.ne	LBB0_14
	b	LBB0_6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"encoded frame too large\n"

	.comm	_AV_CODEC_FLAG_PASS1,4,2        ; @AV_CODEC_FLAG_PASS1
	.comm	_AV_CODEC_FLAG2_NO_OUTPUT,4,2   ; @AV_CODEC_FLAG2_NO_OUTPUT
	.comm	_LOAD4,4,2                      ; @LOAD4
	.comm	_u0,8,3                         ; @u0
	.comm	_v0,8,3                         ; @v0
	.comm	_y0,8,3                         ; @y0
	.comm	_y1,8,3                         ; @y1
	.no_dead_strip	_encode_422_bitstream
.subsections_via_symbols
