	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_rbsp_buffer
_alloc_rbsp_buffer:                     ## @alloc_rbsp_buffer
	.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
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	_INT_MAX@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_AV_INPUT_BUFFER_PADDING_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movl	%esi, %eax
	subl	%ebx, %eax
	cmpl	%r12d, %eax
	jae	LBB0_1
LBB0_11:
	movl	$0, (%r13)
	cmpq	$0, 16(%r13)
	je	LBB0_15
## %bb.12:
	leaq	16(%r13), %rdi
	callq	_av_buffer_unref
	movq	$0, 8(%r13)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	addl	%r12d, %ebx
	cmpl	%ebx, (%r13)
	jb	LBB0_5
## %bb.2:
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	16(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.3:
	callq	_av_buffer_is_writable
	testq	%rax, %rax
	je	LBB0_4
LBB0_14:
	movq	8(%r13), %rdi
	callq	_av_assert0
	movslq	%r12d, %rdi
	shlq	$2, %rdi
	addq	8(%r13), %rdi
	movl	(%r15), %edx
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_15:
	addq	$8, %r13
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_av_freep                       ## TAILCALL
LBB0_4:
	movl	(%r14), %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
LBB0_5:
	movl	%edx, %r14d
	movl	%ebx, %eax
	shrl	$4, %eax
	leal	(%rbx,%rax), %edi
	addl	$32, %edi
	callq	_FFMIN
	movl	%eax, %r12d
	leaq	16(%r13), %r15
	cmpq	$0, 16(%r13)
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_av_buffer_unref
	jmp	LBB0_8
LBB0_7:
	movq	8(%r13), %rdi
	callq	_av_free
LBB0_8:
	movl	%r12d, %edi
	callq	_av_mallocz
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movl	%r12d, (%r13)
	testl	%r14d, %r14d
	je	LBB0_13
## %bb.10:
	movq	%rax, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_av_buffer_create
	movq	%rax, (%r15)
	testq	%rax, %rax
	jne	LBB0_13
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ## @AV_INPUT_BUFFER_PADDING_SIZE
	.no_dead_strip	_alloc_rbsp_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_rbsp_buffer
_alloc_rbsp_buffer:                     ; @alloc_rbsp_buffer
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x23, [x23, _INT_MAX@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x22, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _AV_INPUT_BUFFER_PADDING_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	sub	w9, w1, w8
	cmp	w9, w21
	b.hs	LBB0_4
LBB0_1:
	str	wzr, [x19]
	mov	x0, x19
	ldr	x8, [x0, #16]!
	cbz	x8, LBB0_8
; %bb.2:
	bl	_av_buffer_unref
	str	xzr, [x19, #8]
LBB0_3:
	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_4:
	mov	x20, x2
	ldr	w9, [x19]
	add	w24, w8, w21
	cmp	w9, w24
	b.lo	LBB0_10
; %bb.5:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_av_buffer_is_writable
	cbz	x0, LBB0_9
LBB0_7:
	ldr	x0, [x19, #8]
	bl	_av_assert0
	ldr	x8, [x19, #8]
	add	x0, x8, w21, sxtw #2
	ldr	w2, [x22]
	mov	w1, #0
	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
	b	_memset
LBB0_8:
	add	x0, x19, #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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_av_freep
LBB0_9:
	ldr	w1, [x23]
LBB0_10:
	add	w8, w24, w24, lsr #4
	add	w0, w8, #32
	bl	_FFMIN
	mov	x22, x0
	mov	x21, x19
	ldr	x8, [x21, #16]!
	cbz	x8, LBB0_12
; %bb.11:
	mov	x0, x21
	bl	_av_buffer_unref
	b	LBB0_13
LBB0_12:
	ldr	x0, [x19, #8]
	bl	_av_free
LBB0_13:
	mov	x0, x22
	bl	_av_mallocz
	str	x0, [x19, #8]
	cbz	x0, LBB0_1
; %bb.14:
	str	w22, [x19]
	cbz	w20, LBB0_3
; %bb.15:
	mov	x1, x22
	mov	x2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_av_buffer_create
	str	x0, [x21]
	cbnz	x0, LBB0_3
	b	LBB0_1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_AV_INPUT_BUFFER_PADDING_SIZE,4,2 ; @AV_INPUT_BUFFER_PADDING_SIZE
	.no_dead_strip	_alloc_rbsp_buffer
.subsections_via_symbols
