	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AVIFILE_SaveIndex
_AVIFILE_SaveIndex:                     ## @AVIFILE_SaveIndex
	.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	%rdi, %rbx
	movq	_ckidAVINEWINDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	movq	$0, -112(%rbp)
	movl	8(%rdi), %edi
	leaq	-112(%rbp), %rsi
	xorl	%edx, %edx
	callq	_mmioCreateChunk
	movq	_S_OK@GOTPCREL(%rip), %rdx
	movq	_AVIERR_FILEWRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rdx), %rax
	jne	LBB0_60
## %bb.1:
	movq	_AVIFILEINFO_ISINTERLEAVED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 32(%rbx)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.2:
	movq	24(%rbx), %rax
	movq	(%rax), %rdi
	cmpq	$0, 32(%rdi)
	je	LBB0_16
## %bb.3:
	addq	$64, %rdi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_AVIStreamTimeToSample
	movq	%rax, %r15
	jmp	LBB0_17
LBB0_4:
	cmpq	$0, 40(%rbx)
	je	LBB0_42
## %bb.5:
	leaq	-80(%rbp), %r14
	xorl	%ecx, %ecx
	movq	_AVISTREAMINFO_FORMATCHANGES@GOTPCREL(%rip), %r12
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##       Child Loop BB0_10 Depth 3
	movq	24(%rbx), %rax
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rcx,8), %r13
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_10 Depth 3
	movl	(%r12), %eax
	testl	%eax, 48(%r13)
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	56(%r13), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	16(%r13), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_6 Depth=1
                                        ##     Parent Loop BB0_7 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpq	%r15, (%rcx,%rbx)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=3
	addq	$24, %rbx
	decq	%rax
	jne	LBB0_10
	jmp	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	_AVIIF_NOTIME@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	_cktypePALchange@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r13), %esi
	callq	_MAKEAVICKID
	movq	%rax, -56(%rbp)
	movq	16(%r13), %rax
	movl	16(%rax,%rbx), %ecx
	movl	%ecx, -72(%rbp)
	movq	8(%rax,%rbx), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	subq	16(%rcx), %rax
	movq	%rax, -80(%rbp)
	movl	8(%rcx), %edi
	movl	%r14d, %esi
	movl	$32, %edx
	callq	_mmioWrite
	cmpl	$32, %eax
	jne	LBB0_59
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	8(%r13), %rax
	movq	%r15, %rcx
	shlq	$5, %rcx
	movups	16(%rax,%rcx), %xmm0
	movups	%xmm0, -64(%rbp)
	movl	8(%rax,%rcx), %edx
	movl	%edx, -72(%rbp)
	movq	(%rax,%rcx), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	subq	16(%rcx), %rax
	movq	%rax, -80(%rbp)
	movl	8(%rcx), %edi
	movl	%r14d, %esi
	movl	$32, %edx
	callq	_mmioWrite
	cmpl	$32, %eax
	jne	LBB0_59
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=2
	incq	%r15
	cmpq	(%r13), %r15
	jbe	LBB0_7
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	cmpq	40(%rbx), %rcx
	jb	LBB0_6
	jmp	LBB0_42
LBB0_16:
	movl	$1, %r15d
