	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function asf_write_trailer
_asf_write_trailer:                     ## @asf_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	movq	48(%rbx), %rax
	cmpq	56(%rbx), %rax
	jle	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_flush_packet
LBB0_2:
	movq	(%r14), %rdi
	callq	_avio_tell
	movq	%rax, %r15
	cmpq	$0, 16(%rbx)
	jne	LBB0_6
## %bb.3:
	cmpq	$0, 24(%rbx)
	je	LBB0_6
## %bb.4:
	movq	40(%rbx), %rsi
	incq	%rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_update_index
	testl	%eax, %eax
	js	LBB0_11
## %bb.5:
	movl	(%rbx), %esi
	movl	32(%rbx), %edx
	movq	24(%rbx), %rcx
	movq	%r14, %rdi
	callq	_asf_write_index
LBB0_6:
	movq	(%r14), %rdi
	callq	_avio_flush
	cmpq	$0, 16(%rbx)
	je	LBB0_7
LBB0_8:
	movq	%r14, %rdi
	movl	$17700, %esi                    ## imm = 0x4524
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_put_chunk
	jmp	LBB0_10
LBB0_7:
	movq	(%r14), %rdi
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_8
## %bb.9:
	callq	_avio_tell
	movq	%rax, %r12
	movq	(%r14), %rdi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_avio_seek
	subq	8(%rbx), %r15
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_asf_write_header1
LBB0_10:
	movq	%rbx, %rdi
	callq	_av_freep
	xorl	%eax, %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	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
	.no_dead_strip	_asf_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function asf_write_trailer
_asf_write_trailer:                     ; @asf_write_trailer
	.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	x20, x0
	ldr	x19, [x0, #8]
	ldp	x8, x9, [x19, #48]
	cmp	x8, x9
	b.le	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_flush_packet
LBB0_2:
	ldr	x0, [x20]
	bl	_avio_tell
	mov	x21, x0
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_6
; %bb.3:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_6
; %bb.4:
	ldr	x8, [x19, #40]
	add	x1, x8, #1
	mov	x0, x20
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_update_index
	tbnz	w0, #31, LBB0_11
; %bb.5:
	ldr	w1, [x19]
	ldr	w2, [x19, #32]
	ldr	x3, [x19, #24]
	mov	x0, x20
	bl	_asf_write_index
LBB0_6:
	ldr	x0, [x20]
	bl	_avio_flush
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_8
LBB0_7:
	mov	x0, x20
	mov	w1, #17700
	mov	w2, #0
	mov	w3, #0
	bl	_put_chunk
	b	LBB0_10
LBB0_8:
	ldr	x0, [x20]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.9:
	bl	_avio_tell
	mov	x22, x0
	ldr	x0, [x20]
Lloh3:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_avio_seek
	ldr	x8, [x19, #8]
	sub	x2, x21, x8
	mov	x0, x20
	mov	x1, x22
	bl	_asf_write_header1
LBB0_10:
	mov	x0, x19
	bl	_av_freep
	mov	w0, #0
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_asf_write_trailer
.subsections_via_symbols
