	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_write_ix
_avi_write_ix:                          ## @avi_write_ix
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %r12
	movb	$0, -44(%rbp)
	movl	$808482921, -48(%rbp)           ## imm = 0x30307869
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	(%r12), %edi
	callq	_av_assert0
	cmpl	$0, (%r13)
	jle	LBB0_11
## %bb.1:
	xorl	%r15d, %r15d
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	cmpl	%eax, %ebx
	setl	%dil
	callq	_av_assert0
	incq	%r15
	movslq	(%r13), %rax
	cmpq	%rax, %r15
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax,%r15,8), %rax
	movq	8(%rax), %r14
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ebx
	movl	4(%rcx), %eax
	subl	(%r14), %ebx
	cmpl	%eax, %ebx
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_AVI_MASTER_INDEX_ENTRY_SIZE@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	movq	_AVI_MASTER_INDEX_PREFIX_SIZE@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_avio_tell
	movl	%eax, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_update_odml_entry
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_write_odml_master
	movq	%r12, %rdi
	callq	_avio_tell
	subl	%r13d, %eax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	sete	%dil
	callq	_av_assert1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %eax
	decl	%eax
	movl	%eax, (%r14)
	movl	4(%rcx), %eax
	movl	$1, %ebx
	jmp	LBB0_4
LBB0_5:
	testl	%eax, %eax
	jle	LBB0_11
