	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ioctl_querybuf
_ioctl_querybuf:                        ## @ioctl_querybuf
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	(%rdi), %rcx
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_2
## %bb.1:
	movq	%rsi, %rax
	movq	8(%rdi), %rsi
	cmpq	(%rax), %rsi
	jbe	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_3:
	movq	8(%rax), %r8
	leaq	(%rsi,%rsi,2), %r10
	movq	16(%r8,%r10,8), %rdx
	subq	32(%rax), %rdx
	movq	%rdx, 32(%rdi)
	movl	24(%rax), %ecx
	movl	%ecx, 48(%rdi)
	movq	_V4L2_MEMORY_MMAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 44(%rdi)
	movq	16(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.4:
	movq	_V4L2_BUF_FLAG_MAPPED@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
LBB0_5:
	movq	%rcx, 24(%rdi)
	movl	(%r8,%r10,8), %r9d
	leal	-129(%r9), %eax
	cmpl	$3, %eax
	jae	LBB0_6
## %bb.8:
	movl	$0, 16(%rdi)
	movq	_V4L2_BUF_FLAG_QUEUED@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, 24(%rdi)
	xorl	%r9d, %r9d
	jmp	LBB0_10
LBB0_6:
	cmpl	$128, %r9d
	jne	LBB0_7
## %bb.9:
	movl	12(%r8,%r10,8), %r9d
	movl	%r9d, 16(%rdi)
	movl	8(%r8,%r10,8), %eax
	movl	%eax, 40(%rdi)
	movl	4(%r8,%r10,8), %eax
	movl	%eax, 20(%rdi)
	movq	_V4L2_BUF_FLAG_DONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, 24(%rdi)
	jmp	LBB0_10
LBB0_7:
	movl	16(%rdi), %r9d
LBB0_10:
	movl	20(%rdi), %r8d
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	xorl	%eax, %eax
	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,8,3       ## @V4L2_BUF_FLAG_MAPPED
	.comm	_V4L2_BUF_FLAG_QUEUED,8,3       ## @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_BUF_FLAG_DONE,8,3         ## @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	_ioctl_querybuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ioctl_querybuf
_ioctl_querybuf:                        ; @ioctl_querybuf
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	ldr	x9, [x0]
Lloh0:
	adrp	x10, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
	mov	x8, x1
	ldr	x1, [x0, #8]
	ldr	x9, [x8]
	cmp	x1, x9
	b.ls	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	w10, #24
	ldp	x9, x11, [x8, #8]
	madd	x10, x1, x10, x9
	ldr	x12, [x10, #16]
	ldr	x13, [x8, #32]
	sub	x2, x12, x13
	ldr	w8, [x8, #24]
Lloh6:
	adrp	x12, _V4L2_MEMORY_MMAP@GOTPAGE
Lloh7:
	ldr	x12, [x12, _V4L2_MEMORY_MMAP@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	stp	w12, w8, [x0, #44]
Lloh9:
	adrp	x8, _V4L2_BUF_FLAG_MAPPED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V4L2_BUF_FLAG_MAPPED@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x11, #0
	csel	x3, xzr, x8, eq
	stp	x3, x2, [x0, #24]
	ldr	w8, [x10]
	sub	w10, w8, #129
	cmp	w10, #3
	b.hs	LBB0_5
; %bb.4:
	mov	w5, #0
	str	wzr, [x0, #16]
Lloh12:
	adrp	x8, _V4L2_BUF_FLAG_QUEUED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V4L2_BUF_FLAG_QUEUED@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.6:
	mov	w8, #24
	madd	x8, x1, x8, x9
	ldp	w9, w5, [x8, #8]
	ldr	w8, [x8, #4]
	str	w9, [x0, #40]
	stp	w5, w8, [x0, #16]
Lloh14:
	adrp	x8, _V4L2_BUF_FLAG_DONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _V4L2_BUF_FLAG_DONE@GOTPAGEOFF]
LBB0_7:
	ldr	x3, [x8]
	str	x3, [x0, #24]
	b	LBB0_9
LBB0_8:
	ldr	w5, [x0, #16]
LBB0_9:
	ldr	w4, [x0, #20]
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.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,8,3       ; @V4L2_BUF_FLAG_MAPPED
	.comm	_V4L2_BUF_FLAG_QUEUED,8,3       ; @V4L2_BUF_FLAG_QUEUED
	.comm	_V4L2_BUF_FLAG_DONE,8,3         ; @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	_ioctl_querybuf
.subsections_via_symbols
