	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_list_validity
_check_list_validity:                   ## @check_list_validity
	.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
	leaq	24(%rax), %r9
	testl	%esi, %esi
	cmoveq	%rax, %r9
	movq	(%r9), %rcx
	movq	8(%r9), %r8
	movq	_H264_MAX_FB_NUM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	cmpq	%rdx, %rcx
	jg	LBB0_3
## %bb.1:
	cmpq	%rdx, %r8
	jge	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	cmpq	%rdx, 16(%r9)
	jl	LBB0_4
LBB0_3:
	testl	%esi, %esi
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	movq	16(%r9), %r9
	leaq	L_.str(%rip), %rsi
	callq	_mtk_vcodec_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_H264_MAX_FB_NUM,8,3            ## @H264_MAX_FB_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s list err: cnt=%d r_idx=%d w_idx=%d"

L_.str.1:                               ## @.str.1
	.asciz	"disp"

L_.str.2:                               ## @.str.2
	.asciz	"free"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_check_list_validity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_list_validity
_check_list_validity:                   ; @check_list_validity
	.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]
	add	x9, x8, #24
	cmp	w1, #0
Lloh0:
	adrp	x10, _H264_MAX_FB_NUM@GOTPAGE
Lloh1:
	ldr	x10, [x10, _H264_MAX_FB_NUM@GOTPAGEOFF]
	csel	x8, x8, x9, eq
Lloh2:
	ldr	x9, [x10]
	ldp	x3, x4, [x8]
	cmp	x3, x9
	ccmp	x4, x9, #0, le
	b.ge	LBB0_3
; %bb.1:
	ldr	x10, [x8, #16]
	cmp	x10, x9
	b.ge	LBB0_3
; %bb.2:
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh3:
	adrp	x9, l_.str.1@PAGE
Lloh4:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh5:
	adrp	x10, l_.str.2@PAGE
Lloh6:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	w1, #0
	csel	x2, x10, x9, eq
	ldr	x5, [x8, #16]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_mtk_vcodec_err
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_H264_MAX_FB_NUM,8,3            ; @H264_MAX_FB_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s list err: cnt=%d r_idx=%d w_idx=%d"

l_.str.1:                               ; @.str.1
	.asciz	"disp"

l_.str.2:                               ; @.str.2
	.asciz	"free"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_check_list_validity
.subsections_via_symbols