## %bb.6:
	xorl	%r14d, %r14d
	movl	$2147483647, %r15d              ## imm = 0x7FFFFFFF
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	callq	_avio_tell
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	subl	%edx, %eax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%eax, %ecx
	callq	_update_odml_entry
	incq	%r14
	movslq	(%r13), %rax
	cmpq	%rax, %r14
	jge	LBB0_11
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movq	8(%r13), %rax
	movq	(%rax,%r14,8), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %r13
	movl	(%rcx), %edx
	leaq	-85(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_avi_stream2fourcc
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	leal	48(%r14), %eax
	movb	%al, -45(%rbp)
	movq	%r12, %rdi
	callq	_avio_tell
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	leaq	-48(%rbp), %rsi
	callq	_ffio_wfourcc
	movl	4(%r13), %eax
	leal	24(,%rax,8), %esi
	movq	%r12, %rdi
	callq	_avio_wl32
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_avio_wl16
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_w8
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_avio_w8
	movl	4(%r13), %esi
	movq	%r12, %rdi
	callq	_avio_wl32
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ffio_wfourcc
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %esi
	movq	%r12, %rdi
	callq	_avio_wl64
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_wl32
	cmpl	$0, 4(%r13)
	jle	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_avi_get_ientry
	movq	%rax, %r14
	movl	(%rax), %esi
	addl	$8, %esi
	movq	%r12, %rdi
	callq	_avio_wl32
	movl	8(%r14), %eax
	andl	%r15d, %eax
	movl	4(%r14), %ecx
	andl	$-16, %ecx
	shll	$27, %ecx
	leal	(%rcx,%rax), %esi
	addl	$-2147483648, %esi              ## imm = 0x80000000
	movq	%r12, %rdi
	callq	_avio_wl32
	incl	%ebx
	cmpl	4(%r13), %ebx
	jl	LBB0_9
	jmp	LBB0_10
LBB0_11:
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L___const.avi_write_ix.ix_tag:          ## @__const.avi_write_ix.ix_tag
	.asciz	"ix00"

	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.comm	_AVI_MASTER_INDEX_PREFIX_SIZE,4,2 ## @AVI_MASTER_INDEX_PREFIX_SIZE
	.comm	_AVI_MASTER_INDEX_ENTRY_SIZE,4,2 ## @AVI_MASTER_INDEX_ENTRY_SIZE
	.no_dead_strip	_avi_write_ix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_write_ix
_avi_write_ix:                          ; @avi_write_ix
	.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	x19, x0
	ldp	x26, x20, [x0, #16]
	strb	wzr, [sp, #8]
	mov	w8, #30825
	movk	w8, #12336, lsl #16
	str	w8, [sp, #4]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_av_assert0
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x21, #0
Lloh3:
	adrp	x24, _AVI_MASTER_INDEX_PREFIX_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _AVI_MASTER_INDEX_PREFIX_SIZE@GOTPAGEOFF]
Lloh5:
	adrp	x25, _AVI_MASTER_INDEX_ENTRY_SIZE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _AVI_MASTER_INDEX_ENTRY_SIZE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w9
	cset	w0, lt
	bl	_av_assert0
	add	x21, x21, #1
	ldrsw	x8, [x19]
	cmp	x21, x8
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x21, lsl #3]
	ldr	x27, [x8, #8]
	ldr	w8, [x27]
	ldp	w10, w9, [x26]
	sub	w8, w10, w8
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x24]
	ldr	w10, [x25]
	madd	w22, w10, w8, w9
	mov	x0, x20
	bl	_avio_tell
	mov	x23, x0
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	x3, x22
	bl	_update_odml_entry
	mov	x0, x19
	mov	x1, x21
	bl	_write_odml_master
	mov	x0, x20
	bl	_avio_tell
	sub	w8, w0, w23
	cmp	w8, w22
	cset	w0, eq
	bl	_av_assert1
	ldp	w8, w9, [x26]
	sub	w8, w8, #1
	str	w8, [x27]
	mov	w8, #1
	b	LBB0_2
LBB0_5:
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.6:
	mov	x21, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	bl	_avio_tell
	sub	w3, w0, w23
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	bl	_update_odml_entry
	add	x21, x21, #1
	ldrsw	x8, [x19]
	cmp	x21, x8
	b.ge	LBB0_11
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x21, lsl #3]
	ldp	x8, x22, [x8]
	ldr	w2, [x8]
	add	x0, sp, #11
	mov	x1, x21
	bl	_avi_stream2fourcc
	add	w8, w21, #48
	strb	w8, [sp, #7]
	mov	x0, x20
	bl	_avio_tell
	mov	x23, x0
	add	x1, sp, #4
	mov	x0, x20
	bl	_ffio_wfourcc
	ldr	w8, [x22, #4]
	lsl	w8, w8, #3
	add	w1, w8, #24
	mov	x0, x20
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #2
	bl	_avio_wl16
	mov	x0, x20
	mov	w1, #0
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #1
	bl	_avio_w8
	ldr	w1, [x22, #4]
	mov	x0, x20
	bl	_avio_wl32
	add	x1, sp, #11
	mov	x0, x20
	bl	_ffio_wfourcc
	ldr	w1, [x26, #8]
	mov	x0, x20
	bl	_avio_wl64
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wl32
	ldr	w8, [x22, #4]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w24, #0
LBB0_10:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	mov	x1, x24
	bl	_avi_get_ientry
	mov	x25, x0
	ldr	w8, [x0]
	add	w1, w8, #8
	mov	x0, x20
	bl	_avio_wl32
	ldp	w9, w8, [x25, #4]
	lsr	w9, w9, #4
	bfi	w8, w9, #31, #1
	eor	w1, w8, #0x80000000
	mov	x0, x20
	bl	_avio_wl32
	add	w24, w24, #1
	ldr	w8, [x22, #4]
	cmp	w24, w8
	b.lt	LBB0_10
	b	LBB0_7
LBB0_11:
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l___const.avi_write_ix.ix_tag:          ; @__const.avi_write_ix.ix_tag
	.asciz	"ix00"

	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_AVI_MASTER_INDEX_PREFIX_SIZE,4,2 ; @AVI_MASTER_INDEX_PREFIX_SIZE
	.comm	_AVI_MASTER_INDEX_ENTRY_SIZE,4,2 ; @AVI_MASTER_INDEX_ENTRY_SIZE
	.no_dead_strip	_avi_write_ix
.subsections_via_symbols
