	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vaapi_encode_pick_next
_vaapi_encode_pick_next:                ## @vaapi_encode_pick_next
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	(%rdi), %r15
	movq	64(%r15), %r13
	testq	%r13, %r13
	je	LBB0_12
## %bb.1:
	movq	_PICTURE_TYPE_B@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r13, %rbx
	jmp	LBB0_5
LBB0_2:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%edx, %edx
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%ecx, %edx
	je	LBB0_11
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	40(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_12
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	cmpq	$0, 32(%rbx)
	jne	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%rax, (%rbx)
	jne	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	8(%rbx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_2
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	56(%rbx), %rsi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rsi,%rdx,8), %rdi
	cmpl	$0, (%rdi)
	je	LBB0_3
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_9
LBB0_11:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	48(%rbx), %ecx
	leaq	L_.str(%rip), %rdx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	%rbx, (%r12)
	jmp	LBB0_52
LBB0_12:
	movl	$1, %eax
	cmpq	$0, 72(%r15)
	jne	LBB0_14
## %bb.13:
	movl	(%r15), %ecx
	xorl	%eax, %eax
	cmpl	4(%r15), %ecx
	sete	%al
LBB0_14:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	testq	%r13, %r13
	je	LBB0_25
## %bb.15:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	%r13, %rbx
LBB0_17:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	%rcx, %r13
	testq	%rcx, %rcx
	je	LBB0_26
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	40(%r13), %rcx
	cmpq	$0, 32(%r13)
	jne	LBB0_16
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpq	$0, 24(%r13)
	jne	LBB0_31
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	8(%r15), %r12d
	je	LBB0_31
## %bb.21:                              ##   in Loop: Header=BB0_18 Depth=1
	leal	(%r12,%rax), %edx
	addl	12(%r15), %edx
	cmpl	16(%r15), %edx
	jge	LBB0_31
## %bb.22:                              ##   in Loop: Header=BB0_18 Depth=1
	testq	%rcx, %rcx
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpq	$0, 24(%rcx)
	jne	LBB0_31
LBB0_24:                                ##   in Loop: Header=BB0_18 Depth=1
	incl	%r12d
	jmp	LBB0_17
LBB0_25:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
LBB0_26:
	cmpq	$0, 48(%r15)
	je	LBB0_29
## %bb.27:
	movq	56(%r15), %r13
	cmpq	$0, 32(%r13)
	je	LBB0_30
## %bb.28:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_52
LBB0_29:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_38
LBB0_30:
	decl	%r12d
LBB0_31:
	movq	24(%r15), %rcx
	cmpq	32(%r15), %rcx
	jg	LBB0_33
## %bb.32:
	cmpq	$0, 48(%r15)
	je	LBB0_37
LBB0_33:
	cmpq	$0, 24(%r13)
	je	LBB0_35
## %bb.34:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_PICTURE_TYPE_IDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r13)
	movl	$1, (%r15)
	jmp	LBB0_43
LBB0_35:
	movl	12(%r15), %ecx
	addl	%r12d, %ecx
	movl	16(%r15), %edx
	cmpl	%edx, %ecx
	jge	LBB0_39
## %bb.36:
	addl	%eax, %ecx
	cmpl	%edx, %ecx
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.7(%rip), %rdx
	cmoveq	%rax, %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_PICTURE_TYPE_P@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r13)
	movq	%rbx, %rdi
	callq	_av_assert0
	movl	12(%r15), %eax
	addl	%r12d, %eax
	incl	%eax
	movl	%eax, 12(%r15)
	jmp	LBB0_44
LBB0_37:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
LBB0_38:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_39:
	movl	(%r15), %eax
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	4(%r15), %eax
	jne	LBB0_41
