	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fill_vaapi_pic
_fill_vaapi_pic:                        ## @fill_vaapi_pic
	.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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	testl	%edx, %edx
	jne	LBB0_2
## %bb.1:
	movl	(%r14), %ebx
LBB0_2:
	movq	_PICT_FRAME@GOTPCREL(%rip), %r12
	andl	(%r12), %ebx
	movl	32(%r14), %edi
	callq	_ff_vaapi_get_surface_id
	movl	%eax, 24(%r15)
	movq	16(%r14), %rax
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	movl	24(%r14,%rcx,4), %ecx
	movl	%ecx, 20(%r15)
	movl	$0, 16(%r15)
	xorl	%ecx, %ecx
	cmpl	(%r12), %ebx
	je	LBB0_7
## %bb.3:
	movq	_PICT_TOP_FIELD@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	jne	LBB0_4
## %bb.5:
	movq	_VA_PICTURE_H264_BOTTOM_FIELD@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	movq	_VA_PICTURE_H264_TOP_FIELD@GOTPCREL(%rip), %rcx
LBB0_6:
	movl	(%rcx), %ecx
	movl	%ecx, 16(%r15)
LBB0_7:
	cmpl	$0, (%r14)
	je	LBB0_12
## %bb.8:
	testq	%rax, %rax
	jne	LBB0_9
## %bb.10:
	movq	_VA_PICTURE_H264_SHORT_TERM_REFERENCE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_VA_PICTURE_H264_LONG_TERM_REFERENCE@GOTPCREL(%rip), %rax
LBB0_11:
	orl	(%rax), %ecx
	movl	%ecx, 16(%r15)
LBB0_12:
	movq	$0, (%r15)
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	_INT_MAX@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	cmoveq	%rdx, %rax
	movq	%rax, (%r15)
	movq	$0, 8(%r15)
	movq	8(%r14), %rax
	movq	8(%rax), %rax
	cmpq	(%rcx), %rax
	cmoveq	%rdx, %rax
	movq	%rax, 8(%r15)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PICT_FRAME,4,2                 ## @PICT_FRAME
	.comm	_PICT_TOP_FIELD,4,2             ## @PICT_TOP_FIELD
	.comm	_VA_PICTURE_H264_TOP_FIELD,4,2  ## @VA_PICTURE_H264_TOP_FIELD
	.comm	_VA_PICTURE_H264_BOTTOM_FIELD,4,2 ## @VA_PICTURE_H264_BOTTOM_FIELD
	.comm	_VA_PICTURE_H264_LONG_TERM_REFERENCE,4,2 ## @VA_PICTURE_H264_LONG_TERM_REFERENCE
	.comm	_VA_PICTURE_H264_SHORT_TERM_REFERENCE,4,2 ## @VA_PICTURE_H264_SHORT_TERM_REFERENCE
	.comm	_INT_MAX,8,3                    ## @INT_MAX
	.no_dead_strip	_fill_vaapi_pic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fill_vaapi_pic
_fill_vaapi_pic:                        ; @fill_vaapi_pic
	.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	x20, x1
	mov	x19, x0
	cbnz	w2, LBB0_2
; %bb.1:
	ldr	w2, [x20]
LBB0_2:
Lloh0:
	adrp	x22, _PICT_FRAME@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PICT_FRAME@GOTPAGEOFF]
	ldr	w8, [x22]
	and	w21, w8, w2
	ldr	w0, [x20, #32]
	bl	_ff_vaapi_get_surface_id
	mov	w9, #0
	str	w0, [x19, #24]
	ldr	x8, [x20, #16]
	mov	w10, #28
	mov	w11, #24
	cmp	x8, #0
	csel	x10, x11, x10, eq
	ldr	w10, [x20, x10]
	stp	wzr, w10, [x19, #16]
	ldr	w10, [x22]
	cmp	w21, w10
	b.eq	LBB0_4
; %bb.3:
Lloh2:
	adrp	x9, _PICT_TOP_FIELD@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PICT_TOP_FIELD@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _VA_PICTURE_H264_TOP_FIELD@GOTPAGE
Lloh6:
	ldr	x10, [x10, _VA_PICTURE_H264_TOP_FIELD@GOTPAGEOFF]
Lloh7:
	adrp	x11, _VA_PICTURE_H264_BOTTOM_FIELD@GOTPAGE
Lloh8:
	ldr	x11, [x11, _VA_PICTURE_H264_BOTTOM_FIELD@GOTPAGEOFF]
	tst	w9, w21
	csel	x9, x11, x10, eq
	ldr	w9, [x9]
	str	w9, [x19, #16]
LBB0_4:
	ldr	w10, [x20]
	cbz	w10, LBB0_6
; %bb.5:
Lloh9:
	adrp	x10, _VA_PICTURE_H264_LONG_TERM_REFERENCE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _VA_PICTURE_H264_LONG_TERM_REFERENCE@GOTPAGEOFF]
Lloh11:
	adrp	x11, _VA_PICTURE_H264_SHORT_TERM_REFERENCE@GOTPAGE
Lloh12:
	ldr	x11, [x11, _VA_PICTURE_H264_SHORT_TERM_REFERENCE@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
	orr	w8, w9, w8
	str	w8, [x19, #16]
LBB0_6:
	str	xzr, [x19]
	ldr	x8, [x20, #8]
Lloh13:
	adrp	x9, _INT_MAX@GOTPAGE
Lloh14:
	ldr	x9, [x9, _INT_MAX@GOTPAGEOFF]
	ldr	x8, [x8]
	ldr	x10, [x9]
	cmp	x8, x10
	csel	x8, xzr, x8, eq
	stp	x8, xzr, [x19]
	ldr	x8, [x20, #8]
	ldr	x8, [x8, #8]
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, xzr, x8, eq
	str	x8, [x19, #8]
	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 AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PICT_FRAME,4,2                 ; @PICT_FRAME
	.comm	_PICT_TOP_FIELD,4,2             ; @PICT_TOP_FIELD
	.comm	_VA_PICTURE_H264_TOP_FIELD,4,2  ; @VA_PICTURE_H264_TOP_FIELD
	.comm	_VA_PICTURE_H264_BOTTOM_FIELD,4,2 ; @VA_PICTURE_H264_BOTTOM_FIELD
	.comm	_VA_PICTURE_H264_LONG_TERM_REFERENCE,4,2 ; @VA_PICTURE_H264_LONG_TERM_REFERENCE
	.comm	_VA_PICTURE_H264_SHORT_TERM_REFERENCE,4,2 ; @VA_PICTURE_H264_SHORT_TERM_REFERENCE
	.comm	_INT_MAX,8,3                    ; @INT_MAX
	.no_dead_strip	_fill_vaapi_pic
.subsections_via_symbols
