	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia2_dqbuf
_cpia2_dqbuf:                           ## @cpia2_dqbuf
	.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, %rbx
	callq	_video_drvdata
	movq	%rax, %r14
	movq	(%r12), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	8(%r12), %rax
	movq	_V4L2_MEMORY_MMAP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.4:
	movq	%r14, %rdi
	callq	_find_earliest_filled_buffer
	testl	%eax, %eax
	js	LBB0_5
LBB0_15:
	movl	%eax, 16(%r12)
	movq	(%r14), %rcx
	cltq
	shlq	$5, %rax
	movl	24(%rcx,%rax), %edx
	movl	%edx, 24(%r12)
	movq	_V4L2_BUF_FLAG_MAPPED@GOTPCREL(%rip), %rdx
	movq	_V4L2_BUF_FLAG_DONE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	movq	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPCREL(%rip), %rdx
	orl	(%rdx), %esi
	movl	%esi, 20(%r12)
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, 76(%r12)
	movl	20(%rcx,%rax), %edi
	callq	_ns_to_timeval
	movl	%eax, 72(%r12)
	movq	(%r14), %rax
	movslq	16(%r12), %rcx
	shlq	$5, %rcx
	movl	16(%rax,%rcx), %edx
	movl	%edx, 28(%r12)
	movq	8(%rax,%rcx), %rax
	subq	16(%r14), %rax
	movq	%rax, 64(%r12)
	movl	8(%r14), %eax
	movl	%eax, 56(%r12)
	leaq	32(%r12), %rdi
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%r12)
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movslq	16(%r12), %rsi
	movq	(%r14), %rax
	movq	%rsi, %rcx
	shlq	$5, %rcx
	movl	(%rax,%rcx), %edx
	movl	24(%r12), %r8d
	movl	28(%r12), %ecx
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	jmp	LBB0_16
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_7
## %bb.6:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_7:
	movq	32(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	28(%r14), %rbx
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	40(%r14), %r13d
	movq	%r14, %r15
	addq	$24, %r15
	movq	%r15, %rdi
	callq	_video_is_registered
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	32(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	_FRAME_READY@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	sete	%sil
	jmp	LBB0_10
LBB0_8:
	movl	$1, %esi
LBB0_10:
	movl	%r13d, %edi
	callq	_wait_event_interruptible
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_12:
	movq	%r15, %rdi
	callq	_video_is_registered
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	jmp	LBB0_15
LBB0_13:
	movq	_ENOTTY@GOTPCREL(%rip), %rax
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_MEMORY_MMAP,8,3           ## @V4L2_MEMORY_MMAP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_FRAME_READY,8,3                ## @FRAME_READY
	.comm	_current,4,2                    ## @current
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_ENOTTY,4,2                     ## @ENOTTY
	.comm	_V4L2_BUF_FLAG_MAPPED,4,2       ## @V4L2_BUF_FLAG_MAPPED
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ## @V4L2_BUF_FLAG_DONE
	.comm	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,4,2 ## @V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DQBUF #%d status:%d seq:%d length:%d\n"

	.no_dead_strip	_cpia2_dqbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia2_dqbuf
_cpia2_dqbuf:                           ; @cpia2_dqbuf
	.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, x2
	mov	x21, x0
	bl	_video_drvdata
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _V4L2_MEMORY_MMAP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_MEMORY_MMAP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	x20, x0
	bl	_find_earliest_filled_buffer
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_7
LBB0_3:
	ldr	x8, [x20]
	sxtw	x9, w0
	add	x8, x8, x9, lsl #5
	ldp	w8, w9, [x8, #20]
	str	w9, [x19, #24]
Lloh6:
	adrp	x9, _V4L2_BUF_FLAG_MAPPED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_BUF_FLAG_MAPPED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _V4L2_BUF_FLAG_DONE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _V4L2_BUF_FLAG_DONE@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh12:
	adrp	x10, _V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPAGE
Lloh13:
	ldr	x10, [x10, _V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	orr	w9, w9, w10
	stp	w0, w9, [x19, #16]
Lloh15:
	adrp	x9, _V4L2_FIELD_NONE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	w9, [x19, #76]
	mov	x0, x8
	bl	_ns_to_timeval
	str	w0, [x19, #72]
	ldr	x8, [x20]
	ldrsw	x9, [x19, #16]
	add	x8, x8, x9, lsl #5
	ldr	w9, [x8, #16]
	str	w9, [x19, #28]
	ldr	x8, [x8, #8]
	ldr	x9, [x20, #16]
	sub	x8, x8, x9
	str	x8, [x19, #64]
	ldr	w8, [x20, #8]
	str	w8, [x19, #56]
	add	x0, x19, #32
	stp	xzr, xzr, [x19, #40]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldrsw	x1, [x19, #16]
	ldr	x8, [x20]
	lsl	x9, x1, #5
	ldr	w2, [x8, x9]
	ldp	w4, w3, [x19, #24]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	mov	w0, #0
	b	LBB0_6
LBB0_4:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	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
LBB0_7:
	ldr	w8, [x21]
Lloh22:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
Lloh25:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_5
LBB0_9:
	ldr	x24, [x20, #32]
	add	x22, x20, #28
	mov	x0, x22
	bl	_mutex_unlock
	ldr	w23, [x20, #40]
	add	x21, x20, #24
	mov	x0, x21
	bl	_video_is_registered
	cbz	w0, LBB0_11
; %bb.10:
	ldr	x24, [x20, #32]
	ldr	x8, [x24]
Lloh27:
	adrp	x9, _FRAME_READY@GOTPAGE
Lloh28:
	ldr	x9, [x9, _FRAME_READY@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w1, eq
	b	LBB0_12
LBB0_11:
	mov	w1, #1
LBB0_12:
	mov	x0, x23
	bl	_wait_event_interruptible
	mov	x0, x22
	bl	_mutex_lock
Lloh30:
	adrp	x8, _current@GOTPAGE
Lloh31:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_signal_pending
	cbz	x0, LBB0_14
; %bb.13:
Lloh33:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_5
LBB0_14:
	mov	x0, x21
	bl	_video_is_registered
	cbz	w0, LBB0_16
; %bb.15:
	ldr	w0, [x24, #8]
	b	LBB0_3
LBB0_16:
Lloh35:
	adrp	x8, _ENOTTY@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENOTTY@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_MEMORY_MMAP,8,3           ; @V4L2_MEMORY_MMAP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_FRAME_READY,8,3                ; @FRAME_READY
	.comm	_current,4,2                    ; @current
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_ENOTTY,4,2                     ; @ENOTTY
	.comm	_V4L2_BUF_FLAG_MAPPED,4,2       ; @V4L2_BUF_FLAG_MAPPED
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ; @V4L2_BUF_FLAG_DONE
	.comm	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,4,2 ; @V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DQBUF #%d status:%d seq:%d length:%d\n"

	.no_dead_strip	_cpia2_dqbuf
.subsections_via_symbols
