	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AVIFILE_LoadIndex
_AVIFILE_LoadIndex:                     ## @AVIFILE_LoadIndex
	.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	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	_AVIERR_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_IDX_PER_BLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	shll	$3, %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_21
## %bb.1:
	movq	%rax, %r15
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	cmpq	$0, 8(%r14)
	je	LBB0_10
## %bb.2:
	xorl	%r12d, %r12d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	cmpq	8(%r14), %r12
	jae	LBB0_10
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	(%rax,%r12,8), %rbx
	movl	$-1, (%rbx)
	cmpq	$0, 24(%rbx)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	24(%rbx), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapFree
	movq	$0, 24(%rbx)
	movl	$0, 4(%rbx)
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 8(%rbx)
	je	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%r12, %r12
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_AVIFILEINFO_ISINTERLEAVED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r14)
	je	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rax
	movq	(%rax), %rax
	movl	4(%rax), %eax
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%rbx), %ecx
	testl	%ecx, %ecx
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	20(%rbx), %eax
	cltd
	idivl	%ecx
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	20(%rbx), %eax
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, 4(%rbx)
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	4(%rbx), %edx
	shll	$3, %edx
	movl	%eax, %edi
	callq	_HeapAlloc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	jne	LBB0_9
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 4(%rbx)
	jle	LBB0_9
## %bb.20:
	movl	$0, 4(%rbx)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_HeapFree
LBB0_21:
	movq	_AVIERR_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_32
LBB0_10:
	testq	%r13, %r13
	je	LBB0_25
## %bb.11:
	addq	$8, -56(%rbp)                   ## 8-byte Folded Spill
	movq	$-1, %r12
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_12 Depth=1
	sarl	$3, %ebx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	movq	%r12, %rcx
	leaq	-48(%rbp), %r8
	callq	_AVIFILE_ParseIndex
	testq	%r13, %r13
	je	LBB0_25
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	_IDX_PER_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$3, %edi
	movq	%r13, %rsi
	callq	_min
	movl	%eax, %ebx
	movl	24(%r14), %edi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_mmioRead
	cmpl	%ebx, %eax
	jne	LBB0_13
## %bb.22:                              ##   in Loop: Header=BB0_12 Depth=1
	movslq	%ebx, %rax
	subq	%rax, %r13
	cmpq	$-1, %r12
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	subq	(%r15), %r12
	jmp	LBB0_24
LBB0_25:
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_26
LBB0_13:
	movq	_AVIERR_FILEREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_26:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_HeapFree
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_32
## %bb.27:
	xorl	%ebx, %ebx
	leaq	L_.str(%rip), %r15
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_28 Depth=1
	incq	%rbx
	cmpq	%rax, %rbx
	jae	LBB0_32
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rcx
	movq	(%rcx,%rbx,8), %rcx
	cmpq	$0, 8(%rcx)
	jne	LBB0_31
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	movslq	20(%rcx), %rdx
	movslq	(%rcx), %rcx
	leal	1(%rcx), %esi
	cmpl	%esi, %edx
	je	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_28 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ERR
	movq	8(%r14), %rax
	jmp	LBB0_31
LBB0_32:
	movl	%r12d, %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
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_IDX_PER_BLOCK,4,2              ## @IDX_PER_BLOCK
	.comm	_AVIERR_MEMORY,4,2              ## @AVIERR_MEMORY
	.comm	_AVIFILEINFO_ISINTERLEAVED,4,2  ## @AVIFILEINFO_ISINTERLEAVED
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_AVIERR_FILEREAD,4,2            ## @AVIERR_FILEREAD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"stream %u length mismatch: dwLength=%u found=%d\n"

	.no_dead_strip	_AVIFILE_LoadIndex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_LoadIndex
_AVIFILE_LoadIndex:                     ; @AVIFILE_LoadIndex
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x23, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _AVIERR_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVIERR_OK@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
Lloh3:
	adrp	x8, _TRUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	bl	_GetProcessHeap
Lloh6:
	adrp	x25, _IDX_PER_BLOCK@GOTPAGE
Lloh7:
	ldr	x25, [x25, _IDX_PER_BLOCK@GOTPAGEOFF]
	ldr	w8, [x25]
	lsl	w2, w8, #3
	mov	w1, #0
	bl	_HeapAlloc
	cbz	x0, LBB0_17
