	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_write_trailer
_avi_write_trailer:                     ## @avi_write_trailer
	.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
	pushq	%rax
	.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), %r14
	movq	24(%rdi), %r12
	cmpl	$0, (%rdi)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %rax
	movl	16(%rax), %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_write_skip_frames
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_4
## %bb.5:
	cmpl	$1, (%r12)
	jne	LBB0_7
## %bb.6:
	movl	20(%r12), %esi
	movq	%r14, %rdi
	callq	_ff_end_tag
	movq	%r13, %rdi
	callq	_avi_write_idx1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	16(%r12), %esi
	movq	%r14, %rdi
	callq	_ff_end_tag
	jmp	LBB0_16
LBB0_4:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_16
LBB0_7:
	movq	%r13, %rdi
	callq	_avi_write_ix
	movl	20(%r12), %esi
	movq	%r14, %rdi
	callq	_ff_end_tag
	movl	16(%r12), %esi
	movq	%r14, %rdi
	callq	_ff_end_tag
	movq	%r14, %rdi
	callq	_avio_tell
	movq	%rax, %r15
	movq	8(%r12), %rsi
	addq	$-8, %rsi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_avio_seek
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movq	%r14, %rdi
	movl	$16, %esi
	callq	_avio_skip
	movl	(%r13), %r10d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, %esi
	testl	%r10d, %r10d
	jle	LBB0_15
## %bb.8:
	movq	8(%r13), %rcx
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_AV_CODEC_ID_MP2@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	movq	_AV_CODEC_ID_MP3@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%rdi), %eax
	cmpl	%eax, %esi
	cmovlel	%eax, %esi
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	cmpq	%rbx, %r10
	je	LBB0_15
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rbx,8), %rax
	movq	(%rax), %rdi
	movq	8(%rax), %rax
	cmpq	%rdx, (%rax)
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	8(%rax), %rax
	cmpq	%r9, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	%r8, %rax
	jne	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	addl	(%rdi), %esi
	jmp	LBB0_14
LBB0_15:
	movq	%r14, %rdi
	callq	_avio_wl32
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_avio_seek
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_avi_write_counters
LBB0_16:
	movl	(%r12), %ecx
	cmpl	4(%r12), %ecx
	jl	LBB0_18
## %bb.17:
	movq	_AVI_MASTER_INDEX_PREFIX_SIZE@GOTPCREL(%rip), %rax
	movq	_AVI_MASTER_INDEX_ENTRY_SIZE@GOTPCREL(%rip), %rdx
	imull	(%rdx), %ecx
	addl	(%rax), %ecx
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	callq	_av_log
LBB0_18:
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_23
## %bb.19:
	xorl	%ebx, %ebx
	movq	_SEEK_SET@GOTPCREL(%rip), %r12
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_20 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_23
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r14)
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	8(%r13), %rax
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %r15
	movq	8(%r15), %rsi
	addq	$4, %rsi
	movl	(%r12), %edx
	movq	%r14, %rdi
	callq	_avio_seek
	movl	4(%r15), %esi
	movq	%r14, %rdi
	callq	_avio_wl32
	movl	(%r13), %eax
	jmp	LBB0_22
LBB0_23:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$8, %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
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LIST"

	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_MP2,8,3            ## @AV_CODEC_ID_MP2
	.comm	_AV_CODEC_ID_MP3,8,3            ## @AV_CODEC_ID_MP3
	.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
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"Output file not strictly OpenDML compliant, consider re-muxing with 'reserve_index_space' option value >= %d\n"

	.no_dead_strip	_avi_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_write_trailer
