	.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, %r13
	movq	24(%rdi), %rax
	movq	32(%rdi), %r15
	movq	(%rax), %rbx
	movq	(%rbx), %rax
	movl	8(%rax), %edi
	callq	_av_pix_fmt_desc_get
	movq	%rax, %r14
	movl	20(%r15), %edi
	movl	16(%r13), %esi
	movl	$4, %edx
	callq	_av_strlcpy
	movq	8(%r13), %rax
	movq	_AVFMT_NOFILE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	andl	(%rax), %ecx
	sete	%dl
	movl	%edx, (%r15)
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_AV_CODEC_ID_GIF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rax
	movq	%rax, 8(%r15)
	jmp	LBB0_12
LBB0_2:
	movq	_AV_CODEC_ID_FITS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%r15)
	jmp	LBB0_12
LBB0_4:
	movq	_AV_CODEC_ID_RAWVIDEO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.5:
	movl	20(%r15), %edi
	movl	$46, %esi
	callq	_strrchr
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	incq	%rax
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, %rdi
	callq	_av_strcasecmp
	testl	%eax, %eax
	je	LBB0_7
LBB0_11:
	movl	%r12d, 16(%r15)
LBB0_12:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	cmpl	$1, (%r13)
	jne	LBB0_11
## %bb.8:
	testq	%r14, %r14
	je	LBB0_11
## %bb.9:
	movq	_AV_PIX_FMT_FLAG_PLANAR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_11
## %bb.10:
	xorl	%r12d, %r12d
	cmpl	$3, 4(%r14)
	setge	%r12b
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_AVFMT_NOFILE,4,2               ## @AVFMT_NOFILE
	.comm	_AV_CODEC_ID_GIF,8,3            ## @AV_CODEC_ID_GIF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gif"

	.comm	_AV_CODEC_ID_FITS,8,3           ## @AV_CODEC_ID_FITS
L_.str.1:                               ## @.str.1
	.asciz	"fits"

	.comm	_AV_CODEC_ID_RAWVIDEO,8,3       ## @AV_CODEC_ID_RAWVIDEO
L_.str.2:                               ## @.str.2
	.asciz	"y"

	.comm	_AV_PIX_FMT_FLAG_PLANAR,4,2     ## @AV_PIX_FMT_FLAG_PLANAR
	.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	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldp	x8, x21, [x0, #24]
	ldr	x22, [x8]
	ldr	x8, [x22]
	ldr	w0, [x8, #8]
	bl	_av_pix_fmt_desc_get
	mov	x19, x0
	ldr	w0, [x21, #20]
	ldr	w1, [x20, #16]
	mov	w2, #4
	bl	_av_strlcpy
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _AVFMT_NOFILE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVFMT_NOFILE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, eq
	str	w8, [x21]
	ldr	x8, [x22]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _AV_CODEC_ID_GIF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CODEC_ID_GIF@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, l_.str@PAGE
Lloh7:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x21, #8]
	b	LBB0_13
LBB0_2:
Lloh8:
	adrp	x9, _AV_CODEC_ID_FITS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AV_CODEC_ID_FITS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, l_.str.1@PAGE
Lloh12:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x21, #8]
	b	LBB0_13
LBB0_4:
Lloh13:
	adrp	x9, _AV_CODEC_ID_RAWVIDEO@GOTPAGE
Lloh14:
	ldr	x9, [x9, _AV_CODEC_ID_RAWVIDEO@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.5:
	ldr	w0, [x21, #20]
	mov	w1, #46
	bl	_strrchr
	cbz	x0, LBB0_11
; %bb.6:
	add	x0, x0, #1
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_av_strcasecmp
	mov	w8, #0
	cbnz	w0, LBB0_12
; %bb.7:
	ldr	w9, [x20]
	cmp	w9, #1
	b.ne	LBB0_12
; %bb.8:
	cbz	x19, LBB0_12
; %bb.9:
	ldr	w8, [x19]
Lloh18:
	adrp	x9, _AV_PIX_FMT_FLAG_PLANAR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AV_PIX_FMT_FLAG_PLANAR@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	ldr	w8, [x19, #4]
	cmp	w8, #2
	cset	w8, gt
	b	LBB0_12
LBB0_11:
	mov	w8, #0
LBB0_12:
	str	w8, [x21, #16]
LBB0_13:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_AVFMT_NOFILE,4,2               ; @AVFMT_NOFILE
	.comm	_AV_CODEC_ID_GIF,8,3            ; @AV_CODEC_ID_GIF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gif"

	.comm	_AV_CODEC_ID_FITS,8,3           ; @AV_CODEC_ID_FITS
l_.str.1:                               ; @.str.1
	.asciz	"fits"

	.comm	_AV_CODEC_ID_RAWVIDEO,8,3       ; @AV_CODEC_ID_RAWVIDEO
l_.str.2:                               ; @.str.2
	.asciz	"y"

	.comm	_AV_PIX_FMT_FLAG_PLANAR,4,2     ; @AV_PIX_FMT_FLAG_PLANAR
	.no_dead_strip	_write_header
.subsections_via_symbols