; %bb.1:
	mov	x21, x0
	str	x23, [sp]                       ; 8-byte Folded Spill
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_18
; %bb.2:
	mov	x24, #0
	mov	w26, #-1
Lloh8:
	adrp	x27, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh9:
	ldr	x27, [x27, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh10:
	adrp	x28, _AVIFILEINFO_ISINTERLEAVED@GOTPAGE
Lloh11:
	ldr	x28, [x28, _AVIFILEINFO_ISINTERLEAVED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	ldr	x8, [x20, #8]
	cmp	x24, x8
	b.hs	LBB0_18
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x23, [x8, x24, lsl #3]
	str	w26, [x23]
	ldr	x8, [x23, #24]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_GetProcessHeap
	ldr	x2, [x23, #24]
	mov	w1, #0
	bl	_HeapFree
	str	xzr, [x23, #24]
	str	wzr, [x23, #4]
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x24, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20, #16]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w8, [x8, #4]
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23, #16]
	cbz	w8, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x23, #20]
	sdiv	w8, w9, w8
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23, #20]
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w8, [x23, #4]
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_GetProcessHeap
	ldr	w1, [x27]
	ldr	w8, [x23, #4]
	lsl	w2, w8, #3
	bl	_HeapAlloc
	str	x0, [x23, #24]
	cbnz	x0, LBB0_3
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23, #4]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.16:
	str	wzr, [x23, #4]
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x21
	bl	_HeapFree
LBB0_17:
Lloh12:
	adrp	x8, _AVIERR_MEMORY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AVIERR_MEMORY@GOTPAGEOFF]
Lloh14:
	ldr	w19, [x8]
	b	LBB0_31
LBB0_18:
	cbz	x22, LBB0_25
; %bb.19:
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	add	x26, x8, #8
	mov	x23, #-1
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	asr	w2, w24, #3
	add	x4, sp, #12
	mov	x0, x20
	mov	x1, x21
	mov	x3, x23
	bl	_AVIFILE_ParseIndex
	cbz	x22, LBB0_25
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	lsl	w0, w8, #3
	mov	x1, x22
	bl	_min
	mov	x24, x0
	ldr	w0, [x20, #24]
	mov	x1, x21
	mov	x2, x24
	bl	_mmioRead
	cmp	w0, w24
	b.ne	LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	sub	x22, x22, w24, sxtw
	cmn	x23, #1
	b.ne	LBB0_20
; %bb.23:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x8, [x21]
	sub	x23, x26, x8
	b	LBB0_20
LBB0_24:
Lloh15:
	adrp	x8, _AVIERR_FILEREAD@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AVIERR_FILEREAD@GOTPAGEOFF]
Lloh17:
	ldr	w19, [x8]
LBB0_25:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x21
	bl	_HeapFree
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_31
; %bb.26:
	mov	x21, #0
Lloh18:
	adrp	x22, l_.str@PAGE
Lloh19:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_28 Depth=1
	add	x21, x21, #1
	cmp	x21, x8
	b.hs	LBB0_31
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20]
	ldr	x9, [x9, x21, lsl #3]
	ldr	x10, [x9, #8]
	cbnz	x10, LBB0_27
; %bb.29:                               ;   in Loop: Header=BB0_28 Depth=1
	ldrsw	x2, [x9, #20]
	ldrsw	x3, [x9]
	add	w9, w3, #1
	cmp	w2, w9
	b.eq	LBB0_27
; %bb.30:                               ;   in Loop: Header=BB0_28 Depth=1
	mov	x0, x22
	mov	x1, x21
	bl	_ERR
	ldr	x8, [x20, #8]
	b	LBB0_27
LBB0_31:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIERR_OK,4,2                  ; @AVIERR_OK
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_IDX_PER_BLOCK,4,2              ; @IDX_PER_BLOCK
	.comm	_AVIERR_MEMORY,4,2              ; @AVIERR_MEMORY
	.comm	_AVIFILEINFO_ISINTERLEAVED,4,2  ; @AVIFILEINFO_ISINTERLEAVED
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_AVIERR_FILEREAD,4,2            ; @AVIERR_FILEREAD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"stream %u length mismatch: dwLength=%u found=%d\n"

	.no_dead_strip	_AVIFILE_LoadIndex
.subsections_via_symbols
