	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smjpeg_write_header
_smjpeg_write_header:                   ## @smjpeg_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, %r14
	cmpl	$3, (%rdi)
	jl	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	jmp	LBB0_11
LBB0_2:
	movq	24(%r14), %r12
	movq	_SMJPEG_MAGIC@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	movl	$8, %edx
	callq	_avio_write
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%r14, %rdi
	callq	_ff_standardize_creation_time
	movl	16(%r14), %edi
	movq	_AV_DICT_IGNORE_SUFFIX@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%edx, %edx
	callq	_av_dict_get
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_SMJPEG_TXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_avio_wl32
	movq	(%r13), %rdi
	callq	_strlen
	movq	%r15, %rbx
	movl	%eax, %r15d
	movq	8(%r13), %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	(%r15,%rax), %esi
	addl	$3, %esi
	movq	%rbx, %r15
	movq	%r12, %rdi
	callq	_avio_wb32
	movq	(%r13), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_avio_write
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	$3, %edx
	callq	_avio_write
	movq	8(%r13), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_avio_write
	movl	16(%r14), %edi
	movl	(%r15), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdx
	callq	_av_dict_get
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_4
LBB0_5:
	cmpl	$0, (%r14)
	jle	LBB0_19
## %bb.6:
	movq	%r14, %rcx
	xorl	%ebx, %ebx
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_avio_wl32
	movq	%r15, %rdi
	movl	$32, %esi
	movl	$1, %edx
	movl	$1000, %ecx                     ## imm = 0x3E8
	callq	_avpriv_set_pts_info
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movslq	(%rcx), %rax
	cmpq	%rax, %rbx
	jge	LBB0_19
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rcx), %rax
	movq	(%rax,%rbx,8), %r15
	movq	(%r15), %r14
	movq	(%r14), %rax
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_ff_codec_smjpeg_audio_tags@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%r14), %esi
	callq	_ff_codec_get_tag
	testl	%eax, %eax
	je	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %r13d
	movq	_SMJPEG_SND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_avio_wl32
	movq	%r12, %rdi
	movl	$8, %esi
	callq	_avio_wb32
	movl	28(%r14), %esi
	movq	%r12, %rdi
	callq	_avio_wb16
	movl	24(%r14), %esi
	movq	%r12, %rdi
	callq	_avio_w8
	movl	20(%r14), %esi
	movq	%r12, %rdi
	callq	_avio_w8
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_ff_codec_smjpeg_video_tags@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%r14), %esi
	callq	_ff_codec_get_tag
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %r13d
	movq	_SMJPEG_VID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_avio_wl32
	movq	%r12, %rdi
	movl	$12, %esi
	callq	_avio_wb32
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movl	12(%r14), %esi
	movq	%r12, %rdi
	callq	_avio_wb16
	movl	8(%r14), %esi
	movq	%r12, %rdi
	callq	_avio_wb16
	jmp	LBB0_17
LBB0_19:
	movq	_SMJPEG_HEND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_avio_wl32
	movq	%r12, %rdi
	callq	_avio_flush
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_10
LBB0_15:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
LBB0_10:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_11:
	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_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"more than >2 streams are not supported\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SMJPEG_MAGIC,8,3               ## @SMJPEG_MAGIC
L_.str.1:                               ## @.str.1
	.space	1

	.comm	_AV_DICT_IGNORE_SUFFIX,4,2      ## @AV_DICT_IGNORE_SUFFIX
	.comm	_SMJPEG_TXT,4,2                 ## @SMJPEG_TXT
L_.str.2:                               ## @.str.2
	.asciz	" = "

	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.comm	_ff_codec_smjpeg_audio_tags,4,2 ## @ff_codec_smjpeg_audio_tags
L_.str.3:                               ## @.str.3
	.asciz	"unsupported audio codec\n"

	.comm	_SMJPEG_SND,4,2                 ## @SMJPEG_SND
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
	.comm	_ff_codec_smjpeg_video_tags,4,2 ## @ff_codec_smjpeg_video_tags
L_.str.4:                               ## @.str.4
	.asciz	"unsupported video codec\n"

	.comm	_SMJPEG_VID,4,2                 ## @SMJPEG_VID
	.comm	_SMJPEG_HEND,4,2                ## @SMJPEG_HEND
	.no_dead_strip	_smjpeg_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smjpeg_write_header
_smjpeg_write_header:                   ; @smjpeg_write_header
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	w8, [x0]
	cmp	w8, #3
	b.lt	LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	bl	_av_log
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_3:
	ldr	x20, [x19, #24]
Lloh8:
	adrp	x8, _SMJPEG_MAGIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SMJPEG_MAGIC@GOTPAGEOFF]
