	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sami_read_header
_sami_read_header:                      ## @sami_read_header
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	callq	_avformat_new_stream
	movq	%rax, %r14
	movb	$0, -41(%rbp)
	movl	(%rbx), %edx
	leaq	-60(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ff_text_init_avio
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	$64, %esi
	movl	$1, %edx
	movl	$1000, %ecx                     ## imm = 0x3E8
	callq	_avpriv_set_pts_info
	movq	_AVMEDIA_TYPE_SUBTITLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rcx
	movl	%eax, 4(%rcx)
	movq	_AV_CODEC_ID_SAMI@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movq	_AV_BPRINT_SIZE_UNLIMITED@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	-56(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_av_bprint_init
	movl	(%r14), %edx
	leaq	-80(%rbp), %rdi
	xorl	%esi, %esi
	callq	_av_bprint_init
	leaq	-60(%rbp), %rdi
	callq	_ff_text_eof
	testl	%eax, %eax
	je	LBB0_3
LBB0_17:
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	leaq	-80(%rbp), %rsi
	callq	_ff_bprint_to_codecpar_extradata
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_19
## %bb.18:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_ff_subtitles_queue_finalize
LBB0_19:
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	callq	_av_bprint_finalize
	jmp	LBB0_20
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	-60(%rbp), %r15
	leaq	-56(%rbp), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	leaq	-80(%rbp), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_av_bprintf
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_av_bprint_clear
	movq	%r15, %rdi
	callq	_ff_text_eof
	testl	%eax, %eax
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	jne	LBB0_17
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_ff_text_pos
	movq	%rax, %r14
	cmpb	$1, -41(%rbp)
	adcq	$-1, %r14
	movq	%r15, %rdi
	movq	%r12, %rsi
	leaq	-41(%rbp), %rdx
	callq	_ff_smil_extract_next_text_chunk
	testl	%eax, %eax
	je	LBB0_17
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-56(%rbp), %edi
	leaq	L_.str(%rip), %rsi
	movl	$6, %edx
	callq	_av_strncasecmp
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-56(%rbp), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$5, %edx
	callq	_av_strncasecmp
	movl	%eax, %r13d
	testl	%eax, %eax
	movl	$1, %eax
	cmovel	%eax, %ebx
	movl	-56(%rbp), %eax
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ecx, %ecx
	testl	%r13d, %r13d
	setne	%cl
	movl	-52(%rbp), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_ff_subtitles_queue_insert
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	testl	%r13d, %r13d
	jne	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rbx
	movl	-56(%rbp), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_ff_smil_get_attr_ptr
	movq	%r14, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_strtol
	jmp	LBB0_15
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
LBB0_15:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, 4(%rbx)
	movl	$-1, (%rbx)
	jmp	LBB0_16
LBB0_6:
	leaq	-56(%rbp), %rdi
	callq	_av_bprint_clear
	jmp	LBB0_17
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_SUBTITLE,4,2      ## @AVMEDIA_TYPE_SUBTITLE
	.comm	_AV_CODEC_ID_SAMI,4,2           ## @AV_CODEC_ID_SAMI
	.comm	_AV_BPRINT_SIZE_UNLIMITED,4,2   ## @AV_BPRINT_SIZE_UNLIMITED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"</BODY"

L_.str.1:                               ## @.str.1
	.asciz	"<SYNC"

L_.str.2:                               ## @.str.2
	.asciz	"%s"

L_.str.3:                               ## @.str.3
	.asciz	"Start"

	.no_dead_strip	_sami_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sami_read_header
_sami_read_header:                      ; @sami_read_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x0
	ldr	x19, [x0, #8]
	mov	x1, #0
	bl	_avformat_new_stream
	mov	x21, x0
	strb	wzr, [sp, #15]
	ldr	w2, [x20]
	add	x1, sp, #8
	mov	x0, x20
	bl	_ff_text_init_avio
	cbz	x21, LBB0_5
; %bb.1:
	mov	x0, x21
	mov	w1, #64
	mov	w2, #1
	mov	w3, #1000
	bl	_avpriv_set_pts_info
Lloh0:
	adrp	x8, _AVMEDIA_TYPE_SUBTITLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVMEDIA_TYPE_SUBTITLE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x21]
Lloh3:
	adrp	x10, _AV_CODEC_ID_SAMI@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AV_CODEC_ID_SAMI@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	stp	w10, w8, [x9]
Lloh6:
	adrp	x22, _AV_BPRINT_SIZE_UNLIMITED@GOTPAGE
Lloh7:
	ldr	x22, [x22, _AV_BPRINT_SIZE_UNLIMITED@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x0, sp, #24
	mov	w1, #0
	bl	_av_bprint_init
	ldr	w2, [x22]
	add	x0, sp, #16
	mov	w1, #0
	bl	_av_bprint_init
	add	x0, sp, #8
	bl	_ff_text_eof
	cbz	w0, LBB0_7
LBB0_2:
	ldr	x0, [x21]
	add	x1, sp, #16
	bl	_ff_bprint_to_codecpar_extradata
	mov	x21, x0
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x0, x20
	mov	x1, x19
	bl	_ff_subtitles_queue_finalize
LBB0_4:
	add	x0, sp, #24
	mov	x1, #0
	bl	_av_bprint_finalize
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_7:
	mov	w25, #0
Lloh11:
	adrp	x22, l_.str@PAGE
Lloh12:
	add	x22, x22, l_.str@PAGEOFF
Lloh13:
	adrp	x23, l_.str.1@PAGE
Lloh14:
	add	x23, x23, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x0, sp, #16
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x8
	bl	_av_bprintf
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x0, sp, #24
	bl	_av_bprint_clear
	add	x0, sp, #8
	bl	_ff_text_eof
	cbnz	w0, LBB0_2
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	bl	_ff_text_pos
	mov	x26, x0
	ldrb	w8, [sp, #15]
	cmp	w8, #0
	cset	w24, ne
	add	x0, sp, #8
	add	x1, sp, #24
	add	x2, sp, #15
	bl	_ff_smil_extract_next_text_chunk
	cbz	w0, LBB0_2
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w0, [sp, #24]
	mov	x1, x22
	mov	w2, #6
	bl	_av_strncasecmp
	cbz	w0, LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w0, [sp, #24]
	mov	x1, x23
	mov	w2, #5
	bl	_av_strncasecmp
	cmp	w0, #0
	csinc	w25, w25, wzr, ne
	ldr	w8, [sp, #24]
	cbz	w25, LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x28, x0
	cmp	w0, #0
	cset	w3, ne
	ldr	w2, [sp, #28]
	mov	x0, x19
	mov	x1, x8
	bl	_ff_subtitles_queue_insert
	cbz	x0, LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	cbnz	w28, LBB0_9
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x27, x0
	sub	x24, x26, x24
	ldr	w0, [sp, #24]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_ff_smil_get_attr_ptr
	str	x24, [x27, #8]
	cbz	x0, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x1, #0
	mov	w2, #10
	bl	_strtol
LBB0_17:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w8, #-1
	stp	w8, w0, [x27]
	b	LBB0_9
LBB0_18:
	add	x0, sp, #24
	bl	_av_bprint_clear
	b	LBB0_2
LBB0_19:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x21, x0
	b	LBB0_4
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_SUBTITLE,4,2      ; @AVMEDIA_TYPE_SUBTITLE
	.comm	_AV_CODEC_ID_SAMI,4,2           ; @AV_CODEC_ID_SAMI
	.comm	_AV_BPRINT_SIZE_UNLIMITED,4,2   ; @AV_BPRINT_SIZE_UNLIMITED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"</BODY"

l_.str.1:                               ; @.str.1
	.asciz	"<SYNC"

l_.str.2:                               ; @.str.2
	.asciz	"%s"

l_.str.3:                               ; @.str.3
	.asciz	"Start"

	.no_dead_strip	_sami_read_header
.subsections_via_symbols
