	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vaapi_encode_set_b_pictures
_vaapi_encode_set_b_pictures:           ## @vaapi_encode_set_b_pictures
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %r13
	xorl	%edi, %edi
	cmpq	%rdx, %rsi
	je	LBB0_4
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.2:
	testq	%r12, %r12
	je	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	cmpq	%r12, 24(%rbx)
	setne	%dil
LBB0_4:
	callq	_av_assert0
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rbx), %r15
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	cmpl	%edi, (%r13)
	je	LBB0_22
## %bb.5:
	movq	24(%r15), %rax
	cmpq	%r12, %rax
	je	LBB0_22
## %bb.6:
	movl	$1, %r13d
	cmpq	%r12, %r15
	je	LBB0_16
## %bb.7:
	xorl	%ecx, %ecx
	cmpq	%r12, %rax
	je	LBB0_8
## %bb.31:
	movq	%rax, %rdx
	.p2align	4, 0x90
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	incl	%ecx
	movq	24(%rdx), %rdx
	cmpq	%r12, %rdx
	jne	LBB0_32
LBB0_8:
	cmpl	$2, %ecx
	jb	LBB0_16
## %bb.9:
	addl	$-2, %ecx
	movl	%ecx, %edx
	shrl	%edx
	leal	2(%rdx), %r13d
	cmpl	$2, %ecx
	jb	LBB0_15
## %bb.10:
	leal	-1(%rdx), %esi
	movl	%edx, %ecx
	andl	$7, %ecx
	cmpl	$7, %esi
	jb	LBB0_13
## %bb.11:
	andl	$-8, %edx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%rax), %rax
	movq	24(%rax), %rax
	movq	24(%rax), %rax
	movq	24(%rax), %rax
	movq	24(%rax), %rax
	movq	24(%rax), %rax
	movq	24(%rax), %rax
	movq	24(%rax), %rax
	addl	$-8, %edx
	jne	LBB0_12
LBB0_13:
	testl	%ecx, %ecx
	je	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%rax), %rax
	decl	%ecx
	jne	LBB0_14
LBB0_15:
	movq	%rax, %r15
