	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cafe_vidioc_qbuf
_cafe_vidioc_qbuf:                      ## @cafe_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, %r12
	movq	(%rdi), %r15
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	8(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r12), %r12
	cmpq	(%r15), %r12
	jge	LBB0_6
## %bb.1:
	movq	24(%r15), %rbx
	movl	4(%rbx,%r12,8), %eax
	movq	_V4L2_BUF_FLAG_QUEUED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_2
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_2:
	movq	_V4L2_BUF_FLAG_DONE@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_4
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	orl	%eax, %ecx
	movl	%ecx, 4(%rbx,%r12,8)
	leaq	12(%r15), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	leaq	(%rbx,%r12,8), %rdi
	addq	$16, %r15
	movq	%r15, %rsi
	callq	_list_add
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_BUF_FLAG_QUEUED,4,2       ## @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ## @V4L2_BUF_FLAG_DONE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_cafe_vidioc_qbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cafe_vidioc_qbuf
_cafe_vidioc_qbuf:                      ; @cafe_vidioc_qbuf
	.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	x20, x2
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	add	x19, x21, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x22, [x20]
	ldr	x8, [x21]
	cmp	x22, x8
	b.ge	LBB0_3
; %bb.1:
	ldr	x23, [x21, #24]
	add	x8, x23, x22, lsl #3
	ldr	w9, [x8, #4]!
Lloh3:
	adrp	x10, _V4L2_BUF_FLAG_QUEUED@GOTPAGE
Lloh4:
	ldr	x10, [x10, _V4L2_BUF_FLAG_QUEUED@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
LBB0_2:
	mov	w20, #0
	b	LBB0_4
LBB0_3:
	neg	w20, w23
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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
LBB0_5:
Lloh6:
	adrp	x11, _V4L2_BUF_FLAG_DONE@GOTPAGE
Lloh7:
	ldr	x11, [x11, _V4L2_BUF_FLAG_DONE@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	tst	w11, w9
	b.eq	LBB0_7
; %bb.6:
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_4
LBB0_7:
	orr	w9, w10, w9
	str	w9, [x8]
	add	x20, x21, #12
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x0, x23, x22, lsl #3
	add	x1, x21, #16
	bl	_list_add
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_BUF_FLAG_QUEUED,4,2       ; @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ; @V4L2_BUF_FLAG_DONE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_cafe_vidioc_qbuf
.subsections_via_symbols