LBB0_17:
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	movq	40(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_23
## %bb.18:
	movq	24(%rbx), %rcx
	leaq	-1(%rdx), %rsi
	movl	%edx, %eax
	andl	$3, %eax
	cmpq	$3, %rsi
	jae	LBB0_45
## %bb.19:
	xorl	%r13d, %r13d
	xorl	%esi, %esi
LBB0_20:
	testq	%rax, %rax
	je	LBB0_24
## %bb.21:
	leaq	(%rcx,%rsi,8), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rsi
	movq	40(%rsi), %rsi
	cmpq	%rsi, %r13
	cmovbeq	%rsi, %r13
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_22
	jmp	LBB0_24
LBB0_23:
	xorl	%r13d, %r13d
LBB0_24:
	movq	%r13, %rsi
	negq	%rsi
	movq	48(%rbx), %rax
	subq	%r13, %rax
	cmpq	%rsi, %rax
	jbe	LBB0_42
## %bb.25:
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_27
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_27 Depth=1
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	addq	%r15, %rsi
	movq	48(%r14), %rax
	subq	%r13, %rax
	cmpq	%rax, %rsi
	movq	%r14, %rbx
	jae	LBB0_42
LBB0_27:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_34 Depth 2
                                        ##       Child Loop BB0_40 Depth 3
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	leaq	(%rsi,%r13), %r12
	xorl	%edi, %edi
	cmpq	(%rbx), %r12
	setb	%dil
	callq	_assert
	movq	_listtypeAVIRECORD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movq	_AVIIF_LIST@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	56(%rbx), %rax
	movq	%r12, %rcx
	shlq	$4, %rcx
	movl	8(%rax,%rcx), %edx
	movl	%edx, -72(%rbp)
	movq	(%rax,%rcx), %rax
	subq	16(%rbx), %rax
	movq	%rax, -80(%rbp)
	movl	8(%rbx), %edi
	leaq	-80(%rbp), %rsi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$32, %edx
	callq	_mmioWrite
	cmpl	$32, %eax
	jne	LBB0_59
## %bb.28:                              ##   in Loop: Header=BB0_27 Depth=1
	movq	%rbx, %r14
	movq	40(%rbx), %rax
	testq	%rax, %rax
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_26
## %bb.29:                              ##   in Loop: Header=BB0_27 Depth=1
	xorl	%r15d, %r15d
	jmp	LBB0_34
LBB0_30:                                ##   in Loop: Header=BB0_34 Depth=2
	movq	_AVIIF_NOTIME@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	_cktypePALchange@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%rbx), %esi
	callq	_MAKEAVICKID
	movq	%rax, -56(%rbp)
	movq	16(%rbx), %rax
	movl	16(%rax,%r14), %ecx
	movl	%ecx, -72(%rbp)
	movq	8(%rax,%r14), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	subq	16(%rcx), %rax
	movq	%rax, -80(%rbp)
	movl	8(%rcx), %edi
	leaq	-80(%rbp), %rsi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$32, %edx
	callq	_mmioWrite
	cmpl	$32, %eax
	jne	LBB0_59
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_34 Depth=2
	movq	8(%rbx), %rax
	movq	%r12, %rcx
	shlq	$5, %rcx
	movups	16(%rax,%rcx), %xmm0
	movups	%xmm0, -64(%rbp)
	movl	8(%rax,%rcx), %edx
	movl	%edx, -72(%rbp)
	movq	(%rax,%rcx), %rax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	subq	16(%r14), %rax
	movq	%rax, -80(%rbp)
	movl	8(%r14), %edi
	leaq	-80(%rbp), %rsi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$32, %edx
	callq	_mmioWrite
	cmpl	$32, %eax
	jne	LBB0_59
## %bb.32:                              ##   in Loop: Header=BB0_34 Depth=2
	movq	40(%r14), %rax
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
LBB0_33:                                ##   in Loop: Header=BB0_34 Depth=2
	incq	%r15
	cmpq	%rax, %r15
	jae	LBB0_26
LBB0_34:                                ##   Parent Loop BB0_27 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_40 Depth 3
	movq	24(%r14), %rcx
	movq	(%rcx,%r15,8), %rbx
	movq	40(%rbx), %rcx
	movq	%rcx, %rdx
	negq	%rdx
	cmpq	%rdx, %rsi
	jb	LBB0_33
## %bb.35:                              ##   in Loop: Header=BB0_34 Depth=2
	movq	%r13, %rdx
	subq	%rcx, %rdx
	movl	$0, %ecx
	cmovaeq	%rdx, %rcx
	subq	%rcx, %r12
	cmpq	%r12, (%rbx)
	jbe	LBB0_33
## %bb.36:                              ##   in Loop: Header=BB0_34 Depth=2
	movq	_AVISTREAMINFO_FORMATCHANGES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 48(%rbx)
	je	LBB0_31
