	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rewind_file
_rewind_file:                           ## @rewind_file
	.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	%rdi, %r12
	movq	8(%rdi), %r13
	movq	24(%r13), %rdi
	movq	(%rdi), %rdx
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpq	(%rax), %rdx
	cmovel	%ecx, %edx
	addl	32(%r13), %edx
	movq	_AVSEEK_FLAG_BACKWARD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$-1, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_av_seek_frame
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	cmpl	$0, (%r12)
	jle	LBB0_4
## %bb.2:
	movq	16(%r13), %rax
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%rax,%rbx), %edi
	callq	_avcodec_flush_buffers
	movq	16(%r13), %rax
	movq	$0, (%rax,%rbx)
	incq	%r14
	movslq	(%r12), %rcx
	addq	$16, %rbx
	cmpq	%rcx, %r14
	jl	LBB0_3
LBB0_4:
	movq	$0, 8(%r13)
	xorl	%r14d, %r14d
	jmp	LBB0_5
LBB0_6:
	movl	%eax, %r14d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r14d, %edi
	callq	_av_err2str
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%eax, %ecx
	callq	_av_log
	movl	$1, (%r13)
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ## @AV_NOPTS_VALUE
	.comm	_AVSEEK_FLAG_BACKWARD,4,2       ## @AVSEEK_FLAG_BACKWARD
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to loop: %s\n"

	.no_dead_strip	_rewind_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rewind_file
_rewind_file:                           ; @rewind_file
	.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	x19, x0
	ldr	x22, [x0, #8]
	ldr	w8, [x22, #32]
	ldr	x0, [x22, #24]
	ldr	x9, [x0]
Lloh0:
	adrp	x10, _AV_NOPTS_VALUE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _AV_NOPTS_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	csel	w9, wzr, w9, eq
	add	w2, w9, w8
Lloh3:
	adrp	x8, _AVSEEK_FLAG_BACKWARD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVSEEK_FLAG_BACKWARD@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	w1, #-1
	bl	_av_seek_frame
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x20, #0
	mov	x21, #0
	ldr	x8, [x22, #16]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x20
	ldr	w0, [x8, #8]
	bl	_avcodec_flush_buffers
	ldr	x8, [x22, #16]
	str	xzr, [x8, x20]
	add	x21, x21, #1
	ldrsw	x9, [x19]
	add	x20, x20, #16
	cmp	x21, x9
	b.lt	LBB0_3
LBB0_4:
	mov	w20, #0
	str	xzr, [x22, #8]
	b	LBB0_6
LBB0_5:
	mov	x20, x0
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	bl	_av_err2str
	mov	x3, x0
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_av_log
	mov	w8, #1
	str	w8, [x22]
LBB0_6:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ; @AV_NOPTS_VALUE
	.comm	_AVSEEK_FLAG_BACKWARD,4,2       ; @AVSEEK_FLAG_BACKWARD
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to loop: %s\n"

	.no_dead_strip	_rewind_file
.subsections_via_symbols
