	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_frame
_alloc_frame:                           ## @alloc_frame
	.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	%rdi, %r15
	movq	40(%rdi), %rdi
	callq	_FF_ARRAY_ELEMS
	testl	%eax, %eax
	jle	LBB0_21
## %bb.1:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	40(%r15), %r12
	movq	24(%r12,%r13), %rax
	movq	8(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movq	%r12, %rdi
	callq	_FF_ARRAY_ELEMS
	cltq
	addq	$80, %r13
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_21:
	movq	(%r15), %rdi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
LBB0_22:
	xorl	%r14d, %r14d
LBB0_23:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	(%r15), %rdi
	leaq	(%r12,%r13), %rsi
	addq	$72, %rsi
	movq	_AV_GET_BUFFER_FLAG_REF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_ff_thread_get_buffer
	testl	%eax, %eax
	js	LBB0_22
## %bb.4:
	leaq	(%r12,%r13), %r14
	movl	32(%r15), %edi
	shll	$2, %edi
	callq	_av_buffer_allocz
	movq	%rax, 32(%r12,%r13)
	testq	%rax, %rax
	je	LBB0_19
## %bb.5:
	movl	28(%r15), %edi
	callq	_av_buffer_pool_get
	movq	%rax, 56(%r12,%r13)
	testq	%rax, %rax
	je	LBB0_19
## %bb.6:
	movq	(%rax), %rax
	movq	%rax, 64(%r12,%r13)
	movl	24(%r15), %edi
	callq	_av_buffer_pool_get
	movq	%rax, 48(%r12,%r13)
	testq	%rax, %rax
	je	LBB0_19
## %bb.7:
	movq	(%rax), %rcx
	movq	%rcx, 40(%r12,%r13)
	movq	16(%r15), %rdx
	movl	4(%rdx), %eax
	imull	(%rdx), %eax
	movl	%eax, (%r12,%r13)
	testl	%eax, %eax
	jle	LBB0_15
## %bb.8:
	movq	32(%r12,%r13), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, (%rcx)
	cmpl	$1, %eax
	je	LBB0_15
## %bb.9:
	movl	%eax, %esi
	leaq	-1(%rsi), %rdx
	addq	$-2, %rsi
	movl	%edx, %eax
	andl	$3, %eax
	movl	$1, %ecx
	cmpq	$3, %rsi
	jb	LBB0_13
## %bb.10:
	andq	$-4, %rdx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12,%r13), %rsi
	movq	40(%r12,%r13), %rdi
	movq	(%rsi), %rsi
	movq	%rsi, 8(%rdi,%rcx,8)
	movq	32(%r12,%r13), %rsi
	movq	40(%r12,%r13), %rdi
	movq	(%rsi), %rsi
	movq	%rsi, 16(%rdi,%rcx,8)
	movq	32(%r12,%r13), %rsi
	movq	40(%r12,%r13), %rdi
	movq	(%rsi), %rsi
	movq	%rsi, 24(%rdi,%rcx,8)
	movq	32(%r12,%r13), %rsi
	movq	40(%r12,%r13), %rdi
	movq	(%rsi), %rsi
	movq	%rsi, 32(%rdi,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_11
## %bb.12:
	incq	%rcx
LBB0_13:
	testq	%rax, %rax
	je	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12,%r13), %rdx
	movq	40(%r12,%r13), %rsi
	movq	(%rdx), %rdx
	movq	%rdx, (%rsi,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_14
LBB0_15:
	movq	8(%r15), %rax
	movq	_AV_PICTURE_STRUCTURE_TOP_FIELD@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	movq	24(%r12,%r13), %rcx
	movl	%edx, (%rcx)
	movq	_AV_PICTURE_STRUCTURE_BOTTOM_FIELD@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rax
	sete	%al
	orb	%al, %dl
	movzbl	%dl, %eax
	movl	%eax, 4(%rcx)
	movq	(%r15), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_23
## %bb.16:
	xorl	%edi, %edi
	cmpq	$0, 16(%r12,%r13)
	sete	%dil
	callq	_av_assert0
	movl	(%rbx), %edi
	testl	%edi, %edi
	je	LBB0_23
## %bb.17:
	callq	_av_buffer_allocz
	movq	%rax, 8(%r12,%r13)
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movq	(%rax), %rax
	movq	%rax, 16(%r12,%r13)
	jmp	LBB0_23
LBB0_19:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$-1, %edx
	callq	_ff_hevc_unref_frame
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_GET_BUFFER_FLAG_REF,4,2     ## @AV_GET_BUFFER_FLAG_REF
	.comm	_AV_PICTURE_STRUCTURE_TOP_FIELD,8,3 ## @AV_PICTURE_STRUCTURE_TOP_FIELD
	.comm	_AV_PICTURE_STRUCTURE_BOTTOM_FIELD,8,3 ## @AV_PICTURE_STRUCTURE_BOTTOM_FIELD
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error allocating frame, DPB full.\n"

	.no_dead_strip	_alloc_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_frame
_alloc_frame:                           ; @alloc_frame
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x0, [x0, #40]
	bl	_FF_ARRAY_ELEMS
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x22, #0
	mov	x23, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x21, [x19, #40]
	add	x20, x21, x22
	ldr	x8, [x20, #24]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #1
	mov	x0, x21
	bl	_FF_ARRAY_ELEMS
	add	x22, x22, #80
	cmp	x23, w0, sxtw
	b.lt	LBB0_2
LBB0_4:
	ldr	x0, [x19]
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
LBB0_5:
	mov	x20, #0
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	x0, [x19]
	add	x1, x20, #72
Lloh5:
	adrp	x8, _AV_GET_BUFFER_FLAG_REF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_GET_BUFFER_FLAG_REF@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_ff_thread_get_buffer
	tbnz	w0, #31, LBB0_5
; %bb.8:
	ldr	w8, [x19, #32]
	lsl	w0, w8, #2
	bl	_av_buffer_allocz
	add	x23, x21, x22
	str	x0, [x23, #32]
	cbz	x0, LBB0_19
; %bb.9:
	ldr	w0, [x19, #28]
	bl	_av_buffer_pool_get
	str	x0, [x23, #56]
	cbz	x0, LBB0_19
; %bb.10:
	ldr	x8, [x0]
	add	x24, x21, x22
	str	x8, [x24, #64]
	ldr	w0, [x19, #24]
	bl	_av_buffer_pool_get
	str	x0, [x24, #48]
	cbz	x0, LBB0_19
; %bb.11:
	ldr	x9, [x0]
	str	x9, [x24, #40]
	ldr	x8, [x19, #16]
	ldp	w10, w8, [x8]
	mul	w8, w8, w10
	str	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.12:
	ldr	x10, [x23, #32]
	ldr	x10, [x10]
	str	x10, [x9]
	cmp	w8, #1
	b.eq	LBB0_15
; %bb.13:
	mov	w9, #1
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x24, #40]
	ldr	x11, [x23, #32]
	ldr	x11, [x11]
	str	x11, [x10, x9, lsl #3]
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_14
LBB0_15:
Lloh8:
	adrp	x8, _AV_PICTURE_STRUCTURE_TOP_FIELD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_PICTURE_STRUCTURE_TOP_FIELD@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldp	x10, x9, [x19]
	cmp	x9, x8
	cset	w8, eq
	ldr	x11, [x20, #24]
	str	w8, [x11]
Lloh11:
	adrp	x12, _AV_PICTURE_STRUCTURE_BOTTOM_FIELD@GOTPAGE
Lloh12:
	ldr	x12, [x12, _AV_PICTURE_STRUCTURE_BOTTOM_FIELD@GOTPAGEOFF]
Lloh13:
	ldr	x12, [x12]
	cmp	x9, x12
	cset	w9, eq
	orr	w8, w8, w9
	str	w8, [x11, #4]
	ldr	x23, [x10]
	cbz	x23, LBB0_6
; %bb.16:
	add	x21, x21, x22
	ldr	x8, [x21, #16]
	cmp	x8, #0
	cset	w0, eq
	bl	_av_assert0
	ldr	w0, [x23]
	cbz	w0, LBB0_6
; %bb.17:
	bl	_av_buffer_allocz
	str	x0, [x21, #8]
	cbz	x0, LBB0_19
; %bb.18:
	ldr	x8, [x0]
	str	x8, [x21, #16]
	b	LBB0_6
LBB0_19:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #-1
	bl	_ff_hevc_unref_frame
	b	LBB0_5
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_GET_BUFFER_FLAG_REF,4,2     ; @AV_GET_BUFFER_FLAG_REF
	.comm	_AV_PICTURE_STRUCTURE_TOP_FIELD,8,3 ; @AV_PICTURE_STRUCTURE_TOP_FIELD
	.comm	_AV_PICTURE_STRUCTURE_BOTTOM_FIELD,8,3 ; @AV_PICTURE_STRUCTURE_BOTTOM_FIELD
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error allocating frame, DPB full.\n"

	.no_dead_strip	_alloc_frame
.subsections_via_symbols
