	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function codec2_read_header
_codec2_read_header:                    ## @codec2_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %r14
	movl	8(%rbx), %edi
	callq	_avio_rb24
	movq	_AVPRIV_CODEC2_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	(%r14), %rdi
	movq	_AVPRIV_CODEC2_EXTRADATA_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_ff_alloc_extradata
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movl	8(%rbx), %edi
	movq	(%r14), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	callq	_ffio_read_size
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_avpriv_codec2_version_from_extradata
	sarl	$8, %eax
	movq	_EXPECTED_CODEC2_MAJOR_VERSION@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.10:
	movq	_AVPRIV_CODEC2_HEADER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rcx
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_codec2_read_header_common      ## TAILCALL
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_avpriv_report_missing_feature
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVPRIV_CODEC2_MAGIC,8,3        ## @AVPRIV_CODEC2_MAGIC
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not a .c2 file\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AVPRIV_CODEC2_EXTRADATA_SIZE,4,2 ## @AVPRIV_CODEC2_EXTRADATA_SIZE
	.comm	_EXPECTED_CODEC2_MAJOR_VERSION,4,2 ## @EXPECTED_CODEC2_MAJOR_VERSION
L_.str.1:                               ## @.str.1
	.asciz	"Major version %i"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_AVPRIV_CODEC2_HEADER_SIZE,4,2  ## @AVPRIV_CODEC2_HEADER_SIZE
	.no_dead_strip	_codec2_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function codec2_read_header
_codec2_read_header:                    ; @codec2_read_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	x19, x0
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #8]
	bl	_avio_rb24
Lloh0:
	adrp	x8, _AVPRIV_CODEC2_MAGIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVPRIV_CODEC2_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.2:
	ldr	x0, [x20]
Lloh3:
	adrp	x21, _AVPRIV_CODEC2_EXTRADATA_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _AVPRIV_CODEC2_EXTRADATA_SIZE@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_ff_alloc_extradata
	cbnz	w0, LBB0_9
; %bb.3:
	ldr	w0, [x19, #8]
	ldr	x8, [x20]
	ldr	w1, [x8]
	ldr	w2, [x21]
	bl	_ffio_read_size
	tbnz	w0, #31, LBB0_9
; %bb.4:
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_avpriv_codec2_version_from_extradata
	asr	w2, w0, #8
Lloh5:
	adrp	x8, _EXPECTED_CODEC2_MAJOR_VERSION@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EXPECTED_CODEC2_MAJOR_VERSION@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_10
; %bb.5:
Lloh8:
	adrp	x8, _AVPRIV_CODEC2_HEADER_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVPRIV_CODEC2_HEADER_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [x19]
	str	w8, [x9]
	mov	x0, x19
	mov	x1, x20
	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
	b	_codec2_read_header_common
LBB0_6:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_7:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str@PAGE
Lloh18:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh19:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
LBB0_9:
	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
LBB0_10:
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_avpriv_report_missing_feature
Lloh23:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVPRIV_CODEC2_MAGIC,8,3        ; @AVPRIV_CODEC2_MAGIC
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not a .c2 file\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AVPRIV_CODEC2_EXTRADATA_SIZE,4,2 ; @AVPRIV_CODEC2_EXTRADATA_SIZE
	.comm	_EXPECTED_CODEC2_MAJOR_VERSION,4,2 ; @EXPECTED_CODEC2_MAJOR_VERSION
l_.str.1:                               ; @.str.1
	.asciz	"Major version %i"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_AVPRIV_CODEC2_HEADER_SIZE,4,2  ; @AVPRIV_CODEC2_HEADER_SIZE
	.no_dead_strip	_codec2_read_header
.subsections_via_symbols
