	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function purge_dialogues
_purge_dialogues:                       ## @purge_dialogues
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r15
	movq	16(%r15), %r12
	testq	%r12, %r12
	je	LBB0_14
## %bb.1:
	movq	(%r15), %rcx
	movq	(%r12), %r8
	cmpq	%rcx, %r8
	sete	%al
	testl	%esi, %esi
	jne	LBB0_3
## %bb.2:
	xorl	%ebx, %ebx
	cmpq	%rcx, %r8
	jne	LBB0_13
LBB0_3:
	movl	$1, %ebx
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r12), %r14
	testb	$1, %al
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_av_log
	movq	(%r12), %rax
	movq	%rax, (%r15)
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	16(%r12), %r13
	movl	16(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	leaq	L_.str.2(%rip), %rcx
	callq	_avio_print
	cmpq	24(%r15), %r12
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, 24(%r15)
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_av_freep
	movq	%r12, %rdi
	callq	_av_free
	testq	%r14, %r14
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	$0, 8(%r14)
	movq	%r14, 16(%r15)
	movq	(%r15), %rcx
	incq	%rcx
	movq	%rcx, (%r15)
	movq	(%r14), %r8
	cmpq	%rcx, %r8
	sete	%al
	incl	%ebx
	movq	%r14, %r12
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	testl	%esi, %esi
	jne	LBB0_4
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %r12
	cmpq	%rcx, %r8
	je	LBB0_4
## %bb.12:
	decl	%ebx
	jmp	LBB0_13
LBB0_9:
	movq	%r14, 16(%r15)
	incq	(%r15)
LBB0_13:
	movl	%ebx, %eax
	movq	8(%r15), %r8
	subq	%rax, %r8
	movq	%r8, 8(%r15)
	cmpl	$2, %ebx
	jb	LBB0_14
## %bb.15:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %r9
	leaq	L_.str.3(%rip), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %ecx
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_av_log                         ## TAILCALL
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ReadOrder gap found between %d and %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Dialogue: "

L_.str.2:                               ## @.str.2
	.asciz	"\r\n"

	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.3:                               ## @.str.3
	.asciz	"wrote %d ASS lines, cached dialogues: %d, waiting for event id %d\n"

	.no_dead_strip	_purge_dialogues
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function purge_dialogues
_purge_dialogues:                       ; @purge_dialogues
	.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
	ldr	x27, [x0, #8]
	ldr	x28, [x27, #16]
	cbz	x28, LBB0_16
; %bb.1:
	mov	x21, x1
	mov	x19, x0
	ldr	x3, [x27]
	ldr	x4, [x28]
	cmp	x4, x3
	cset	w8, eq
	cbnz	w1, LBB0_4
; %bb.2:
	cmp	x4, x3
	b.eq	LBB0_4
; %bb.3:
	mov	w20, #0
	b	LBB0_14
LBB0_4:
	mov	w20, #1
Lloh0:
	adrp	x22, l_.str.1@PAGE
Lloh1:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh2:
	adrp	x23, l_.str.2@PAGE
Lloh3:
	add	x23, x23, l_.str.2@PAGEOFF
Lloh4:
	adrp	x24, l_.str@PAGE
Lloh5:
	add	x24, x24, l_.str@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x28, #24]
	tbnz	w8, #0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh6:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x24
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_av_log
	ldr	x8, [x28]
	str	x8, [x27]
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19]
	mov	x26, x28
	ldr	w2, [x26, #16]!
	mov	x1, x22
	mov	x3, x23
	bl	_avio_print
	ldr	x8, [x27, #24]
	cmp	x28, x8
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	str	x25, [x27, #24]
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x26
	bl	_av_freep
	mov	x0, x28
	bl	_av_free
	cbz	x25, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [x25, #8]
	str	x25, [x27, #16]
	ldr	x8, [x27]
	add	x3, x8, #1
	str	x3, [x27]
	ldr	x4, [x25]
	cmp	x4, x3
	cset	w8, eq
	add	w20, w20, #1
	mov	x28, x25
	cbnz	w21, LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x28, x25
	cmp	x4, x3
	b.eq	LBB0_5
; %bb.12:
	sub	w20, w20, #1
	b	LBB0_14
LBB0_13:
	str	x25, [x27, #16]
	ldr	x8, [x27]
	add	x8, x8, #1
	str	x8, [x27]
LBB0_14:
	ldr	x8, [x27, #8]
	sub	x4, x8, w20, uxtw
	str	x4, [x27, #8]
	cmp	w20, #2
	b.lo	LBB0_16
; %bb.15:
Lloh9:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	x8, [x27]
Lloh12:
	adrp	x2, l_.str.3@PAGE
Lloh13:
	add	x2, x2, l_.str.3@PAGEOFF
	str	x8, [sp]
	mov	x0, x19
	mov	x3, x20
	bl	_av_log
LBB0_16:
	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 AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ReadOrder gap found between %d and %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Dialogue: "

l_.str.2:                               ; @.str.2
	.asciz	"\r\n"

	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.3:                               ; @.str.3
	.asciz	"wrote %d ASS lines, cached dialogues: %d, waiting for event id %d\n"

	.no_dead_strip	_purge_dialogues
.subsections_via_symbols
