	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function caf_write_trailer
_caf_write_trailer:                     ## @caf_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	16(%rdi), %r14
	movq	8(%rdi), %rbx
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
## %bb.1:
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	movq	%rbx, %rdi
	callq	_avio_tell
	movl	%eax, %r15d
	movl	(%r14), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_avio_seek
	movl	%r15d, %esi
	subl	(%r14), %esi
	addl	$-8, %esi
	movq	%rbx, %rdi
	callq	_avio_wb64
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_avio_seek
	cmpl	$0, (%r12)
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ffio_wfourcc
	movl	4(%r14), %esi
	addl	$24, %esi
	movq	%rbx, %rdi
	callq	_avio_wb64
	movl	8(%r14), %esi
	movq	%rbx, %rdi
	callq	_avio_wb64
	movl	8(%r14), %r15d
	movl	8(%r12), %edi
	movl	(%r12), %edx
	movl	4(%r12), %esi
	callq	_samples_per_packet
	imull	%eax, %r15d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_avio_wb64
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movl	4(%r14), %edx
	movl	12(%r14), %esi
	movq	%rbx, %rdi
	callq	_avio_write
	movq	$0, 16(%r14)
LBB0_3:
	movq	%rbx, %rdi
	callq	_avio_flush
LBB0_4:
	addq	$12, %r14
	movq	%r14, %rdi
	callq	_av_freep
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pakt"

	.no_dead_strip	_caf_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function caf_write_trailer
_caf_write_trailer:                     ; @caf_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
	ldp	x19, x21, [x0, #8]
	ldr	w8, [x19]
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_4
; %bb.1:
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x22, [x8]
	mov	x0, x19
	bl	_avio_tell
	mov	x20, x0
	ldr	w1, [x21]
Lloh3:
	adrp	x23, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x23, [x23, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_avio_seek
	ldr	w8, [x21]
	sub	w8, w20, w8
	sub	w1, w8, #8
	mov	x0, x19
	bl	_avio_wb64
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x20
	bl	_avio_seek
	ldr	w8, [x22]
	cbnz	w8, LBB0_3
; %bb.2:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ffio_wfourcc
	ldr	w8, [x21, #4]
	add	w1, w8, #24
	mov	x0, x19
	bl	_avio_wb64
	ldr	w1, [x21, #8]
	mov	x0, x19
	bl	_avio_wb64
	ldr	w20, [x21, #8]
	ldp	w1, w0, [x22, #4]
	ldr	w2, [x22]
	bl	_samples_per_packet
	mul	w1, w0, w20
	mov	x0, x19
	bl	_avio_wb64
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #0
	bl	_avio_wb32
	ldr	w1, [x21, #12]
	ldr	w2, [x21, #4]
	mov	x0, x19
	bl	_avio_write
	str	xzr, [x21, #16]
LBB0_3:
	mov	x0, x19
	bl	_avio_flush
LBB0_4:
	add	x0, x21, #12
	bl	_av_freep
	mov	w0, #0
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pakt"

	.no_dead_strip	_caf_write_trailer
.subsections_via_symbols
