	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vidioc_qbuf
_vidioc_qbuf:                           ## @vidioc_qbuf
	.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	%rdx, %r15
	movq	%rsi, %r12
	movq	_D_FRAM@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movl	(%rdx), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_PDEBUG
	leaq	24(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_2:
	movl	(%r15), %edx
	movl	(%r12), %ecx
	cmpl	%ecx, %edx
	jae	LBB0_3
## %bb.4:
	movq	8(%r15), %rax
	cmpq	8(%r12), %rax
	jne	LBB0_5
## %bb.8:
	movslq	%edx, %rcx
	movq	32(%r12), %rax
	leaq	(%rcx,%rcx,2), %rcx
	movl	(%rax,%rcx,8), %edi
	movq	_BUF_ALL_FLAGS@GOTPCREL(%rip), %rsi
	testl	%edi, (%rsi)
	je	LBB0_10
## %bb.9:
	movl	(%r13), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_6
LBB0_3:
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_PDEBUG
	jmp	LBB0_7
LBB0_5:
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_6:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_PDEBUG
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%edx, %r13d
	leaq	(%rax,%rcx,8), %rsi
	movq	_V4L2_BUF_FLAG_QUEUED@GOTPCREL(%rip), %rdx
	orl	(%rdx), %edi
	movl	%edi, (%rsi)
	movq	8(%rax,%rcx,8), %rdx
	movq	_V4L2_MEMORY_USERPTR@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_12
## %bb.11:
	movl	24(%r15), %edx
	movl	%edx, 20(%rax,%rcx,8)
	movl	20(%r15), %edx
	movl	%edx, 16(%rax,%rcx,8)
LBB0_12:
	leaq	28(%r12), %rbx
	movq	%rbx, %rdi
	callq	_atomic_read
	movq	16(%r12), %rcx
	cltq
	movl	%r13d, (%rcx,%rax,4)
	incl	%eax
	movq	_GSPCA_MAX_FRAMES@GOTPCREL(%rip), %rcx
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	(%rcx)
	movq	%rbx, %rdi
	movl	%edx, %esi
	callq	_atomic_set
	movl	16(%r15), %eax
	movq	_V4L2_BUF_FLAG_QUEUED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_V4L2_BUF_FLAG_DONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	%ecx, 16(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_D_FRAM,4,2                     ## @D_FRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qbuf %d"

	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
L_.str.1:                               ## @.str.1
	.asciz	"qbuf idx %d >= %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"qbuf bad memory type"

	.comm	_BUF_ALL_FLAGS,4,2              ## @BUF_ALL_FLAGS
L_.str.3:                               ## @.str.3
	.asciz	"qbuf bad state"

	.comm	_V4L2_BUF_FLAG_QUEUED,4,2       ## @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_MEMORY_USERPTR,8,3        ## @V4L2_MEMORY_USERPTR
	.comm	_GSPCA_MAX_FRAMES,4,2           ## @GSPCA_MAX_FRAMES
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ## @V4L2_BUF_FLAG_DONE
	.no_dead_strip	_vidioc_qbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vidioc_qbuf
_vidioc_qbuf:                           ; @vidioc_qbuf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x2
	mov	x21, x1
Lloh0:
	adrp	x22, _D_FRAM@GOTPAGE
Lloh1:
	ldr	x22, [x22, _D_FRAM@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	w8, [x2]
	str	x8, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
	add	x19, x21, #24
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_2:
	ldr	w23, [x20]
	ldr	w8, [x21]
	cmp	w23, w8
	b.hs	LBB0_6
; %bb.3:
	ldr	x8, [x20, #8]
	ldr	x9, [x21, #8]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	sxtw	x8, w23
	ldr	x9, [x21, #32]
	mov	w10, #24
	madd	x10, x8, x10, x9
	ldr	w11, [x10]
Lloh7:
	adrp	x12, _BUF_ALL_FLAGS@GOTPAGE
Lloh8:
	ldr	x12, [x12, _BUF_ALL_FLAGS@GOTPAGEOFF]
Lloh9:
	ldr	w12, [x12]
	tst	w12, w11
	b.eq	LBB0_11
; %bb.5:
	ldr	w0, [x22]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_6:
	ldr	w0, [x22]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	stp	x23, x8, [sp]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
	ldr	w0, [x22]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	bl	_PDEBUG
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
Lloh19:
	adrp	x24, _V4L2_BUF_FLAG_QUEUED@GOTPAGE
Lloh20:
	ldr	x24, [x24, _V4L2_BUF_FLAG_QUEUED@GOTPAGEOFF]
	ldr	w12, [x24]
	orr	w11, w12, w11
	str	w11, [x10]
	mov	w10, #24
	madd	x10, x8, x10, x9
	ldr	x10, [x10, #8]
Lloh21:
	adrp	x11, _V4L2_MEMORY_USERPTR@GOTPAGE
Lloh22:
	ldr	x11, [x11, _V4L2_MEMORY_USERPTR@GOTPAGEOFF]
Lloh23:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_13
; %bb.12:
	mov	w10, #24
	madd	x8, x8, x10, x9
	ldur	d0, [x20, #20]
	str	d0, [x8, #16]
LBB0_13:
	add	x22, x21, #28
	mov	x0, x22
	bl	_atomic_read
	ldr	x8, [x21, #16]
	str	w23, [x8, w0, sxtw #2]
	add	w8, w0, #1
Lloh24:
	adrp	x9, _GSPCA_MAX_FRAMES@GOTPAGE
Lloh25:
	ldr	x9, [x9, _GSPCA_MAX_FRAMES@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	sdiv	w10, w8, w9
	msub	w1, w10, w9, w8
	mov	x0, x22
	bl	_atomic_set
	mov	w21, #0
	ldr	w8, [x24]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
Lloh27:
	adrp	x9, _V4L2_BUF_FLAG_DONE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _V4L2_BUF_FLAG_DONE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x20, #16]
	b	LBB0_9
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_D_FRAM,4,2                     ; @D_FRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qbuf %d"

	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
l_.str.1:                               ; @.str.1
	.asciz	"qbuf idx %d >= %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"qbuf bad memory type"

	.comm	_BUF_ALL_FLAGS,4,2              ; @BUF_ALL_FLAGS
l_.str.3:                               ; @.str.3
	.asciz	"qbuf bad state"

	.comm	_V4L2_BUF_FLAG_QUEUED,4,2       ; @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_MEMORY_USERPTR,8,3        ; @V4L2_MEMORY_USERPTR
	.comm	_GSPCA_MAX_FRAMES,4,2           ; @GSPCA_MAX_FRAMES
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ; @V4L2_BUF_FLAG_DONE
	.no_dead_strip	_vidioc_qbuf
.subsections_via_symbols
