	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_h264_parse_ref_count        ## -- Begin function ff_h264_parse_ref_count
	.p2align	4, 0x90
_ff_h264_parse_ref_count:               ## @ff_h264_parse_ref_count
	.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	%rsi, %rbx
	movq	(%rcx), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%rsi)
	movl	4(%rax), %eax
	leaq	4(%rsi), %r14
	movl	%eax, 4(%rsi)
	movq	_AV_PICTURE_TYPE_I@GOTPCREL(%rip), %rax
	cmpl	%r8d, (%rax)
	jne	LBB0_1
## %bb.10:
	movl	$0, (%r14)
	xorl	%r13d, %r13d
	movq	%rbx, %r14
	jmp	LBB0_11
LBB0_1:
	movl	%r8d, %r12d
	movq	%rdx, %r13
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_PICT_FRAME@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	cmpl	%r9d, (%rax)
	setne	%r15b
	shll	$4, %r15d
	orl	$15, %r15d
	movq	%rdx, %rdi
	callq	_get_bits1
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movq	%r13, %rdi
	callq	_get_ue_golomb
	incl	%eax
	movl	%eax, (%rbx)
	movq	_AV_PICTURE_TYPE_B@GOTPCREL(%rip), %rcx
	movl	$1, %eax
	cmpl	%r12d, (%rcx)
	jne	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	callq	_get_ue_golomb
	incl	%eax
LBB0_4:
	movl	%eax, (%r14)
LBB0_5:
	movq	16(%rbp), %rdi
	movq	_AV_PICTURE_TYPE_B@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	cmpl	%r12d, (%rax)
	sete	%al
	movl	(%rbx), %ecx
	movl	4(%rbx), %r9d
	decl	%ecx
	decl	%r9d
	cmpl	%r15d, %r9d
	seta	%dl
	cmpl	%r15d, %ecx
	ja	LBB0_13
## %bb.6:
	andb	%al, %dl
	jne	LBB0_13
## %bb.7:
	movb	%al, %r13b
	incl	%r13d
	cmpl	%r15d, %r9d
	jbe	LBB0_8
## %bb.9:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movl	%r9d, %ecx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_11:
	movl	$0, (%r14)
LBB0_12:
	movl	%r13d, (%rdi)
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_13:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, (%rsp)
	leaq	L_.str(%rip), %rdx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	movq	$0, (%rbx)
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PICTURE_TYPE_I,4,2          ## @AV_PICTURE_TYPE_I
	.comm	_PICT_FRAME,4,2                 ## @PICT_FRAME
	.comm	_AV_PICTURE_TYPE_B,4,2          ## @AV_PICTURE_TYPE_B
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reference overflow %u > %u or %u > %u\n"

	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"reference overflow %u > %u \n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_h264_parse_ref_count        ; -- Begin function ff_h264_parse_ref_count
	.p2align	2
_ff_h264_parse_ref_count:               ; @ff_h264_parse_ref_count
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x3]
	ldr	w9, [x8]
	str	w9, [x1]
	ldr	w8, [x8, #4]
	mov	x25, x1
	str	w8, [x25, #4]!
Lloh0:
	adrp	x8, _AV_PICTURE_TYPE_I@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_PICTURE_TYPE_I@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w4
	b.ne	LBB0_2
; %bb.1:
	mov	w23, #0
	str	wzr, [x25]
	mov	x25, x21
	b	LBB0_11
LBB0_2:
	mov	x20, x6
	mov	x23, x4
	mov	x24, x2
Lloh3:
	adrp	x8, _PICT_FRAME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PICT_FRAME@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, #31
	mov	w10, #15
	cmp	w8, w5
	csel	w22, w10, w9, eq
	mov	x0, x2
	bl	_get_bits1
Lloh6:
	adrp	x26, _AV_PICTURE_TYPE_B@GOTPAGE
Lloh7:
	ldr	x26, [x26, _AV_PICTURE_TYPE_B@GOTPAGEOFF]
	cbz	w0, LBB0_7
; %bb.3:
	mov	x0, x24
	bl	_get_ue_golomb
	add	w8, w0, #1
	str	w8, [x21]
	ldr	w8, [x26]
	cmp	w8, w23
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x24
	bl	_get_ue_golomb
	add	w8, w0, #1
	b	LBB0_6
LBB0_5:
	mov	w8, #1
LBB0_6:
	str	w8, [x25]
LBB0_7:
	ldr	w8, [x26]
	cmp	w8, w23
	cset	w9, eq
	mov	w8, #1
	cinc	w23, w8, eq
	ldp	w8, w10, [x21]
	sub	w8, w8, #1
	sub	w3, w10, #1
	cmp	w3, w22
	cset	w10, hi
	cmp	w8, w22
	b.hi	LBB0_13
; %bb.8:
	and	w9, w9, w10
	tbnz	w9, #0, LBB0_13
; %bb.9:
	cmp	w3, w22
	b.ls	LBB0_12
; %bb.10:
Lloh8:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
                                        ; kill: def $w3 killed $w3 killed $x3
	mov	x4, x22
	bl	_av_log
LBB0_11:
	str	wzr, [x25]
LBB0_12:
	mov	w0, #0
	str	w23, [x19]
	b	LBB0_14
LBB0_13:
Lloh13:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x9]
Lloh16:
	adrp	x2, l_.str@PAGE
Lloh17:
	add	x2, x2, l_.str@PAGEOFF
	stp	x3, x22, [sp]
	mov	x0, x20
	mov	x3, x8
	mov	x4, x22
	bl	_av_log
	str	wzr, [x19]
	str	xzr, [x21]
Lloh18:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PICTURE_TYPE_I,4,2          ; @AV_PICTURE_TYPE_I
	.comm	_PICT_FRAME,4,2                 ; @PICT_FRAME
	.comm	_AV_PICTURE_TYPE_B,4,2          ; @AV_PICTURE_TYPE_B
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reference overflow %u > %u or %u > %u\n"

	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"reference overflow %u > %u \n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
.subsections_via_symbols
