	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_writer_write
_avi_writer_write:                      ## @avi_writer_write
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	cmpl	$0, (%r12)
	je	LBB0_1
## %bb.3:
	cmpq	$0, 8(%r12)
	jne	LBB0_5
LBB0_4:
	movq	%r15, %rdi
	callq	_STREAM_POSITION
	movq	%rax, %rbx
	movq	%rax, 8(%r12)
	xorl	%edi, %edi
	callq	_INT64_C
	xorl	%edi, %edi
	cmpq	%rax, %rbx
	setne	%dil
	callq	_vc_container_assert
	movl	$76, %edi
	movl	$73, %esi
	movl	$83, %edx
	movl	$84, %ecx
	callq	_VC_FOURCC
	leaq	L_.str(%rip), %rbx
	movq	%r15, %rdi
	movl	%eax, %esi
	movq	%rbx, %rdx
	callq	_WRITE_FOURCC
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_WRITE_U32
	movl	$109, %edi
	movl	$111, %esi
	movl	$118, %edx
	movl	$105, %ecx
	callq	_VC_FOURCC
	movq	%r15, %rdi
	movl	%eax, %esi
	movq	%rbx, %rdx
	callq	_WRITE_FOURCC
	movq	%r15, %rdi
	callq	_STREAM_STATUS
	movq	%rax, %rbx
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_5
	jmp	LBB0_46
LBB0_1:
	movq	%r15, %rdi
	callq	_avi_write_headers
	movq	%rax, %rbx
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_46
## %bb.2:
	movl	$1, (%r12)
	cmpq	$0, 8(%r12)
	je	LBB0_4
LBB0_5:
	movq	16(%r12), %rsi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.6:
	movq	24(%r12), %rax
	cmpq	%rax, (%r14)
	je	LBB0_8
## %bb.7:
	movq	(%r15), %rcx
	movq	(%rcx,%rax,8), %rax
	movq	8(%rax), %rax
	movq	(%rax), %r13
	movq	%r15, %rdi
	callq	_avi_finish_data_chunk
	movq	%rax, %rbx
	movq	16(%r12), %rdx
	movq	24(%r12), %rsi
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	_avi_write_index_entry
	incl	16(%r13)
	movq	16(%r12), %rsi
	addq	%rsi, (%r13)
	movq	8(%r13), %rdi
	callq	_MAX
	movq	%rax, 8(%r13)
	movq	$0, 16(%r12)
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_46
LBB0_8:
	movq	%r15, %rdi
	callq	_avi_num_chunks
	movq	_ULONG_MAX@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	je	LBB0_9
## %bb.10:
	movq	%r15, %rdi
	callq	_STREAM_SEEKABLE
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_avi_calculate_file_size
	cmpq	(%rbx), %rax
	jge	LBB0_9
LBB0_12:
	cmpq	$0, 16(%r12)
	je	LBB0_13
## %bb.14:
	movq	_VC_CONTAINER_PACKET_FLAG_FRAME_START@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	setne	%al
	jmp	LBB0_15
LBB0_13:
	xorl	%eax, %eax
LBB0_15:
	xorb	$1, %al
	movzbl	%al, %edi
	callq	_vc_container_assert
	movq	(%r15), %rax
	movq	(%r14), %rdx
	movq	(%rax,%rdx,8), %r13
	movq	8(%r13), %rax
	movq	(%rax), %rsi
	movq	%rdx, 24(%r12)
	cmpq	$0, 16(%r12)
	je	LBB0_16
## %bb.24:
	movq	72(%r12), %rdi
	testq	%rdi, %rdi
	jle	LBB0_28
## %bb.25:
	cmpl	$0, 40(%r12)
	je	LBB0_28
## %bb.26:
	movq	24(%r14), %rdx
	leaq	(%rdx,%rdi), %rax
	movq	_AVI_FRAME_BUFFER_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_27
LBB0_9:
	movq	_VC_CONTAINER_ERROR_OUT_OF_RESOURCES@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_46:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	32(%r14), %esi
	movq	24(%r14), %rdx
	movq	%r15, %rdi
	callq	_WRITE_BYTES
	jmp	LBB0_29
LBB0_16:
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	leaq	-52(%rbp), %rsi
	movq	%r15, %rdi
	callq	_avi_chunk_id_from_track_num
	movq	16(%r14), %rax
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:
	movq	24(%r14), %rbx
