	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cbs_vp9_assemble_fragment
_cbs_vp9_assemble_fragment:             ## @cbs_vp9_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	$72, %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), %ecx
	cmpl	$1, %ecx
	jne	LBB0_3
## %bb.1:
	movq	32(%r13), %rbx
	movl	16(%rbx), %edi
	callq	_av_buffer_ref
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	je	LBB0_29
## %bb.2:
	movq	8(%rbx), %rax
	movq	%rax, 16(%r13)
	movq	(%rbx), %rax
	movq	%rax, 8(%r13)
LBB0_27:
	xorl	%r12d, %r12d
	jmp	LBB0_28
LBB0_3:
	movq	%rdi, %r15
	cmpl	$8, %ecx
	jle	LBB0_4
## %bb.30:
	movl	(%r15), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%eax, %eax
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r12d
LBB0_28:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	$1, %r12d
	testl	%ecx, %ecx
	jle	LBB0_15
## %bb.5:
	movq	32(%r13), %rax
	movq	(%rax), %rdi
	cmpl	$1, %ecx
	je	LBB0_13
## %bb.6:
	movq	24(%rax), %rdx
	cmpq	%rdx, %rdi
	cmovbeq	%rdx, %rdi
	cmpl	$2, %ecx
	je	LBB0_13
## %bb.7:
	movq	48(%rax), %rdx
	cmpq	%rdx, %rdi
	cmovbeq	%rdx, %rdi
	cmpl	$3, %ecx
	je	LBB0_13
## %bb.8:
	movq	72(%rax), %rdx
	cmpq	%rdx, %rdi
	cmovbeq	%rdx, %rdi
	cmpl	$4, %ecx
	je	LBB0_13
## %bb.9:
	movq	96(%rax), %rdx
	cmpq	%rdx, %rdi
	cmovbeq	%rdx, %rdi
	cmpl	$5, %ecx
	je	LBB0_13
## %bb.10:
	movq	120(%rax), %rdx
	cmpq	%rdx, %rdi
	cmovbeq	%rdx, %rdi
	cmpl	$6, %ecx
	je	LBB0_13
## %bb.11:
	movq	144(%rax), %rdx
	cmpq	%rdx, %rdi
	cmovbeq	%rdx, %rdi
	cmpl	$7, %ecx
	je	LBB0_13
## %bb.12:
	movq	168(%rax), %rax
	cmpq	%rax, %rdi
	cmovbeq	%rax, %rdi
LBB0_13:
	cmpq	$2, %rdi
	jb	LBB0_15
## %bb.14:
	callq	_av_log2
                                        ## kill: def $eax killed $eax def $rax
	leal	7(%rax), %r12d
	testl	%eax, %eax
	cmovnsl	%eax, %r12d
	sarl	$3, %r12d
	incl	%r12d
LBB0_15:
	xorl	%edi, %edi
	cmpl	$5, %r12d
	setl	%dil
	callq	_av_assert0
	movq	_VP9_SUPERFRAME_MARKER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	leal	-1(%r12), %eax
	movl	%eax, -104(%rbp)
	movl	(%r13), %eax
	leal	-1(%rax), %ecx
	movl	%ecx, -100(%rbp)
	testl	%eax, %eax
	jle	LBB0_18
## %bb.16:
	movq	32(%r13), %rax
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	addq	$24, %rax
	incq	%rcx
	jmp	LBB0_17
LBB0_29:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_18:
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	$2, %rdi
	callq	_av_buffer_alloc
	movq	%rax, -80(%rbp)
	testq	%rax, %rax
	je	LBB0_19
## %bb.21:
	movq	%rax, %rbx
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r15
	leaq	8(%r15), %rdi
	movq	(%r14), %rdx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_memset
	movl	(%r13), %eax
	testl	%eax, %eax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_24
