	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function v4l2_ctrl_add_event
_v4l2_ctrl_add_event:                   ## @v4l2_ctrl_add_event
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	movl	20(%r15), %esi
	callq	_v4l2_ctrl_find
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_v4l2_ctrl_lock
	leaq	16(%r15), %rdi
	movq	%rbx, %rsi
	addq	$12, %rsi
	callq	_list_add_tail
	movq	(%rbx), %rax
	movq	_V4L2_CTRL_TYPE_CTRL_CLASS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.3:
	movq	_V4L2_EVENT_SUB_FL_SEND_INITIAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_7
## %bb.4:
	movq	_V4L2_EVENT_CTRL_CH_FLAGS@GOTPCREL(%rip), %rax
	movq	_V4L2_CTRL_FLAG_WRITE_ONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	andl	8(%rbx), %ecx
	jne	LBB0_6
## %bb.5:
	movq	_V4L2_EVENT_CTRL_CH_VALUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_6:
	orl	(%rax), %edx
	leaq	-40(%rbp), %r12
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_fill_event
	movl	%r14d, 4(%r15)
	movq	8(%r15), %rdi
	movq	%r12, %rsi
	callq	_v4l2_event_queue_fh
LBB0_7:
	movq	%rbx, %rdi
	callq	_v4l2_ctrl_unlock
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_CTRL_TYPE_CTRL_CLASS,8,3  ## @V4L2_CTRL_TYPE_CTRL_CLASS
	.comm	_V4L2_EVENT_SUB_FL_SEND_INITIAL,4,2 ## @V4L2_EVENT_SUB_FL_SEND_INITIAL
	.comm	_V4L2_EVENT_CTRL_CH_FLAGS,4,2   ## @V4L2_EVENT_CTRL_CH_FLAGS
	.comm	_V4L2_CTRL_FLAG_WRITE_ONLY,4,2  ## @V4L2_CTRL_FLAG_WRITE_ONLY
	.comm	_V4L2_EVENT_CTRL_CH_VALUE,4,2   ## @V4L2_EVENT_CTRL_CH_VALUE
	.no_dead_strip	_v4l2_ctrl_add_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function v4l2_ctrl_add_event
_v4l2_ctrl_add_event:                   ; @v4l2_ctrl_add_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	ldr	w1, [x19, #20]
	bl	_v4l2_ctrl_find
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x0
	bl	_v4l2_ctrl_lock
	add	x0, x19, #16
	add	x1, x21, #12
	bl	_list_add_tail
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _V4L2_CTRL_TYPE_CTRL_CLASS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_CTRL_TYPE_CTRL_CLASS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.2:
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _V4L2_EVENT_SUB_FL_SEND_INITIAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_EVENT_SUB_FL_SEND_INITIAL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _V4L2_EVENT_CTRL_CH_FLAGS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_EVENT_CTRL_CH_FLAGS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x21, #8]
Lloh9:
	adrp	x10, _V4L2_CTRL_FLAG_WRITE_ONLY@GOTPAGE
Lloh10:
	ldr	x10, [x10, _V4L2_CTRL_FLAG_WRITE_ONLY@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
Lloh12:
	adrp	x11, _V4L2_EVENT_CTRL_CH_VALUE@GOTPAGE
Lloh13:
	ldr	x11, [x11, _V4L2_EVENT_CTRL_CH_VALUE@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, w11, wzr, eq
	orr	w2, w9, w8
	add	x0, sp, #8
	mov	x1, x21
	bl	_fill_event
	str	w20, [x19, #4]
	ldr	x0, [x19, #8]
	add	x1, sp, #8
	bl	_v4l2_event_queue_fh
LBB0_4:
	mov	x0, x21
	bl	_v4l2_ctrl_unlock
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_CTRL_TYPE_CTRL_CLASS,8,3  ; @V4L2_CTRL_TYPE_CTRL_CLASS
	.comm	_V4L2_EVENT_SUB_FL_SEND_INITIAL,4,2 ; @V4L2_EVENT_SUB_FL_SEND_INITIAL
	.comm	_V4L2_EVENT_CTRL_CH_FLAGS,4,2   ; @V4L2_EVENT_CTRL_CH_FLAGS
	.comm	_V4L2_CTRL_FLAG_WRITE_ONLY,4,2  ; @V4L2_CTRL_FLAG_WRITE_ONLY
	.comm	_V4L2_EVENT_CTRL_CH_VALUE,4,2   ; @V4L2_EVENT_CTRL_CH_VALUE
	.no_dead_strip	_v4l2_ctrl_add_event
.subsections_via_symbols
