	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_extradata_ps_mp4
_decode_extradata_ps_mp4:               ## @decode_extradata_ps_mp4
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r13
	movl	$1, %ecx
	callq	_decode_extradata_ps
	testl	%eax, %eax
	jns	LBB0_15
## %bb.1:
	movq	_AV_EF_EXPLODE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_2
LBB0_15:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	movq	_INT16_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	subl	%ebx, %ecx
	movslq	%ecx, %rcx
	imulq	$1431655766, %rcx, %rcx         ## imm = 0x55555556
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	cmpl	%ecx, %eax
	jge	LBB0_3
## %bb.5:
	leal	(%r15,%r15,2), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	addl	%ecx, %ebx
	movl	%ebx, %edi
	callq	_av_mallocz
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	leaq	-48(%rbp), %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	movq	%rax, %r15
	callq	_bytestream2_init
	leaq	-44(%rbp), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_bytestream2_init_writer
	leaq	-48(%rbp), %rdi
	callq	_bytestream2_get_bytes_left
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	leaq	-48(%rbp), %rbx
	leaq	-44(%rbp), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_bytestream2_put_byte
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	callq	_bytestream2_get_bytes_left
	testl	%eax, %eax
	je	LBB0_14
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	$3, %eax
	jl	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	callq	_bytestream2_peek_be24
	cmpl	$3, %eax
	jg	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	movl	$3, %esi
	callq	_bytestream2_put_be24
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_bytestream2_skip
	jmp	LBB0_13
LBB0_3:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_14:
	leaq	-44(%rbp), %rdi
	callq	_bytestream2_tell_p
	movl	%eax, %ebx
	leal	-2(%rbx), %esi
	movq	%r15, %rdi
	callq	_AV_WB16
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	movq	%r12, %r8
	callq	_decode_extradata_ps
	leaq	-56(%rbp), %rdi
	callq	_av_freep
	jmp	LBB0_15
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_EF_EXPLODE,4,2              ## @AV_EF_EXPLODE
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SPS decoding failure, trying again after escaping the NAL\n"

	.comm	_INT16_MAX,4,2                  ## @INT16_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_decode_extradata_ps_mp4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_extradata_ps_mp4
_decode_extradata_ps_mp4:               ; @decode_extradata_ps_mp4
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x4
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x23, x0
	mov	w3, #1
	bl	_decode_extradata_ps
	tbz	w0, #31, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AV_EF_EXPLODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_EF_EXPLODE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_3
LBB0_2:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_3:
Lloh3:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	cmp	w22, #0
Lloh8:
	adrp	x8, _INT16_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INT16_MAX@GOTPAGEOFF]
	cinc	w9, w22, lt
Lloh10:
	ldr	w10, [x8]
Lloh11:
	adrp	x8, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	sub	w10, w10, w8
	mov	w11, #21846
	movk	w11, #21845, lsl #16
	smull	x10, w10, w11
	lsr	x11, x10, #63
	lsr	x10, x10, #32
	add	w10, w10, w11
	cmp	w10, w9, asr #1
	b.le	LBB0_11
; %bb.4:
	add	w9, w22, w22, lsl #1
	cmp	w9, #0
	cinc	w9, w9, lt
	add	w24, w8, w9, asr #1
	mov	x0, x24
	bl	_av_mallocz
	str	x0, [sp]
	cbz	x0, LBB0_13
; %bb.5:
	mov	x21, x0
	add	x0, sp, #12
	mov	x1, x23
	mov	x2, x22
	bl	_bytestream2_init
	add	x0, sp, #8
	mov	x1, x21
	mov	x2, x24
	bl	_bytestream2_init_writer
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x0, sp, #12
	bl	_bytestream2_get_byte
	mov	x1, x0
	add	x0, sp, #8
	bl	_bytestream2_put_byte
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #12
	bl	_bytestream2_get_bytes_left
	cbz	w0, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x0, sp, #12
	bl	_bytestream2_get_bytes_left
	cmp	w0, #3
	b.lt	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x0, sp, #12
	bl	_bytestream2_peek_be24
	cmp	w0, #3
	b.gt	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	add	x0, sp, #8
	mov	w1, #3
	bl	_bytestream2_put_be24
	add	x0, sp, #12
	mov	w1, #2
	bl	_bytestream2_skip
	b	LBB0_7
LBB0_11:
Lloh14:
	adrp	x8, _ERANGE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
	add	x0, sp, #8
	bl	_bytestream2_tell_p
	mov	x22, x0
	sub	w1, w0, #2
	mov	x0, x21
	bl	_AV_WB16
	mov	x0, x21
	mov	x1, x22
	mov	x2, x20
	mov	w3, #1
	mov	x4, x19
	bl	_decode_extradata_ps
	mov	x0, sp
	bl	_av_freep
	b	LBB0_2
LBB0_13:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_14:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_EF_EXPLODE,4,2              ; @AV_EF_EXPLODE
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SPS decoding failure, trying again after escaping the NAL\n"

	.comm	_INT16_MAX,4,2                  ; @INT16_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_decode_extradata_ps_mp4
.subsections_via_symbols
