	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function allocate_frame_buf
_allocate_frame_buf:                    ## @allocate_frame_buf
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_FRAME_NUM@GOTPCREL(%rip), %r15
	movq	_CPIA_MAX_FRAME_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	imull	(%r15), %edi
	callq	_rvmalloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movl	(%r15), %r10d
	testl	%r10d, %r10d
	jle	LBB0_2
## %bb.3:
	movslq	(%r14), %rdx
	movq	8(%rbx), %rdi
	leaq	-1(%r10), %rcx
	movl	%r10d, %r9d
	andl	$3, %r9d
	xorl	%r8d, %r8d
	cmpq	$3, %rcx
	jae	LBB0_6
## %bb.4:
	xorl	%ecx, %ecx
	jmp	LBB0_8
LBB0_5:
	movq	_ENOBUFS@GOTPCREL(%rip), %rax
	xorl	%r8d, %r8d
	subl	(%rax), %r8d
	jmp	LBB0_11
LBB0_2:
	xorl	%r8d, %r8d
	jmp	LBB0_11
LBB0_6:
	andl	$-4, %r10d
	leaq	(%rdx,%rdx), %r11
	leaq	(,%rdx,4), %r14
	leaq	(%rdx,%rdx,2), %r15
	xorl	%ecx, %ecx
	movq	%rax, %rsi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rsi, (%rdi,%rcx,8)
	leaq	(%rdx,%rsi), %rbx
	movq	%rbx, 8(%rdi,%rcx,8)
	leaq	(%r11,%rsi), %rbx
	movq	%rbx, 16(%rdi,%rcx,8)
	leaq	(%r15,%rsi), %rbx
	movq	%rbx, 24(%rdi,%rcx,8)
	addq	$4, %rcx
	addq	%r14, %rsi
	cmpq	%rcx, %r10
	jne	LBB0_7
LBB0_8:
	testq	%r9, %r9
	je	LBB0_11
## %bb.9:
	leaq	(%rdi,%rcx,8), %rsi
	imulq	%rdx, %rcx
	addq	%rcx, %rax
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, (%rsi,%rcx,8)
	incq	%rcx
	addq	%rdx, %rax
	cmpq	%rcx, %r9
	jne	LBB0_10
LBB0_11:
	movl	%r8d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FRAME_NUM,4,2                  ## @FRAME_NUM
	.comm	_CPIA_MAX_FRAME_SIZE,4,2        ## @CPIA_MAX_FRAME_SIZE
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.no_dead_strip	_allocate_frame_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function allocate_frame_buf
_allocate_frame_buf:                    ; @allocate_frame_buf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
Lloh0:
	adrp	x21, _FRAME_NUM@GOTPAGE
Lloh1:
	ldr	x21, [x21, _FRAME_NUM@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x20, _CPIA_MAX_FRAME_SIZE@GOTPAGE
Lloh3:
	ldr	x20, [x20, _CPIA_MAX_FRAME_SIZE@GOTPAGEOFF]
	ldr	w9, [x20]
	mul	w0, w9, w8
	bl	_rvmalloc
	str	x0, [x19]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.2:
	ldrsw	x8, [x20]
	ldr	x10, [x19, #8]
	cmp	w9, #4
	b.hs	LBB0_5
; %bb.3:
	mov	x11, #0
	b	LBB0_8
LBB0_4:
Lloh4:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_5:
	and	x11, x9, #0xfffffffc
	lsl	x12, x8, #1
	add	x13, x12, x8
	lsl	x14, x8, #2
	add	x15, x10, #16
	mov	x16, x11
	mov	x17, x0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x8, x17
	add	x2, x12, x17
	add	x3, x13, x17
	stp	x17, x1, [x15, #-16]
	stp	x2, x3, [x15], #32
	add	x17, x17, x14
	subs	x16, x16, #4
	b.ne	LBB0_6
; %bb.7:
	cmp	x11, x9
	b.eq	LBB0_10
LBB0_8:
	madd	x12, x11, x8, x0
	add	x10, x10, x11, lsl #3
	sub	x9, x9, x11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	str	x12, [x10], #8
	add	x12, x12, x8
	subs	x9, x9, #1
	b.ne	LBB0_9
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_FRAME_NUM,4,2                  ; @FRAME_NUM
	.comm	_CPIA_MAX_FRAME_SIZE,4,2        ; @CPIA_MAX_FRAME_SIZE
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.no_dead_strip	_allocate_frame_buf
.subsections_via_symbols
