	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_calculate_file_size
_avi_calculate_file_size:               ## @avi_calculate_file_size
	.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	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	(%rax), %r14
	callq	_STREAM_POSITION
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_vc_container_writer_extraio_enable
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_vc_container_assert
	movl	%r13d, %edi
	callq	_VC_CONTAINER_PARAM_UNUSED
	movq	8(%r12), %rdx
	testq	%rdx, %rdx
	jne	LBB0_2
## %bb.1:
	movq	(%r12), %rdx
LBB0_2:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_WRITE_BYTES
	movq	%r15, %rdi
	callq	_AVI_END_CHUNK
	movq	_AVI_INDEX_ENTRY_SIZE@GOTPCREL(%rip), %rax
	movq	_AVI_STD_INDEX_ENTRY_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	addq	(%rax), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_WRITE_BYTES
	movq	%r15, %rdi
	callq	_avi_write_standard_index_data
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	callq	_avi_write_legacy_index_data
LBB0_4:
	movq	%r15, %rdi
	callq	_STREAM_POSITION
	movq	%rax, %rbx
	addq	-48(%rbp), %rbx                 ## 8-byte Folded Reload
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_vc_container_writer_extraio_disable
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.comm	_AVI_INDEX_ENTRY_SIZE,8,3       ## @AVI_INDEX_ENTRY_SIZE
	.comm	_AVI_STD_INDEX_ENTRY_SIZE,8,3   ## @AVI_STD_INDEX_ENTRY_SIZE
	.no_dead_strip	_avi_calculate_file_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_calculate_file_size
_avi_calculate_file_size:               ; @avi_calculate_file_size
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x20, [x8]
	bl	_STREAM_POSITION
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_vc_container_writer_extraio_enable
	mov	x23, x0
	cmp	w0, #0
	cset	w0, eq
	bl	_vc_container_assert
	mov	x0, x23
	bl	_VC_CONTAINER_PARAM_UNUSED
	ldr	x2, [x22, #8]
	cbnz	x2, LBB0_2
; %bb.1:
	ldr	x2, [x22]
LBB0_2:
	mov	x0, x19
	mov	x1, #0
	bl	_WRITE_BYTES
	mov	x0, x19
	bl	_AVI_END_CHUNK
Lloh0:
	adrp	x8, _AVI_INDEX_ENTRY_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVI_INDEX_ENTRY_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _AVI_STD_INDEX_ENTRY_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AVI_STD_INDEX_ENTRY_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x2, x9, x8
	mov	x0, x19
	mov	x1, #0
	bl	_WRITE_BYTES
	mov	x0, x19
	bl	_avi_write_standard_index_data
Lloh6:
	adrp	x8, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_avi_write_legacy_index_data
LBB0_4:
	mov	x0, x19
	bl	_STREAM_POSITION
	add	x21, x0, x21
	mov	x0, x19
	mov	x1, x20
	bl	_vc_container_writer_extraio_disable
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.comm	_AVI_INDEX_ENTRY_SIZE,8,3       ; @AVI_INDEX_ENTRY_SIZE
	.comm	_AVI_STD_INDEX_ENTRY_SIZE,8,3   ; @AVI_STD_INDEX_ENTRY_SIZE
	.no_dead_strip	_avi_calculate_file_size
.subsections_via_symbols
