	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apng_write_trailer
_apng_write_trailer:                    ## @apng_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
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	(%rdi), %r14
	movq	8(%rdi), %rbx
	cmpq	$0, 16(%rbx)
	je	LBB0_3
## %bb.1:
	xorl	%esi, %esi
	callq	_flush_packet
	testl	%eax, %eax
	js	LBB0_2
LBB0_3:
	movl	$73, %edi
	movl	$69, %esi
	movl	$78, %edx
	movl	$68, %ecx
	callq	_MKBETAG
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_apng_write_chunk
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.4:
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_6
## %bb.5:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_avio_seek
	movl	4(%rbx), %esi
	leaq	-80(%rbp), %r15
	movq	%r15, %rdi
	callq	_AV_WB32
	leaq	-64(%rbp), %rdi
	movl	(%rbx), %esi
	callq	_AV_WB32
	movl	$97, %edi
	movl	$99, %esi
	movl	$84, %edx
	movl	$76, %ecx
	callq	_MKBETAG
	movq	%r14, %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	movl	$8, %ecx
	callq	_apng_write_chunk
	jmp	LBB0_6
LBB0_2:
	movl	%eax, %r12d
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r12d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_apng_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apng_write_trailer
_apng_write_trailer:                    ; @apng_write_trailer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldp	x19, x20, [x0]
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x1, #0
	bl	_flush_packet
	tbnz	w0, #31, LBB0_6
LBB0_2:
	mov	w0, #73
	mov	w1, #69
	mov	w2, #78
	mov	w3, #68
	bl	_MKBETAG
	mov	x1, x0
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_apng_write_chunk
	ldr	x1, [x20, #8]
	cbz	x1, LBB0_5
; %bb.3:
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_avio_seek
	ldr	w1, [x20, #4]
	add	x21, sp, #8
	add	x0, sp, #8
	bl	_AV_WB32
	add	x0, x21, #16
	ldr	w1, [x20]
	bl	_AV_WB32
	mov	w0, #97
	mov	w1, #99
	mov	w2, #84
	mov	w3, #76
	bl	_MKBETAG
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #8
	bl	_apng_write_chunk
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldr	x8, [sp, #40]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_apng_write_trailer
.subsections_via_symbols