## %bb.22:
	movq	32(%r13), %rcx
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movl	$2, %eax
	subq	%r14, %rax
	xorl	%edi, %edi
	cmpq	(%rcx,%rbx), %rax
	seta	%dil
	callq	_av_assert0
	leaq	(%r15,%r14,4), %rdi
	movq	32(%r13), %rax
	movq	(%rax,%rbx), %rdx
	movq	8(%rax,%rbx), %rsi
	callq	_memcpy
	movq	32(%r13), %rcx
	addq	(%rcx,%rbx), %r14
	incq	%r12
	movslq	(%r13), %rax
	addq	$24, %rbx
	cmpq	%rax, %r12
	jl	LBB0_23
LBB0_24:
	movl	$2, %r12d
	subq	%r14, %r12
	imull	-64(%rbp), %eax                 ## 4-byte Folded Reload
	addl	$2, %eax
	cltq
	xorl	%edi, %edi
	cmpq	%rax, %r12
	sete	%dil
	callq	_av_assert0
	leaq	(%r15,%r14,4), %rsi
	leaq	-44(%rbp), %r14
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_init_put_bits
	leaq	-104(%rbp), %rdx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_cbs_vp9_write_superframe_index
	testl	%eax, %eax
	js	LBB0_25
## %bb.26:
	leaq	-44(%rbp), %r14
	movq	%r14, %rdi
	callq	_put_bits_left
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_av_assert0
	movq	%r14, %rdi
	callq	_flush_put_bits
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r13)
	movq	%r15, 16(%r13)
	movq	$2, 8(%r13)
	jmp	LBB0_27
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_25:
	movl	%eax, %r12d
	movl	(%rbx), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	xorl	%eax, %eax
	callq	_av_log
	leaq	-80(%rbp), %rdi
	callq	_av_buffer_unref
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Too many frames to make superframe: %d.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VP9_SUPERFRAME_MARKER,4,2      ## @VP9_SUPERFRAME_MARKER
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ## @AV_INPUT_BUFFER_PADDING_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to write superframe index.\n"

	.no_dead_strip	_cbs_vp9_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_vp9_assemble_fragment
