	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function matroska_resync
_matroska_resync:                       ## @matroska_resync
	.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	%rsi, %rbx
	movq	%rdi, %r12
	movq	16(%rdi), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_avio_tell
	cmpq	%rbx, %rax
	jle	LBB0_3
## %bb.1:
	incq	%rbx
	movq	_SEEK_SET@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_avio_seek
	testq	%rax, %rax
	jns	LBB0_3
## %bb.2:
	movq	16(%r12), %rdi
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	movq	%r15, %rdi
	callq	_avio_tell
	addq	(%r15), %rax
	subq	8(%r15), %rax
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_FFMAX
	movl	(%r14), %edx
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_avio_seek
LBB0_3:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_avio_rb32
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_avio_feof
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movq	_MATROSKA_ID_ATTACHMENTS@GOTPCREL(%rip), %r14
	movq	_MATROSKA_ID_CLUSTER@GOTPCREL(%rip), %r12
	movq	_MATROSKA_ID_CHAPTERS@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movd	%ebx, %xmm0
	movq	_MATROSKA_ID_INFO@GOTPCREL(%rip), %rax
	movd	(%rax), %xmm1                   ## xmm1 = mem[0],zero,zero,zero
	movq	_MATROSKA_ID_TRACKS@GOTPCREL(%rip), %rax
	pinsrd	$1, (%rax), %xmm1
	movq	_MATROSKA_ID_CUES@GOTPCREL(%rip), %rax
	pinsrd	$2, (%rax), %xmm1
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movq	_MATROSKA_ID_TAGS@GOTPCREL(%rip), %rax
	pinsrd	$3, (%rax), %xmm1
	movq	_MATROSKA_ID_SEEKHEAD@GOTPCREL(%rip), %rax
	movd	(%rax), %xmm2                   ## xmm2 = mem[0],zero,zero,zero
	pinsrd	$1, (%r14), %xmm2
	pinsrd	$2, (%r12), %xmm2
	pinsrd	$3, (%r13), %xmm2
	pcmpeqd	%xmm0, %xmm2
	pcmpeqd	%xmm0, %xmm1
	packssdw	%xmm2, %xmm1
	psllw	$15, %xmm1
	pmovmskb	%xmm1, %eax
	testl	$43690, %eax                    ## imm = 0xAAAA
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	shll	$8, %ebx
	movq	%r15, %rdi
	callq	_avio_r8
	orl	%eax, %ebx
	movq	%r15, %rdi
	callq	_avio_feof
	testl	%eax, %eax
	je	LBB0_5
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movl	16(%r15), %eax
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_6:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$-1, %edx
	callq	_matroska_reset_status
	movq	_EBML_UNKNOWN_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Seek to desired resync point failed. Seeking to earliest point available instead.\n"

	.comm	_MATROSKA_ID_INFO,4,2           ## @MATROSKA_ID_INFO
	.comm	_MATROSKA_ID_TRACKS,4,2         ## @MATROSKA_ID_TRACKS
	.comm	_MATROSKA_ID_CUES,4,2           ## @MATROSKA_ID_CUES
	.comm	_MATROSKA_ID_TAGS,4,2           ## @MATROSKA_ID_TAGS
	.comm	_MATROSKA_ID_SEEKHEAD,4,2       ## @MATROSKA_ID_SEEKHEAD
	.comm	_MATROSKA_ID_ATTACHMENTS,4,2    ## @MATROSKA_ID_ATTACHMENTS
	.comm	_MATROSKA_ID_CLUSTER,4,2        ## @MATROSKA_ID_CLUSTER
	.comm	_MATROSKA_ID_CHAPTERS,4,2       ## @MATROSKA_ID_CHAPTERS
	.comm	_EBML_UNKNOWN_LENGTH,4,2        ## @EBML_UNKNOWN_LENGTH
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.no_dead_strip	_matroska_resync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function matroska_resync
_matroska_resync:                       ; @matroska_resync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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 w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x20, [x8]
	mov	x0, x20
	bl	_avio_tell
	cmp	x0, x21
	b.le	LBB0_3
; %bb.1:
	add	x21, x21, #1
Lloh0:
	adrp	x22, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x21
	bl	_avio_seek
	tbz	x0, #63, LBB0_3