LBB0_18:
	movq	%rax, 32(%r12)
	movl	-52(%rbp), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	callq	_WRITE_FOURCC
	movq	%r15, %rdi
	callq	_STREAM_SEEKABLE
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:
	movq	_VC_CONTAINER_PACKET_FLAG_FRAME_END@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	je	LBB0_21
LBB0_20:
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_WRITE_U32
	movl	32(%r14), %esi
	movq	24(%r14), %rdx
	movq	%r15, %rdi
	callq	_WRITE_BYTES
LBB0_23:
	movq	24(%r14), %rax
	movq	%rax, 16(%r12)
	jmp	LBB0_30
LBB0_27:
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	addl	80(%r12), %edi
	movl	32(%r14), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_memcpy
	movq	24(%r14), %rax
	addq	%rax, 72(%r12)
LBB0_29:
	movq	24(%r14), %rax
	addq	%rax, 16(%r12)
LBB0_30:
	movq	%r15, %rdi
	callq	_STREAM_STATUS
	movq	%rax, %rbx
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_46
## %bb.31:
	movq	_VC_CONTAINER_PACKET_FLAG_FRAME_END@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	je	LBB0_32
LBB0_35:
	movq	72(%r12), %rsi
	testq	%rsi, %rsi
	jle	LBB0_37
## %bb.36:
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	callq	_WRITE_U32
	movl	80(%r12), %esi
	movq	72(%r12), %rdx
	movq	%r15, %rdi
	callq	_WRITE_BYTES
	movq	72(%r12), %rax
	movq	%rax, 24(%r14)
	movq	$0, 72(%r12)
LBB0_37:
	cmpq	$0, 32(%r12)
	jne	LBB0_39
## %bb.38:
	movq	16(%r12), %rsi
	cmpq	24(%r14), %rsi
	jg	LBB0_40
LBB0_39:
	xorl	%esi, %esi
LBB0_40:
	movq	%r15, %rdi
	callq	_avi_finish_data_chunk
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_STREAM_SEEKABLE
	testq	%rax, %rax
	jne	LBB0_42
## %bb.41:
	movq	_VC_CONTAINER_CONTROL_IO_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vc_container_control
LBB0_42:
	movq	%r15, %rdi
	callq	_STREAM_SEEKABLE
	testq	%rax, %rax
	je	LBB0_44
