	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_v4l_control
_set_v4l_control:                       ## @set_v4l_control
	.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	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movl	%esi, -56(%rbp)
	movq	_VIDIOC_QUERYCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	callq	*%rcx
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	jne	LBB0_8
## %bb.3:
	movl	-52(%rbp), %eax
	movq	_V4L2_CTRL_FLAG_DISABLED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_8
## %bb.4:
	movq	_V4L2_CTRL_FLAG_GRABBED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_8
## %bb.5:
	xorl	%eax, %eax
	testl	%r15d, %r15d
	cmovgl	%r15d, %eax
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	movl	$65535, %ecx                    ## imm = 0xFFFF
	cmovael	%ecx, %eax
	movq	-48(%rbp), %rdx
	movq	_V4L2_CTRL_TYPE_BOOLEAN@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	cmovnel	%eax, %ecx
	testl	%eax, %eax
	cmovel	%eax, %ecx
	movl	-56(%rbp), %eax
	movl	%eax, -88(%rbp)
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	subl	%edx, %eax
	imull	%ecx, %eax
	movl	%eax, %ecx
	addl	$32767, %ecx                    ## imm = 0x7FFF
	movslq	%ecx, %rcx
	imulq	$-2147450879, %rcx, %rcx        ## imm = 0x80008001
	shrq	$32, %rcx
	addl	%ecx, %eax
	addl	$32767, %eax                    ## imm = 0x7FFF
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$15, %eax
	addl	%ecx, %eax
	addl	%edx, %eax
	movl	%eax, -72(%rbp)
	movq	_VIDIOC_S_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-88(%rbp), %rdx
	movq	%rbx, %rdi
	callq	*%r14
	testl	%eax, %eax
	jns	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_7:
	movl	%eax, %esi
	callq	_dprintk
LBB0_8:
	xorl	%eax, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDIOC_QUERYCTRL,4,2           ## @VIDIOC_QUERYCTRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VIDIOC_QUERYCTRL: %d\n"

	.comm	_V4L2_CTRL_FLAG_DISABLED,4,2    ## @V4L2_CTRL_FLAG_DISABLED
	.comm	_V4L2_CTRL_FLAG_GRABBED,4,2     ## @V4L2_CTRL_FLAG_GRABBED
	.comm	_V4L2_CTRL_TYPE_BOOLEAN,8,3     ## @V4L2_CTRL_TYPE_BOOLEAN
	.comm	_VIDIOC_S_CTRL,4,2              ## @VIDIOC_S_CTRL
L_.str.1:                               ## @.str.1
	.asciz	"VIDIOC_S_CTRL: %d\n"

	.no_dead_strip	_set_v4l_control
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_v4l_control
_set_v4l_control:                       ; @set_v4l_control
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x3
	mov	x21, x2
	mov	x20, x0
	str	w1, [sp, #32]
Lloh0:
	adrp	x8, _VIDIOC_QUERYCTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDIOC_QUERYCTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #32
	blr	x3
	mov	x1, x0
	tbnz	w0, #31, LBB0_6
; %bb.1:
	cbnz	w1, LBB0_8
; %bb.2:
	ldr	w8, [sp, #36]
Lloh3:
	adrp	x9, _V4L2_CTRL_FLAG_DISABLED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_CTRL_FLAG_DISABLED@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.3:
Lloh6:
	adrp	x9, _V4L2_CTRL_FLAG_GRABBED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_CTRL_FLAG_GRABBED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.4:
	cmp	w21, #0
	csel	w8, w21, wzr, gt
	mov	w9, #65535
	cmp	w8, w9
	csel	w8, w8, w9, lo
Lloh9:
	adrp	x10, _V4L2_CTRL_TYPE_BOOLEAN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _V4L2_CTRL_TYPE_BOOLEAN@GOTPAGEOFF]
	ldr	x11, [sp, #40]
Lloh11:
	ldr	x10, [x10]
	cmp	x11, x10
	csel	w9, w9, w8, eq
	cmp	w8, #0
	csel	w8, wzr, w9, eq
	ldp	w9, w10, [sp, #52]
	sub	w9, w9, w10
	mov	w11, #32767
	madd	w8, w9, w8, w11
	ldr	w9, [sp, #32]
	mov	w11, #32769
	movk	w11, #32768, lsl #16
	smull	x11, w8, w11
	lsr	x11, x11, #32
	add	w8, w11, w8
	asr	w11, w8, #15
	add	w8, w11, w8, lsr #31
	add	w8, w8, w10
	str	w9, [sp]
	str	w8, [sp, #16]
Lloh12:
	adrp	x8, _VIDIOC_S_CTRL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VIDIOC_S_CTRL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x20
	blr	x19
	tbz	w0, #31, LBB0_8
; %bb.5:
	mov	x1, x0
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
LBB0_7:
	bl	_dprintk
LBB0_8:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDIOC_QUERYCTRL,4,2           ; @VIDIOC_QUERYCTRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VIDIOC_QUERYCTRL: %d\n"

	.comm	_V4L2_CTRL_FLAG_DISABLED,4,2    ; @V4L2_CTRL_FLAG_DISABLED
	.comm	_V4L2_CTRL_FLAG_GRABBED,4,2     ; @V4L2_CTRL_FLAG_GRABBED
	.comm	_V4L2_CTRL_TYPE_BOOLEAN,8,3     ; @V4L2_CTRL_TYPE_BOOLEAN
	.comm	_VIDIOC_S_CTRL,4,2              ; @VIDIOC_S_CTRL
l_.str.1:                               ; @.str.1
	.asciz	"VIDIOC_S_CTRL: %d\n"

	.no_dead_strip	_set_v4l_control
.subsections_via_symbols
