	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flac_write_trailer
_flac_write_trailer:                    ## @flac_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, %r12
	movq	8(%rdi), %rbx
	movq	24(%rbx), %r15
	testq	%r15, %r15
	jne	LBB0_2
## %bb.1:
	movq	(%r12), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rax
	movq	(%rax), %r15
LBB0_2:
	movq	16(%r12), %r14
	cmpq	$0, 16(%rbx)
	je	LBB0_4
## %bb.3:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movq	%r12, %rdi
	callq	_flac_queue_flush
LBB0_4:
	cmpl	$0, 8(%rbx)
	je	LBB0_9
## %bb.5:
	testq	%r15, %r15
	je	LBB0_9
## %bb.6:
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_avio_tell
	movl	%eax, %ebx
	movq	_SEEK_SET@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r14, %rdi
	movl	$8, %esi
	callq	_avio_seek
	movq	_FLAC_STREAMINFO_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_avio_write
	movl	(%r12), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_avio_seek
	movq	%r14, %rdi
	callq	_avio_flush
	jmp	LBB0_9
LBB0_8:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
LBB0_9:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No packets were sent for some of the attached pictures.\n"

	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_FLAC_STREAMINFO_SIZE,4,2       ## @FLAC_STREAMINFO_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"unable to rewrite FLAC header.\n"

	.no_dead_strip	_flac_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flac_write_trailer
_flac_write_trailer:                    ; @flac_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	x21, x0
	ldr	x22, [x0, #8]
	ldr	x20, [x22, #24]
	cbnz	x20, LBB0_2
; %bb.1:
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x8, [x8]
	ldr	x20, [x8]
LBB0_2:
	ldr	x19, [x21, #16]
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_av_log
	mov	x0, x21
	bl	_flac_queue_flush
LBB0_4:
	ldr	w8, [x22, #8]
	cmp	w8, #0
	ccmp	x20, #0, #4, ne
	b.eq	LBB0_8
; %bb.5:
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_avio_tell
	mov	x21, x0
Lloh8:
	adrp	x22, _SEEK_SET@GOTPAGE
Lloh9:
	ldr	x22, [x22, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #8
	bl	_avio_seek
Lloh10:
	adrp	x8, _FLAC_STREAMINFO_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FLAC_STREAMINFO_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_avio_write
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x21
	bl	_avio_seek
	mov	x0, x19
	bl	_avio_flush
	b	LBB0_8
LBB0_7:
Lloh13:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, l_.str.1@PAGE
Lloh17:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_av_log
LBB0_8:
	mov	w0, #0
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No packets were sent for some of the attached pictures.\n"

	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_FLAC_STREAMINFO_SIZE,4,2       ; @FLAC_STREAMINFO_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"unable to rewrite FLAC header.\n"

	.no_dead_strip	_flac_write_trailer
.subsections_via_symbols