## %bb.43:
	movq	(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	16(%r12), %r13
	movl	8(%r14), %edi
	callq	_AVI_PACKET_IS_KEYFRAME
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	movl	%eax, %ecx
	callq	_avi_write_index_entry
LBB0_44:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	incl	16(%r14)
	movq	16(%r12), %rsi
	addq	%rsi, (%r14)
	movq	8(%r14), %rdi
	callq	_MAX
	movq	%rax, 8(%r14)
	movq	$0, 16(%r12)
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_46
	jmp	LBB0_45
LBB0_32:
	movq	(%r13), %rax
	movq	(%rax), %rcx
	movq	_VC_CONTAINER_ES_TYPE_AUDIO@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_45
## %bb.33:
	movq	8(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_45
## %bb.34:
	movq	16(%r12), %rax
	movq	_AVI_AUDIO_CHUNK_SIZE_LIMIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_35
LBB0_45:
	movq	%r15, %rdi
	callq	_STREAM_STATUS
	movq	%rax, %rbx
	jmp	LBB0_46
LBB0_21:
	movl	40(%r12), %edi
	callq	_vc_container_assert
	movq	24(%r14), %rax
	movq	_AVI_FRAME_BUFFER_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_9
## %bb.22:
	movq	32(%r14), %rax
	movq	%rax, 80(%r12)
	movups	(%r14), %xmm0
	movups	16(%r14), %xmm1
	movups	%xmm1, 64(%r12)
	movups	%xmm0, 48(%r12)
	movl	40(%r12), %edi
	movl	%edi, 80(%r12)
	movl	32(%r14), %esi
	movq	72(%r12), %rdx
	callq	_memcpy
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Chunk ID"

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

	.comm	_ULONG_MAX,8,3                  ## @ULONG_MAX
	.comm	_VC_CONTAINER_ERROR_OUT_OF_RESOURCES,8,3 ## @VC_CONTAINER_ERROR_OUT_OF_RESOURCES
	.comm	_VC_CONTAINER_PACKET_FLAG_FRAME_START,4,2 ## @VC_CONTAINER_PACKET_FLAG_FRAME_START
	.comm	_VC_CONTAINER_PACKET_FLAG_FRAME_END,4,2 ## @VC_CONTAINER_PACKET_FLAG_FRAME_END
L_.str.2:                               ## @.str.2
	.asciz	"Chunk Size"

	.comm	_AVI_FRAME_BUFFER_SIZE,8,3      ## @AVI_FRAME_BUFFER_SIZE
	.comm	_VC_CONTAINER_ES_TYPE_AUDIO,8,3 ## @VC_CONTAINER_ES_TYPE_AUDIO
	.comm	_AVI_AUDIO_CHUNK_SIZE_LIMIT,8,3 ## @AVI_AUDIO_CHUNK_SIZE_LIMIT
	.comm	_VC_CONTAINER_CONTROL_IO_FLUSH,4,2 ## @VC_CONTAINER_CONTROL_IO_FLUSH
	.no_dead_strip	_avi_writer_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_writer_write
_avi_writer_write:                      ; @avi_writer_write
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x24, [x8]
	ldr	w8, [x24]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	x8, [x24, #8]
	cbnz	x8, LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_STREAM_POSITION
	mov	x21, x0
	str	x0, [x24, #8]
	mov	w0, #0
	bl	_INT64_C
	cmp	x21, x0
	cset	w0, ne
	bl	_vc_container_assert
	mov	w0, #76
	mov	w1, #73
	mov	w2, #83
	mov	w3, #84
	bl	_VC_FOURCC
	mov	x1, x0
Lloh0:
	adrp	x21, l_.str@PAGE
Lloh1:
	add	x21, x21, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_WRITE_FOURCC
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, #0
	bl	_WRITE_U32
	mov	w0, #109
	mov	w1, #111
	mov	w2, #118
	mov	w3, #105
	bl	_VC_FOURCC
	mov	x1, x0
	mov	x0, x19
	mov	x2, x21
	bl	_WRITE_FOURCC
	mov	x0, x19
	bl	_STREAM_STATUS
	mov	x21, x0
Lloh4:
	adrp	x8, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_5
	b	LBB0_18
LBB0_3:
	mov	x0, x19
	bl	_avi_write_headers
	mov	x21, x0
Lloh7:
	adrp	x8, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_18
; %bb.4:
	mov	w8, #1
	str	w8, [x24]
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_2
LBB0_5:
	ldr	x1, [x24, #16]
	cbz	x1, LBB0_8
; %bb.6:
	ldr	x9, [x20]
	ldr	x8, [x24, #24]
	cmp	x9, x8
	b.eq	LBB0_8
; %bb.7:
	ldr	x9, [x19]
	ldr	x8, [x9, x8, lsl #3]
	ldr	x8, [x8, #8]
	ldr	x22, [x8]
	mov	x0, x19
	bl	_avi_finish_data_chunk
	mov	x21, x0
	ldp	x2, x1, [x24, #16]
	mov	x0, x19
	mov	w3, #0
	bl	_avi_write_index_entry
	ldr	w8, [x22, #16]
	add	w8, w8, #1
	str	w8, [x22, #16]
	ldr	x1, [x24, #16]
	ldp	x8, x0, [x22]
	add	x8, x8, x1
	str	x8, [x22]
	bl	_MAX
	str	x0, [x22, #8]
	str	xzr, [x24, #16]
Lloh10:
	adrp	x8, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x21, x8
	b.ne	LBB0_18
LBB0_8:
	mov	x0, x19
	bl	_avi_num_chunks
Lloh13:
	adrp	x21, _ULONG_MAX@GOTPAGE
Lloh14:
	ldr	x21, [x21, _ULONG_MAX@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_17
; %bb.9:
	mov	x0, x19
	bl	_STREAM_SEEKABLE
	cbz	x0, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	bl	_avi_calculate_file_size
	ldr	x8, [x21]
	cmp	x0, x8
	b.ge	LBB0_17
LBB0_11:
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_13
; %bb.12:
	ldr	w8, [x20, #8]
Lloh15:
	adrp	x9, _VC_CONTAINER_PACKET_FLAG_FRAME_START@GOTPAGE
Lloh16:
	ldr	x9, [x9, _VC_CONTAINER_PACKET_FLAG_FRAME_START@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
LBB0_13:
	eor	w0, w8, #0x1
	bl	_vc_container_assert
	ldr	x8, [x19]
	ldr	x2, [x20]
	ldr	x22, [x8, x2, lsl #3]
	ldr	x8, [x22, #8]
	ldr	x25, [x8]
	str	x2, [x24, #24]
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_20
; %bb.14:
	ldr	x8, [x24, #72]
	cmp	x8, #1
	b.lt	LBB0_19
; %bb.15:
	ldr	w9, [x24, #40]
	cbz	w9, LBB0_19
; %bb.16:
	ldr	x2, [x20, #24]
Lloh18:
	adrp	x9, _AVI_FRAME_BUFFER_SIZE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AVI_FRAME_BUFFER_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x10, x2, x8
	cmp	x10, x9
	b.le	LBB0_25
LBB0_17:
Lloh21:
	adrp	x8, _VC_CONTAINER_ERROR_OUT_OF_RESOURCES@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_OUT_OF_RESOURCES@GOTPAGEOFF]
Lloh23:
	ldr	x21, [x8]
LBB0_18:
	mov	x0, x21
	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
LBB0_19:
	ldr	w1, [x20, #32]
	ldr	x2, [x20, #24]
	mov	x0, x19
	bl	_WRITE_BYTES
	b	LBB0_26
LBB0_20:
	add	x1, sp, #12
	mov	x0, x19
	bl	_avi_chunk_id_from_track_num
	ldr	x8, [x20, #16]
	mov	x21, x8
	cbnz	x8, LBB0_22
; %bb.21:
	ldr	x21, [x20, #24]
LBB0_22:
	str	x8, [x24, #32]
	ldr	w1, [sp, #12]
Lloh24:
	adrp	x2, l_.str@PAGE
Lloh25:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_WRITE_FOURCC
	mov	x0, x19
	bl	_STREAM_SEEKABLE
	cbnz	x0, LBB0_24
; %bb.23:
	ldr	w8, [x20, #8]
Lloh26:
	adrp	x9, _VC_CONTAINER_PACKET_FLAG_FRAME_END@GOTPAGE
Lloh27:
	ldr	x9, [x9, _VC_CONTAINER_PACKET_FLAG_FRAME_END@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_43
LBB0_24:
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_WRITE_U32
	ldr	w1, [x20, #32]
	ldr	x2, [x20, #24]
	mov	x0, x19
	bl	_WRITE_BYTES
	ldr	x8, [x20, #24]
	b	LBB0_27
LBB0_25:
	ldr	w9, [x24, #80]
	add	w0, w9, w8
	ldr	w1, [x20, #32]
	bl	_memcpy
	ldr	x8, [x20, #24]
	ldr	x9, [x24, #72]
	add	x8, x9, x8
	str	x8, [x24, #72]
LBB0_26:
	ldr	x8, [x20, #24]
	ldr	x9, [x24, #16]
	add	x8, x9, x8
LBB0_27:
	str	x8, [x24, #16]
	mov	x0, x19
	bl	_STREAM_STATUS
	mov	x21, x0
Lloh31:
	adrp	x26, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh32:
	ldr	x26, [x26, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_18
; %bb.28:
	ldr	w8, [x20, #8]
Lloh33:
	adrp	x9, _VC_CONTAINER_PACKET_FLAG_FRAME_END@GOTPAGE
Lloh34:
	ldr	x9, [x9, _VC_CONTAINER_PACKET_FLAG_FRAME_END@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_39
LBB0_29:
	ldr	x1, [x24, #72]
	cmp	x1, #1
	b.lt	LBB0_31
; %bb.30:
Lloh36:
	adrp	x2, l_.str.2@PAGE
Lloh37:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_WRITE_U32
	ldr	w1, [x24, #80]
	ldr	x2, [x24, #72]
	mov	x0, x19
	bl	_WRITE_BYTES
	ldr	x8, [x24, #72]
	str	x8, [x20, #24]
	str	xzr, [x24, #72]
LBB0_31:
	ldr	x8, [x24, #32]
	cbnz	x8, LBB0_33
; %bb.32:
	ldr	x1, [x24, #16]
	ldr	x8, [x20, #24]
	cmp	x1, x8
	b.gt	LBB0_34
LBB0_33:
	mov	x1, #0
LBB0_34:
	mov	x0, x19
	bl	_avi_finish_data_chunk
	mov	x21, x0
	mov	x0, x19
	bl	_STREAM_SEEKABLE
	cbnz	x0, LBB0_36
; %bb.35:
Lloh38:
	adrp	x8, _VC_CONTAINER_CONTROL_IO_FLUSH@GOTPAGE
Lloh39:
	ldr	x8, [x8, _VC_CONTAINER_CONTROL_IO_FLUSH@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_vc_container_control
LBB0_36:
	mov	x0, x19
	bl	_STREAM_SEEKABLE
	cbz	x0, LBB0_38
; %bb.37:
	ldr	x22, [x20]
	ldr	x23, [x24, #16]
	ldr	w0, [x20, #8]
	bl	_AVI_PACKET_IS_KEYFRAME
	mov	x3, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_avi_write_index_entry
LBB0_38:
	ldr	w8, [x25, #16]
	add	w8, w8, #1
	str	w8, [x25, #16]
	ldr	x1, [x24, #16]
	ldp	x8, x0, [x25]
	add	x8, x8, x1
	str	x8, [x25]
	bl	_MAX
	str	x0, [x25, #8]
	str	xzr, [x24, #16]
	ldr	x8, [x26]
	cmp	x21, x8
	b.ne	LBB0_18
	b	LBB0_42
LBB0_39:
	ldr	x8, [x22]
	ldr	x9, [x8]
Lloh41:
	adrp	x10, _VC_CONTAINER_ES_TYPE_AUDIO@GOTPAGE
Lloh42:
	ldr	x10, [x10, _VC_CONTAINER_ES_TYPE_AUDIO@GOTPAGEOFF]
Lloh43:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_42
; %bb.40:
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_42
; %bb.41:
	ldr	x8, [x24, #16]
Lloh44:
	adrp	x9, _AVI_AUDIO_CHUNK_SIZE_LIMIT@GOTPAGE
Lloh45:
	ldr	x9, [x9, _AVI_AUDIO_CHUNK_SIZE_LIMIT@GOTPAGEOFF]
Lloh46:
	ldr	x9, [x9]
	cmp	x8, x9
	b.gt	LBB0_29
LBB0_42:
	mov	x0, x19
	bl	_STREAM_STATUS
	mov	x21, x0
	b	LBB0_18
LBB0_43:
	ldr	w0, [x24, #40]
	bl	_vc_container_assert
	ldr	x8, [x20, #24]
Lloh47:
	adrp	x9, _AVI_FRAME_BUFFER_SIZE@GOTPAGE
Lloh48:
	ldr	x9, [x9, _AVI_FRAME_BUFFER_SIZE@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	cmp	x8, x9
	b.gt	LBB0_17
; %bb.44:
	ldp	q0, q1, [x20]
	ldr	x8, [x20, #32]
	str	x8, [x24, #80]
	stp	q0, q1, [x24, #48]
	ldr	w0, [x24, #40]
	str	w0, [x24, #80]
	ldr	w1, [x20, #32]
	ldr	x2, [x24, #72]
	bl	_memcpy
	ldr	x8, [x20, #24]
	b	LBB0_27
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Chunk ID"

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

	.comm	_ULONG_MAX,8,3                  ; @ULONG_MAX
	.comm	_VC_CONTAINER_ERROR_OUT_OF_RESOURCES,8,3 ; @VC_CONTAINER_ERROR_OUT_OF_RESOURCES
	.comm	_VC_CONTAINER_PACKET_FLAG_FRAME_START,4,2 ; @VC_CONTAINER_PACKET_FLAG_FRAME_START
	.comm	_VC_CONTAINER_PACKET_FLAG_FRAME_END,4,2 ; @VC_CONTAINER_PACKET_FLAG_FRAME_END
l_.str.2:                               ; @.str.2
	.asciz	"Chunk Size"

	.comm	_AVI_FRAME_BUFFER_SIZE,8,3      ; @AVI_FRAME_BUFFER_SIZE
	.comm	_VC_CONTAINER_ES_TYPE_AUDIO,8,3 ; @VC_CONTAINER_ES_TYPE_AUDIO
	.comm	_AVI_AUDIO_CHUNK_SIZE_LIMIT,8,3 ; @AVI_AUDIO_CHUNK_SIZE_LIMIT
	.comm	_VC_CONTAINER_CONTROL_IO_FLUSH,4,2 ; @VC_CONTAINER_CONTROL_IO_FLUSH
	.no_dead_strip	_avi_writer_write
.subsections_via_symbols