_avi_write_trailer:                     ; @avi_write_trailer
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	ldp	x20, x23, [x0, #16]
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x21, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x21, lsl #3]
	ldr	x8, [x8]
	ldr	w2, [x8, #16]
	mov	x0, x19
	mov	x1, x21
	bl	_write_skip_frames
	add	x21, x21, #1
	ldrsw	x8, [x19]
	cmp	x21, x8
	b.lt	LBB0_2
LBB0_3:
	ldr	w8, [x20]
Lloh0:
	adrp	x22, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.4:
	ldr	w8, [x23]
	cmp	w8, #1
	b.ne	LBB0_6
; %bb.5:
	ldr	w1, [x23, #20]
	mov	x0, x20
	bl	_ff_end_tag
	mov	x0, x19
	bl	_avi_write_idx1
	mov	x21, x0
	ldr	w1, [x23, #16]
	mov	x0, x20
	bl	_ff_end_tag
	b	LBB0_16
LBB0_6:
	mov	x0, x19
	bl	_avi_write_ix
	ldr	w1, [x23, #20]
	mov	x0, x20
	bl	_ff_end_tag
	ldr	w1, [x23, #16]
	mov	x0, x20
	bl	_ff_end_tag
	mov	x0, x20
	bl	_avio_tell
	mov	x21, x0
	ldr	x8, [x23, #8]
	sub	x1, x8, #8
Lloh2:
	adrp	x24, _SEEK_SET@GOTPAGE
Lloh3:
	ldr	x24, [x24, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x20
	bl	_avio_seek
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_ffio_wfourcc
	mov	x0, x20
	mov	w1, #16
	bl	_avio_skip
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.7:
	mov	w1, #0
	ldr	x9, [x19, #8]
Lloh6:
	adrp	x10, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh7:
	ldr	x10, [x10, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
Lloh9:
	adrp	x11, _AV_CODEC_ID_MP2@GOTPAGE
Lloh10:
	ldr	x11, [x11, _AV_CODEC_ID_MP2@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
Lloh12:
	adrp	x12, _AV_CODEC_ID_MP3@GOTPAGE
Lloh13:
	ldr	x12, [x12, _AV_CODEC_ID_MP3@GOTPAGEOFF]
Lloh14:
	ldr	x12, [x12]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	w13, [x13]
	cmp	w1, w13
	csel	w1, w1, w13, gt
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x9]
	ldp	x13, x14, [x13]
	ldr	x15, [x14]
	cmp	x15, x10
	b.eq	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x14, [x14, #8]
	cmp	x14, x11
	ccmp	x14, x12, #4, ne
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w13, [x13]
	add	w1, w13, w1
	b	LBB0_9
LBB0_13:
	mov	w1, #0
LBB0_14:
	mov	x0, x20
	bl	_avio_wl32
	ldr	w2, [x24]
	mov	x0, x20
	mov	x1, x21
	bl	_avio_seek
	ldr	w1, [x23]
	mov	x0, x19
	bl	_avi_write_counters
LBB0_15:
	mov	w21, #0
LBB0_16:
	ldp	w8, w9, [x23]
	cmp	w8, w9
	b.lt	LBB0_18
; %bb.17:
Lloh15:
	adrp	x9, _AVI_MASTER_INDEX_PREFIX_SIZE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _AVI_MASTER_INDEX_PREFIX_SIZE@GOTPAGEOFF]
Lloh17:
	adrp	x10, _AVI_MASTER_INDEX_ENTRY_SIZE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _AVI_MASTER_INDEX_ENTRY_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	ldr	w10, [x10]
	madd	w3, w10, w8, w9
Lloh21:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x2, l_.str.1@PAGE
Lloh25:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_18:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_23
; %bb.19:
	mov	x23, #0
Lloh26:
	adrp	x24, _SEEK_SET@GOTPAGE
Lloh27:
	ldr	x24, [x24, _SEEK_SET@GOTPAGEOFF]
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	add	x23, x23, #1
	cmp	x23, w8, sxtw
	b.ge	LBB0_23
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x20]
	ldr	w10, [x22]
	tst	w10, w9
	b.eq	LBB0_20
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x23, lsl #3]
	ldr	x25, [x8]
	ldr	x8, [x25, #8]
	add	x1, x8, #4
	ldr	w2, [x24]
	mov	x0, x20
	bl	_avio_seek
	ldr	w1, [x25, #4]
	mov	x0, x20
	bl	_avio_wl32
	ldr	w8, [x19]
	b	LBB0_20
LBB0_23:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LIST"

	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_MP2,8,3            ; @AV_CODEC_ID_MP2
	.comm	_AV_CODEC_ID_MP3,8,3            ; @AV_CODEC_ID_MP3
	.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
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"Output file not strictly OpenDML compliant, consider re-muxing with 'reserve_index_space' option value >= %d\n"

	.no_dead_strip	_avi_write_trailer
.subsections_via_symbols
