	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_csi_dma_register         ## -- Begin function sun4i_csi_dma_register
	.p2align	4, 0x90
_sun4i_csi_dma_register:                ## @sun4i_csi_dma_register
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	32(%rdi), %r14
	addq	$28, %rdi
	callq	_spin_lock_init
	movq	%rbx, %rdi
	callq	_mutex_init
	leaq	24(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	movq	_CSI_MAX_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	LBB0_7
## %bb.1:
	leaq	-1(%rdx), %rcx
	movl	%edx, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_3
## %bb.2:
	xorl	%ecx, %ecx
	jmp	LBB0_5
LBB0_3:
	andl	$-4, %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rsi
	movq	$0, (%rsi,%rcx,8)
	movq	16(%rbx), %rsi
	movq	$0, 8(%rsi,%rcx,8)
	movq	16(%rbx), %rsi
	movq	$0, 16(%rsi,%rcx,8)
	movq	16(%rbx), %rsi
	movq	$0, 24(%rsi,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_4
LBB0_5:
	testq	%rax, %rax
	je	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rdx
	movq	$0, (%rdx,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_6
LBB0_7:
	movl	$3, 32(%rbx)
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 84(%rbx)
	movq	_VB2_MMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 80(%rbx)
	movq	%rbx, 72(%rbx)
	movq	%rbx, 64(%rbx)
	movl	$4, 36(%rbx)
	movq	_sun4i_csi_qops@GOTPCREL(%rip), %rax
	movq	%rax, 56(%rbx)
	movq	_vb2_dma_contig_memops@GOTPCREL(%rip), %rax
	movq	%rax, 48(%rbx)
	movq	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movl	8(%rbx), %eax
	movl	%eax, 40(%rbx)
	movq	%r14, %rdi
	callq	_vb2_queue_init
	movl	8(%rbx), %edi
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, %r14d
	leaq	4(%rbx), %r13
	movq	%r13, %rsi
	callq	_v4l2_device_register
	movl	8(%rbx), %r15d
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	callq	_dev_err
	jmp	LBB0_13
LBB0_8:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_14
LBB0_11:
	movq	_sun4i_csi_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_dev_name
	xorl	%r12d, %r12d
	movl	%r15d, %edi
	movl	%r14d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	movq	%rbx, %r9
	callq	_devm_request_irq
	testl	%eax, %eax
	je	LBB0_15
## %bb.12:
	movl	%eax, %r15d
	movl	8(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	%r13, %rdi
	callq	_v4l2_device_unregister
	movl	%r15d, %r12d
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_vb2_queue_release
LBB0_14:
	movq	%rbx, %rdi
	callq	_mutex_destroy
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CSI_MAX_BUFFER,4,2             ## @CSI_MAX_BUFFER
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_VB2_MMAP,4,2                   ## @VB2_MMAP
	.comm	_sun4i_csi_qops,4,2             ## @sun4i_csi_qops
	.comm	_vb2_dma_contig_memops,4,2      ## @vb2_dma_contig_memops
	.comm	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,4,2 ## @V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to initialize VB2 queue\n"

L_.str.1:                               ## @.str.1
	.asciz	"Couldn't register the v4l2 device\n"

	.comm	_sun4i_csi_irq,4,2              ## @sun4i_csi_irq
L_.str.2:                               ## @.str.2
	.asciz	"Couldn't register our interrupt\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function sun4i_csi_dma_register
lCPI0_0:
	.long	3                               ; 0x3
	.long	4                               ; 0x4
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_sun4i_csi_dma_register
	.p2align	2
_sun4i_csi_dma_register:                ; @sun4i_csi_dma_register
	.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, x1
	mov	x19, x0
	add	x20, x0, #32
	add	x0, x0, #28
	bl	_spin_lock_init
	mov	x0, x19
	bl	_mutex_init
	add	x0, x19, #24
	bl	_INIT_LIST_HEAD
Lloh0:
	adrp	x8, _CSI_MAX_BUFFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSI_MAX_BUFFER@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x8, #0
	lsl	x9, x9, #3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19, #16]
	str	xzr, [x10, x8]
	add	x8, x8, #8
	cmp	x9, x8
	b.ne	LBB0_2
LBB0_3:
Lloh3:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _VB2_MMAP@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VB2_MMAP@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #80]
	stp	x19, x19, [x19, #64]
Lloh9:
	adrp	x8, lCPI0_0@PAGE
Lloh10:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #32]
Lloh11:
	adrp	x8, _sun4i_csi_qops@GOTPAGE
Lloh12:
	ldr	x8, [x8, _sun4i_csi_qops@GOTPAGEOFF]
Lloh13:
	adrp	x9, _vb2_dma_contig_memops@GOTPAGE
Lloh14:
	ldr	x9, [x9, _vb2_dma_contig_memops@GOTPAGEOFF]
	stp	x9, x8, [x19, #48]
Lloh15:
	adrp	x8, _V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	stp	w9, w8, [x19, #40]
	mov	x0, x20
	bl	_vb2_queue_init
	mov	x22, x0
	ldr	w0, [x19, #8]
	tbnz	w22, #31, LBB0_6
; %bb.4:
	add	x23, x19, #4
	mov	x1, x23
	bl	_v4l2_device_register
	ldr	w24, [x19, #8]
	cbz	w0, LBB0_7
; %bb.5:
	mov	x22, x0
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x24
	bl	_dev_err
	b	LBB0_9
LBB0_6:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_7:
Lloh22:
	adrp	x8, _sun4i_csi_irq@GOTPAGE
Lloh23:
	ldr	x8, [x8, _sun4i_csi_irq@GOTPAGEOFF]
Lloh24:
	ldr	w22, [x8]
	mov	x0, x24
	bl	_dev_name
	mov	x4, x0
	mov	x0, x24
	mov	x1, x21
	mov	x2, x22
	mov	w3, #0
	mov	x5, x19
	bl	_devm_request_irq
	mov	x22, x0
	cbz	w0, LBB0_11
; %bb.8:
	ldr	w0, [x19, #8]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	mov	x0, x23
	bl	_v4l2_device_unregister
LBB0_9:
	mov	x0, x20
	bl	_vb2_queue_release
LBB0_10:
	mov	x0, x19
	bl	_mutex_destroy
LBB0_11:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdrp	Lloh9, Lloh11
	.loh AdrpLdr	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_CSI_MAX_BUFFER,4,2             ; @CSI_MAX_BUFFER
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_VB2_MMAP,4,2                   ; @VB2_MMAP
	.comm	_sun4i_csi_qops,4,2             ; @sun4i_csi_qops
	.comm	_vb2_dma_contig_memops,4,2      ; @vb2_dma_contig_memops
	.comm	_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,4,2 ; @V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to initialize VB2 queue\n"

l_.str.1:                               ; @.str.1
	.asciz	"Couldn't register the v4l2 device\n"

	.comm	_sun4i_csi_irq,4,2              ; @sun4i_csi_irq
l_.str.2:                               ; @.str.2
	.asciz	"Couldn't register our interrupt\n"

.subsections_via_symbols