; %bb.2:
	ldr	x0, [x19, #16]
Lloh2:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
	mov	x0, x20
	bl	_avio_tell
	ldp	x8, x9, [x20]
	add	x8, x8, x0
	sub	x0, x8, x9
	mov	x1, x21
	bl	_FFMAX
	mov	x1, x0
	ldr	w2, [x22]
	mov	x0, x20
	bl	_avio_seek
LBB0_3:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x20
	bl	_avio_rb32
	mov	x21, x0
	mov	x0, x20
	bl	_avio_feof
	cbnz	w0, LBB0_7
; %bb.4:
Lloh7:
	adrp	x22, _MATROSKA_ID_INFO@GOTPAGE
Lloh8:
	ldr	x22, [x22, _MATROSKA_ID_INFO@GOTPAGEOFF]
Lloh9:
	adrp	x23, _MATROSKA_ID_TRACKS@GOTPAGE
Lloh10:
	ldr	x23, [x23, _MATROSKA_ID_TRACKS@GOTPAGEOFF]
Lloh11:
	adrp	x24, _MATROSKA_ID_CUES@GOTPAGE
Lloh12:
	ldr	x24, [x24, _MATROSKA_ID_CUES@GOTPAGEOFF]
Lloh13:
	adrp	x25, _MATROSKA_ID_TAGS@GOTPAGE
Lloh14:
	ldr	x25, [x25, _MATROSKA_ID_TAGS@GOTPAGEOFF]
Lloh15:
	adrp	x26, _MATROSKA_ID_SEEKHEAD@GOTPAGE
Lloh16:
	ldr	x26, [x26, _MATROSKA_ID_SEEKHEAD@GOTPAGEOFF]
Lloh17:
	adrp	x27, _MATROSKA_ID_ATTACHMENTS@GOTPAGE
Lloh18:
	ldr	x27, [x27, _MATROSKA_ID_ATTACHMENTS@GOTPAGEOFF]
Lloh19:
	adrp	x28, _MATROSKA_ID_CLUSTER@GOTPAGE
Lloh20:
	ldr	x28, [x28, _MATROSKA_ID_CLUSTER@GOTPAGEOFF]
Lloh21:
	adrp	x19, _MATROSKA_ID_CHAPTERS@GOTPAGE
Lloh22:
	ldr	x19, [x19, _MATROSKA_ID_CHAPTERS@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	ldr	w9, [x23]
	ldr	w10, [x24]
	ldr	w11, [x25]
	ldr	w12, [x26]
	ldr	w13, [x27]
	ldr	w14, [x28]
	ldr	w15, [x19]
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	ccmp	w21, w10, #4, ne
	ccmp	w21, w11, #4, ne
	ccmp	w21, w12, #4, ne
	ccmp	w21, w13, #4, ne
	ccmp	w21, w14, #4, ne
	ccmp	w21, w15, #4, ne
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_avio_r8
	orr	w21, w0, w21, lsl #8
	mov	x0, x20
	bl	_avio_feof
	cbz	w0, LBB0_5
LBB0_7:
	mov	w8, #1
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	w8, [x9]
	ldr	w8, [x20, #16]
Lloh23:
	adrp	x9, _AVERROR_EOF@GOTPAGE
Lloh24:
	ldr	x9, [x9, _AVERROR_EOF@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w0, w9, w8, eq
	b	LBB0_9
LBB0_8:
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x21
	mov	w2, #-1
	bl	_matroska_reset_status
	mov	w0, #0
Lloh26:
	adrp	x8, _EBML_UNKNOWN_LENGTH@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EBML_UNKNOWN_LENGTH@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
	str	w8, [x9]
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Seek to desired resync point failed. Seeking to earliest point available instead.\n"

	.comm	_MATROSKA_ID_INFO,4,2           ; @MATROSKA_ID_INFO
	.comm	_MATROSKA_ID_TRACKS,4,2         ; @MATROSKA_ID_TRACKS
	.comm	_MATROSKA_ID_CUES,4,2           ; @MATROSKA_ID_CUES
	.comm	_MATROSKA_ID_TAGS,4,2           ; @MATROSKA_ID_TAGS
	.comm	_MATROSKA_ID_SEEKHEAD,4,2       ; @MATROSKA_ID_SEEKHEAD
	.comm	_MATROSKA_ID_ATTACHMENTS,4,2    ; @MATROSKA_ID_ATTACHMENTS
	.comm	_MATROSKA_ID_CLUSTER,4,2        ; @MATROSKA_ID_CLUSTER
	.comm	_MATROSKA_ID_CHAPTERS,4,2       ; @MATROSKA_ID_CHAPTERS
	.comm	_EBML_UNKNOWN_LENGTH,4,2        ; @EBML_UNKNOWN_LENGTH
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.no_dead_strip	_matroska_resync
.subsections_via_symbols