LBB0_16:
	movq	_PICTURE_TYPE_B@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r15)
	movl	%edi, (%r15)
	movl	$1, 4(%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	$1, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	callq	_vaapi_encode_add_ref
	movq	8(%r12), %rax
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	8(%rbx), %rax
	jmp	LBB0_18
LBB0_22:
	testq	%r15, %r15
	je	LBB0_30
## %bb.23:
	cmpq	%r12, %r15
	je	LBB0_30
## %bb.24:
	movq	_PICTURE_TYPE_B@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_27:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_29 Depth 2
	movq	(%r13), %rax
	movq	%rax, 16(%r15)
	movl	%edi, (%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	$1, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	$1, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	callq	_vaapi_encode_add_ref
	movq	8(%r12), %rax
	.p2align	4, 0x90
LBB0_29:                                ##   Parent Loop BB0_27 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_25
## %bb.28:                              ##   in Loop: Header=BB0_29 Depth=2
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	callq	_vaapi_encode_add_ref
	movq	8(%rbx), %rax
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_27 Depth=1
	movq	24(%r15), %r15
	testq	%r15, %r15
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_30
## %bb.26:                              ##   in Loop: Header=BB0_27 Depth=1
	cmpq	%r12, %r15
	jne	LBB0_27
LBB0_30:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	incl	%ebx
	movq	%r15, %rcx
	cmpl	$2, %r13d
	jb	LBB0_21
## %bb.20:
	leaq	-80(%rbp), %r9
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	movq	%r15, %rcx
	movl	%ebx, %r8d
	callq	_vaapi_encode_set_b_pictures
	movq	-80(%rbp), %rcx
LBB0_21:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	%ebx, %r8d
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vaapi_encode_set_b_pictures    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PICTURE_TYPE_B,8,3             ## @PICTURE_TYPE_B
	.no_dead_strip	_vaapi_encode_set_b_pictures
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vaapi_encode_set_b_pictures
_vaapi_encode_set_b_pictures:           ; @vaapi_encode_set_b_pictures
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x5
	mov	x23, x4
	mov	x24, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	mov	w0, #0
	ldr	x25, [x21]
	cmp	x1, x2
	b.eq	LBB0_4
; %bb.1:
	cbz	x22, LBB0_4
; %bb.2:
	cbz	x20, LBB0_4
; %bb.3:
	ldr	x8, [x22, #24]
	cmp	x8, x20
	cset	w0, ne
LBB0_4:
	bl	_av_assert0
	ldr	w8, [x25]
	ldr	x25, [x22, #24]
	cmp	w8, w23
	b.eq	LBB0_14
; %bb.5:
	ldr	x9, [x25, #24]
	cmp	x9, x20
	b.eq	LBB0_14
; %bb.6:
	mov	w8, #1
	cmp	x25, x20
	b.eq	LBB0_24
; %bb.7:
	cmp	x9, x20
	b.eq	LBB0_23
; %bb.8:
	mov	w10, #0
	mov	x11, x9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	w10, w10, #1
	ldr	x11, [x11, #24]
	cmp	x11, x20
	b.ne	LBB0_9
; %bb.10:
	subs	w11, w10, #2
	b.lo	LBB0_24
LBB0_11:
	lsr	w10, w11, #1
	add	w26, w10, #2
	cmp	w11, #2
	b.lo	LBB0_13
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x9, #24]
	subs	w10, w10, #1
	b.ne	LBB0_12
LBB0_13:
	mov	x25, x9
	b	LBB0_25
LBB0_14:
	cbz	x25, LBB0_22
; %bb.15:
	cmp	x25, x20
	b.eq	LBB0_22
; %bb.16:
Lloh0:
	adrp	x27, _PICTURE_TYPE_B@GOTPAGE
Lloh1:
	ldr	x27, [x27, _PICTURE_TYPE_B@GOTPAGEOFF]
LBB0_17:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	x8, [x27]
	str	x8, [x25, #16]
	str	w23, [x25]
	mov	x0, x21
	mov	x1, x25
	mov	x2, x22
	mov	w3, #1
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	mov	x0, x21
	mov	x1, x25
	mov	x2, x20
	mov	w3, #1
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	mov	x0, x21
	mov	x1, x25
	mov	x2, x24
	mov	w3, #0
	mov	w4, #0
	mov	w5, #1
	bl	_vaapi_encode_add_ref
	ldr	x8, [x20, #8]
LBB0_18:                                ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x26, [x8, #8]
	cbz	x26, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	mov	x0, x21
	mov	x1, x25
	mov	x2, x26
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	ldr	x8, [x26, #8]
	b	LBB0_18
LBB0_20:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	x25, [x25, #24]
	cbz	x25, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_17 Depth=1
	cmp	x25, x20
	b.ne	LBB0_17
LBB0_22:
	str	x24, [x19]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_23:
	mov	w10, #0
	subs	w11, w10, #2
	b.hs	LBB0_11
LBB0_24:
	mov	w26, #1
LBB0_25:
Lloh2:
	adrp	x9, _PICTURE_TYPE_B@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PICTURE_TYPE_B@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	str	x9, [x25, #16]
	stp	w23, w8, [x25]
	mov	x0, x21
	mov	x1, x25
	mov	x2, x25
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	mov	x0, x21
	mov	x1, x25
	mov	x2, x22
	mov	w3, #1
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	mov	x0, x21
	mov	x1, x25
	mov	x2, x20
	mov	w3, #1
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	mov	x0, x21
	mov	x1, x25
	mov	x2, x24
	mov	w3, #0
	mov	w4, #0
	mov	w5, #1
	bl	_vaapi_encode_add_ref
	ldr	x8, [x20, #8]
	ldr	x24, [x8, #8]
	cbz	x24, LBB0_27
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x25
	mov	x2, x24
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	bl	_vaapi_encode_add_ref
	ldr	x8, [x24, #8]
	ldr	x24, [x8, #8]
	cbnz	x24, LBB0_26
LBB0_27:
	add	w23, w23, #1
	mov	x3, x25
	cmp	w26, #2
	b.lo	LBB0_29
; %bb.28:
	add	x5, sp, #8
	mov	x0, x21
	mov	x1, x22
	mov	x2, x25
	mov	x3, x25
	mov	x4, x23
	bl	_vaapi_encode_set_b_pictures
	ldr	x3, [sp, #8]
LBB0_29:
	mov	x0, x21
	mov	x1, x25
	mov	x2, x20
	mov	x4, x23
	mov	x5, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_vaapi_encode_set_b_pictures
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PICTURE_TYPE_B,8,3             ; @PICTURE_TYPE_B
	.no_dead_strip	_vaapi_encode_set_b_pictures
.subsections_via_symbols
