	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_event_subscribe           ## -- Begin function v4l2_event_subscribe
	.p2align	4, 0x90
_v4l2_event_subscribe:                  ## @v4l2_event_subscribe
	.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	%rcx, %r13
	movq	(%rsi), %rax
	movq	_V4L2_EVENT_ALL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	%rsi, %r12
	movq	%rdi, %r14
	testl	%edx, %edx
	movl	$1, %r15d
	cmovnel	%edx, %r15d
	movq	_events@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_struct_size
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_kvzalloc
	testq	%rax, %rax
	je	LBB0_23
## %bb.4:
	movq	%rax, %rbx
	movq	48(%rax), %rax
	movl	%r15d, %ecx
	cmpl	$4, %r15d
	jae	LBB0_6
## %bb.5:
	xorl	%edx, %edx
	jmp	LBB0_14
LBB0_23:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_22
LBB0_6:
	movl	%ecx, %edx
	andl	$-4, %edx
	movq	%rbx, %xmm0
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	leaq	-4(%rdx), %rsi
	movq	%rsi, %rdi
	shrq	$2, %rdi
	incq	%rdi
	movl	%edi, %r8d
	andl	$7, %r8d
	cmpq	$28, %rsi
	jae	LBB0_8
## %bb.7:
	xorl	%esi, %esi
	jmp	LBB0_10
LBB0_8:
	andq	$-8, %rdi
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rax,%rsi,8)
	movdqu	%xmm0, 16(%rax,%rsi,8)
	movdqu	%xmm0, 32(%rax,%rsi,8)
	movdqu	%xmm0, 48(%rax,%rsi,8)
	movdqu	%xmm0, 64(%rax,%rsi,8)
	movdqu	%xmm0, 80(%rax,%rsi,8)
	movdqu	%xmm0, 96(%rax,%rsi,8)
	movdqu	%xmm0, 112(%rax,%rsi,8)
	movdqu	%xmm0, 128(%rax,%rsi,8)
	movdqu	%xmm0, 144(%rax,%rsi,8)
	movdqu	%xmm0, 160(%rax,%rsi,8)
	movdqu	%xmm0, 176(%rax,%rsi,8)
	movdqu	%xmm0, 192(%rax,%rsi,8)
	movdqu	%xmm0, 208(%rax,%rsi,8)
	movdqu	%xmm0, 224(%rax,%rsi,8)
	movdqu	%xmm0, 240(%rax,%rsi,8)
	addq	$32, %rsi
	addq	$-8, %rdi
	jne	LBB0_9
LBB0_10:
	testq	%r8, %r8
	je	LBB0_13
## %bb.11:
	leaq	(%rax,%rsi,8), %rsi
	addq	$16, %rsi
	shlq	$5, %r8
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rsi,%rdi)
	movdqu	%xmm0, (%rsi,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %r8
	jne	LBB0_12
LBB0_13:
	cmpq	%rcx, %rdx
	je	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, (%rax,%rdx,8)
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_14
LBB0_15:
	movq	(%r12), %rax
	movq	%rax, (%rbx)
	movl	8(%r12), %eax
	movl	%eax, 44(%rbx)
	movl	12(%r12), %eax
	movl	%eax, 40(%rbx)
	movq	%r14, 32(%rbx)
	movq	%r13, 16(%rbx)
	movl	%r15d, 8(%rbx)
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%r14), %rdi
	callq	_spin_lock_irqsave
	movq	(%r12), %rsi
	movl	8(%r12), %edx
	movq	%r14, %rdi
	callq	_v4l2_event_subscribed
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_16
LBB0_20:
	movq	8(%r14), %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	callq	_kvfree
LBB0_21:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_22:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%rbx, %rdi
	addq	$24, %rdi
	leaq	16(%r14), %rsi
	callq	_list_add
	movq	8(%r14), %rdi
	callq	_spin_unlock_irqrestore
	movq	16(%rbx), %rax
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_21
## %bb.17:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_21
## %bb.18:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	*%rcx
	testl	%eax, %eax
	je	LBB0_21
## %bb.19:
	movl	%eax, %r15d
	movq	8(%r14), %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	callq	___v4l2_event_unsubscribe
	movl	%r15d, %r12d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_EVENT_ALL,8,3             ## @V4L2_EVENT_ALL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_events,4,2                     ## @events
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v4l2_event_subscribe           ; -- Begin function v4l2_event_subscribe
	.p2align	2
_v4l2_event_subscribe:                  ; @v4l2_event_subscribe
	.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
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _V4L2_EVENT_ALL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_EVENT_ALL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	mov	x23, x3
	mov	x22, x1
	mov	x19, x0
	cmp	w2, #0
	csinc	w21, w2, wzr, ne
Lloh5:
	adrp	x8, _events@GOTPAGE
Lloh6:
	ldr	x8, [x8, _events@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_struct_size
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_kvzalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x20, x0
	ldr	x8, [x0, #48]
	cmp	w21, #8
	b.hs	LBB0_7
; %bb.4:
	mov	x9, #0
	b	LBB0_10
LBB0_5:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_7:
	and	x9, x21, #0xfffffff8
	dup.2d	v0, x20
	add	x10, x8, #32
	mov	x11, x9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x11, x11, #8
	b.ne	LBB0_8
; %bb.9:
	cmp	x9, x21
	b.eq	LBB0_12
LBB0_10:
	add	x8, x8, x9, lsl #3
	sub	x9, x21, x9
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	str	x20, [x8], #8
	subs	x9, x9, #1
	b.ne	LBB0_11
LBB0_12:
	ldr	x8, [x22]
	str	x8, [x20]
	ldr	d0, [x22, #8]
	rev64.2s	v0, v0
	str	d0, [x20, #40]
	str	x19, [x20, #32]
	str	x23, [x20, #16]
	str	w21, [x20, #8]
	mov	x0, x19
	bl	_mutex_lock
	ldr	x0, [x19, #8]
	bl	_spin_lock_irqsave
	ldr	x1, [x22]
	ldr	w2, [x22, #8]
	mov	x0, x19
	bl	_v4l2_event_subscribed
	cbz	x0, LBB0_15
; %bb.13:
	mov	w21, #0
LBB0_14:
	ldr	x0, [x19, #8]
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	bl	_kvfree
	b	LBB0_20
LBB0_15:
	add	x0, x20, #24
	add	x1, x19, #16
	bl	_list_add
	ldr	x0, [x19, #8]
	bl	_spin_unlock_irqrestore
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_19
; %bb.16:
	ldr	x8, [x8]
	cbz	x8, LBB0_19
; %bb.17:
	mov	x0, x20
	mov	x1, x21
	blr	x8
	mov	x21, x0
	cbz	w0, LBB0_20
; %bb.18:
	ldr	x0, [x19, #8]
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	___v4l2_event_unsubscribe
	b	LBB0_14
LBB0_19:
	mov	w21, #0
LBB0_20:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_21:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_EVENT_ALL,8,3             ; @V4L2_EVENT_ALL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_events,4,2                     ; @events
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
