	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun6i_csi_v4l2_init
_sun6i_csi_v4l2_init:                   ## @sun6i_csi_v4l2_init
	.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	%rdi, %rbx
	movl	8(%rdi), %edi
	movl	52(%rbx), %eax
	movl	%eax, 12(%rbx)
	leaq	L_.str(%rip), %rsi
	movl	$4, %edx
	callq	_strscpy
	movq	$0, (%rbx)
	movq	%rbx, %rdi
	callq	_media_device_init
	leaq	16(%rbx), %r14
	movq	%r14, %rdi
	callq	_v4l2_async_notifier_init
	leaq	24(%rbx), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_v4l2_ctrl_handler_init
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	movl	52(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_2:
	leaq	32(%rbx), %r13
	movq	%rbx, 40(%rbx)
	movq	%r15, 32(%rbx)
	movl	52(%rbx), %edi
	movq	%r13, %rsi
	callq	_v4l2_device_register
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	movl	52(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_11
LBB0_4:
	leaq	48(%rbx), %rdi
	leaq	L_.str.3(%rip), %rdx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_sun6i_video_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movl	52(%rbx), %edi
	movq	_sun6i_csi_fwnode_parse@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rsi
	movl	$4, %edx
	callq	_v4l2_async_notifier_parse_fwnode_endpoints
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.6:
	movq	_sun6i_csi_async_ops@GOTPCREL(%rip), %rax
	movq	%rax, (%r14)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_v4l2_async_notifier_register
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %r12d
	movl	52(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_sun6i_video_cleanup
LBB0_10:
	movq	%r13, %rdi
	callq	_v4l2_device_unregister
LBB0_11:
	movq	%r15, %rdi
	callq	_v4l2_ctrl_handler_free
LBB0_12:
	movq	%r14, %rdi
	callq	_v4l2_async_notifier_cleanup
	movq	%rbx, %rdi
	callq	_media_device_cleanup
LBB0_13:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	xorl	%r12d, %r12d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allwinner Video Capture Device"

L_.str.1:                               ## @.str.1
	.asciz	"V4L2 controls handler init failed (%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"V4L2 device registration failed (%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"sun6i-csi"

	.comm	_sun6i_csi_fwnode_parse,4,2     ## @sun6i_csi_fwnode_parse
	.comm	_sun6i_csi_async_ops,4,2        ## @sun6i_csi_async_ops
L_.str.4:                               ## @.str.4
	.asciz	"notifier registration failed\n"

	.no_dead_strip	_sun6i_csi_v4l2_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun6i_csi_v4l2_init
_sun6i_csi_v4l2_init:                   ; @sun6i_csi_v4l2_init
	.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	x19, x0
	ldr	w8, [x0, #52]
	str	w8, [x0, #12]
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #4
	bl	_strscpy
	str	xzr, [x19]
	mov	x0, x19
	bl	_media_device_init
	add	x20, x19, #16
	mov	x0, x20
	bl	_v4l2_async_notifier_init
	add	x21, x19, #24
	mov	x0, x21
	mov	w1, #0
	bl	_v4l2_ctrl_handler_init
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w0, [x19, #52]
	str	x22, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_11
LBB0_2:
	mov	x23, x19
	str	x21, [x23, #32]!
	str	x19, [x19, #40]
	ldr	w0, [x19, #52]
	mov	x1, x23
	bl	_v4l2_device_register
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
	ldr	w0, [x19, #52]
	str	x22, [sp]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_10
LBB0_4:
	add	x24, x19, #48
Lloh6:
	adrp	x2, l_.str.3@PAGE
Lloh7:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x24
	mov	x1, x19
	bl	_sun6i_video_init
	mov	x22, x0
	cbnz	w0, LBB0_9
; %bb.5:
	ldr	w0, [x19, #52]
Lloh8:
	adrp	x8, _sun6i_csi_fwnode_parse@GOTPAGE
Lloh9:
	ldr	x8, [x8, _sun6i_csi_fwnode_parse@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x1, x20
	mov	w2, #4
	bl	_v4l2_async_notifier_parse_fwnode_endpoints
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.6:
Lloh11:
	adrp	x8, _sun6i_csi_async_ops@GOTPAGE
Lloh12:
	ldr	x8, [x8, _sun6i_csi_async_ops@GOTPAGEOFF]
	str	x8, [x20]
	mov	x0, x23
	mov	x1, x20
	bl	_v4l2_async_notifier_register
	mov	x22, x0
	cbz	w0, LBB0_12
; %bb.7:
	ldr	w0, [x19, #52]
Lloh13:
	adrp	x1, l_.str.4@PAGE
Lloh14:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
LBB0_8:
	mov	x0, x24
	bl	_sun6i_video_cleanup
LBB0_9:
	mov	x0, x23
	bl	_v4l2_device_unregister
LBB0_10:
	mov	x0, x21
	bl	_v4l2_ctrl_handler_free
LBB0_11:
	mov	x0, x20
	bl	_v4l2_async_notifier_cleanup
	mov	x0, x19
	bl	_media_device_cleanup
LBB0_12:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allwinner Video Capture Device"

l_.str.1:                               ; @.str.1
	.asciz	"V4L2 controls handler init failed (%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"V4L2 device registration failed (%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"sun6i-csi"

	.comm	_sun6i_csi_fwnode_parse,4,2     ; @sun6i_csi_fwnode_parse
	.comm	_sun6i_csi_async_ops,4,2        ; @sun6i_csi_async_ops
l_.str.4:                               ; @.str.4
	.asciz	"notifier registration failed\n"

	.no_dead_strip	_sun6i_csi_v4l2_init
.subsections_via_symbols
