	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vp9_swap_frm_bufs
_vp9_swap_frm_bufs:                     ## @vp9_swap_frm_bufs
	.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
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	movl	(%r12), %r15d
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r15d, %eax
	sarl	%eax
	addq	$4, %rbx
	cmpl	$1, %r15d
	movl	%eax, %r15d
	jbe	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testb	$1, %r15b
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	48(%r12), %rsi
	addq	%rbx, %rsi
	movq	8(%r12), %rdx
	movq	%r14, %rdi
	callq	_vp9_ref_cnt_fb
	jmp	LBB0_4
LBB0_5:
	movq	8(%r12), %rax
	movq	32(%r12), %rcx
	shlq	$4, %rax
	decq	(%rcx,%rax)
	leaq	(%rcx,%rax), %r15
	addq	$8, %r15
	movq	8(%rcx,%rax), %rsi
	movq	(%r14), %rax
	cmpq	%rax, %rsi
	je	LBB0_13
## %bb.6:
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.7:
	movq	(%rax), %rdx
	movq	(%rsi), %rcx
	cmpq	%rcx, %rdx
	jl	LBB0_10
## %bb.8:
	movq	16(%rax), %rdi
	cmpq	16(%rsi), %rdi
	jge	LBB0_9
LBB0_10:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_mtk_vcodec_err
	jmp	LBB0_11
LBB0_13:
	movq	%r14, %rdi
	callq	_vp9_is_sf_ref_fb
	testl	%eax, %eax
	jne	LBB0_16
## %bb.14:
	cmpq	$0, 40(%r12)
	jne	LBB0_15
	jmp	LBB0_16
LBB0_9:
	movq	8(%rax), %rdi
	movq	8(%rsi), %rsi
	movq	%rcx, %rdx
	callq	_memcpy
	movq	(%r14), %rax
	movq	24(%rax), %rdi
	movq	(%r15), %rax
	movq	16(%rax), %rdx
	movq	24(%rax), %rsi
	callq	_memcpy
LBB0_11:
	movq	(%r14), %rsi
	movq	%r14, %rdi
	callq	_vp9_is_sf_ref_fb
	testl	%eax, %eax
	jne	LBB0_16
## %bb.12:
	cmpq	$0, 40(%r12)
	movq	%r14, %r15
	je	LBB0_16
LBB0_15:
	movq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_vp9_add_to_fb_disp_list
LBB0_16:
	movq	8(%r12), %rax
	movq	32(%r12), %rcx
	shlq	$4, %rax
	cmpq	$0, (%rcx,%rax)
	jne	LBB0_20
## %bb.17:
	movq	8(%rcx,%rax), %rsi
	movq	%r14, %rdi
	callq	_vp9_is_sf_ref_fb
	movq	8(%r12), %rcx
	movq	32(%r12), %rdx
	shlq	$4, %rcx
	movq	8(%rdx,%rcx), %rdi
	testl	%eax, %eax
	je	LBB0_18
## %bb.19:
	callq	_vp9_free_sf_ref_fb
	jmp	LBB0_20
