	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cbs_vp9_read_unit
_cbs_vp9_read_unit:                     ## @cbs_vp9_read_unit
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movl	(%rsi), %edx
	movl	4(%rsi), %esi
	shll	$3, %edx
	leaq	-36(%rbp), %rdi
	callq	_init_get_bits
	testl	%eax, %eax
	js	LBB0_10
## %bb.1:
	movq	_cbs_vp9_free_frame@GOTPCREL(%rip), %rcx
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$24, %edx
	callq	_ff_cbs_alloc_unit_content
	testl	%eax, %eax
	js	LBB0_10
## %bb.2:
	movq	16(%r15), %r14
	leaq	-36(%rbp), %rsi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_cbs_vp9_read_frame
	testl	%eax, %eax
	js	LBB0_10
## %bb.3:
	leaq	-36(%rbp), %rdi
	callq	_get_bits_count
	movl	%eax, %ebx
	xorl	%edi, %edi
	testb	$7, %bl
	sete	%dil
	callq	_av_assert0
	leal	7(%rbx), %r12d
	testl	%ebx, %ebx
	cmovnsl	%ebx, %r12d
	sarl	$3, %r12d
	xorl	%edi, %edi
	cmpl	(%r15), %r12d
	setle	%dil
	callq	_av_assert0
	xorl	%ebx, %ebx
	cmpl	(%r15), %r12d
	je	LBB0_11
## %bb.4:
	movl	8(%r15), %edi
	callq	_av_buffer_ref
	movl	%eax, 16(%r14)
	testl	%eax, %eax
	je	LBB0_9
## %bb.5:
	movslq	4(%r15), %rax
	movslq	%r12d, %rcx
	addq	%rax, %rcx
	movq	%rcx, 8(%r14)
	movl	(%r15), %eax
	subl	%r12d, %eax
	movl	%eax, (%r14)
	jmp	LBB0_11
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
LBB0_10:
	movl	%eax, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cbs_vp9_free_frame,4,2         ## @cbs_vp9_free_frame
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_cbs_vp9_read_unit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cbs_vp9_read_unit
_cbs_vp9_read_unit:                     ; @cbs_vp9_read_unit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x21, x0
	ldr	w1, [x1, #4]
	ldr	w8, [x19]
	lsl	w2, w8, #3
	add	x0, sp, #12
	bl	_init_get_bits
	tbnz	w0, #31, LBB0_8
; %bb.1:
Lloh0:
	adrp	x3, _cbs_vp9_free_frame@GOTPAGE
Lloh1:
	ldr	x3, [x3, _cbs_vp9_free_frame@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x19
	mov	w2, #24
	bl	_ff_cbs_alloc_unit_content
	tbnz	w0, #31, LBB0_8
; %bb.2:
	ldr	x20, [x19, #16]
	add	x1, sp, #12
	mov	x0, x21
	mov	x2, x20
	bl	_cbs_vp9_read_frame
	tbnz	w0, #31, LBB0_8
; %bb.3:
	add	x0, sp, #12
	bl	_get_bits_count
	mov	x21, x0
	tst	w0, #0x7
	cset	w0, eq
	bl	_av_assert0
	add	w8, w21, #7
	cmp	w21, #0
	csel	w8, w8, w21, lt
	asr	w21, w8, #3
	ldr	w8, [x19]
	cmp	w21, w8
	cset	w0, le
	bl	_av_assert0
	ldr	w8, [x19]
	cmp	w21, w8
	b.ne	LBB0_5
; %bb.4:
	mov	w0, #0
	b	LBB0_8
LBB0_5:
	ldr	w0, [x19, #8]
	bl	_av_buffer_ref
	str	w0, [x20, #16]
	cbz	w0, LBB0_7
; %bb.6:
	mov	w0, #0
	ldp	w9, w8, [x19]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x8, x8, w21, sxtw
	str	x8, [x20, #8]
	sub	w8, w9, w21
	str	w8, [x20]
	b	LBB0_8
LBB0_7:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_8:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_cbs_vp9_free_frame,4,2         ; @cbs_vp9_free_frame
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_cbs_vp9_read_unit
.subsections_via_symbols