## %bb.40:
	leaq	L_.str.4(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movl	$1, %eax
	movq	_PICTURE_TYPE_IDR@GOTPCREL(%rip), %rcx
	jmp	LBB0_42
LBB0_41:
	leaq	L_.str.5(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movl	(%r15), %eax
	incl	%eax
	movq	_PICTURE_TYPE_I@GOTPCREL(%rip), %rcx
LBB0_42:
	movq	(%rcx), %rcx
	movq	%rcx, (%r13)
	movl	%eax, (%r15)
LBB0_43:
	movl	$1, 12(%r15)
LBB0_44:
	movl	$1, 12(%r13)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	(%r13), %rax
	movq	_PICTURE_TYPE_IDR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_46
## %bb.45:
	movq	_PICTURE_TYPE_P@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	cmpq	(%rdx), %rax
	sete	%cl
	xorl	%r8d, %r8d
	testl	%r12d, %r12d
	setg	%r8b
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	40(%r15), %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	callq	_vaapi_encode_add_ref
LBB0_46:
	movq	40(%r15), %rax
	testq	%rax, %rax
	je	LBB0_48
## %bb.47:
	movq	16(%rax), %rax
	decl	(%rax)
LBB0_48:
	addq	$40, %r15
	testl	%r12d, %r12d
	jle	LBB0_50
## %bb.49:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	movq	%r13, %rcx
	movl	$1, %r8d
	movq	%r15, %r9
	callq	_vaapi_encode_set_b_pictures
	movq	(%r15), %r13
	jmp	LBB0_51
LBB0_50:
	movq	%r13, (%r15)
LBB0_51:
	movq	16(%r13), %rax
	incl	(%rax)
	xorl	%r15d, %r15d
LBB0_52:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PICTURE_TYPE_B,8,3             ## @PICTURE_TYPE_B
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Pick B-picture at depth %d to encode next.\n"

	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
L_.str.1:                               ## @.str.1
	.asciz	"Pick nothing to encode next - need more input for reference pictures.\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.2:                               ## @.str.2
	.asciz	"Pick nothing to encode next - need more input for timestamps.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Pick forced IDR-picture to encode next.\n"

	.comm	_PICTURE_TYPE_IDR,8,3           ## @PICTURE_TYPE_IDR
L_.str.4:                               ## @.str.4
	.asciz	"Pick new-GOP IDR-picture to encode next.\n"

L_.str.5:                               ## @.str.5
	.asciz	"Pick new-GOP I-picture to encode next.\n"

	.comm	_PICTURE_TYPE_I,8,3             ## @PICTURE_TYPE_I
L_.str.6:                               ## @.str.6
	.asciz	"Pick group-end P-picture to encode next.\n"

L_.str.7:                               ## @.str.7
	.asciz	"Pick normal P-picture to encode next.\n"

	.comm	_PICTURE_TYPE_P,8,3             ## @PICTURE_TYPE_P
	.no_dead_strip	_vaapi_encode_pick_next
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vaapi_encode_pick_next
_vaapi_encode_pick_next:                ; @vaapi_encode_pick_next
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x1
	mov	x19, x0
	ldr	x20, [x0]
	ldr	x21, [x20, #64]
	cbz	x21, LBB0_12
; %bb.1:
Lloh0:
	adrp	x8, _PICTURE_TYPE_B@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PICTURE_TYPE_B@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	x23, x21
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w10, #0
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w10, w9
	b.eq	LBB0_11
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x23, [x23, #40]
	cbz	x23, LBB0_12
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x9, [x23, #32]
	cbnz	x9, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x23]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x23, #8]
	cmp	w9, #1
	b.lt	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x10, #0
	ldr	x11, [x23, #56]
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x12, [x11, x10, lsl #3]
	ldr	w12, [x12]
	cbz	w12, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	add	x10, x10, #1
	cmp	x9, x10
	b.ne	LBB0_9
LBB0_11:
Lloh3:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w8, [x23, #48]
	str	x8, [sp]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	w0, #0
	str	x23, [x22]
	b	LBB0_50
LBB0_12:
	ldr	x8, [x20, #72]
	cbz	x8, LBB0_23
; %bb.13:
	mov	w8, #1
	cbz	x21, LBB0_24
LBB0_14:
	mov	w24, #0
	mov	x23, #0
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x23, x21
	mov	x21, x9
	cbz	x9, LBB0_25
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldp	x10, x9, [x21, #32]
	cbnz	x10, LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x10, [x21, #24]
	cbnz	x10, LBB0_30
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w10, [x20, #8]
	cmp	w24, w10
	b.eq	LBB0_30
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	ldp	w10, w11, [x20, #12]
	add	w12, w24, w8
	add	w10, w12, w10
	cmp	w10, w11
	b.ge	LBB0_30
; %bb.20:                               ;   in Loop: Header=BB0_16 Depth=1
	cbz	x9, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x10, [x9, #24]
	cbnz	x10, LBB0_30
LBB0_22:                                ;   in Loop: Header=BB0_16 Depth=1
	add	w24, w24, #1
	mov	x21, x9
	cbnz	x9, LBB0_16
	b	LBB0_25
LBB0_23:
	ldp	w8, w9, [x20]
	cmp	w8, w9
	cset	w8, eq
	cbnz	x21, LBB0_14
LBB0_24:
	mov	x23, #0
	mov	w24, #0
LBB0_25:
	ldr	x9, [x20, #48]
	cbz	x9, LBB0_28
; %bb.26:
	ldr	x21, [x20, #56]
	ldr	x9, [x21, #32]
	cbz	x9, LBB0_29
; %bb.27:
Lloh8:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_50
LBB0_28:
Lloh11:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str.1@PAGE
Lloh15:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_37
LBB0_29:
	sub	w24, w24, #1
LBB0_30:
	ldp	x9, x10, [x20, #24]
	cmp	x9, x10
	b.gt	LBB0_32
; %bb.31:
	ldr	x9, [x20, #48]
	cbz	x9, LBB0_36
LBB0_32:
	ldr	x9, [x21, #24]
Lloh16:
	adrp	x25, _PICTURE_TYPE_IDR@GOTPAGE
Lloh17:
	ldr	x25, [x25, _PICTURE_TYPE_IDR@GOTPAGEOFF]
	cbz	x9, LBB0_34
; %bb.33:
Lloh18:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x2, l_.str.3@PAGE
Lloh22:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	x8, [x25]
	str	x8, [x21]
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_42
LBB0_34:
	ldp	w10, w9, [x20, #12]
	add	w10, w10, w24
	cmp	w10, w9
	b.ge	LBB0_38
; %bb.35:
Lloh23:
	adrp	x11, _AV_LOG_DEBUG@GOTPAGE
Lloh24:
	ldr	x11, [x11, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh25:
	adrp	x12, l_.str.7@PAGE
Lloh26:
	add	x12, x12, l_.str.7@PAGEOFF
Lloh27:
	ldr	w1, [x11]
Lloh28:
	adrp	x11, l_.str.6@PAGE
Lloh29:
	add	x11, x11, l_.str.6@PAGEOFF
	add	w8, w10, w8
	cmp	w8, w9
	csel	x2, x11, x12, eq
	mov	x0, x19
	bl	_av_log
Lloh30:
	adrp	x8, _PICTURE_TYPE_P@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PICTURE_TYPE_P@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	str	x8, [x21]
	mov	x0, x23
	bl	_av_assert0
	ldr	w8, [x20, #12]
	add	w8, w24, w8
	add	w8, w8, #1
	b	LBB0_42
LBB0_36:
Lloh33:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh34:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x2, l_.str.2@PAGE
Lloh37:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_37:
	mov	x0, x19
	bl	_av_log
Lloh38:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_AVERROR
LBB0_38:
	ldp	w8, w9, [x20]
Lloh41:
	adrp	x10, _AV_LOG_DEBUG@GOTPAGE
Lloh42:
	ldr	x10, [x10, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x10]
	cmp	w8, w9
	b.ne	LBB0_40
; %bb.39:
Lloh44:
	adrp	x2, l_.str.4@PAGE
Lloh45:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	w8, #1
Lloh46:
	adrp	x9, _PICTURE_TYPE_IDR@GOTPAGE
Lloh47:
	ldr	x9, [x9, _PICTURE_TYPE_IDR@GOTPAGEOFF]
	b	LBB0_41
LBB0_40:
Lloh48:
	adrp	x2, l_.str.5@PAGE
Lloh49:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	w8, [x20]
	add	w8, w8, #1
Lloh50:
	adrp	x9, _PICTURE_TYPE_I@GOTPAGE
Lloh51:
	ldr	x9, [x9, _PICTURE_TYPE_I@GOTPAGEOFF]
LBB0_41:
	ldr	x9, [x9]
	str	x9, [x21]
	str	w8, [x20]
	mov	w8, #1
LBB0_42:
	str	w8, [x20, #12]
	mov	w8, #1
	str	w8, [x21, #12]
	str	x21, [x22]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x21
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	ldr	x8, [x21]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_44
; %bb.43:
Lloh52:
	adrp	x9, _PICTURE_TYPE_P@GOTPAGE
Lloh53:
	ldr	x9, [x9, _PICTURE_TYPE_P@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w3, eq
	cmp	w24, #0
	cset	w4, gt
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	ldr	x2, [x20, #40]
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	mov	w4, #0
	mov	w5, #1
	bl	_vaapi_encode_add_ref
LBB0_44:
	ldr	x8, [x20, #40]!
	cbz	x8, LBB0_46
; %bb.45:
	ldr	x8, [x8, #16]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
LBB0_46:
	cmp	w24, #1
	b.lt	LBB0_48
; %bb.47:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	mov	x3, x21
	mov	w4, #1
	mov	x5, x20
	bl	_vaapi_encode_set_b_pictures
	ldr	x21, [x20]
	b	LBB0_49
LBB0_48:
	str	x21, [x20]
LBB0_49:
	mov	w0, #0
	ldr	x8, [x21, #16]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_50:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_PICTURE_TYPE_B,8,3             ; @PICTURE_TYPE_B
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Pick B-picture at depth %d to encode next.\n"

	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
l_.str.1:                               ; @.str.1
	.asciz	"Pick nothing to encode next - need more input for reference pictures.\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.2:                               ; @.str.2
	.asciz	"Pick nothing to encode next - need more input for timestamps.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Pick forced IDR-picture to encode next.\n"

	.comm	_PICTURE_TYPE_IDR,8,3           ; @PICTURE_TYPE_IDR
l_.str.4:                               ; @.str.4
	.asciz	"Pick new-GOP IDR-picture to encode next.\n"

l_.str.5:                               ; @.str.5
	.asciz	"Pick new-GOP I-picture to encode next.\n"

	.comm	_PICTURE_TYPE_I,8,3             ; @PICTURE_TYPE_I
l_.str.6:                               ; @.str.6
	.asciz	"Pick group-end P-picture to encode next.\n"

l_.str.7:                               ; @.str.7
	.asciz	"Pick normal P-picture to encode next.\n"

	.comm	_PICTURE_TYPE_P,8,3             ; @PICTURE_TYPE_P
	.no_dead_strip	_vaapi_encode_pick_next
.subsections_via_symbols