## %bb.37:                              ##   in Loop: Header=BB0_34 Depth=2
	movq	56(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_31
## %bb.38:                              ##   in Loop: Header=BB0_34 Depth=2
	movq	16(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_31
## %bb.39:                              ##   in Loop: Header=BB0_34 Depth=2
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_40:                                ##   Parent Loop BB0_27 Depth=1
                                        ##     Parent Loop BB0_34 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpq	%r12, (%rcx,%r14)
	je	LBB0_30
## %bb.41:                              ##   in Loop: Header=BB0_40 Depth=3
	addq	$24, %r14
	decq	%rax
	jne	LBB0_40
	jmp	LBB0_31
LBB0_42:
	movl	8(%rbx), %edi
	leaq	-112(%rbp), %rsi
	xorl	%edx, %edx
	callq	_mmioAscend
	movq	_S_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_59
## %bb.43:
	movq	_AVIERR_OK@GOTPCREL(%rip), %rcx
	jmp	LBB0_60
LBB0_59:
	movq	_AVIERR_FILEWRITE@GOTPCREL(%rip), %rcx
LBB0_60:
	movl	(%rcx), %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_45:
	andq	$-4, %rdx
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	jmp	LBB0_47
	.p2align	4, 0x90
LBB0_46:                                ##   in Loop: Header=BB0_47 Depth=1
	addq	$4, %rsi
	cmpq	%rsi, %rdx
	je	LBB0_20
LBB0_47:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rdi
	movq	40(%rdi), %rdi
	cmpq	%rdi, %r13
	ja	LBB0_49
## %bb.48:                              ##   in Loop: Header=BB0_47 Depth=1
	movq	%rdi, %r13
LBB0_49:                                ##   in Loop: Header=BB0_47 Depth=1
	movq	8(%rcx,%rsi,8), %rdi
	movq	40(%rdi), %rdi
	cmpq	%rdi, %r13
	ja	LBB0_51
## %bb.50:                              ##   in Loop: Header=BB0_47 Depth=1
	movq	%rdi, %r13
LBB0_51:                                ##   in Loop: Header=BB0_47 Depth=1
	movq	16(%rcx,%rsi,8), %rdi
	movq	40(%rdi), %rdi
	cmpq	%rdi, %r13
	ja	LBB0_53
## %bb.52:                              ##   in Loop: Header=BB0_47 Depth=1
	movq	%rdi, %r13
LBB0_53:                                ##   in Loop: Header=BB0_47 Depth=1
	movq	24(%rcx,%rsi,8), %rdi
	movq	40(%rdi), %rdi
	cmpq	%rdi, %r13
	ja	LBB0_46
## %bb.54:                              ##   in Loop: Header=BB0_47 Depth=1
	movq	%rdi, %r13
	jmp	LBB0_46
	.cfi_endproc
                                        ## -- End function
	.comm	_ckidAVINEWINDEX,4,2            ## @ckidAVINEWINDEX
	.comm	_S_OK,8,3                       ## @S_OK
	.comm	_AVIERR_FILEWRITE,4,2           ## @AVIERR_FILEWRITE
	.comm	_AVIFILEINFO_ISINTERLEAVED,4,2  ## @AVIFILEINFO_ISINTERLEAVED
	.comm	_listtypeAVIRECORD,8,3          ## @listtypeAVIRECORD
	.comm	_AVIIF_LIST,8,3                 ## @AVIIF_LIST
	.comm	_AVISTREAMINFO_FORMATCHANGES,4,2 ## @AVISTREAMINFO_FORMATCHANGES
	.comm	_AVIIF_NOTIME,8,3               ## @AVIIF_NOTIME
	.comm	_cktypePALchange,4,2            ## @cktypePALchange
	.comm	_AVIERR_OK,4,2                  ## @AVIERR_OK
	.no_dead_strip	_AVIFILE_SaveIndex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_SaveIndex
_AVIFILE_SaveIndex:                     ; @AVIFILE_SaveIndex
	.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, x0
Lloh0:
	adrp	x8, _ckidAVINEWINDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ckidAVINEWINDEX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	str	xzr, [sp]
	ldr	w0, [x0, #8]
	mov	x1, sp
	mov	w2, #0
	bl	_mmioCreateChunk
Lloh3:
	adrp	x8, _S_OK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x21, _AVIERR_FILEWRITE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _AVIERR_FILEWRITE@GOTPAGEOFF]
	cmp	x0, x8
	b.ne	LBB0_47
; %bb.1:
	ldr	w8, [x19, #32]
Lloh8:
	adrp	x9, _AVIFILEINFO_ISINTERLEAVED@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AVIFILEINFO_ISINTERLEAVED@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	ldr	x9, [x8, #32]
	cbz	x9, LBB0_16
; %bb.3:
	add	x0, x8, #64
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_AVIStreamTimeToSample
	mov	x20, x0
	b	LBB0_17
LBB0_4:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_45
; %bb.5:
	mov	x20, #0
Lloh11:
	adrp	x23, _AVISTREAMINFO_FORMATCHANGES@GOTPAGE
Lloh12:
	ldr	x23, [x23, _AVISTREAMINFO_FORMATCHANGES@GOTPAGEOFF]
Lloh13:
	adrp	x22, _AVIERR_FILEWRITE@GOTPAGE
Lloh14:
	ldr	x22, [x22, _AVIERR_FILEWRITE@GOTPAGEOFF]
Lloh15:
	adrp	x24, _AVIIF_NOTIME@GOTPAGE
Lloh16:
	ldr	x24, [x24, _AVIIF_NOTIME@GOTPAGEOFF]
Lloh17:
	adrp	x25, _cktypePALchange@GOTPAGE
Lloh18:
	ldr	x25, [x25, _cktypePALchange@GOTPAGEOFF]
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_10 Depth 3
	mov	x26, #0
	ldr	x8, [x19, #24]
	ldr	x27, [x8, x20, lsl #3]
LBB0_7:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_10 Depth 3
	ldr	w8, [x27, #48]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x27, #56]
	cbz	x8, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x28, #0
	ldr	x9, [x27, #16]
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x10, [x9, x28]
	cmp	x10, x26
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=3
	add	x28, x28, #24
	subs	x8, x8, #1
	b.ne	LBB0_10
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x24]
	str	x8, [sp, #32]
	ldr	w0, [x25]
	ldr	w1, [x27, #24]
	bl	_MAKEAVICKID
	str	x0, [sp, #40]
	ldr	x8, [x27, #16]
	add	x8, x8, x28
	ldr	w9, [x8, #16]
	str	w9, [sp, #24]
	ldr	x8, [x8, #8]
	ldr	x9, [x19, #16]
	sub	x8, x8, x9
	str	x8, [sp, #16]
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #32
	bl	_mmioWrite
	cmp	w0, #32
	b.ne	LBB0_21
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x27, #8]
	add	x8, x8, x26, lsl #5
	ldr	x9, [x8, #24]
	str	x9, [sp, #40]
	ldr	x9, [x8, #16]
	str	x9, [sp, #32]
	ldr	w9, [x8, #8]
	str	w9, [sp, #24]
	ldr	x8, [x8]
	ldr	x9, [x19, #16]
	sub	x8, x8, x9
	str	x8, [sp, #16]
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #32
	bl	_mmioWrite
	cmp	w0, #32
	b.ne	LBB0_21
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=2
	add	x26, x26, #1
	ldr	x8, [x27]
	cmp	x26, x8
	b.ls	LBB0_7
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	add	x20, x20, #1
	ldr	x8, [x19, #40]
	cmp	x20, x8
	b.lo	LBB0_6
	b	LBB0_45
LBB0_16:
	mov	w20, #1
LBB0_17:
	cmp	x20, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_20
; %bb.18:
	ldr	x9, [x19, #24]
	cmp	x8, #4
	b.hs	LBB0_22
; %bb.19:
	mov	x23, #0
	mov	x10, #0
	b	LBB0_25
LBB0_20:
	mov	x23, #0
	b	LBB0_27
LBB0_21:
	mov	x21, x22
	b	LBB0_47
LBB0_22:
	mov	x13, #0
	mov	x14, #0
	mov	x12, #0
	mov	x11, #0
	and	x10, x8, #0xfffffffffffffffc
	add	x15, x9, #16
	mov	x16, x10
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldp	x17, x0, [x15, #-16]
	ldp	x1, x2, [x15], #32
	ldr	x17, [x17, #40]
	ldr	x0, [x0, #40]
	ldr	x1, [x1, #40]
	cmp	x13, x17
	csel	x13, x13, x17, hi
	cmp	x14, x0
	csel	x14, x14, x0, hi
	cmp	x12, x1
	csel	x12, x12, x1, hi
	ldr	x17, [x2, #40]
	cmp	x11, x17
	csel	x11, x11, x17, hi
	subs	x16, x16, #4
	b.ne	LBB0_23
; %bb.24:
	cmp	x13, x14
	csel	x13, x13, x14, hi
	cmp	x13, x12
	csel	x12, x13, x12, hi
	cmp	x12, x11
	csel	x23, x12, x11, hi
	cmp	x8, x10
	b.eq	LBB0_27
LBB0_25:
	sub	x8, x8, x10
	add	x9, x9, x10, lsl #3
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9], #8
	ldr	x10, [x10, #40]
	cmp	x23, x10
	csel	x23, x23, x10, hi
	subs	x8, x8, #1
	b.ne	LBB0_26
LBB0_27:
	neg	x24, x23
	ldr	x8, [x19, #48]
	sub	x8, x8, x23
	cmp	x8, x24
	b.ls	LBB0_45
; %bb.28:
Lloh19:
	adrp	x28, _AVISTREAMINFO_FORMATCHANGES@GOTPAGE
Lloh20:
	ldr	x28, [x28, _AVISTREAMINFO_FORMATCHANGES@GOTPAGEOFF]
	b	LBB0_30
LBB0_29:                                ;   in Loop: Header=BB0_30 Depth=1
	add	x24, x24, x20
	ldr	x8, [x19, #48]
	sub	x8, x8, x23
	cmp	x24, x8
	b.hs	LBB0_45
LBB0_30:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_37 Depth 2
                                        ;       Child Loop BB0_43 Depth 3
	ldr	x8, [x19]
	add	x25, x24, x23
	cmp	x25, x8
	cset	w0, lo
	bl	_assert
Lloh21:
	adrp	x8, _listtypeAVIRECORD@GOTPAGE
Lloh22:
	ldr	x8, [x8, _listtypeAVIRECORD@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
Lloh24:
	adrp	x9, _AVIIF_LIST@GOTPAGE
Lloh25:
	ldr	x9, [x9, _AVIIF_LIST@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	stp	x9, x8, [sp, #32]
	ldr	x8, [x19, #56]
	add	x8, x8, x25, lsl #4
	ldr	w9, [x8, #8]
	str	w9, [sp, #24]
	ldr	x8, [x8]
	ldr	x9, [x19, #16]
	sub	x8, x8, x9
	str	x8, [sp, #16]
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #32
	bl	_mmioWrite
	cmp	w0, #32
	b.ne	LBB0_46
; %bb.31:                               ;   in Loop: Header=BB0_30 Depth=1
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_29
; %bb.32:                               ;   in Loop: Header=BB0_30 Depth=1
	mov	x22, #0
	b	LBB0_37
LBB0_33:                                ;   in Loop: Header=BB0_37 Depth=2
Lloh27:
	adrp	x8, _AVIIF_NOTIME@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AVIIF_NOTIME@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	str	x8, [sp, #32]
Lloh30:
	adrp	x8, _cktypePALchange@GOTPAGE
Lloh31:
	ldr	x8, [x8, _cktypePALchange@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	ldr	w1, [x26, #24]
	bl	_MAKEAVICKID
	str	x0, [sp, #40]
	ldr	x8, [x26, #16]
	add	x8, x8, x27
	ldr	w9, [x8, #16]
	str	w9, [sp, #24]
	ldr	x8, [x8, #8]
	ldr	x9, [x19, #16]
	sub	x8, x8, x9
	str	x8, [sp, #16]
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #32
	bl	_mmioWrite
	cmp	w0, #32
	b.ne	LBB0_46
LBB0_34:                                ;   in Loop: Header=BB0_37 Depth=2
	ldr	x8, [x26, #8]
	add	x8, x8, x25, lsl #5
	ldr	x9, [x8, #24]
	str	x9, [sp, #40]
	ldr	x9, [x8, #16]
	str	x9, [sp, #32]
	ldr	w9, [x8, #8]
	str	w9, [sp, #24]
	ldr	x8, [x8]
	ldr	x9, [x19, #16]
	sub	x8, x8, x9
	str	x8, [sp, #16]
	ldr	w0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #32
	bl	_mmioWrite
	cmp	w0, #32
	b.ne	LBB0_46
; %bb.35:                               ;   in Loop: Header=BB0_37 Depth=2
	ldr	x8, [x19, #40]
LBB0_36:                                ;   in Loop: Header=BB0_37 Depth=2
	add	x22, x22, #1
	cmp	x22, x8
	b.hs	LBB0_29
LBB0_37:                                ;   Parent Loop BB0_30 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_43 Depth 3
	ldr	x9, [x19, #24]
	ldr	x26, [x9, x22, lsl #3]
	ldr	x9, [x26, #40]
	neg	x10, x9
	cmp	x24, x10
	b.lo	LBB0_36
; %bb.38:                               ;   in Loop: Header=BB0_37 Depth=2
	subs	x9, x23, x9
	csel	x9, xzr, x9, lo
	ldr	x10, [x26]
	sub	x25, x25, x9
	cmp	x10, x25
	b.ls	LBB0_36
; %bb.39:                               ;   in Loop: Header=BB0_37 Depth=2
	ldr	w8, [x26, #48]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_34
; %bb.40:                               ;   in Loop: Header=BB0_37 Depth=2
	ldr	x8, [x26, #56]
	cbz	x8, LBB0_34
; %bb.41:                               ;   in Loop: Header=BB0_37 Depth=2
	ldr	x9, [x26, #16]
	cbz	x9, LBB0_34
; %bb.42:                               ;   in Loop: Header=BB0_37 Depth=2
	mov	x27, #0
LBB0_43:                                ;   Parent Loop BB0_30 Depth=1
                                        ;     Parent Loop BB0_37 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x10, [x9, x27]
	cmp	x10, x25
	b.eq	LBB0_33
; %bb.44:                               ;   in Loop: Header=BB0_43 Depth=3
	add	x27, x27, #24
	subs	x8, x8, #1
	b.ne	LBB0_43
	b	LBB0_34
LBB0_45:
	ldr	w0, [x19, #8]
	mov	x1, sp
	mov	w2, #0
	bl	_mmioAscend
Lloh33:
	adrp	x8, _S_OK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
Lloh36:
	adrp	x9, _AVIERR_OK@GOTPAGE
Lloh37:
	ldr	x9, [x9, _AVIERR_OK@GOTPAGEOFF]
	cmp	x0, x8
	csel	x21, x9, x21, eq
	b	LBB0_47
LBB0_46:
Lloh38:
	adrp	x21, _AVIERR_FILEWRITE@GOTPAGE
Lloh39:
	ldr	x21, [x21, _AVIERR_FILEWRITE@GOTPAGEOFF]
LBB0_47:
	ldr	w0, [x21]
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_ckidAVINEWINDEX,4,2            ; @ckidAVINEWINDEX
	.comm	_S_OK,8,3                       ; @S_OK
	.comm	_AVIERR_FILEWRITE,4,2           ; @AVIERR_FILEWRITE
	.comm	_AVIFILEINFO_ISINTERLEAVED,4,2  ; @AVIFILEINFO_ISINTERLEAVED
	.comm	_listtypeAVIRECORD,8,3          ; @listtypeAVIRECORD
	.comm	_AVIIF_LIST,8,3                 ; @AVIIF_LIST
	.comm	_AVISTREAMINFO_FORMATCHANGES,4,2 ; @AVISTREAMINFO_FORMATCHANGES
	.comm	_AVIIF_NOTIME,8,3               ; @AVIIF_NOTIME
	.comm	_cktypePALchange,4,2            ; @cktypePALchange
	.comm	_AVIERR_OK,4,2                  ; @AVIERR_OK
	.no_dead_strip	_AVIFILE_SaveIndex
.subsections_via_symbols
