	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usbvision_frames_alloc         ## -- Begin function usbvision_frames_alloc
	.p2align	4, 0x90
_usbvision_frames_alloc:                ## @usbvision_frames_alloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	imull	4(%r14), %edi
	imull	48(%r14), %edi
	callq	_PAGE_ALIGN
	movl	%eax, (%r14)
	movl	%ebx, 12(%r14)
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.1:
	imull	%ebx, %eax
	movl	%eax, 16(%r14)
	movl	%eax, %edi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	callq	_usbvision_rvmalloc
	movq	%rax, 40(%r14)
	movl	12(%r14), %ecx
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rcx), %ebx
	movl	%ebx, 12(%r14)
	cmpl	$2, %ecx
	jl	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	imull	(%r14), %ebx
	movl	%ebx, 16(%r14)
	movl	%ebx, %edi
	jmp	LBB0_2
LBB0_5:
	testl	%ecx, %ecx
	jle	LBB0_6
## %bb.8:
	movl	%ecx, %ebx
	movq	32(%r14), %rdx
	movl	(%r14), %ecx
	movl	4(%r14), %r8d
	movl	8(%r14), %r9d
	movslq	%ecx, %r11
	addq	$32, %rdx
	xorl	%edi, %edi
	movq	_frame_state_unused@GOTPCREL(%rip), %r10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edi, -32(%rdx)
	movl	(%r10), %esi
	movl	%esi, (%rdx)
	movq	%rax, -8(%rdx)
	movl	%r8d, -28(%rdx)
	movl	%r9d, -24(%rdx)
	movq	$0, -16(%rdx)
	incq	%rdi
	addq	%r11, %rax
	addq	$40, %rdx
	cmpq	%rdi, %rbx
	jne	LBB0_9
## %bb.10:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 20(%r14)
	jmp	LBB0_11
LBB0_6:
	movl	%ecx, %ebx
LBB0_7:
	movl	(%r14), %ecx
LBB0_11:
	movq	_DBG_FUNC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_PDEBUG
	movl	12(%r14), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_frame_state_unused,4,2         ## @frame_state_unused
	.comm	_DBG_FUNC,4,2                   ## @DBG_FUNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"allocated %d frames (%d bytes per frame)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usbvision_frames_alloc         ; -- Begin function usbvision_frames_alloc
	.p2align	2
_usbvision_frames_alloc:                ; @usbvision_frames_alloc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	ldp	w8, w9, [x0, #4]
	mul	w8, w9, w8
	ldr	w9, [x0, #48]
	mul	w0, w8, w9
	bl	_PAGE_ALIGN
	str	w0, [x19]
	str	w20, [x19, #12]
	cmp	w20, #1
	b.lt	LBB0_10
; %bb.1:
	mul	w0, w0, w20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	w0, [x19, #16]
	bl	_usbvision_rvmalloc
	str	x0, [x19, #40]
	ldr	w20, [x19, #12]
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w8, w20, #1
	str	w8, [x19, #12]
	cmp	w20, #2
	b.lt	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x19]
	mul	w0, w9, w8
	b	LBB0_2
LBB0_5:
	cmp	w20, #0
	b.le	LBB0_10
; %bb.6:
	mov	x8, #0
	mov	w20, w20
	ldr	x10, [x19, #32]
	ldr	w3, [x19]
	ldur	d0, [x19, #4]
	sxtw	x9, w3
	add	x10, x10, #32
Lloh0:
	adrp	x11, _frame_state_unused@GOTPAGE
Lloh1:
	ldr	x11, [x11, _frame_state_unused@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	stur	w8, [x10, #-32]
	ldr	w12, [x11]
	str	w12, [x10]
	stur	d0, [x10, #-28]
	stp	xzr, x0, [x10, #-16]
	add	x8, x8, #1
	add	x0, x0, x9
	add	x10, x10, #40
	cmp	x20, x8
	b.ne	LBB0_7
; %bb.8:
	movi.2s	v0, #1
	stur	d0, [x19, #20]
	b	LBB0_11
LBB0_9:
	mov	x20, x8
LBB0_10:
	ldr	w3, [x19]
LBB0_11:
Lloh2:
	adrp	x8, _DBG_FUNC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DBG_FUNC@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_PDEBUG
	ldr	w0, [x19, #12]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_frame_state_unused,4,2         ; @frame_state_unused
	.comm	_DBG_FUNC,4,2                   ; @DBG_FUNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"allocated %d frames (%d bytes per frame)"

.subsections_via_symbols
