	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hevc_extradata_to_annexb
_hevc_extradata_to_annexb:              ## @hevc_extradata_to_annexb
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$0, -48(%rbp)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	leaq	-52(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_bytestream2_init
	movq	%rbx, %rdi
	movl	$21, %esi
	callq	_bytestream2_skip
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_bytestream2_get_byte
	xorl	%r15d, %r15d
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	leaq	-52(%rbp), %r14
	movq	_HEVC_NAL_VPS@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	incl	%r15d
	cmpl	-60(%rbp), %r15d                ## 4-byte Folded Reload
	movq	%r12, %r14
	movq	_HEVC_NAL_VPS@GOTPCREL(%rip), %r12
	je	LBB0_16
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movq	%r14, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %ebx
	andl	$63, %ebx
	movq	%r14, %rdi
	callq	_bytestream2_get_be16
	movl	%eax, %r14d
	cmpl	(%r12), %ebx
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_HEVC_NAL_SPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_HEVC_NAL_PPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_HEVC_NAL_SEI_PREFIX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_HEVC_NAL_SEI_SUFFIX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_19
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	leaq	-52(%rbp), %r12
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rbx
	jle	LBB0_15
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	callq	_bytestream2_get_be16
	movq	(%rbx), %rcx
	movslq	%eax, %r15
	leaq	(%rcx,%r15), %rsi
	addq	$4, %rsi
	movq	_SIZE_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subq	%r13, %rax
	cmpq	%rax, %rsi
	ja	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=2
	addq	%r13, %rsi
	leaq	-48(%rbp), %rdi
	callq	_av_reallocp
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=2
	leaq	(,%r13,4), %rdi
	addq	-48(%rbp), %rdi
	movl	$1, %esi
	callq	_AV_WB32
	movq	-48(%rbp), %rax
	leaq	(%rax,%r13,4), %rsi
	addq	$16, %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_bytestream2_get_buffer
	leaq	(%r15,%r13), %rax
	addq	%r15, %r13
	addq	$4, %r13
	leaq	16(,%rax,4), %rdi
	addq	-48(%rbp), %rdi
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	xorl	%esi, %esi
	callq	_memset
	decl	%r14d
	jne	LBB0_9
	jmp	LBB0_15
LBB0_1:
	xorl	%r13d, %r13d
LBB0_16:
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	andl	$3, %ebx
	incl	%ebx
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rdi
	addq	$8, %rdi
	callq	_av_freep
	movq	-48(%rbp), %rax
	movq	(%r14), %rcx
	movq	%rax, 8(%rcx)
	movq	%r13, (%rcx)
	testq	%r13, %r13
	jne	LBB0_18
## %bb.17:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_18
LBB0_13:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_19:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_av_log
LBB0_10:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_11:
	leaq	-48(%rbp), %rdi
	callq	_av_freep
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HEVC_NAL_VPS,4,2               ## @HEVC_NAL_VPS
	.comm	_HEVC_NAL_SPS,4,2               ## @HEVC_NAL_SPS
	.comm	_HEVC_NAL_PPS,4,2               ## @HEVC_NAL_PPS
	.comm	_HEVC_NAL_SEI_PREFIX,4,2        ## @HEVC_NAL_SEI_PREFIX
	.comm	_HEVC_NAL_SEI_SUFFIX,4,2        ## @HEVC_NAL_SEI_SUFFIX
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid NAL unit type in extradata: %d\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_SIZE_MAX,8,3                   ## @SIZE_MAX
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"No parameter sets in the extradata\n"

	.no_dead_strip	_hevc_extradata_to_annexb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hevc_extradata_to_annexb
_hevc_extradata_to_annexb:              ; @hevc_extradata_to_annexb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	xzr, [sp, #32]
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
	ldr	x8, [x0, #8]
	ldp	w2, w1, [x8]
	add	x0, sp, #44
	bl	_bytestream2_init
	add	x0, sp, #44
	mov	w1, #21
	bl	_bytestream2_skip
	add	x0, sp, #44
	bl	_bytestream2_get_byte
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	add	x0, sp, #44
	bl	_bytestream2_get_byte
	str	w0, [sp, #28]                   ; 4-byte Folded Spill
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.1:
	mov	w26, #0
	mov	x25, #0
Lloh0:
	adrp	x20, _HEVC_NAL_VPS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _HEVC_NAL_VPS@GOTPAGEOFF]
Lloh2:
	adrp	x19, _HEVC_NAL_SPS@GOTPAGE
Lloh3:
	ldr	x19, [x19, _HEVC_NAL_SPS@GOTPAGEOFF]
Lloh4:
	adrp	x21, _HEVC_NAL_PPS@GOTPAGE
Lloh5:
	ldr	x21, [x21, _HEVC_NAL_PPS@GOTPAGEOFF]
Lloh6:
	adrp	x24, _HEVC_NAL_SEI_PREFIX@GOTPAGE
Lloh7:
	ldr	x24, [x24, _HEVC_NAL_SEI_PREFIX@GOTPAGEOFF]
Lloh8:
	adrp	x27, _HEVC_NAL_SEI_SUFFIX@GOTPAGE
Lloh9:
	ldr	x27, [x27, _HEVC_NAL_SEI_SUFFIX@GOTPAGEOFF]
Lloh10:
	adrp	x28, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh11:
	ldr	x28, [x28, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w26, w26, #1
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	cmp	w26, w8
Lloh12:
	adrp	x24, _HEVC_NAL_SEI_PREFIX@GOTPAGE
Lloh13:
	ldr	x24, [x24, _HEVC_NAL_SEI_PREFIX@GOTPAGEOFF]
Lloh14:
	adrp	x27, _HEVC_NAL_SEI_SUFFIX@GOTPAGE
Lloh15:
	ldr	x27, [x27, _HEVC_NAL_SEI_SUFFIX@GOTPAGEOFF]
	b.eq	LBB0_9
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	add	x0, sp, #44
	bl	_bytestream2_get_byte
	and	w23, w0, #0x3f
	add	x0, sp, #44
	bl	_bytestream2_get_be16
	ldr	w8, [x20]
	ldr	w9, [x19]
	ldr	w10, [x21]
	ldr	w11, [x24]
	ldr	w12, [x27]
	cmp	w23, w8
	ccmp	w23, w9, #4, ne
	ccmp	w23, w10, #4, ne
	ccmp	w23, w11, #4, ne
	ccmp	w23, w12, #4, ne
	b.ne	LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, x0
	cmp	w0, #1
Lloh16:
	adrp	x27, _SIZE_MAX@GOTPAGE
Lloh17:
	ldr	x27, [x27, _SIZE_MAX@GOTPAGEOFF]
	b.lt	LBB0_2
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x0, sp, #44
	bl	_bytestream2_get_be16
	ldr	x8, [x28]
	add	x8, x8, w0, sxtw
	add	x8, x8, #4
	ldr	x9, [x27]
	sub	x9, x9, x25
	cmp	x8, x9
	b.hi	LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x24, x0
	add	x1, x8, x25
	add	x0, sp, #32
	bl	_av_reallocp
	tbnz	w0, #31, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	ldr	x8, [sp, #32]
	lsl	x23, x25, #2
	add	x0, x8, x23
	mov	w1, #1
	bl	_AV_WB32
	ldr	x8, [sp, #32]
	add	x8, x8, x23
	add	x1, x8, #16
	add	x0, sp, #44
	mov	x2, x24
	bl	_bytestream2_get_buffer
	add	w8, w24, #4
	add	x25, x25, w8, sxtw
	ldr	x8, [sp, #32]
	add	x0, x8, x25, lsl #2
	ldr	x2, [x28]
	mov	w1, #0
	bl	_memset
	subs	w22, w22, #1
	b.ne	LBB0_5
	b	LBB0_2
LBB0_8:
	mov	x25, #0
LBB0_9:
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	and	w8, w8, #0x3
	add	w23, w8, #1
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_av_freep
	ldr	x8, [sp, #32]
	ldr	x9, [x19]
	stp	x25, x8, [x9]
	cbnz	x25, LBB0_15
; %bb.10:
Lloh18:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x2, l_.str.1@PAGE
Lloh22:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
	b	LBB0_15
LBB0_11:
	mov	x23, x0
	b	LBB0_14
LBB0_12:
Lloh23:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	str	x23, [sp]
Lloh26:
	adrp	x2, l_.str@PAGE
Lloh27:
	add	x2, x2, l_.str@PAGEOFF
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_av_log
LBB0_13:
Lloh28:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh30:
	ldr	w23, [x8]
LBB0_14:
	add	x0, sp, #32
	bl	_av_freep
LBB0_15:
	mov	x0, x23
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_HEVC_NAL_VPS,4,2               ; @HEVC_NAL_VPS
	.comm	_HEVC_NAL_SPS,4,2               ; @HEVC_NAL_SPS
	.comm	_HEVC_NAL_PPS,4,2               ; @HEVC_NAL_PPS
	.comm	_HEVC_NAL_SEI_PREFIX,4,2        ; @HEVC_NAL_SEI_PREFIX
	.comm	_HEVC_NAL_SEI_SUFFIX,4,2        ; @HEVC_NAL_SEI_SUFFIX
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid NAL unit type in extradata: %d\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,8,3 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.comm	_SIZE_MAX,8,3                   ; @SIZE_MAX
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"No parameter sets in the extradata\n"

	.no_dead_strip	_hevc_extradata_to_annexb
.subsections_via_symbols
