	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function put_fb_to_free
_put_fb_to_free:                        ## @put_fb_to_free
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorl	%esi, %esi
	callq	_check_list_validity
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	(%rbx), %r15
	movl	(%r15), %eax
	movq	_H264_MAX_FB_NUM@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	jne	LBB0_3
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_vcodec_err                 ## TAILCALL
LBB0_3:
	movl	8(%r14), %edx
	movq	(%r14), %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mtk_vcodec_debug
	movq	8(%r15), %rax
	movq	16(%r15), %rcx
	movq	%r14, (%rcx,%rax,8)
	movslq	(%r12), %rcx
	decq	%rcx
	leaq	1(%rax), %rdx
	xorl	%esi, %esi
	cmpq	%rcx, %rax
	cmovneq	%rdx, %rsi
	movq	%rsi, 8(%r15)
	incl	(%r15)
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_H264_MAX_FB_NUM,4,2            ## @H264_MAX_FB_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[FB] put fb free_list full"

L_.str.1:                               ## @.str.1
	.asciz	"[FB] put fb into free_list @(%p, %llx)"

	.no_dead_strip	_put_fb_to_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function put_fb_to_free
_put_fb_to_free:                        ; @put_fb_to_free
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x1, LBB0_5
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	w1, #0
	bl	_check_list_validity
	cbnz	x0, LBB0_5
; %bb.2:
	ldr	x21, [x20]
	ldr	w8, [x21]
Lloh0:
	adrp	x22, _H264_MAX_FB_NUM@GOTPAGE
Lloh1:
	ldr	x22, [x22, _H264_MAX_FB_NUM@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mtk_vcodec_err
LBB0_4:
	ldr	w2, [x19, #8]
	ldr	x3, [x19]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_mtk_vcodec_debug
	ldp	x9, x8, [x21, #8]
	str	x19, [x8, x9, lsl #3]
	ldrsw	x8, [x22]
	sub	x8, x8, #1
	cmp	x9, x8
	csinc	x8, xzr, x9, eq
	str	x8, [x21, #8]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_H264_MAX_FB_NUM,4,2            ; @H264_MAX_FB_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[FB] put fb free_list full"

l_.str.1:                               ; @.str.1
	.asciz	"[FB] put fb into free_list @(%p, %llx)"

	.no_dead_strip	_put_fb_to_free
.subsections_via_symbols
