	.file	"extr_vaapi_h264.c_fill_vaapi_pic.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	fill_vaapi_pic, @function
fill_vaapi_pic:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	test	edx, edx
	jne	.L2
	mov	edx, DWORD PTR [rsi]
.L2:
	mov	edi, DWORD PTR 32[rbp]
	and	edx, DWORD PTR PICT_FRAME[rip]
	mov	r12d, edx
	call	ff_vaapi_get_surface_id@PLT
	mov	rdx, QWORD PTR 16[rbp]
	mov	DWORD PTR 24[rbx], eax
	mov	eax, DWORD PTR 28[rbp]
	test	rdx, rdx
	cmove	eax, DWORD PTR 24[rbp]
	cmp	DWORD PTR PICT_FRAME[rip], r12d
	mov	DWORD PTR 16[rbx], 0
	mov	DWORD PTR 20[rbx], eax
	je	.L4
	mov	eax, DWORD PTR VA_PICTURE_H264_TOP_FIELD[rip]
	test	DWORD PTR PICT_TOP_FIELD[rip], r12d
	cmove	eax, DWORD PTR VA_PICTURE_H264_BOTTOM_FIELD[rip]
	mov	DWORD PTR 16[rbx], eax
.L4:
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	je	.L7
	test	rdx, rdx
	mov	eax, DWORD PTR VA_PICTURE_H264_LONG_TERM_REFERENCE[rip]
	cmove	eax, DWORD PTR VA_PICTURE_H264_SHORT_TERM_REFERENCE[rip]
	or	DWORD PTR 16[rbx], eax
.L7:
	mov	rax, QWORD PTR 8[rbp]
	mov	QWORD PTR [rbx], 0
	xor	ecx, ecx
	mov	rsi, QWORD PTR INT_MAX[rip]
	mov	rdx, QWORD PTR [rax]
	mov	QWORD PTR 8[rbx], 0
	cmp	rdx, rsi
	cmove	rdx, rcx
	mov	QWORD PTR [rbx], rdx
	mov	rax, QWORD PTR 8[rax]
	cmp	rsi, rax
	cmove	rax, rcx
	mov	QWORD PTR 8[rbx], rax
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	fill_vaapi_pic, .-fill_vaapi_pic
	.comm	VA_PICTURE_H264_TOP_FIELD,4,4
	.comm	VA_PICTURE_H264_SHORT_TERM_REFERENCE,4,4
	.comm	VA_PICTURE_H264_LONG_TERM_REFERENCE,4,4
	.comm	VA_PICTURE_H264_BOTTOM_FIELD,4,4
	.comm	PICT_TOP_FIELD,4,4
	.comm	PICT_FRAME,4,4
	.comm	INT_MAX,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_vaapi_h264.c_fill_vaapi_pic.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fill_vaapi_pic, %function
fill_vaapi_pic:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	ldr	r7, .L19
	cmp	r2, #0
	ldreq	r2, [r1]
	ldr	r6, [r7]
	mov	r4, r0
	ldr	r0, [r1, #20]
	and	r6, r6, r2
	bl	ff_vaapi_get_surface_id
	ldr	r2, [r5, #8]
	ldr	r1, [r5, #16]
	cmp	r2, #0
	ldr	r3, [r5, #12]
	movne	r3, r1
	mov	r1, #0
	ldr	ip, [r7]
	str	r0, [r4, #16]
	cmp	ip, r6
	str	r3, [r4, #12]
	str	r1, [r4, #8]
	beq	.L4
	ldr	r3, .L19+4
	ldr	r3, [r3]
	tst	r6, r3
	ldrne	r3, .L19+8
	ldreq	r3, .L19+12
	ldr	r3, [r3]
	str	r3, [r4, #8]
.L4:
	ldr	r3, [r5]
	cmp	r3, #0
	beq	.L7
	cmp	r2, #0
	ldrne	r2, .L19+16
	ldreq	r2, .L19+20
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r4, #8]
.L7:
	mov	r0, #0
	ldr	r3, [r5, #4]
	ldr	r1, .L19+24
	str	r0, [r4]
	ldr	r2, [r3]
	ldr	r1, [r1]
	str	r0, [r4, #4]
	cmp	r2, r1
	moveq	r2, r0
	str	r2, [r4]
	ldr	r3, [r3, #4]
	cmp	r1, r3
	moveq	r3, r0
	str	r3, [r4, #4]
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	.align	2
.L19:
	.word	PICT_FRAME
	.word	PICT_TOP_FIELD
	.word	VA_PICTURE_H264_TOP_FIELD
	.word	VA_PICTURE_H264_BOTTOM_FIELD
	.word	VA_PICTURE_H264_LONG_TERM_REFERENCE
	.word	VA_PICTURE_H264_SHORT_TERM_REFERENCE
	.word	INT_MAX
	.size	fill_vaapi_pic, .-fill_vaapi_pic
	.comm	VA_PICTURE_H264_TOP_FIELD,4,4
	.comm	VA_PICTURE_H264_SHORT_TERM_REFERENCE,4,4
	.comm	VA_PICTURE_H264_LONG_TERM_REFERENCE,4,4
	.comm	VA_PICTURE_H264_BOTTOM_FIELD,4,4
	.comm	PICT_TOP_FIELD,4,4
	.comm	PICT_FRAME,4,4
	.comm	INT_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