_cbs_vp9_assemble_fragment:             ; @cbs_vp9_assemble_fragment
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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.ne	LBB0_4
; %bb.1:
	ldr	x20, [x19, #32]
	ldr	w0, [x20, #16]
	bl	_av_buffer_ref
	str	x0, [x19, #24]
	cbz	x0, LBB0_19
; %bb.2:
	mov	w22, #0
	ldr	x8, [x20, #8]
	str	x8, [x19, #16]
	ldr	x8, [x20]
LBB0_3:
	str	x8, [x19, #8]
	b	LBB0_7
LBB0_4:
	mov	x20, x0
	cmp	w8, #8
	b.le	LBB0_8
; %bb.5:
	ldr	w0, [x20]
Lloh0:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	str	x8, [sp]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x22, x0
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_8:
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.9:
	ldr	x9, [x19, #32]
	ldr	x0, [x9]
	cmp	w8, #1
	b.eq	LBB0_17
; %bb.10:
	ldr	x10, [x9, #24]
	cmp	x0, x10
	csel	x0, x0, x10, hi
	cmp	w8, #2
	b.eq	LBB0_17
; %bb.11:
	ldr	x10, [x9, #48]
	cmp	x0, x10
	csel	x0, x0, x10, hi
	cmp	w8, #3
	b.eq	LBB0_17
; %bb.12:
	ldr	x10, [x9, #72]
	cmp	x0, x10
	csel	x0, x0, x10, hi
	cmp	w8, #4
	b.eq	LBB0_17
; %bb.13:
	ldr	x10, [x9, #96]
	cmp	x0, x10
	csel	x0, x0, x10, hi
	cmp	w8, #5
	b.eq	LBB0_17
; %bb.14:
	ldr	x10, [x9, #120]
	cmp	x0, x10
	csel	x0, x0, x10, hi
	cmp	w8, #6
	b.eq	LBB0_17
; %bb.15:
	ldr	x10, [x9, #144]
	cmp	x0, x10
	csel	x0, x0, x10, hi
	cmp	w8, #7
	b.eq	LBB0_17
; %bb.16:
	ldr	x8, [x9, #168]
	cmp	x0, x8
	csel	x0, x0, x8, hi
LBB0_17:
	cmp	x0, #2
	b.hs	LBB0_20
LBB0_18:
	mov	w24, #1
	b	LBB0_21
LBB0_19:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_AVERROR
LBB0_20:
	bl	_av_log2
	add	w8, w0, #7
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w8, w8, #3
	add	w24, w8, #1
LBB0_21:
	cmp	w24, #5
	cset	w0, lt
	bl	_av_assert0
Lloh10:
	adrp	x8, _VP9_SUPERFRAME_MARKER@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VP9_SUPERFRAME_MARKER@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	sub	w8, w24, #1
	ldr	w9, [x19]
	subs	w9, w9, #1
	stp	w8, w9, [sp, #24]
	b.lt	LBB0_24
; %bb.22:
	ldr	x8, [x19, #32]
	mov	w9, #1
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x8, #24
	add	x9, x9, #1
	b	LBB0_23
LBB0_24:
Lloh13:
	adrp	x22, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh14:
	ldr	x22, [x22, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x0, x8, #2
	bl	_av_buffer_alloc
	str	x0, [sp, #8]
	cbz	x0, LBB0_28
; %bb.25:
	mov	x21, x0
	ldr	x23, [x0]
	add	x0, x23, #8
	ldr	x2, [x22]
	mov	w1, #0
	bl	_memset
	ldr	w9, [x19]
	cmp	w9, #1
	b.lt	LBB0_29
; %bb.26:
	mov	x22, #0
	mov	x26, #0
	mov	x25, #0
	ldr	x8, [x19, #32]
	mov	w27, #2
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, x22]
	sub	x9, x27, x25
	cmp	x9, x8
	cset	w0, hi
	bl	_av_assert0
	add	x0, x23, x25, lsl #2
	ldr	x8, [x19, #32]
	add	x8, x8, x22
	ldp	x2, x1, [x8]
	bl	_memcpy
	ldr	x8, [x19, #32]
	ldr	x9, [x8, x22]
	add	x25, x9, x25
	add	x26, x26, #1
	ldrsw	x9, [x19]
	add	x22, x22, #24
	cmp	x26, x9
	b.lt	LBB0_27
	b	LBB0_30
LBB0_28:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_29:
	mov	x25, #0
LBB0_30:
	mov	w8, #2
	sub	x22, x8, x25
	orr	w8, wzr, #0x2
	madd	w8, w9, w24, w8
	cmp	x22, w8, sxtw
	cset	w0, eq
	bl	_av_assert0
	add	x1, x23, x25, lsl #2
	add	x0, sp, #20
	mov	x2, x22
	bl	_init_put_bits
	add	x1, sp, #20
	add	x2, sp, #24
	mov	x0, x20
	bl	_cbs_vp9_write_superframe_index
	tbnz	w0, #31, LBB0_32
; %bb.31:
	add	x0, sp, #20
	bl	_put_bits_left
	cmp	x0, #0
	cset	w0, eq
	bl	_av_assert0
	add	x0, sp, #20
	bl	_flush_put_bits
	mov	w22, #0
	stp	x23, x21, [x19, #16]
	mov	w8, #2
	b	LBB0_3
LBB0_32:
	mov	x22, x0
	ldr	w0, [x20]
Lloh17:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str.1@PAGE
Lloh21:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_av_log
	add	x0, sp, #8
	bl	_av_buffer_unref
	b	LBB0_7
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Too many frames to make superframe: %d.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VP9_SUPERFRAME_MARKER,4,2      ; @VP9_SUPERFRAME_MARKER
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ; @AV_INPUT_BUFFER_PADDING_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to write superframe index.\n"

	.no_dead_strip	_cbs_vp9_assemble_fragment
.subsections_via_symbols
