	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function AVIFILE_RemoveStream
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_AVIFILE_RemoveStream:                  ## @AVIFILE_RemoveStream
	.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, %r14
	movq	%rdi, %rbx
	leaq	-1(%rsi), %rcx
	xorl	%r12d, %r12d
	testq	%rdi, %rdi
	setne	%r12b
	leaq	1(%rsi), %rax
	leaq	(%rsi,%rsi,2), %r13
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rcx,2), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_assert
	xorl	%edi, %edi
	cmpq	%r14, (%rbx)
	seta	%dil
	callq	_assert
	movq	8(%rbx), %rax
	movq	16(%rax,%r13,8), %rdi
	callq	_IAVIStream_Release
	movq	(%rbx), %rax
	decq	%rax
	movq	%rax, (%rbx)
	movq	%rax, %rcx
	subq	%r14, %rcx
	jbe	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rax
	leaq	(%rax,%r13,8), %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rax,%rdx,8), %rsi
	shlq	$3, %rcx
	leaq	(%rcx,%rcx,2), %rdx
	callq	_memmove
	movq	(%rbx), %rax
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rcx
	leaq	(%rax,%rax,2), %rdx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rcx,%rdx,8)
	movq	$0, 16(%rcx,%rdx,8)
	testq	%r14, %r14
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	16(%rcx,%r15,8), %rax
	cmpq	16(%rcx,%r13,8), %rax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_EditStreamEnd
	movq	8(%rbx), %rcx
	cmpq	(%rcx,%r13,8), %rax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rcx,%r13,8), %rax
	addq	%rax, 8(%rcx,%r15,8)
	jmp	LBB0_1
LBB0_8:
	movq	_AVIERR_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIERR_OK,4,2                  ## @AVIERR_OK
	.no_dead_strip	_AVIFILE_RemoveStream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_RemoveStream
_AVIFILE_RemoveStream:                  ; @AVIFILE_RemoveStream
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	sub	x21, x1, #1
	cmp	x0, #0
	cset	w22, ne
	add	x23, x1, #1
	mov	w24, #24
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_assert
	ldr	x8, [x20]
	cmp	x8, x19
	cset	w0, hi
	bl	_assert
	ldr	x8, [x20, #8]
	madd	x8, x19, x24, x8
	ldr	x0, [x8, #16]
	bl	_IAVIStream_Release
	ldr	x8, [x20]
	sub	x8, x8, #1
	str	x8, [x20]
	subs	x9, x8, x19
	b.ls	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x20, #8]
	madd	x0, x19, x24, x8
	madd	x1, x23, x24, x8
	add	x8, x9, x9, lsl #1
	lsl	x2, x8, #3
	bl	_memmove
	ldr	x8, [x20]
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x9, [x20, #8]
	madd	x10, x8, x24, x9
	stp	xzr, xzr, [x10]
	str	xzr, [x10, #16]
	cbz	x19, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	cbz	x8, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	madd	x8, x21, x24, x9
	ldr	x8, [x8, #16]
	madd	x9, x19, x24, x9
	ldr	x9, [x9, #16]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_EditStreamEnd
	ldr	x8, [x20, #8]
	mul	x9, x19, x24
	ldr	x9, [x8, x9]
	cmp	x0, x9
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	madd	x9, x19, x24, x8
	ldr	x9, [x9, #8]
	madd	x8, x21, x24, x8
	ldr	x10, [x8, #8]
	add	x9, x10, x9
	str	x9, [x8, #8]
	b	LBB0_1
LBB0_8:
Lloh0:
	adrp	x8, _AVIERR_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVIERR_OK@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIERR_OK,4,2                  ; @AVIERR_OK
	.no_dead_strip	_AVIFILE_RemoveStream
.subsections_via_symbols
