	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hds_write_trailer
_hds_write_trailer:                     ## @hds_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
	subq	$1032, %rsp                     ## imm = 0x408
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r13
	cmpl	$0, (%r13)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rsi
	movl	(%rsi,%rbx), %ecx
	addq	%rbx, %rsi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_hds_flush
	incq	%r14
	movslq	(%r13), %rax
	addq	$4, %rbx
	cmpq	%rax, %r14
	jl	LBB0_2
LBB0_3:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_write_manifest
	cmpq	$0, 8(%r13)
	je	LBB0_8
## %bb.4:
	movq	(%r12), %rcx
	leaq	L_.str(%rip), %rdx
	leaq	-1072(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	xorl	%eax, %eax
	callq	_snprintf
	movq	%rbx, %rdi
	callq	_unlink
	cmpl	$0, (%r13)
	jle	LBB0_7
## %bb.5:
	leaq	L_.str.1(%rip), %r14
	leaq	-1072(%rbp), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rcx
	movq	%r15, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movq	%r14, %rdx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r15, %rdi
	callq	_unlink
	incl	%ebx
	cmpl	(%r13), %ebx
	jl	LBB0_6
LBB0_7:
	movq	(%r12), %rdi
	callq	_rmdir
LBB0_8:
	movq	%r12, %rdi
	callq	_hds_free
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	addq	$1032, %rsp                     ## imm = 0x408
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/index.f4m"

L_.str.1:                               ## @.str.1
	.asciz	"%s/stream%d.abst"

	.no_dead_strip	_hds_write_trailer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hds_write_trailer
_hds_write_trailer:                     ; @hds_write_trailer
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [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 w27, -56
	.cfi_offset w28, -64
	sub	sp, sp, #1040
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x21, [x0, #8]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x20, #0
	mov	x22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #16]
	add	x1, x8, x20
	ldr	w3, [x1]
	mov	x0, x19
	mov	w2, #1
	bl	_hds_flush
	add	x22, x22, #1
	ldrsw	x8, [x21]
	add	x20, x20, #4
	cmp	x22, x8
	b.lt	LBB0_2
LBB0_3:
	mov	x0, x19
	mov	w1, #1
	bl	_write_manifest
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_8
; %bb.4:
	ldr	x3, [x19]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #1024
	bl	_snprintf
	add	x0, sp, #8
	bl	_unlink
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w22, #0
Lloh5:
	adrp	x20, l_.str.1@PAGE
Lloh6:
	add	x20, x20, l_.str.1@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x3, [x19]
	str	x22, [sp]
	add	x0, sp, #8
	mov	w1, #1024
	mov	x2, x20
	bl	_snprintf
	add	x0, sp, #8
	bl	_unlink
	add	w22, w22, #1
	ldr	w8, [x21]
	cmp	w22, w8
	b.lt	LBB0_6
LBB0_7:
	ldr	x0, [x19]
	bl	_rmdir
LBB0_8:
	mov	x0, x19
	bl	_hds_free
	ldur	x8, [x29, #-56]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	mov	w0, #0
	add	sp, sp, #1040
	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	x28, x27, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/index.f4m"

l_.str.1:                               ; @.str.1
	.asciz	"%s/stream%d.abst"

	.no_dead_strip	_hds_write_trailer
.subsections_via_symbols
