	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpbe_buffer_queue_setup
_vpbe_buffer_queue_setup:               ## @vpbe_buffer_queue_setup
	.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
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_vb2_get_drv_priv
	movq	%rax, %r13
	movq	8(%rax), %rax
	movq	(%rax), %rdx
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	callq	_v4l2_dbg
	movq	(%rbx), %rax
	movl	(%r12), %edx
	addq	%rax, %rdx
	movq	_VPBE_DEFAULT_NUM_BUFS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rdx
	jge	LBB0_2
## %bb.1:
	subl	%eax, %ecx
	movl	%ecx, (%r12)
LBB0_2:
	cmpl	$0, (%r15)
	je	LBB0_4
## %bb.3:
	movl	(%r14), %ecx
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	xorl	%eax, %eax
	subl	(%rdx), %eax
	cmpl	(%r13), %ecx
	cmovael	%esi, %eax
	jmp	LBB0_5
LBB0_4:
	movl	$1, (%r15)
	movl	(%r13), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vpbe_buffer_setup\n"

	.comm	_VPBE_DEFAULT_NUM_BUFS,8,3      ## @VPBE_DEFAULT_NUM_BUFS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_vpbe_buffer_queue_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpbe_buffer_queue_setup
_vpbe_buffer_queue_setup:               ; @vpbe_buffer_queue_setup
	.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	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x23, x0
	bl	_vb2_get_drv_priv
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x2, [x8]
Lloh0:
	adrp	x8, _debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	bl	_v4l2_dbg
	ldr	x8, [x23]
	ldr	w10, [x22]
Lloh5:
	adrp	x9, _VPBE_DEFAULT_NUM_BUFS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VPBE_DEFAULT_NUM_BUFS@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x10, x8, x10
	cmp	x10, x9
	b.ge	LBB0_2
; %bb.1:
	sub	w8, w9, w8
	str	w8, [x22]
LBB0_2:
	ldr	w8, [x20]
	cbz	w8, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	ldr	w9, [x21]
Lloh8:
	adrp	x10, _EINVAL@GOTPAGE
Lloh9:
	ldr	x10, [x10, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	w8, w9
	csneg	w0, wzr, w10, hs
	b	LBB0_5
LBB0_4:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x20]
	ldr	w8, [x21]
	str	w8, [x19]
LBB0_5:
	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 AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vpbe_buffer_setup\n"

	.comm	_VPBE_DEFAULT_NUM_BUFS,8,3      ; @VPBE_DEFAULT_NUM_BUFS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_vpbe_buffer_queue_setup
.subsections_via_symbols
