	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_write_standard_index_chunk
_avi_write_standard_index_chunk:        ## @avi_write_standard_index_chunk
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	(%rcx), %r14
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, %ecx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	movl	(%r14), %r13d
	movl	(%r12), %r15d
	movq	_AVI_STD_INDEX_ENTRY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r15d, %eax
	addl	$32, %eax
	movq	_ULONG_MAX@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	setle	%dil
	callq	_vc_container_assert
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%r14)
	je	LBB0_1
## %bb.8:
	movl	$8, %edi
	callq	_INT64_C
	imull	%eax, %r15d
	addl	$32, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_WRITE_BYTES
	movq	%rbx, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_STREAM_STATUS                  ## TAILCALL
LBB0_1:
	movl	%r13d, %r14d
	addl	$12, %r14d
	movq	%rbx, %rdi
	callq	_STREAM_POSITION
	movl	%eax, 8(%r12)
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	leal	-8(%r13), %eax
	testl	%r13d, %r13d
	cmovel	%r13d, %eax
	movl	%eax, 4(%r12)
	leaq	-44(%rbp), %rdi
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	callq	_avi_index_chunk_id_from_track_num
	movl	-44(%rbp), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_WRITE_FOURCC
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_WRITE_U32
	movq	%rbx, %rdi
	leaq	-44(%rbp), %rsi
	movl	%r12d, %edx
	movl	%r12d, %r13d
	callq	_avi_chunk_id_from_track_num
	leaq	L_.str.2(%rip), %rdx
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_WRITE_U16
	leaq	L_.str.3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U8
	movq	_AVI_INDEX_OF_CHUNKS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%rbx, %rdi
	callq	_WRITE_U8
	leaq	L_.str.5(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_WRITE_U32
	movl	-44(%rbp), %esi
	leaq	L_.str.6(%rip), %rdx
	movq	%rbx, %rdi
	callq	_WRITE_FOURCC
	leaq	L_.str.7(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_WRITE_U64
	leaq	L_.str.8(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U32
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %r15d
	xorl	%edi, %edi
	callq	_INT64_C
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_vc_container_io_seek
	movq	%rbx, %rdi
	callq	_STREAM_STATUS
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_7
## %bb.2:
	movl	%r13d, %r14d
	movl	$4, %r15d
	leaq	-48(%rbp), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_STREAM_STATUS
	cmpq	(%r12), %rax
	jne	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	leaq	-56(%rbp), %rsi
	movq	%r13, %rdx
	callq	_avi_read_index_entry
	cmpq	(%r12), %rax
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r14d, -56(%rbp)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	leaq	L_.str.9(%rip), %rdx
	callq	_WRITE_U32
	movl	-48(%rbp), %esi
	movq	%rbx, %rdi
	leaq	L_.str.10(%rip), %rdx
	callq	_WRITE_U32
	movl	-48(%rbp), %eax
	incl	%eax
	movq	_AVI_INDEX_DELTAFRAME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	andl	$-2, %ecx
	addl	%ecx, %r15d
	addl	$12, %r15d
	jmp	LBB0_6
LBB0_7:
	movq	%rbx, %rdi
	callq	_AVI_END_CHUNK
	movq	%rbx, %rdi
	callq	_STREAM_STATUS
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVI_STD_INDEX_ENTRY_SIZE,8,3   ## @AVI_STD_INDEX_ENTRY_SIZE
	.comm	_ULONG_MAX,8,3                  ## @ULONG_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Chunk ID"

L_.str.1:                               ## @.str.1
	.asciz	"Chunk Size"

L_.str.2:                               ## @.str.2
	.asciz	"wLongsPerEntry"

L_.str.3:                               ## @.str.3
	.asciz	"bIndexSubType"

	.comm	_AVI_INDEX_OF_CHUNKS,4,2        ## @AVI_INDEX_OF_CHUNKS
L_.str.4:                               ## @.str.4
	.asciz	"bIndexType"

L_.str.5:                               ## @.str.5
	.asciz	"nEntriesInUse"

L_.str.6:                               ## @.str.6
	.asciz	"dwChunkId"

L_.str.7:                               ## @.str.7
	.asciz	"qwBaseOffset"

L_.str.8:                               ## @.str.8
	.asciz	"dwReserved"

	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
L_.str.9:                               ## @.str.9
	.asciz	"dwOffset"

L_.str.10:                              ## @.str.10
	.asciz	"dwSize"

	.comm	_AVI_INDEX_DELTAFRAME,4,2       ## @AVI_INDEX_DELTAFRAME
	.no_dead_strip	_avi_write_standard_index_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_write_standard_index_chunk
_avi_write_standard_index_chunk:        ; @avi_write_standard_index_chunk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	ldp	x9, x8, [x0]
	ldr	x24, [x8]
	ldr	x8, [x9, w1, uxtw #3]
	ldr	x8, [x8]
	ldr	x25, [x8]
	ldr	w22, [x24]
	ldr	w21, [x25]
Lloh0:
	adrp	x8, _AVI_STD_INDEX_ENTRY_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVI_STD_INDEX_ENTRY_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w26, wzr, #0x20
	madd	w8, w21, w8, w26
Lloh3:
	adrp	x9, _ULONG_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ULONG_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	cset	w0, le
	bl	_vc_container_assert
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #8
	bl	_INT64_C
	madd	w2, w0, w21, w26
	mov	x0, x19
	mov	x1, #0
	bl	_WRITE_BYTES
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_STREAM_STATUS
LBB0_2:
	add	w22, w22, #12
	mov	x0, x19
	bl	_STREAM_POSITION
	sub	w8, w23, #8
	cmp	w23, #0
	csel	w8, wzr, w8, eq
	stp	w8, w0, [x25, #4]
	add	x0, sp, #12
	mov	x1, x20
	bl	_avi_index_chunk_id_from_track_num
	ldr	w1, [sp, #12]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_WRITE_FOURCC
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x23
	bl	_WRITE_U32
	add	x1, sp, #12
	mov	x0, x19
	mov	x2, x20
	bl	_avi_chunk_id_from_track_num
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w1, #2
	bl	_WRITE_U16
Lloh12:
	adrp	x2, l_.str.3@PAGE
Lloh13:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U8
Lloh14:
	adrp	x8, _AVI_INDEX_OF_CHUNKS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AVI_INDEX_OF_CHUNKS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str.4@PAGE
Lloh18:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U8
Lloh19:
	adrp	x2, l_.str.5@PAGE
Lloh20:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_WRITE_U32
	ldr	w1, [sp, #12]
Lloh21:
	adrp	x2, l_.str.6@PAGE
Lloh22:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_WRITE_FOURCC
Lloh23:
	adrp	x2, l_.str.7@PAGE
Lloh24:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x0, x19
	mov	x1, x22
	bl	_WRITE_U64
Lloh25:
	adrp	x2, l_.str.8@PAGE
Lloh26:
	add	x2, x2, l_.str.8@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_WRITE_U32
	ldr	w21, [x24, #4]
	mov	w0, #0
	bl	_INT64_C
	mov	x1, x0
	mov	x0, x21
	bl	_vc_container_io_seek
	mov	x0, x19
	bl	_STREAM_STATUS
Lloh27:
	adrp	x24, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh28:
	ldr	x24, [x24, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.3:
	mov	w21, #4
Lloh29:
	adrp	x22, l_.str.9@PAGE
Lloh30:
	add	x22, x22, l_.str.9@PAGEOFF
Lloh31:
	adrp	x25, _AVI_INDEX_DELTAFRAME@GOTPAGE
Lloh32:
	ldr	x25, [x25, _AVI_INDEX_DELTAFRAME@GOTPAGEOFF]
Lloh33:
	adrp	x23, l_.str.10@PAGE
Lloh34:
	add	x23, x23, l_.str.10@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	bl	_STREAM_STATUS
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #4
	add	x2, sp, #8
	mov	x0, x19
	bl	_avi_read_index_entry
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp, #4]
	cmp	w8, w20
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_WRITE_U32
	ldr	w1, [sp, #8]
	mov	x0, x19
	mov	x2, x23
	bl	_WRITE_U32
	ldr	w8, [sp, #8]
	add	w8, w8, #1
	ldr	w9, [x25]
	bic	w8, w8, w9
	and	w8, w8, #0xfffffffe
	add	w8, w21, w8
	add	w21, w8, #12
	b	LBB0_4
LBB0_8:
	mov	x0, x19
	bl	_AVI_END_CHUNK
	mov	x0, x19
	bl	_STREAM_STATUS
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_AVI_STD_INDEX_ENTRY_SIZE,8,3   ; @AVI_STD_INDEX_ENTRY_SIZE
	.comm	_ULONG_MAX,8,3                  ; @ULONG_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Chunk ID"

l_.str.1:                               ; @.str.1
	.asciz	"Chunk Size"

l_.str.2:                               ; @.str.2
	.asciz	"wLongsPerEntry"

l_.str.3:                               ; @.str.3
	.asciz	"bIndexSubType"

	.comm	_AVI_INDEX_OF_CHUNKS,4,2        ; @AVI_INDEX_OF_CHUNKS
l_.str.4:                               ; @.str.4
	.asciz	"bIndexType"

l_.str.5:                               ; @.str.5
	.asciz	"nEntriesInUse"

l_.str.6:                               ; @.str.6
	.asciz	"dwChunkId"

l_.str.7:                               ; @.str.7
	.asciz	"qwBaseOffset"

l_.str.8:                               ; @.str.8
	.asciz	"dwReserved"

	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
l_.str.9:                               ; @.str.9
	.asciz	"dwOffset"

l_.str.10:                              ; @.str.10
	.asciz	"dwSize"

	.comm	_AVI_INDEX_DELTAFRAME,4,2       ; @AVI_INDEX_DELTAFRAME
	.no_dead_strip	_avi_write_standard_index_chunk
.subsections_via_symbols
