	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function avi_finish_data_chunk
_avi_finish_data_chunk:                 ## @avi_finish_data_chunk
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %r12
	movq	(%r12), %r14
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	%rsi, %r15
	movq	%rbx, %rdi
	callq	_STREAM_SEEKABLE
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_STREAM_POSITION
	subq	%r15, %rax
	leaq	-4(%rax), %rsi
	movq	%rbx, %rdi
	callq	_SEEK
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_WRITE_U32
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_SKIP_BYTES
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_LOG_DEBUG
	movq	_VC_CONTAINER_ERROR_FAILED@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_4:
	movq	%rbx, %rdi
	callq	_AVI_END_CHUNK
	cmpq	(%r12), %r14
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_STREAM_STATUS                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Chunk Size"

L_.str.1:                               ## @.str.1
	.asciz	"warning, can't rewrite chunk size, data will be malformed"

	.comm	_VC_CONTAINER_ERROR_FAILED,8,3  ## @VC_CONTAINER_ERROR_FAILED
	.no_dead_strip	_avi_finish_data_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function avi_finish_data_chunk
_avi_finish_data_chunk:                 ; @avi_finish_data_chunk
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	ldr	x20, [x22]
	cbz	x1, LBB0_4
; %bb.1:
	mov	x21, x1
	mov	x0, x19
	bl	_STREAM_SEEKABLE
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_STREAM_POSITION
	sub	x8, x0, x21
	sub	x1, x8, #4
	mov	x0, x19
	bl	_SEEK
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_WRITE_U32
	mov	x0, x19
	mov	x1, x21
	bl	_SKIP_BYTES
	b	LBB0_4
LBB0_3:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_LOG_DEBUG
Lloh6:
	adrp	x8, _VC_CONTAINER_ERROR_FAILED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_FAILED@GOTPAGEOFF]
Lloh8:
	ldr	x20, [x8]
LBB0_4:
	mov	x0, x19
	bl	_AVI_END_CHUNK
	ldr	x8, [x22]
	cmp	x20, x8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_STREAM_STATUS
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Chunk Size"

l_.str.1:                               ; @.str.1
	.asciz	"warning, can't rewrite chunk size, data will be malformed"

	.comm	_VC_CONTAINER_ERROR_FAILED,8,3  ; @VC_CONTAINER_ERROR_FAILED
	.no_dead_strip	_avi_finish_data_chunk
.subsections_via_symbols
