	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia2_querybuf
_cpia2_querybuf:                        ## @cpia2_querybuf
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	callq	_video_drvdata
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	8(%rbx), %rsi
	cmpq	(%r14), %rsi
	jae	LBB0_2
## %bb.3:
	movq	8(%r14), %r8
	leaq	(%rsi,%rsi,2), %r9
	movq	16(%r8,%r9,8), %rdx
	subq	32(%r14), %rdx
	movq	%rdx, 32(%rbx)
	movl	24(%r14), %eax
	movl	%eax, 48(%rbx)
	movq	_V4L2_MEMORY_MMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	xorl	%ecx, %ecx
	cmpq	$0, 16(%r14)
	je	LBB0_5
## %bb.4:
	movq	_V4L2_BUF_FLAG_MAPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_5:
	movq	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 24(%rbx)
	movl	(%r8,%r9,8), %eax
	leal	-129(%rax), %edi
	cmpl	$3, %edi
	jae	LBB0_6
## %bb.11:
	movl	$0, 16(%rbx)
	movq	_V4L2_BUF_FLAG_QUEUED@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_6:
	cmpl	$128, %eax
	jne	LBB0_9
## %bb.7:
	movl	12(%r8,%r9,8), %eax
	movl	%eax, 16(%rbx)
	movl	8(%r8,%r9,8), %edi
	callq	_ns_to_timeval
	movl	%eax, 40(%rbx)
	movq	8(%r14), %rax
	movq	8(%rbx), %rsi
	movq	32(%rbx), %rdx
	leaq	(%rsi,%rsi,2), %rcx
	movl	4(%rax,%rcx,8), %eax
	movl	%eax, 20(%rbx)
	movq	_V4L2_BUF_FLAG_DONE@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ecx
	movl	%ecx, 24(%rbx)
LBB0_9:
	movl	16(%rbx), %r9d
	movl	20(%rbx), %r8d
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	xorl	%eax, %eax
LBB0_10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_MEMORY_MMAP,4,2           ## @V4L2_MEMORY_MMAP
	.comm	_V4L2_BUF_FLAG_MAPPED,4,2       ## @V4L2_BUF_FLAG_MAPPED
	.comm	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,4,2 ## @V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
	.comm	_V4L2_BUF_FLAG_QUEUED,4,2       ## @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ## @V4L2_BUF_FLAG_DONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QUERYBUF index:%d offset:%d flags:%d seq:%d bytesused:%d\n"

	.no_dead_strip	_cpia2_querybuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia2_querybuf
_cpia2_querybuf:                        ; @cpia2_querybuf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	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:
	mov	x20, x0
	ldr	x1, [x19, #8]
	ldr	x8, [x0]
	cmp	x1, x8
	b.hs	LBB0_4
; %bb.2:
	mov	w9, #24
	ldp	x8, x10, [x20, #8]
	madd	x9, x1, x9, x8
	ldr	x11, [x9, #16]
	ldr	x12, [x20, #32]
	sub	x2, x11, x12
Lloh3:
	adrp	x11, _V4L2_MEMORY_MMAP@GOTPAGE
Lloh4:
	ldr	x11, [x11, _V4L2_MEMORY_MMAP@GOTPAGEOFF]
	ldr	w12, [x20, #24]
Lloh5:
	ldr	w11, [x11]
	stp	w11, w12, [x19, #44]
Lloh6:
	adrp	x11, _V4L2_BUF_FLAG_MAPPED@GOTPAGE
Lloh7:
	ldr	x11, [x11, _V4L2_BUF_FLAG_MAPPED@GOTPAGEOFF]
	str	x2, [x19, #32]
Lloh8:
	ldr	w11, [x11]
	cmp	x10, #0
	csel	w10, wzr, w11, eq
Lloh9:
	adrp	x11, _V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPAGE
Lloh10:
	ldr	x11, [x11, _V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	orr	w3, w10, w11
	str	w3, [x19, #24]
	ldr	w9, [x9]
	sub	w10, w9, #129
	cmp	w10, #3
	b.hs	LBB0_5
; %bb.3:
	str	wzr, [x19, #16]
Lloh12:
	adrp	x8, _V4L2_BUF_FLAG_QUEUED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V4L2_BUF_FLAG_QUEUED@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	str	w3, [x19, #24]
	b	LBB0_7
LBB0_4:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_5:
	cmp	w9, #128
	b.ne	LBB0_7
; %bb.6:
	mov	w21, #24
	madd	x8, x1, x21, x8
	ldp	w0, w9, [x8, #8]
	str	w9, [x19, #16]
	bl	_ns_to_timeval
	str	w0, [x19, #40]
	ldr	x8, [x20, #8]
	ldr	x1, [x19, #8]
	madd	x8, x1, x21, x8
	ldr	w8, [x8, #4]
Lloh18:
	adrp	x9, _V4L2_BUF_FLAG_DONE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _V4L2_BUF_FLAG_DONE@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x9]
	stp	w8, w3, [x19, #20]
	ldr	x2, [x19, #32]
LBB0_7:
	ldp	w5, w4, [x19, #16]
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_MEMORY_MMAP,4,2           ; @V4L2_MEMORY_MMAP
	.comm	_V4L2_BUF_FLAG_MAPPED,4,2       ; @V4L2_BUF_FLAG_MAPPED
	.comm	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,4,2 ; @V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
	.comm	_V4L2_BUF_FLAG_QUEUED,4,2       ; @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_BUF_FLAG_DONE,4,2         ; @V4L2_BUF_FLAG_DONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QUERYBUF index:%d offset:%d flags:%d seq:%d bytesused:%d\n"

	.no_dead_strip	_cpia2_querybuf
.subsections_via_symbols
