	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function codec2_write_header
_codec2_write_header:                   ## @codec2_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	cmpl	$1, (%rdi)
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movq	(%rax), %r14
	movq	(%r14), %rax
	movq	(%rax), %rcx
	movq	_AV_CODEC_ID_CODEC2@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_2
## %bb.4:
	movq	8(%rax), %r8
	movq	_AVPRIV_CODEC2_EXTRADATA_SIZE@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	cmpq	%rcx, %r8
	jne	LBB0_5
## %bb.6:
	movl	4(%rbx), %edi
	movq	_AVPRIV_CODEC2_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_avio_wb24
	movl	4(%rbx), %edi
	movq	(%r14), %rax
	movl	16(%rax), %esi
	movq	(%r15), %rdx
	callq	_avio_write
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_CODEC_ID_CODEC2,8,3         ## @AV_CODEC_ID_CODEC2
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	".c2 files must have exactly one codec2 stream\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AVPRIV_CODEC2_EXTRADATA_SIZE,8,3 ## @AVPRIV_CODEC2_EXTRADATA_SIZE
L_.str.1:                               ## @.str.1
	.asciz	".c2 files require exactly %i bytes of extradata (got %i)\n"

	.comm	_AVPRIV_CODEC2_MAGIC,4,2        ## @AVPRIV_CODEC2_MAGIC
	.no_dead_strip	_codec2_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function codec2_write_header
_codec2_write_header:                   ; @codec2_write_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x20, [x8]
	ldr	x8, [x20]
	ldr	x9, [x8]
Lloh0:
	adrp	x10, _AV_CODEC_ID_CODEC2@GOTPAGE
Lloh1:
	ldr	x10, [x10, _AV_CODEC_ID_CODEC2@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.2:
	ldr	x8, [x8, #8]
Lloh3:
	adrp	x21, _AVPRIV_CODEC2_EXTRADATA_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _AVPRIV_CODEC2_EXTRADATA_SIZE@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	w0, [x19, #4]
Lloh5:
	adrp	x8, _AVPRIV_CODEC2_MAGIC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVPRIV_CODEC2_MAGIC@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_avio_wb24
	ldr	w0, [x19, #4]
	ldr	x8, [x20]
	ldr	w1, [x8, #16]
	ldr	x2, [x21]
	bl	_avio_write
	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
	add	sp, sp, #64
	ret
LBB0_4:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
LBB0_5:
	mov	x0, x19
	bl	_av_log
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	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
	add	sp, sp, #64
	b	_AVERROR
LBB0_6:
Lloh16:
	adrp	x10, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x10, [x10, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x10]
	stp	x9, x8, [sp]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_CODEC_ID_CODEC2,8,3         ; @AV_CODEC_ID_CODEC2
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	".c2 files must have exactly one codec2 stream\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AVPRIV_CODEC2_EXTRADATA_SIZE,8,3 ; @AVPRIV_CODEC2_EXTRADATA_SIZE
l_.str.1:                               ; @.str.1
	.asciz	".c2 files require exactly %i bytes of extradata (got %i)\n"

	.comm	_AVPRIV_CODEC2_MAGIC,4,2        ; @AVPRIV_CODEC2_MAGIC
	.no_dead_strip	_codec2_write_header
.subsections_via_symbols
