	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cbs_insert_unit
_cbs_insert_unit:                       ## @cbs_insert_unit
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movl	(%rsi), %edx
	cmpl	4(%rsi), %edx
	jge	LBB0_3
## %bb.1:
	movq	8(%rbx), %r14
	subl	%r15d, %edx
	jle	LBB0_8
## %bb.2:
	movslq	%r15d, %rax
	leaq	(%r14,%rax,4), %rsi
	leaq	(%r14,%rax,4), %rdi
	addq	$4, %rdi
	shll	$2, %edx
	callq	_memmove
	jmp	LBB0_8
LBB0_3:
	incl	%edx
	movl	%edx, %edi
	movl	$4, %esi
	callq	_av_malloc_array
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movq	%rax, %r14
	incl	4(%rbx)
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.5:
	movq	8(%rbx), %rsi
	leal	(,%r15,4), %edx
	movq	%r14, %rdi
	callq	_memcpy
LBB0_6:
	movl	(%rbx), %edx
	subl	%r15d, %edx
	jle	LBB0_8
## %bb.7:
	movslq	%r15d, %rsi
	leaq	(%r14,%rsi,4), %rdi
	addq	$4, %rdi
	shlq	$2, %rsi
	addq	8(%rbx), %rsi
	shll	$2, %edx
	callq	_memcpy
LBB0_8:
	movslq	%r15d, %rax
	leaq	(%r14,%rax,4), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	8(%rbx), %rdi
	cmpq	%rdi, %r14
	je	LBB0_10
## %bb.9:
	callq	_av_free
	movq	%r14, 8(%rbx)
LBB0_10:
	incl	(%rbx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_cbs_insert_unit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cbs_insert_unit
_cbs_insert_unit:                       ; @cbs_insert_unit
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x2
	mov	x19, x1
	ldp	w8, w9, [x1]
	cmp	w8, w9
	b.ge	LBB0_3
; %bb.1:
	ldr	x20, [x19, #8]
	subs	w8, w8, w21
	b.le	LBB0_8
; %bb.2:
	add	x1, x20, w21, sxtw #2
	add	x0, x1, #4
	lsl	w2, w8, #2
	bl	_memmove
	b	LBB0_8
LBB0_3:
	add	w0, w8, #1
	mov	w1, #4
	bl	_av_malloc_array
	cbz	x0, LBB0_11
; %bb.4:
	mov	x20, x0
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	cmp	w21, #1
	b.lt	LBB0_6
; %bb.5:
	ldr	x1, [x19, #8]
	lsl	w2, w21, #2
	mov	x0, x20
	bl	_memcpy
LBB0_6:
	ldr	w8, [x19]
	subs	w8, w8, w21
	b.le	LBB0_8
; %bb.7:
	sbfiz	x9, x21, #2, #32
	add	x10, x20, x9
	add	x0, x10, #4
	ldr	x10, [x19, #8]
	add	x1, x10, x9
	lsl	w2, w8, #2
	bl	_memcpy
LBB0_8:
	add	x0, x20, w21, sxtw #2
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x0, [x19, #8]
	cmp	x20, x0
	b.eq	LBB0_10
; %bb.9:
	bl	_av_free
	str	x20, [x19, #8]
LBB0_10:
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_cbs_insert_unit
.subsections_via_symbols
