	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function register_instance
_register_instance:                     ## @register_instance
	.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
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r15
	leaq	40(%rsi), %rdi
	callq	_spin_lock_init
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_init
	movq	_m2m_ops@GOTPCREL(%rip), %rdi
	callq	_v4l2_m2m_init
	movl	%eax, (%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_v4l2_err
	movl	(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	%r13, %rsi
	leaq	8(%rbx), %r13
	movq	_vicodec_videodev@GOTPCREL(%rip), %rax
	movups	(%rax), %xmm0
	movups	%xmm0, 8(%rbx)
	movq	%r14, 32(%rbx)
	movq	%r15, 24(%rbx)
	movl	16(%rbx), %edi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	$4, %edx
	callq	_strscpy
	movq	_V4L2_CAP_STREAMING@GOTPCREL(%rip), %rax
	movq	_multiplanar@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	jne	LBB0_2
## %bb.3:
	movq	_V4L2_CAP_VIDEO_M2M@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_V4L2_CAP_VIDEO_M2M_MPLANE@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 8(%rbx)
	testl	%r12d, %r12d
	movq	_VIDIOC_DECODER_CMD@GOTPCREL(%rip), %rax
	cmoveq	_VIDIOC_ENCODER_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VIDIOC_TRY_DECODER_CMD@GOTPCREL(%rip), %r14
	cmoveq	_VIDIOC_TRY_ENCODER_CMD@GOTPCREL(%rip), %r14
	movq	%r13, %rdi
	callq	_v4l2_disable_ioctl
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_v4l2_disable_ioctl
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_video_set_drvdata
	movq	_VFL_TYPE_GRABBER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_video_register_device
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_v4l2_err
	movl	(%rbx), %edi
	callq	_v4l2_m2m_release
	movl	%r12d, %r14d
	jmp	LBB0_7
LBB0_6:
	movl	12(%rbx), %ecx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_v4l2_info
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_m2m_ops,4,2                    ## @m2m_ops
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to init vicodec enc device\n"

	.comm	_vicodec_videodev,32,3          ## @vicodec_videodev
	.comm	_V4L2_CAP_STREAMING,4,2         ## @V4L2_CAP_STREAMING
	.comm	_multiplanar,8,3                ## @multiplanar
	.comm	_V4L2_CAP_VIDEO_M2M_MPLANE,4,2  ## @V4L2_CAP_VIDEO_M2M_MPLANE
	.comm	_V4L2_CAP_VIDEO_M2M,4,2         ## @V4L2_CAP_VIDEO_M2M
	.comm	_VIDIOC_DECODER_CMD,4,2         ## @VIDIOC_DECODER_CMD
	.comm	_VIDIOC_TRY_DECODER_CMD,4,2     ## @VIDIOC_TRY_DECODER_CMD
	.comm	_VIDIOC_ENCODER_CMD,4,2         ## @VIDIOC_ENCODER_CMD
	.comm	_VIDIOC_TRY_ENCODER_CMD,4,2     ## @VIDIOC_TRY_ENCODER_CMD
	.comm	_VFL_TYPE_GRABBER,4,2           ## @VFL_TYPE_GRABBER
L_.str.1:                               ## @.str.1
	.asciz	"Failed to register video device '%s'\n"

L_.str.2:                               ## @.str.2
	.asciz	"Device '%s' registered as /dev/video%d\n"

	.no_dead_strip	_register_instance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function register_instance
_register_instance:                     ; @register_instance
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	add	x0, x1, #40
	bl	_spin_lock_init
	add	x23, x19, #4
	mov	x0, x23
	bl	_mutex_init
Lloh0:
	adrp	x0, _m2m_ops@GOTPAGE
Lloh1:
	ldr	x0, [x0, _m2m_ops@GOTPAGEOFF]
	bl	_v4l2_m2m_init
	str	w0, [x19]
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_v4l2_err
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_PTR_ERR
LBB0_2:
Lloh4:
	adrp	x8, _vicodec_videodev@GOTPAGE
Lloh5:
	ldr	x8, [x8, _vicodec_videodev@GOTPAGEOFF]
	add	x24, x19, #8
Lloh6:
	ldr	q0, [x8]
	stur	q0, [x19, #8]
	stp	x20, x23, [x19, #24]
	ldr	w0, [x19, #16]
	mov	x1, x21
	mov	w2, #4
	bl	_strscpy
Lloh7:
	adrp	x8, _V4L2_CAP_STREAMING@GOTPAGE
Lloh8:
	ldr	x8, [x8, _V4L2_CAP_STREAMING@GOTPAGEOFF]
Lloh9:
	adrp	x9, _multiplanar@GOTPAGE
Lloh10:
	ldr	x9, [x9, _multiplanar@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	ldr	x9, [x9]
Lloh13:
	adrp	x10, _V4L2_CAP_VIDEO_M2M_MPLANE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _V4L2_CAP_VIDEO_M2M_MPLANE@GOTPAGEOFF]
Lloh15:
	adrp	x11, _V4L2_CAP_VIDEO_M2M@GOTPAGE
Lloh16:
	ldr	x11, [x11, _V4L2_CAP_VIDEO_M2M@GOTPAGEOFF]
	cmp	x9, #0
	csel	x9, x11, x10, eq
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh17:
	adrp	x9, _VIDIOC_ENCODER_CMD@GOTPAGE
Lloh18:
	ldr	x9, [x9, _VIDIOC_ENCODER_CMD@GOTPAGEOFF]
	str	w8, [x19, #8]
Lloh19:
	adrp	x8, _VIDIOC_DECODER_CMD@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VIDIOC_DECODER_CMD@GOTPAGEOFF]
	cmp	w22, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _VIDIOC_TRY_ENCODER_CMD@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VIDIOC_TRY_ENCODER_CMD@GOTPAGEOFF]
Lloh23:
	adrp	x9, _VIDIOC_TRY_DECODER_CMD@GOTPAGE
Lloh24:
	ldr	x9, [x9, _VIDIOC_TRY_DECODER_CMD@GOTPAGEOFF]
	csel	x22, x8, x9, eq
	mov	x0, x24
	bl	_v4l2_disable_ioctl
	ldr	w1, [x22]
	mov	x0, x24
	bl	_v4l2_disable_ioctl
	mov	x0, x24
	mov	x1, x20
	bl	_video_set_drvdata
Lloh25:
	adrp	x8, _VFL_TYPE_GRABBER@GOTPAGE
Lloh26:
	ldr	x8, [x8, _VFL_TYPE_GRABBER@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x24
	mov	w2, #0
	bl	_video_register_device
	mov	x22, x0
	cbz	w0, LBB0_4
; %bb.3:
	str	x21, [sp]
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_v4l2_err
	ldr	w0, [x19]
	bl	_v4l2_m2m_release
	b	LBB0_5
LBB0_4:
	ldr	w3, [x19, #12]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_v4l2_info
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_m2m_ops,4,2                    ; @m2m_ops
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to init vicodec enc device\n"

	.comm	_vicodec_videodev,32,3          ; @vicodec_videodev
	.comm	_V4L2_CAP_STREAMING,4,2         ; @V4L2_CAP_STREAMING
	.comm	_multiplanar,8,3                ; @multiplanar
	.comm	_V4L2_CAP_VIDEO_M2M_MPLANE,4,2  ; @V4L2_CAP_VIDEO_M2M_MPLANE
	.comm	_V4L2_CAP_VIDEO_M2M,4,2         ; @V4L2_CAP_VIDEO_M2M
	.comm	_VIDIOC_DECODER_CMD,4,2         ; @VIDIOC_DECODER_CMD
	.comm	_VIDIOC_TRY_DECODER_CMD,4,2     ; @VIDIOC_TRY_DECODER_CMD
	.comm	_VIDIOC_ENCODER_CMD,4,2         ; @VIDIOC_ENCODER_CMD
	.comm	_VIDIOC_TRY_ENCODER_CMD,4,2     ; @VIDIOC_TRY_ENCODER_CMD
	.comm	_VFL_TYPE_GRABBER,4,2           ; @VFL_TYPE_GRABBER
l_.str.1:                               ; @.str.1
	.asciz	"Failed to register video device '%s'\n"

l_.str.2:                               ; @.str.2
	.asciz	"Device '%s' registered as /dev/video%d\n"

	.no_dead_strip	_register_instance
.subsections_via_symbols
