	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function seg_write_trailer
_seg_write_trailer:                     ## @seg_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, %r12
	movq	(%rdi), %r13
	movq	(%r13), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	cmpl	$0, 48(%r13)
	je	LBB0_3
## %bb.6:
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_segment_end
LBB0_7:
	movl	%eax, %r15d
	cmpq	$0, 40(%r13)
	jne	LBB0_9
	jmp	LBB0_10
LBB0_1:
	xorl	%r15d, %r15d
	cmpq	$0, 40(%r13)
	je	LBB0_10
LBB0_9:
	leaq	32(%r13), %rsi
	movq	%r12, %rdi
	callq	_ff_format_io_close
LBB0_10:
	leaq	28(%r13), %rdi
	callq	_av_dict_free
	movq	%r13, %rdi
	callq	_av_opt_free
	leaq	24(%r13), %rdi
	callq	_av_freep
	leaq	20(%r13), %rdi
	callq	_av_freep
	leaq	16(%r13), %rdi
	callq	_av_freep
	movq	8(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %r12
	movq	%rbx, %rdi
	callq	_av_freep
	movq	%rbx, %rdi
	callq	_av_free
	movq	%r12, %rbx
	testq	%r12, %r12
	jne	LBB0_11
LBB0_12:
	movq	%r14, %rdi
	callq	_avformat_free_context
	movq	$0, (%r13)
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_segment_end
	testl	%eax, %eax
	js	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_open_null_ctx
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	movq	%r14, %rdi
	callq	_av_write_trailer
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_close_null_ctxp
	cmpq	$0, 40(%r13)
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_seg_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function seg_write_trailer
_seg_write_trailer:                     ; @seg_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	x22, x0
	ldr	x19, [x0]
	ldr	x20, [x19]
	cbz	x20, LBB0_4
; %bb.1:
	ldr	w8, [x19, #48]
	cbz	w8, LBB0_9
; %bb.2:
	mov	x0, x22
	mov	w1, #1
	mov	w2, #1
	bl	_segment_end
LBB0_3:
	mov	x21, x0
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_5
	b	LBB0_6
LBB0_4:
	mov	w21, #0
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_6
LBB0_5:
	add	x1, x19, #32
	mov	x0, x22
	bl	_ff_format_io_close
LBB0_6:
	add	x0, x19, #28
	bl	_av_dict_free
	mov	x0, x19
	bl	_av_opt_free
	add	x0, x19, #24
	bl	_av_freep
	add	x0, x19, #20
	bl	_av_freep
	add	x0, x19, #16
	bl	_av_freep
	ldr	x22, [x19, #8]
	cbz	x22, LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x22, #8]
	mov	x0, x22
	bl	_av_freep
	mov	x0, x22
	bl	_av_free
	mov	x22, x23
	cbnz	x23, LBB0_7
LBB0_8:
	mov	x0, x20
	bl	_avformat_free_context
	str	xzr, [x19]
	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
LBB0_9:
	mov	x0, x22
	mov	w1, #0
	mov	w2, #1
	bl	_segment_end
	tbnz	w0, #31, LBB0_3
; %bb.10:
	mov	x0, x20
	bl	_open_null_ctx
	tbnz	w0, #31, LBB0_3
; %bb.11:
	mov	x0, x20
	bl	_av_write_trailer
	mov	x21, x0
	mov	x0, x20
	bl	_close_null_ctxp
	ldr	x8, [x19, #40]
	cbnz	x8, LBB0_5
	b	LBB0_6
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_seg_write_trailer
.subsections_via_symbols
