	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function frame_alloc
_frame_alloc:                           ## @frame_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	%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	%ecx, %r13d
	movl	%edx, %r15d
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movslq	(%rdi), %rax
	movq	56(%rdi), %rcx
	movl	(%rcx,%rax,4), %ebx
	movq	_D_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_PDEBUG
	movl	%ebx, %edi
	callq	_PAGE_ALIGN
	movl	%eax, %ebx
	movq	_GSPCA_MAX_FRAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	-1(%rax), %r12d
	cmpl	%r13d, %eax
	cmoval	%r13d, %r12d
	movl	%r12d, %edi
	imull	%ebx, %edi
	callq	_vmalloc_32
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 32(%r14)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 48(%r14)
	movl	%r15d, 4(%r14)
	movl	%ebx, 8(%r14)
	movl	%r12d, 12(%r14)
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.3:
	movq	40(%r14), %rcx
	movl	%r12d, %r10d
	xorl	%esi, %esi
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %r8
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %r9
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edi, (%rcx)
	movl	(%r8), %edx
	movl	%edx, 40(%rcx)
	movq	$0, 32(%rcx)
	movl	(%r9), %edx
	movl	%edx, 24(%rcx)
	movl	%ebx, 4(%rcx)
	movl	%r15d, 8(%rcx)
	movq	$0, 16(%rcx)
	leal	(%rax,%rsi), %edx
	movq	%rdx, 48(%rcx)
	movl	%esi, 12(%rcx)
	incq	%rdi
	addl	%ebx, %esi
	addq	$56, %rcx
	cmpq	%rdi, %r10
	jne	LBB0_4
LBB0_5:
	leaq	28(%r14), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_atomic_set
	leaq	24(%r14), %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	movq	$0, 16(%r14)
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	callq	_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D_STREAM,4,2                   ## @D_STREAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"frame alloc frsz: %d"

	.comm	_GSPCA_MAX_FRAMES,4,2           ## @GSPCA_MAX_FRAMES
L_.str.1:                               ## @.str.1
	.asciz	"frame alloc failed"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.no_dead_strip	_frame_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function frame_alloc
_frame_alloc:                           ; @frame_alloc
	.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	x23, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldrsw	x8, [x0]
	ldr	x9, [x0, #56]
	ldr	w21, [x9, x8, lsl #2]
Lloh0:
	adrp	x8, _D_STREAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D_STREAM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_PDEBUG
	mov	x0, x21
	bl	_PAGE_ALIGN
	mov	x21, x0
Lloh5:
	adrp	x8, _GSPCA_MAX_FRAMES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GSPCA_MAX_FRAMES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	sub	w9, w8, #1
	cmp	w8, w23
	csel	w23, w23, w9, hi
	mul	w0, w23, w0
	bl	_vmalloc_32
	str	w0, [x19, #32]
	cbz	w0, LBB0_5
; %bb.1:
	str	x22, [x19, #48]
	stp	w20, w21, [x19, #4]
	str	w23, [x19, #12]
	cbz	w23, LBB0_4
; %bb.2:
	mov	w8, #0
	mov	x9, #0
	ldr	x10, [x19, #40]
	add	x10, x10, #24
Lloh8:
	adrp	x11, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh9:
	ldr	x11, [x11, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh10:
	adrp	x12, _V4L2_FIELD_NONE@GOTPAGE
Lloh11:
	ldr	x12, [x12, _V4L2_FIELD_NONE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	stur	w9, [x10, #-24]
	ldr	w13, [x11]
	str	w13, [x10, #16]
	str	xzr, [x10, #8]
	ldr	w13, [x12]
	str	w13, [x10]
	stp	w21, w20, [x10, #-20]
	stur	xzr, [x10, #-8]
	add	w13, w0, w8
	str	x13, [x10, #24]
	stur	w8, [x10, #-12]
	add	x9, x9, #1
	add	w8, w8, w21
	add	x10, x10, #56
	cmp	x23, x9
	b.ne	LBB0_3
LBB0_4:
	add	x0, x19, #28
	mov	w1, #0
	bl	_atomic_set
	add	x0, x19, #24
	mov	w1, #0
	bl	_atomic_set
	mov	w0, #0
	str	xzr, [x19, #16]
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_D_STREAM,4,2                   ; @D_STREAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"frame alloc frsz: %d"

	.comm	_GSPCA_MAX_FRAMES,4,2           ; @GSPCA_MAX_FRAMES
l_.str.1:                               ; @.str.1
	.asciz	"frame alloc failed"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.no_dead_strip	_frame_alloc
.subsections_via_symbols
