	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_trailer
_write_trailer:                         ## @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, %rbx
	movq	(%rdi), %r15
	movq	8(%rdi), %r14
	movq	_WTV_TIMELINE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	callq	_finish_file
	movl	$-1, %r12d
	testq	%rax, %rax
	js	LBB0_6
## %bb.1:
	movq	%r15, %rdi
	callq	_avio_tell
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_write_table_entries_events
	movq	_WTV_TIMELINE_TABLE_0_ENTRIES_EVENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_finish_file
	testq	%rax, %rax
	js	LBB0_6
## %bb.2:
	movq	%r15, %rdi
	callq	_avio_tell
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_write_table_entries_attrib
	movq	_WTV_TABLE_0_ENTRIES_LEGACY_ATTRIB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_finish_file
	testq	%rax, %rax
	js	LBB0_6
## %bb.3:
	movq	%r15, %rdi
	callq	_avio_tell
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_write_table_redirector_legacy_attrib
	movq	_WTV_TABLE_0_REDIRECTOR_LEGACY_ATTRIB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_finish_file
	testq	%rax, %rax
	js	LBB0_6
## %bb.4:
	movq	%r15, %rdi
	callq	_avio_tell
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_write_table_entries_time
	movq	_WTV_TABLE_0_ENTRIES_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_finish_file
	testq	%rax, %rax
	js	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_avio_tell
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_write_root_table
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_avio_tell
	movl	%eax, %ebx
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$48, %esi
	callq	_avio_seek
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_avio_wl32
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_avio_seek
	movq	_WTV_SECTOR_BITS@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	sarl	%cl, %r12d
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_avio_wl32
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$92, %esi
	callq	_avio_seek
	movb	(%r13), %cl
	sarl	%cl, %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_avio_wl32
	movq	%r15, %rdi
	callq	_avio_flush
	movl	12(%r14), %edi
	callq	_av_free
	movl	8(%r14), %edi
	callq	_av_free
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_av_packet_unref
	xorl	%r12d, %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WTV_TIMELINE,4,2               ## @WTV_TIMELINE
	.comm	_WTV_TIMELINE_TABLE_0_ENTRIES_EVENTS,4,2 ## @WTV_TIMELINE_TABLE_0_ENTRIES_EVENTS
	.comm	_WTV_TABLE_0_ENTRIES_LEGACY_ATTRIB,4,2 ## @WTV_TABLE_0_ENTRIES_LEGACY_ATTRIB
	.comm	_WTV_TABLE_0_REDIRECTOR_LEGACY_ATTRIB,4,2 ## @WTV_TABLE_0_REDIRECTOR_LEGACY_ATTRIB
	.comm	_WTV_TABLE_0_ENTRIES_TIME,4,2   ## @WTV_TABLE_0_ENTRIES_TIME
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_WTV_SECTOR_BITS,4,2            ## @WTV_SECTOR_BITS
	.no_dead_strip	_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_trailer
_write_trailer:                         ; @write_trailer
	.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	x20, x0
	ldp	x19, x23, [x0]
Lloh0:
	adrp	x8, _WTV_TIMELINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WTV_TIMELINE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x23]
	bl	_finish_file
	tbnz	x0, #63, LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_avio_tell
	mov	x21, x0
	mov	x0, x20
	bl	_write_table_entries_events
Lloh3:
	adrp	x8, _WTV_TIMELINE_TABLE_0_ENTRIES_EVENTS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WTV_TIMELINE_TABLE_0_ENTRIES_EVENTS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_finish_file
	tbnz	x0, #63, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_avio_tell
	mov	x21, x0
	mov	x0, x20
	bl	_write_table_entries_attrib
Lloh6:
	adrp	x8, _WTV_TABLE_0_ENTRIES_LEGACY_ATTRIB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WTV_TABLE_0_ENTRIES_LEGACY_ATTRIB@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_finish_file
	tbnz	x0, #63, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_avio_tell
	mov	x21, x0
	mov	x0, x20
	bl	_write_table_redirector_legacy_attrib
Lloh9:
	adrp	x8, _WTV_TABLE_0_REDIRECTOR_LEGACY_ATTRIB@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WTV_TABLE_0_REDIRECTOR_LEGACY_ATTRIB@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_finish_file
	tbnz	x0, #63, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	_avio_tell
	mov	x21, x0
	mov	x0, x20
	bl	_write_table_entries_time
Lloh12:
	adrp	x8, _WTV_TABLE_0_ENTRIES_TIME@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WTV_TABLE_0_ENTRIES_TIME@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_finish_file
	tbnz	x0, #63, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_avio_tell
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	bl	_write_root_table
	mov	x20, x0
	mov	x0, x19
	bl	_avio_tell
	mov	x22, x0
Lloh15:
	adrp	x24, _SEEK_SET@GOTPAGE
Lloh16:
	ldr	x24, [x24, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #48
	bl	_avio_seek
	mov	x0, x19
	mov	x1, x20
	bl	_avio_wl32
Lloh17:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #4
	bl	_avio_seek
Lloh20:
	adrp	x20, _WTV_SECTOR_BITS@GOTPAGE
Lloh21:
	ldr	x20, [x20, _WTV_SECTOR_BITS@GOTPAGEOFF]
	ldr	w8, [x20]
	asr	w1, w21, w8
	mov	x0, x19
	bl	_avio_wl32
	ldr	w2, [x24]
	mov	x0, x19
	mov	w1, #92
	bl	_avio_seek
	ldr	w8, [x20]
	asr	w1, w22, w8
	mov	x0, x19
	bl	_avio_wl32
	mov	x0, x19
	bl	_avio_flush
	ldr	w0, [x23, #12]
	bl	_av_free
	ldr	w0, [x23, #8]
	bl	_av_free
	add	x0, x23, #4
	bl	_av_packet_unref
	mov	w0, #0
	b	LBB0_7
LBB0_6:
	mov	w0, #-1
LBB0_7:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_WTV_TIMELINE,4,2               ; @WTV_TIMELINE
	.comm	_WTV_TIMELINE_TABLE_0_ENTRIES_EVENTS,4,2 ; @WTV_TIMELINE_TABLE_0_ENTRIES_EVENTS
	.comm	_WTV_TABLE_0_ENTRIES_LEGACY_ATTRIB,4,2 ; @WTV_TABLE_0_ENTRIES_LEGACY_ATTRIB
	.comm	_WTV_TABLE_0_REDIRECTOR_LEGACY_ATTRIB,4,2 ; @WTV_TABLE_0_REDIRECTOR_LEGACY_ATTRIB
	.comm	_WTV_TABLE_0_ENTRIES_TIME,4,2   ; @WTV_TABLE_0_ENTRIES_TIME
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_WTV_SECTOR_BITS,4,2            ; @WTV_SECTOR_BITS
	.no_dead_strip	_write_trailer
.subsections_via_symbols
