	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uvc_alloc_buffers              ## -- Begin function uvc_alloc_buffers
	.p2align	4, 0x90
_uvc_alloc_buffers:                     ## @uvc_alloc_buffers
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	%edx, %edi
	callq	_PAGE_ALIGN
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_UVC_MAX_VIDEO_BUFFERS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r15d, %eax
	cmovbl	%eax, %r15d
	leaq	8(%r14), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	___uvc_free_buffers
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_9
## %bb.1:
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.2:
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movl	%r15d, %r13d
	imull	-44(%rbp), %r15d                ## 4-byte Folded Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	callq	_vmalloc_32
	testq	%rax, %rax
	jne	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	decq	%r13
	subl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	testl	%r13d, %r13d
	jne	LBB0_3
## %bb.8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_4:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %r12
	xorl	%r15d, %r15d
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rdi
	addq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	24(%r13), %rax
	leaq	(%rax,%rbx), %rdi
	movl	%r15d, 8(%rax,%rbx)
	movl	%r14d, 36(%rax,%rbx)
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 12(%rax,%rbx)
	movl	32(%r13), %ecx
	movl	%ecx, 32(%rax,%rbx)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rax,%rbx)
	movq	_V4L2_MEMORY_MMAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%rax,%rbx)
	movq	$0, 16(%rax,%rbx)
	callq	_init_waitqueue_head
	addl	-44(%rbp), %r14d                ## 4-byte Folded Reload
	incl	%r15d
	addq	$40, %rbx
	decq	%r12
	jne	LBB0_5
## %bb.6:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 16(%rcx)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, (%rcx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rcx)
	movq	-80(%rbp), %r12                 ## 8-byte Reload
LBB0_9:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UVC_MAX_VIDEO_BUFFERS,4,2      ## @UVC_MAX_VIDEO_BUFFERS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_V4L2_MEMORY_MMAP,4,2           ## @V4L2_MEMORY_MMAP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uvc_alloc_buffers              ; -- Begin function uvc_alloc_buffers
	.p2align	2
_uvc_alloc_buffers:                     ; @uvc_alloc_buffers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	bl	_PAGE_ALIGN
	mov	x22, x0
Lloh0:
	adrp	x8, _UVC_MAX_VIDEO_BUFFERS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UVC_MAX_VIDEO_BUFFERS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	csel	w28, w8, w19, lo
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	___uvc_free_buffers
	mov	x23, x0
	tbnz	w0, #31, LBB0_9
; %bb.1:
	cbz	w28, LBB0_9
; %bb.2:
	mul	w24, w22, w28
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_vmalloc_32
	cbnz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w24, w24, w22
	sub	x28, x28, #1
	cbnz	w28, LBB0_3
; %bb.5:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_9
LBB0_6:
	mov	x23, x0
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x24, #0
	mov	w26, #0
	mov	w27, #0
Lloh6:
	adrp	x19, _V4L2_MEMORY_MMAP@GOTPAGE
Lloh7:
	ldr	x19, [x19, _V4L2_MEMORY_MMAP@GOTPAGEOFF]
	mov	x25, x28
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	add	x0, x8, x24
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	ldr	x8, [x20, #24]
	add	x0, x8, x24
	stp	w26, w21, [x0, #8]
	ldr	w8, [x20, #32]
	stp	w8, w27, [x0, #32]
Lloh8:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x0, #28]
	ldr	w8, [x19]
	str	w8, [x0, #24]
	str	xzr, [x0, #16]
	bl	_init_waitqueue_head
	add	w27, w27, w22
	add	w26, w26, #1
	add	x24, x24, #40
	subs	x25, x25, #1
	b.ne	LBB0_7
; %bb.8:
	str	x23, [x20, #16]
	mov	x23, x28
	stp	w28, w22, [x20]
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_UVC_MAX_VIDEO_BUFFERS,4,2      ; @UVC_MAX_VIDEO_BUFFERS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_V4L2_MEMORY_MMAP,4,2           ; @V4L2_MEMORY_MMAP
.subsections_via_symbols
