	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_write_idx1
_avi_write_idx1:                        ## @avi_write_idx1
	.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
	movq	%rdi, %r14
	movq	24(%rdi), %rdi
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_19
## %bb.1:
	movq	16(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rsi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_ff_start_tag
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.2:
	movq	8(%r14), %rdx
	leaq	-1(%rax), %rsi
	movl	%eax, %ecx
	andl	$3, %ecx
	cmpq	$3, %rsi
	jae	LBB0_20
## %bb.3:
	xorl	%esi, %esi
	jmp	LBB0_4
LBB0_20:
	movl	%eax, %edi
	andl	$-4, %edi
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rbx
	movq	8(%rbx), %rbx
	movq	$0, (%rbx)
	movq	8(%rdx,%rsi,8), %rbx
	movq	8(%rbx), %rbx
	movq	$0, (%rbx)
	movq	16(%rdx,%rsi,8), %rbx
	movq	8(%rbx), %rbx
	movq	$0, (%rbx)
	movq	24(%rdx,%rsi,8), %rbx
	movq	8(%rbx), %rbx
	movq	$0, (%rbx)
	addq	$4, %rsi
	cmpq	%rsi, %rdi
	jne	LBB0_21
LBB0_4:
	testq	%rcx, %rcx
	je	LBB0_7
## %bb.5:
	leaq	(%rdx,%rsi,8), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rdi
	movq	8(%rdi), %rdi
	movq	$0, (%rdi)
	incq	%rsi
	cmpq	%rsi, %rcx
	jne	LBB0_6
LBB0_7:
	testl	%eax, %eax
	jle	LBB0_18
## %bb.8:
	movl	$1, %r13d
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_ffio_wfourcc
	movq	16(%r15), %rsi
	movq	%rbx, %rdi
	callq	_avio_wl32
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	callq	_avio_wl32
	movq	24(%r15), %rsi
	movq	%rbx, %rdi
	callq	_avio_wl32
	incq	(%r12)
	cmpl	$0, (%r14)
	movl	$0, %r12d
	movl	$1, %r13d
	jle	LBB0_18
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movq	(%rax,%r12,8), %rax
	movq	8(%rax), %rdi
	movq	(%rdi), %rsi
	cmpq	%rsi, 8(%rdi)
	jle	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	addq	$8, %rdi
	callq	_avi_get_ientry
	testl	%r13d, %r13d
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rax), %rcx
	xorl	%r13d, %r13d
	cmpq	(%r15), %rcx
	jge	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	xorl	%r13d, %r13d
	movq	%rax, %r15
	movl	%r12d, %eax
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%r12
	movslq	(%r14), %rax
	cmpq	%rax, %r12
	jl	LBB0_9
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	testl	%r13d, %r13d
	jne	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%r14), %rax
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	(%rax,%rcx,8), %rax
	movq	8(%rax), %r12
	movq	8(%r15), %rsi
	cmpb	$0, (%rsi)
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rax), %rax
	movl	(%rax), %edx
	leaq	-69(%rbp), %rbx
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_avi_stream2fourcc
	movq	%rbx, %rsi
	jmp	LBB0_17
LBB0_18:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_ff_end_tag
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_avi_write_counters
LBB0_19:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"idx1"

	.no_dead_strip	_avi_write_idx1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_write_idx1
_avi_write_idx1:                        ; @avi_write_idx1
	.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
	ldr	x20, [x0, #24]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.1:
	mov	x19, x0
	ldr	x24, [x0, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_ff_start_tag
	mov	x21, x0
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.2:
	ldr	x9, [x19, #8]
	cmp	w8, #4
	b.hs	LBB0_4
; %bb.3:
	mov	x10, #0
	b	LBB0_7
LBB0_4:
	and	x10, x8, #0xfffffffc
	add	x11, x9, #16
	mov	x12, x10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x13, x14, [x11, #-16]
	ldp	x15, x16, [x11], #32
	ldr	x13, [x13, #8]
	ldr	x14, [x14, #8]
	ldr	x15, [x15, #8]
	ldr	x16, [x16, #8]
	str	xzr, [x13]
	str	xzr, [x14]
	str	xzr, [x15]
	str	xzr, [x16]
	subs	x12, x12, #4
	b.ne	LBB0_5
; %bb.6:
	cmp	x10, x8
	b.eq	LBB0_9
LBB0_7:
	add	x9, x9, x10, lsl #3
	sub	x10, x8, x10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9], #8
	ldr	x11, [x11, #8]
	str	xzr, [x11]
	subs	x10, x10, #1
	b.ne	LBB0_8
LBB0_9:
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.10:
	mov	x23, #0
	mov	x25, #0
	mov	w26, #1
	mov	w22, #-1
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x20
	mov	x1, x23
	bl	_ffio_wfourcc
	ldr	x1, [x25, #16]
	mov	x0, x20
	bl	_avio_wl32
	ldr	x1, [x25]
	mov	x0, x20
	bl	_avio_wl32
	ldr	x1, [x25, #24]
	mov	x0, x20
	bl	_avio_wl32
	mov	x23, #0
	ldr	x8, [x26]
	add	x8, x8, #1
	str	x8, [x26]
	ldr	w8, [x19]
	mov	w26, #1
	cmp	w8, #0
	b.le	LBB0_21
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x23, lsl #3]
	ldr	x0, [x8, #8]
	ldr	x1, [x0]
	ldr	x8, [x0, #8]!
	cmp	x8, x1
	b.le	LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	bl	_avi_get_ientry
	cbnz	w26, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x0]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ge	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w26, #0
	mov	x25, x0
	mov	x22, x23
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w26, #0
LBB0_17:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.lt	LBB0_12
; %bb.18:                               ;   in Loop: Header=BB0_12 Depth=1
	cbnz	w26, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, w22, sxtw #3]
	ldr	x26, [x8, #8]
	ldr	x23, [x25, #8]
	ldrb	w9, [x23]
	cbnz	w9, LBB0_11
; %bb.20:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x23, sp, #11
	ldr	x8, [x8]
	ldr	w2, [x8]
	add	x0, sp, #11
	mov	x1, x22
	bl	_avi_stream2fourcc
	b	LBB0_11
LBB0_21:
	mov	x0, x20
	mov	x1, x21
	bl	_ff_end_tag
	ldr	w1, [x24]
	mov	x0, x19
	bl	_avi_write_counters
LBB0_22:
	mov	w0, #0
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"idx1"

	.no_dead_strip	_avi_write_idx1
.subsections_via_symbols
