	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7146_register_device        ## -- Begin function saa7146_register_device
	.p2align	4, 0x90
_saa7146_register_device:               ## @saa7146_register_device
	.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, %r15d
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movslq	%ecx, %rdi
	callq	_DEB_EE
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_video_device_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_video_device_shadow_get
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	_video_fops@GOTPCREL(%rip), %rcx
	movq	%rcx, 24(%rbx)
	movq	8(%r12), %rcx
	leaq	16(%rcx), %rdx
	movq	%rdx, 16(%rbx)
	movq	_video_device_release@GOTPCREL(%rip), %rdx
	movq	%rdx, 8(%rbx)
	leaq	16(%r12), %rdx
	movq	%rdx, (%rax)
	movl	$0, 4(%rbx)
	movl	(%rcx), %eax
	testl	%eax, %eax
	jle	LBB0_17
## %bb.5:
	movq	8(%rcx), %rcx
	cmpl	$8, %eax
	jae	LBB0_7
## %bb.6:
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	LBB0_15
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_20
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_20
LBB0_7:
	movl	%eax, %edx
	andl	$-8, %edx
	leaq	-8(%rdx), %rdi
	movq	%rdi, %rsi
	shrq	$3, %rsi
	incq	%rsi
	movl	%esi, %r8d
	andl	$3, %r8d
	cmpq	$24, %rdi
	jae	LBB0_9
## %bb.8:
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	jmp	LBB0_11
LBB0_9:
	andq	$-4, %rsi
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rdi,4), %xmm2
	por	%xmm0, %xmm2
	movdqu	16(%rcx,%rdi,4), %xmm0
	por	%xmm1, %xmm0
	movdqu	32(%rcx,%rdi,4), %xmm1
	movdqu	48(%rcx,%rdi,4), %xmm3
	movdqu	64(%rcx,%rdi,4), %xmm4
	por	%xmm1, %xmm4
	por	%xmm2, %xmm4
	movdqu	80(%rcx,%rdi,4), %xmm2
	por	%xmm3, %xmm2
	por	%xmm0, %xmm2
	movdqu	96(%rcx,%rdi,4), %xmm0
	por	%xmm4, %xmm0
	movdqu	112(%rcx,%rdi,4), %xmm1
	por	%xmm2, %xmm1
	addq	$32, %rdi
	addq	$-4, %rsi
	jne	LBB0_10
LBB0_11:
	testq	%r8, %r8
	je	LBB0_14
## %bb.12:
	leaq	(%rcx,%rdi,4), %rsi
	addq	$16, %rsi
	shlq	$5, %r8
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rsi,%rdi), %xmm2
	por	%xmm2, %xmm0
	movdqu	(%rsi,%rdi), %xmm2
	por	%xmm2, %xmm1
	addq	$32, %rdi
	cmpq	%rdi, %r8
	jne	LBB0_13
LBB0_14:
	por	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	por	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	por	%xmm1, %xmm0
	movd	%xmm0, %esi
	cmpq	%rax, %rdx
	je	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	orl	(%rcx,%rdx,4), %esi
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_15
LBB0_16:
	movl	%esi, 4(%rbx)
LBB0_17:
	movl	(%rbx), %edi
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_video_set_drvdata
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	$-1, %edx
	callq	_video_register_device
	testl	%eax, %eax
	js	LBB0_18
## %bb.19:
	movq	%rbx, %rdi
	callq	_video_device_node_name
	movslq	%eax, %rdi
	callq	_INFO
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	xorl	%r14d, %r14d
	jmp	LBB0_20
LBB0_18:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	movq	%rbx, %rdi
	callq	_video_device_release
LBB0_20:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_video_fops,4,2                 ## @video_fops
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"cannot register v4l2 device. skipping.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7146_register_device        ; -- Begin function saa7146_register_device
	.p2align	2
_saa7146_register_device:               ; @saa7146_register_device
	.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
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x19, x0
	sxtw	x0, w21
	bl	_DEB_EE
	bl	_video_device_alloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	bl	_video_device_shadow_get
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _video_fops@GOTPAGE
Lloh1:
	ldr	x8, [x8, _video_fops@GOTPAGEOFF]
	str	x8, [x20, #24]
	ldr	x9, [x22, #8]
	mov	x10, x9
	ldr	w8, [x10], #16
Lloh2:
	adrp	x11, _video_device_release@GOTPAGE
Lloh3:
	ldr	x11, [x11, _video_device_release@GOTPAGEOFF]
	stp	x11, x10, [x20, #8]
	add	x10, x22, #16
	str	x10, [x0]
	str	wzr, [x20, #4]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.3:
	ldr	x9, [x9, #8]
	cmp	w8, #16
	b.hs	LBB0_6
; %bb.4:
	mov	x10, #0
	mov	w11, #0
	b	LBB0_9
LBB0_5:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_15
LBB0_6:
	and	x10, x8, #0xfffffff0
	add	x11, x9, #32
	movi.2d	v0, #0000000000000000
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	orr.16b	v0, v0, v4
	orr.16b	v1, v1, v5
	orr.16b	v2, v2, v6
	orr.16b	v3, v3, v7
	subs	x12, x12, #16
	b.ne	LBB0_7
; %bb.8:
	orr.16b	v0, v1, v0
	orr.16b	v0, v2, v0
	orr.16b	v0, v3, v0
	ext.16b	v1, v0, v0, #8
	orr.8b	v0, v0, v1
	fmov	w11, s0
	mov.s	w12, v0[1]
	orr	w11, w11, w12
	cmp	x10, x8
	b.eq	LBB0_11
LBB0_9:
	add	x9, x9, x10, lsl #2
	sub	x8, x8, x10
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #4
	orr	w11, w11, w10
	subs	x8, x8, #1
	b.ne	LBB0_10
LBB0_11:
	str	w11, [x20, #4]
LBB0_12:
	ldr	w0, [x20]
	mov	x1, x23
	mov	w2, #4
	bl	_strlcpy
	mov	x0, x20
	mov	x1, x22
	bl	_video_set_drvdata
	mov	x0, x20
	mov	x1, x21
	mov	w2, #-1
	bl	_video_register_device
	tbnz	w0, #31, LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_video_device_node_name
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x0, w0
	bl	_INFO
	mov	w21, #0
	str	x20, [x19]
	b	LBB0_15
LBB0_14:
	mov	x21, x0
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
	mov	x0, x20
	bl	_video_device_release
LBB0_15:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_video_fops,4,2                 ; @video_fops
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"cannot register v4l2 device. skipping.\n"

.subsections_via_symbols