LBB0_18:
	movq	8(%rdi), %rsi
	movq	%r14, %rdi
	callq	_vp9_rm_from_fb_use_list
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_vp9_add_to_fb_free_list
LBB0_20:
	movl	16(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_23
## %bb.21:
	decl	%eax
	cmpl	%eax, 20(%r12)
	je	LBB0_23
## %bb.22:
	movq	%r14, %rdi
	callq	_vp9_get_sf_ref_fb
	movl	%eax, 24(%r12)
LBB0_23:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"inst->cur_fb->base_y.size=%zu, frm_to_show->fb.base_y.size=%zu"

	.no_dead_strip	_vp9_swap_frm_bufs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vp9_swap_frm_bufs
_vp9_swap_frm_bufs:                     ; @vp9_swap_frm_bufs
	.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
	mov	x19, x0
	ldr	x20, [x0, #8]
	ldr	w21, [x20]
	cbz	w21, LBB0_5
; %bb.1:
	mov	x22, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	asr	w8, w21, #1
	add	x22, x22, #4
	cmp	w21, #1
	mov	x21, x8
	b.ls	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	tbz	w21, #0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #48]
	add	x1, x8, x22
	ldr	x2, [x20, #8]
	mov	x0, x19
	bl	_vp9_ref_cnt_fb
	b	LBB0_2
LBB0_5:
	ldr	x8, [x20, #32]
	ldr	x9, [x20, #8]
	lsl	x9, x9, #4
	add	x21, x8, x9
	ldr	x10, [x8, x9]
	sub	x10, x10, #1
	str	x10, [x8, x9]
	ldr	x1, [x21, #8]!
	ldr	x8, [x19]
	cmp	x1, x8
	b.eq	LBB0_10
; %bb.6:
	cbz	x1, LBB0_13
; %bb.7:
	ldr	x2, [x8]
	ldr	x3, [x1]
	cmp	x2, x3
	b.lt	LBB0_9
; %bb.8:
	ldr	x9, [x8, #16]
	ldr	x10, [x1, #16]
	cmp	x9, x10
	b.ge	LBB0_12
LBB0_9:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mtk_vcodec_err
	b	LBB0_13
LBB0_10:
	mov	x0, x19
	bl	_vp9_is_sf_ref_fb
	cbnz	w0, LBB0_16
; %bb.11:
	ldr	x8, [x20, #40]
	cbnz	x8, LBB0_15
	b	LBB0_16
LBB0_12:
	ldr	x0, [x8, #8]
	ldr	x1, [x1, #8]
	mov	x2, x3
	bl	_memcpy
	ldr	x8, [x19]
	ldr	x0, [x8, #24]
	ldr	x8, [x21]
	ldp	x2, x1, [x8, #16]
	bl	_memcpy
LBB0_13:
	ldr	x1, [x19]
	mov	x0, x19
	bl	_vp9_is_sf_ref_fb
	cbnz	w0, LBB0_16
; %bb.14:
	ldr	x8, [x20, #40]
	mov	x21, x19
	cbz	x8, LBB0_16
LBB0_15:
	ldr	x1, [x21]
	mov	x0, x19
	bl	_vp9_add_to_fb_disp_list
LBB0_16:
	ldr	x8, [x20, #32]
	ldr	x9, [x20, #8]
	lsl	x10, x9, #4
	ldr	x10, [x8, x10]
	cbnz	x10, LBB0_20
; %bb.17:
	add	x8, x8, x9, lsl #4
	ldr	x1, [x8, #8]
	mov	x0, x19
	bl	_vp9_is_sf_ref_fb
	mov	x8, x0
	ldr	x9, [x20, #32]
	ldr	x10, [x20, #8]
	add	x9, x9, x10, lsl #4
	ldr	x0, [x9, #8]
	cbz	w8, LBB0_19
; %bb.18:
	bl	_vp9_free_sf_ref_fb
	b	LBB0_20
LBB0_19:
	ldr	x1, [x0, #8]
	mov	x0, x19
	bl	_vp9_rm_from_fb_use_list
	mov	x1, x0
	mov	x0, x19
	bl	_vp9_add_to_fb_free_list
LBB0_20:
	ldr	w8, [x20, #16]
	subs	w8, w8, #1
	b.lt	LBB0_23
; %bb.21:
	ldr	w9, [x20, #20]
	cmp	w9, w8
	b.eq	LBB0_23
; %bb.22:
	mov	x0, x19
	bl	_vp9_get_sf_ref_fb
	str	w0, [x20, #24]
LBB0_23:
	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 AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"inst->cur_fb->base_y.size=%zu, frm_to_show->fb.base_y.size=%zu"

	.no_dead_strip	_vp9_swap_frm_bufs
.subsections_via_symbols
