	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_header
_write_header:                          ## @write_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	cmpl	$1, (%rdi)
	jne	LBB0_13
## %bb.1:
	movq	8(%rbx), %rax
	movq	(%rax), %rdi
	movq	(%rdi), %r13
	movq	(%r13), %rax
	movq	_AV_CODEC_ID_ASS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.2:
	movq	16(%rbx), %r12
	movl	$64, %esi
	movl	$1, %edx
	movl	$100, %ecx
	callq	_avpriv_set_pts_info
	movq	8(%r13), %r14
	testq	%r14, %r14
	je	LBB0_12
## %bb.3:
	movq	16(%r13), %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, %rdi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movq	%rax, %rdi
	movl	$10, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	incq	%rax
	movq	%rax, %rcx
	subq	%r15, %rcx
	movq	%r14, %rdx
	subq	%rcx, %rdx
	movq	%rdx, (%r12)
	je	LBB0_8
## %bb.7:
	movq	%rax, 8(%r12)
	movq	%rcx, %r14
LBB0_8:
	movl	4(%rbx), %edi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_avio_write
	movq	16(%r13), %r15
	cmpb	$10, -1(%r14,%r15)
	je	LBB0_10
## %bb.9:
	movl	4(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	$2, %edx
	callq	_avio_write
	movq	16(%r13), %r15
LBB0_10:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	callq	_strstr
	movq	%rax, %r14
	xorl	%eax, %eax
	testq	%r14, %r14
	sete	%al
	movl	%eax, 16(%r12)
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_strstr
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	testq	%r14, %r14
	movl	4(%rbx), %edi
	leaq	L_.str.7(%rip), %rax
	leaq	L_.str.8(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.6(%rip), %rsi
	callq	_avio_printf
LBB0_12:
	movl	4(%rbx), %edi
	callq	_avio_flush
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_CODEC_ID_ASS,8,3            ## @AV_CODEC_ID_ASS
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Exactly one ASS/SSA stream is needed.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"\n[Events]"

L_.str.2:                               ## @.str.2
	.asciz	"Format:"

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

L_.str.5:                               ## @.str.5
	.asciz	"\n[V4+ Styles]"

L_.str.6:                               ## @.str.6
	.asciz	"[Events]\r\nFormat: %s, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n"

L_.str.7:                               ## @.str.7
	.asciz	"Marked"

L_.str.8:                               ## @.str.8
	.asciz	"Layer"

	.no_dead_strip	_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_header
_write_header:                          ; @write_header
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	ldr	x23, [x0]
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _AV_CODEC_ID_ASS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_CODEC_ID_ASS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.2:
	ldr	x22, [x19, #16]
	mov	w1, #64
	mov	w2, #1
	mov	w3, #100
	bl	_avpriv_set_pts_info
	ldr	x20, [x23, #8]
	cbz	x20, LBB0_12
; %bb.3:
	ldr	x21, [x23, #16]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_strstr
	cbz	x0, LBB0_8
; %bb.4:
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_8
; %bb.5:
	mov	w1, #10
	bl	_strchr
	cbz	x0, LBB0_8
; %bb.6:
	add	x8, x0, #1
	sub	x9, x8, x21
	subs	x10, x20, x9
	str	x10, [x22]
	b.eq	LBB0_8
; %bb.7:
	str	x8, [x22, #8]
	mov	x20, x9
LBB0_8:
	ldr	w0, [x19, #4]
	mov	x1, x21
	mov	x2, x20
	bl	_avio_write
	ldr	x21, [x23, #16]
	add	x8, x20, x21
	ldurb	w8, [x8, #-1]
	cmp	w8, #10
	b.eq	LBB0_10
; %bb.9:
	ldr	w0, [x19, #4]
Lloh7:
	adrp	x1, l_.str.4@PAGE
Lloh8:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w2, #2
	bl	_avio_write
	ldr	x21, [x23, #16]
LBB0_10:
Lloh9:
	adrp	x1, l_.str.5@PAGE
Lloh10:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_strstr
	mov	x20, x0
	cmp	x0, #0
	cset	w8, eq
	str	w8, [x22, #16]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_strstr
	cbnz	x0, LBB0_12
; %bb.11:
	ldr	w0, [x19, #4]
Lloh13:
	adrp	x8, l_.str.8@PAGE
Lloh14:
	add	x8, x8, l_.str.8@PAGEOFF
Lloh15:
	adrp	x9, l_.str.7@PAGE
Lloh16:
	add	x9, x9, l_.str.7@PAGEOFF
	cmp	x20, #0
	csel	x2, x9, x8, eq
Lloh17:
	adrp	x1, l_.str.6@PAGE
Lloh18:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_avio_printf
LBB0_12:
	ldr	w0, [x19, #4]
	bl	_avio_flush
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh19:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x2, l_.str@PAGE
Lloh23:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_CODEC_ID_ASS,8,3            ; @AV_CODEC_ID_ASS
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Exactly one ASS/SSA stream is needed.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"\n[Events]"

l_.str.2:                               ; @.str.2
	.asciz	"Format:"

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

l_.str.5:                               ; @.str.5
	.asciz	"\n[V4+ Styles]"

l_.str.6:                               ; @.str.6
	.asciz	"[Events]\r\nFormat: %s, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n"

l_.str.7:                               ; @.str.7
	.asciz	"Marked"

l_.str.8:                               ; @.str.8
	.asciz	"Layer"

	.no_dead_strip	_write_header
.subsections_via_symbols