Lloh10:
	ldr	x1, [x8]
	mov	x0, x20
	mov	w2, #8
	bl	_avio_write
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x19
	bl	_ff_standardize_creation_time
	ldr	w0, [x19, #16]
Lloh11:
	adrp	x25, _AV_DICT_IGNORE_SUFFIX@GOTPAGE
Lloh12:
	ldr	x25, [x25, _AV_DICT_IGNORE_SUFFIX@GOTPAGEOFF]
	ldr	w3, [x25]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, #0
	bl	_av_dict_get
	cbz	x0, LBB0_6
; %bb.4:
	mov	x21, x0
Lloh15:
	adrp	x26, _SMJPEG_TXT@GOTPAGE
Lloh16:
	ldr	x26, [x26, _SMJPEG_TXT@GOTPAGEOFF]
Lloh17:
	adrp	x22, l_.str.2@PAGE
Lloh18:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh19:
	adrp	x23, l_.str.1@PAGE
Lloh20:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x20
	bl	_avio_wl32
	ldr	x0, [x21]
	bl	_strlen
	mov	x24, x0
	ldr	x0, [x21, #8]
	bl	_strlen
	add	w8, w24, w0
	add	w1, w8, #3
	mov	x0, x20
	bl	_avio_wb32
	ldr	x24, [x21]
	mov	x0, x24
	bl	_strlen
	mov	x2, x0
	mov	x0, x20
	mov	x1, x24
	bl	_avio_write
	mov	x0, x20
	mov	x1, x22
	mov	w2, #3
	bl	_avio_write
	ldr	x24, [x21, #8]
	mov	x0, x24
	bl	_strlen
	mov	x2, x0
	mov	x0, x20
	mov	x1, x24
	bl	_avio_write
	ldr	w0, [x19, #16]
	ldr	w3, [x25]
	mov	x1, x23
	mov	x2, x21
	bl	_av_dict_get
	mov	x21, x0
	cbnz	x0, LBB0_5
LBB0_6:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.7:
	mov	x23, #0
Lloh21:
	adrp	x24, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh22:
	ldr	x24, [x24, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh23:
	adrp	x25, _ff_codec_smjpeg_audio_tags@GOTPAGE
Lloh24:
	ldr	x25, [x25, _ff_codec_smjpeg_audio_tags@GOTPAGEOFF]
Lloh25:
	adrp	x26, _SMJPEG_SND@GOTPAGE
Lloh26:
	ldr	x26, [x26, _SMJPEG_SND@GOTPAGEOFF]
Lloh27:
	adrp	x27, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh28:
	ldr	x27, [x27, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_avio_wl32
	mov	x0, x21
	mov	w1, #32
	mov	w2, #1
	mov	w3, #1000
	bl	_avpriv_set_pts_info
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.ge	LBB0_16
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x21, [x8, x23, lsl #3]
	ldr	x28, [x21]
	ldr	x8, [x28]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w0, [x25]
	ldr	w1, [x28, #16]
	bl	_ff_codec_get_tag
	cbz	w0, LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x22, x0
	ldr	w1, [x26]
	mov	x0, x20
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #8
	bl	_avio_wb32
	ldr	w1, [x28, #28]
	mov	x0, x20
	bl	_avio_wb16
	ldr	w1, [x28, #24]
	mov	x0, x20
	bl	_avio_w8
	ldr	w1, [x28, #20]
	mov	x0, x20
	bl	_avio_w8
	b	LBB0_8
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
Lloh29:
	adrp	x8, _ff_codec_smjpeg_video_tags@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ff_codec_smjpeg_video_tags@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	ldr	w1, [x28, #16]
	bl	_ff_codec_get_tag
	cbz	w0, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x22, x0
Lloh32:
	adrp	x8, _SMJPEG_VID@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SMJPEG_VID@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_avio_wl32
	mov	x0, x20
	mov	w1, #12
	bl	_avio_wb32
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb32
	ldr	w1, [x28, #12]
	mov	x0, x20
	bl	_avio_wb16
	ldr	w1, [x28, #8]
	mov	x0, x20
	bl	_avio_wb16
	b	LBB0_8
LBB0_16:
Lloh35:
	adrp	x8, _SMJPEG_HEND@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SMJPEG_HEND@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_avio_wl32
	mov	x0, x20
	bl	_avio_flush
	mov	w0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_17:
Lloh38:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
Lloh41:
	adrp	x2, l_.str.3@PAGE
Lloh42:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_18:
Lloh43:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh44:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
Lloh46:
	adrp	x2, l_.str.4@PAGE
Lloh47:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"more than >2 streams are not supported\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SMJPEG_MAGIC,8,3               ; @SMJPEG_MAGIC
l_.str.1:                               ; @.str.1
	.space	1

	.comm	_AV_DICT_IGNORE_SUFFIX,4,2      ; @AV_DICT_IGNORE_SUFFIX
	.comm	_SMJPEG_TXT,4,2                 ; @SMJPEG_TXT
l_.str.2:                               ; @.str.2
	.asciz	" = "

	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.comm	_ff_codec_smjpeg_audio_tags,4,2 ; @ff_codec_smjpeg_audio_tags
l_.str.3:                               ; @.str.3
	.asciz	"unsupported audio codec\n"

	.comm	_SMJPEG_SND,4,2                 ; @SMJPEG_SND
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
	.comm	_ff_codec_smjpeg_video_tags,4,2 ; @ff_codec_smjpeg_video_tags
l_.str.4:                               ; @.str.4
	.asciz	"unsupported video codec\n"

	.comm	_SMJPEG_VID,4,2                 ; @SMJPEG_VID
	.comm	_SMJPEG_HEND,4,2                ; @SMJPEG_HEND
	.no_dead_strip	_smjpeg_write_header
.subsections_via_symbols
