	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function latm_write_header
_latm_write_header:                     ## @latm_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
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
	movq	(%rcx), %rdx
	movq	_AV_CODEC_ID_AAC_LATM@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	cmpq	(%rsi), %rdx
	je	LBB0_5
## %bb.1:
	movq	_AV_CODEC_ID_AAC@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	je	LBB0_3
## %bb.2:
	movq	_AV_CODEC_ID_MP4ALS@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	je	LBB0_3
## %bb.6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_3:
	movq	8(%rcx), %rdx
	testq	%rdx, %rdx
	jle	LBB0_5
## %bb.4:
	movl	16(%rcx), %esi
	callq	_latm_decode_extradata
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rcx
	sarq	$63, %rax
	andl	(%rcx), %eax
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_CODEC_ID_AAC_LATM,8,3       ## @AV_CODEC_ID_AAC_LATM
	.comm	_AV_CODEC_ID_AAC,8,3            ## @AV_CODEC_ID_AAC
	.comm	_AV_CODEC_ID_MP4ALS,8,3         ## @AV_CODEC_ID_MP4ALS
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Only AAC, LATM and ALS are supported\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.no_dead_strip	_latm_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function latm_write_header
_latm_write_header:                     ; @latm_write_header
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x9, [x8]
Lloh0:
	adrp	x10, _AV_CODEC_ID_AAC_LATM@GOTPAGE
Lloh1:
	ldr	x10, [x10, _AV_CODEC_ID_AAC_LATM@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
LBB0_1:
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh3:
	adrp	x10, _AV_CODEC_ID_AAC@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AV_CODEC_ID_AAC@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _AV_CODEC_ID_MP4ALS@GOTPAGE
Lloh7:
	ldr	x11, [x11, _AV_CODEC_ID_MP4ALS@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	cmp	x9, x10
	ccmp	x9, x11, #4, ne
	b.ne	LBB0_5
; %bb.3:
	ldr	x2, [x8, #8]
	cmp	x2, #1
	b.lt	LBB0_1
; %bb.4:
	ldr	w1, [x8, #16]
	bl	_latm_decode_extradata
Lloh9:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	asr	x9, x0, #63
	and	w0, w9, w8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh12:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_CODEC_ID_AAC_LATM,8,3       ; @AV_CODEC_ID_AAC_LATM
	.comm	_AV_CODEC_ID_AAC,8,3            ; @AV_CODEC_ID_AAC
	.comm	_AV_CODEC_ID_MP4ALS,8,3         ; @AV_CODEC_ID_MP4ALS
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Only AAC, LATM and ALS are supported\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.no_dead_strip	_latm_write_header
.subsections_via_symbols
