	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hds_flush
_hds_flush:                             ## @hds_flush
	.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	$1048, %rsp                     ## imm = 0x418
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpq	$0, 40(%rsi)
	je	LBB0_1
## %bb.2:
	movq	%rcx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	%edx, -1076(%rbp)               ## 4-byte Spill
	movq	16(%rdi), %rax
	movq	%rax, -1088(%rbp)               ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	(%rsi), %rcx
	movq	48(%rsi), %rdx
	movq	(%rax,%rcx,8), %rax
	movl	(%rax), %r13d
	movl	(%rdx), %edi
	callq	_avio_flush
	movq	$0, 40(%r14)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_close_file
	movq	(%r15), %rcx
	movl	8(%r14), %r9d
	leaq	L_.str(%rip), %rdx
	leaq	-1072(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	movl	%r13d, %r8d
	callq	_snprintf
	movl	32(%r14), %edi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_ff_rename
	testl	%eax, %eax
	js	LBB0_15
## %bb.3:
	movq	24(%r14), %rdx
	movq	%r12, %rcx
	subq	%rdx, %rcx
	leaq	-1072(%rbp), %rsi
	movq	%r14, %rdi
	callq	_add_fragment
	movl	-1076(%rbp), %ebx               ## 4-byte Reload
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.7:
	movq	-1088(%rbp), %rdx               ## 8-byte Reload
	movl	(%rdx), %eax
	movq	8(%rdx), %rcx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	testq	%rcx, %rcx
	je	LBB0_14
LBB0_9:
	addl	4(%rdx), %eax
	xorl	%edx, %edx
	testq	%rcx, %rcx
	movl	12(%r14), %r13d
	cmovel	%eax, %edx
	subl	%edx, %r13d
	testl	%r13d, %r13d
	jg	LBB0_11
	jmp	LBB0_14
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_init_file
	testl	%eax, %eax
	js	LBB0_15
## %bb.5:
	movq	-1088(%rbp), %rcx               ## 8-byte Reload
	movl	(%rcx), %eax
	testl	%eax, %eax
	je	LBB0_14
## %bb.6:
	movl	12(%r14), %r13d
	addl	4(%rcx), %eax
	subl	%eax, %r13d
	testl	%r13d, %r13d
	jle	LBB0_14
LBB0_11:
	movl	%r13d, %r12d
	shlq	$3, %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movq	(%rax,%rbx), %rax
	movl	(%rax), %edi
	callq	_unlink
	movq	16(%r14), %rdi
	addq	%rbx, %rdi
	callq	_av_freep
	addq	$8, %rbx
	cmpq	%rbx, %r12
	jne	LBB0_12
## %bb.13:
	movl	12(%r14), %edx
	subl	%r13d, %edx
	movl	%edx, 12(%r14)
	movq	16(%r14), %rdi
	movslq	%r13d, %rax
	leaq	(%rdi,%rax,8), %rsi
	shll	$3, %edx
	callq	_memmove
	movl	-1076(%rbp), %ebx               ## 4-byte Reload
LBB0_14:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_write_abst
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_17
## %bb.16:
	addq	$1048, %rsp                     ## imm = 0x418
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/stream%dSeg1-Frag%d"

	.no_dead_strip	_hds_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hds_flush
_hds_flush:                             ; @hds_flush
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w27, -72
	.cfi_offset w28, -80
	sub	sp, sp, #1040
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x8, [x1, #40]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x22, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldp	x8, x24, [x0, #8]
	ldr	x9, [x1]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w23, [x8]
	ldr	x8, [x1, #48]
	ldr	w0, [x8]
	bl	_avio_flush
	str	xzr, [x20, #40]
	mov	x0, x21
	mov	x1, x20
	bl	_close_file
	ldr	x3, [x21]
	ldr	w5, [x20, #8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #1024
	mov	x4, x23
	bl	_snprintf
	ldr	w0, [x20, #32]
	add	x1, sp, #8
	mov	x2, x21
	bl	_ff_rename
	tbnz	w0, #31, LBB0_13
; %bb.2:
	ldr	x2, [x20, #24]
	sub	x3, x22, x2
	add	x1, sp, #8
	mov	x0, x20
	bl	_add_fragment
	cbz	w19, LBB0_6
; %bb.3:
	ldr	w8, [x24]
	ldr	x9, [x24, #8]
	cmp	w8, #0
	ccmp	x9, #0, #0, eq
	b.eq	LBB0_12
; %bb.4:
	ldr	w10, [x20, #12]
	ldr	w11, [x24, #4]
	add	w8, w11, w8
	cmp	x9, #0
	csel	w8, w8, wzr, eq
	sub	w22, w10, w8
	cmp	w22, #1
	b.ge	LBB0_9
	b	LBB0_12
LBB0_5:
	mov	w0, #0
	b	LBB0_13
LBB0_6:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_init_file
	tbnz	w0, #31, LBB0_13
; %bb.7:
	ldr	w8, [x24]
	cbz	w8, LBB0_12
; %bb.8:
	ldr	w9, [x20, #12]
	ldr	w10, [x24, #4]
	add	w8, w8, w10
	sub	w22, w9, w8
	cmp	w22, #1
	b.lt	LBB0_12
LBB0_9:
	mov	x23, #0
	mov	w8, w22
	lsl	x24, x8, #3
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	x8, [x8, x23]
	ldr	w0, [x8]
	bl	_unlink
	ldr	x8, [x20, #16]
	add	x0, x8, x23
	bl	_av_freep
	add	x23, x23, #8
	cmp	x24, x23
	b.ne	LBB0_10
; %bb.11:
	ldr	w8, [x20, #12]
	sub	w8, w8, w22
	str	w8, [x20, #12]
	ldr	x0, [x20, #16]
	add	x1, x0, w22, sxtw #3
	lsl	w2, w8, #3
	bl	_memmove
LBB0_12:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_write_abst
LBB0_13:
	ldur	x8, [x29, #-72]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/stream%dSeg1-Frag%d"

	.no_dead_strip	_hds_flush
.subsections_via_symbols
