	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function cbs_mpeg2_assemble_fragment
LCPI0_0:
	.quad	3                               ## 0x3
	.quad	3                               ## 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_cbs_mpeg2_assemble_fragment:           ## @cbs_mpeg2_assemble_fragment
	.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, %r13
	movl	(%rsi), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	24(%r13), %rcx
	cmpl	$5, %eax
	jae	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_4:
	movl	%eax, %edx
	andl	$3, %edx
	testq	%rdx, %rdx
	movl	$4, %esi
	cmovneq	%rdx, %rsi
	movq	%rax, %rdx
	subq	%rsi, %rdx
	leaq	32(%rcx), %rsi
	pxor	%xmm0, %xmm0
	movdqa	LCPI0_0(%rip), %xmm2            ## xmm2 = [3,3]
	movq	%rdx, %rdi
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	-32(%rsi), %xmm3
	movdqu	-16(%rsi), %xmm4
	punpcklqdq	%xmm4, %xmm3            ## xmm3 = xmm3[0],xmm4[0]
	movdqu	(%rsi), %xmm4
	movdqu	16(%rsi), %xmm5
	punpcklqdq	%xmm5, %xmm4            ## xmm4 = xmm4[0],xmm5[0]
	paddq	%xmm2, %xmm0
	paddq	%xmm3, %xmm0
	paddq	%xmm2, %xmm1
	paddq	%xmm4, %xmm1
	addq	$64, %rsi
	addq	$-4, %rdi
	jne	LBB0_5
## %bb.6:
	paddq	%xmm0, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddq	%xmm1, %xmm0
	movq	%xmm0, %rbx
LBB0_7:
	subq	%rdx, %rax
	shlq	$4, %rdx
	addq	%rdx, %rcx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx), %rdx
	addq	%rdx, %rbx
	addq	$3, %rbx
	addq	$16, %rcx
	decq	%rax
	jne	LBB0_8
LBB0_9:
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%rbx, %rdi
	callq	_av_buffer_alloc
	movq	%rax, 32(%r13)
	testq	%rax, %rax
	je	LBB0_15
## %bb.10:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rcx
	cmpl	$0, (%r13)
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_11
## %bb.12:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %r12
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	$0, (%rcx,%rax,4)
	leaq	3(%rax), %r14
	movl	$1, 8(%rcx,%rax,4)
	leaq	(%rcx,%rax,4), %rdi
	addq	$12, %rdi
	movl	8(%r12,%rbx), %esi
	movq	(%r12,%rbx), %rdx
	callq	_memcpy
	addq	(%r12,%rbx), %r14
	incq	%r15
	movslq	(%r13), %rcx
	addq	$16, %rbx
	movq	%r14, %rax
	cmpq	%rcx, %r15
	jl	LBB0_13
	jmp	LBB0_14
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_11:
	xorl	%r14d, %r14d
LBB0_14:
	xorl	%edi, %edi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpq	%rbx, %r14
	sete	%dil
	callq	_av_assert0
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	leaq	(%r14,%rbx,4), %rdi
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%esi, %esi
	callq	_memset
	movq	%r14, 8(%r13)
	movq	%rbx, 16(%r13)
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_cbs_mpeg2_assemble_fragment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cbs_mpeg2_assemble_fragment
_cbs_mpeg2_assemble_fragment:           ; @cbs_mpeg2_assemble_fragment
	.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	x19, x1
	ldr	w8, [x1]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x9, [x19, #24]
	cmp	w8, #9
	b.hs	LBB0_4
; %bb.2:
	mov	x10, #0
	mov	x20, #0
	b	LBB0_7
LBB0_3:
	mov	x20, #0
	b	LBB0_9
LBB0_4:
	ands	x10, x8, #0x7
	mov	w11, #8
	csel	x10, x11, x10, eq
	sub	x10, x8, x10
	add	x11, x9, #64
	movi.2d	v0, #0000000000000000
	mov	w12, #3
	dup.2d	v1, x12
	mov	x12, x10
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
	movi.2d	v4, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	x13, x11, #64
	ld2.2d	{ v5, v6 }, [x13]
	sub	x13, x11, #32
	ld2.2d	{ v16, v17 }, [x13]
	mov	x13, x11
	ld2.2d	{ v18, v19 }, [x13], #32
	ld2.2d	{ v20, v21 }, [x13]
	add.2d	v0, v0, v5
	add.2d	v2, v2, v16
	add.2d	v3, v3, v18
	add.2d	v4, v4, v20
	add.2d	v0, v0, v1
	add.2d	v2, v2, v1
	add.2d	v3, v3, v1
	add.2d	v4, v4, v1
	add	x11, x11, #128
	subs	x12, x12, #8
	b.ne	LBB0_5
; %bb.6:
	add.2d	v0, v2, v0
	add.2d	v0, v3, v0
	add.2d	v0, v4, v0
	addp.2d	d0, v0
	fmov	x20, d0
LBB0_7:
	add	x9, x9, x10, lsl #4
	sub	x8, x8, x10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9], #16
	add	x10, x20, x10
	add	x20, x10, #3
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
Lloh0:
	adrp	x21, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x0, x8, x20
	bl	_av_buffer_alloc
	str	x0, [x19, #32]
	cbz	x0, LBB0_13
; %bb.10:
	ldr	x22, [x0]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.11:
	mov	x23, #0
	mov	x24, #0
	mov	x8, #0
	mov	w25, #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #24]
	add	x10, x22, x8, lsl #2
	str	xzr, [x10]
	add	x26, x8, #3
	str	w25, [x10, #8]
	add	x0, x22, x26, lsl #2
	add	x27, x9, x23
	ldr	w1, [x27, #8]
	ldr	x2, [x27]
	bl	_memcpy
	ldr	x8, [x27]
	add	x8, x8, x26
	add	x24, x24, #1
	ldrsw	x9, [x19]
	add	x23, x23, #16
	cmp	x24, x9
	b.lt	LBB0_12
	b	LBB0_15
LBB0_13:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_14:
	mov	x8, #0
LBB0_15:
	cmp	x8, x20
	cset	w0, eq
	bl	_av_assert0
	add	x0, x22, x20, lsl #2
	ldr	x2, [x21]
	mov	w1, #0
	bl	_memset
	stp	x22, x20, [x19, #8]
	mov	w0, #0
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_cbs_mpeg2_assemble_fragment
.subsections_via_symbols
