	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nut_write_trailer
_nut_write_trailer:                     ## @nut_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r14
	movq	8(%rdi), %r15
	cmpl	$2, (%r15)
	jg	LBB0_3
## %bb.1:
	movq	%rdi, %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_write_headers
	cmpl	$3, (%r15)
	jl	LBB0_2
LBB0_3:
	cmpl	$0, 8(%r15)
	je	LBB0_6
## %bb.4:
	leaq	-32(%rbp), %rdi
	callq	_avio_open_dyn_buf
	testl	%eax, %eax
	js	LBB0_6
## %bb.5:
	movl	4(%r15), %edi
	callq	_av_assert1
	movq	-32(%rbp), %rsi
	movq	%r15, %rdi
	callq	_write_index
	movq	-32(%rbp), %rdx
	movq	_INDEX_STARTCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	_put_packet
LBB0_6:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INDEX_STARTCODE,4,2            ## @INDEX_STARTCODE
	.no_dead_strip	_nut_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nut_write_trailer
_nut_write_trailer:                     ; @nut_write_trailer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldp	x20, x19, [x0]
	ldr	w8, [x19]
	cmp	w8, #2
	b.gt	LBB0_3
; %bb.1:
	mov	x21, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_write_headers
	ldr	w8, [x19]
	cmp	w8, #3
	b.lt	LBB0_2
LBB0_3:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_6
; %bb.4:
	add	x0, sp, #8
	bl	_avio_open_dyn_buf
	tbnz	w0, #31, LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
	bl	_av_assert1
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_write_index
	ldr	x2, [sp, #8]
Lloh0:
	adrp	x8, _INDEX_STARTCODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INDEX_STARTCODE@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w3, #1
	bl	_put_packet
LBB0_6:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_INDEX_STARTCODE,4,2            ; @INDEX_STARTCODE
	.no_dead_strip	_nut_write_trailer
.subsections_via_symbols
