	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_drif_dma_complete
_rcar_drif_dma_complete:                ## @rcar_drif_dma_complete
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %r12
	movq	_RCAR_DRIF_MAX_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	24(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	leaq	28(%r12), %rdi
	callq	_vb2_is_streaming
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	(%r12), %rax
	movq	_RCAR_DRIF_NUM_HWBUFS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_4
## %bb.5:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %r13
	jmp	LBB0_6
LBB0_1:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_30
## %bb.2:
	movq	%rbx, %rdi
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %r13d
LBB0_6:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_rcar_drif_channel_complete
	movl	8(%r12), %eax
	movq	_RCAR_DRIF_MAX_CHANNEL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_17
## %bb.7:
	movq	(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.10:
	movq	%r12, %rdi
	movq	%r13, %rdx
	callq	_to_rcar_drif_buf_pair
	cmpq	$0, (%r15)
	movq	%rax, (%r14)
	je	LBB0_9
## %bb.11:
	shlq	$3, %r13
	addq	8(%r15), %r13
	jmp	LBB0_12
LBB0_17:
	movq	8(%r15), %rcx
	leaq	(%rcx,%r13,8), %rax
	movq	%rax, (%r14)
	movl	(%rcx,%r13,8), %ecx
	movq	_RCAR_DRIF_BUF_OVERFLOW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%ecx, %edx
	je	LBB0_15
## %bb.18:
	notl	%edx
	andl	%edx, %ecx
	movl	%ecx, (%rax)
	jmp	LBB0_19
LBB0_8:
	leaq	(,%r13,8), %rax
	addq	8(%r15), %rax
	movq	%rax, (%r14)
LBB0_9:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r13, %rdx
	callq	_to_rcar_drif_buf_pair
	movq	%rax, %r13
LBB0_12:
	movq	%r13, 8(%r14)
	movq	%r14, %rdi
	callq	_rcar_drif_bufs_done
	testl	%eax, %eax
	je	LBB0_13
## %bb.14:
	movq	_RCAR_DRIF_BUF_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rcar_drif_bufs_clear
	movq	%r14, %rdi
	callq	_rcar_drif_bufs_overflow
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	movq	_RCAR_DRIF_BUF_OVERFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rcar_drif_bufs_clear
LBB0_19:
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_20
LBB0_15:
	movb	$1, %al
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
LBB0_20:
	movq	(%r12), %r13
	leaq	1(%r13), %rax
	movq	%rax, (%r12)
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rcx
	callq	_rdrif_dbg
	movq	%r12, %rdi
	callq	_rcar_drif_get_fbuf
	testq	%rax, %rax
	je	LBB0_28
## %bb.21:
	movq	%rax, %r15
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_RCAR_DRIF_MAX_CHANNEL@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_24
## %bb.22:
	leaq	8(%r15), %rbx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movl	12(%r12), %edx
	movl	%r13d, %edi
	imull	%edx, %edi
	addq	%rax, %rdi
	movq	(%r14,%r13,8), %rax
	movl	4(%rax), %esi
	callq	_memcpy
	incq	%r13
	movq	_RCAR_DRIF_MAX_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %r13
	jb	LBB0_23
LBB0_24:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, 12(%rbx)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%rbx)
	xorl	%eax, %eax
	callq	_ktime_get_ns
	addq	$8, %r15
	movl	%eax, 8(%rbx)
	movq	16(%r12), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vb2_set_plane_payload
	cmpb	$0, -52(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_25
## %bb.26:
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_25:
	movq	_VB2_BUF_STATE_ERROR@GOTPCREL(%rip), %rax
LBB0_27:
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vb2_buffer_done
	jmp	LBB0_28
LBB0_13:
	movq	%rbx, %rdi
	callq	_spin_unlock
LBB0_28:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_30
## %bb.29:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RCAR_DRIF_MAX_CHANNEL,4,2      ## @RCAR_DRIF_MAX_CHANNEL
	.comm	_RCAR_DRIF_NUM_HWBUFS,8,3       ## @RCAR_DRIF_NUM_HWBUFS
	.comm	_RCAR_DRIF_BUF_DONE,4,2         ## @RCAR_DRIF_BUF_DONE
	.comm	_RCAR_DRIF_BUF_OVERFLOW,4,2     ## @RCAR_DRIF_BUF_OVERFLOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ch%u: prod %u\n"

	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_VB2_BUF_STATE_ERROR,4,2        ## @VB2_BUF_STATE_ERROR
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.no_dead_strip	_rcar_drif_dma_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_drif_dma_complete
_rcar_drif_dma_complete:                ; @rcar_drif_dma_complete
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x19, [x0, #16]
Lloh3:
	adrp	x24, _RCAR_DRIF_MAX_CHANNEL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _RCAR_DRIF_MAX_CHANNEL@GOTPAGEOFF]
	ldr	w8, [x24]
	lsl	x8, x8, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
	add	x22, x19, #24
	mov	x0, x22
	bl	_spin_lock
	add	x0, x19, #28
	bl	_vb2_is_streaming
	cbz	w0, LBB0_5
; %bb.1:
	ldr	x8, [x19]
Lloh7:
	adrp	x9, _RCAR_DRIF_NUM_HWBUFS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _RCAR_DRIF_NUM_HWBUFS@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	udiv	x10, x8, x9
	msub	x23, x10, x9, x8
	mov	x0, x21
	mov	x1, x23
	bl	_rcar_drif_channel_complete
	ldr	w8, [x19, #8]
	ldr	w9, [x24]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.2:
	ldr	x1, [x21]
	cbz	x1, LBB0_9
; %bb.3:
	mov	x0, x19
	mov	x2, x23
	bl	_to_rcar_drif_buf_pair
	ldr	x8, [x21]
	str	x0, [x20]
	cbz	x8, LBB0_10
; %bb.4:
	ldr	x8, [x21, #8]
	add	x0, x8, x23, lsl #3
	b	LBB0_11
LBB0_5:
	ldur	x8, [x29, #-72]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.6:
	mov	x0, x22
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_spin_unlock
LBB0_7:
	ldr	x8, [x21, #8]
	add	x8, x8, x23, lsl #3
	str	x8, [x20]
	ldr	w9, [x8]
Lloh13:
	adrp	x10, _RCAR_DRIF_BUF_OVERFLOW@GOTPAGE
Lloh14:
	ldr	x10, [x10, _RCAR_DRIF_BUF_OVERFLOW@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_14
; %bb.8:
	mov	w25, #0
	bic	w9, w9, w10
	str	w9, [x8]
	b	LBB0_15
LBB0_9:
	ldr	x8, [x21, #8]
	add	x8, x8, x23, lsl #3
	str	x8, [x20]
LBB0_10:
	mov	x0, x19
	mov	x1, #0
	mov	x2, x23
	bl	_to_rcar_drif_buf_pair
LBB0_11:
	str	x0, [x20, #8]
	mov	x0, x20
	bl	_rcar_drif_bufs_done
	cbz	w0, LBB0_20
; %bb.12:
Lloh16:
	adrp	x8, _RCAR_DRIF_BUF_DONE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RCAR_DRIF_BUF_DONE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rcar_drif_bufs_clear
	mov	x0, x20
	bl	_rcar_drif_bufs_overflow
	cbz	x0, LBB0_14
; %bb.13:
Lloh19:
	adrp	x8, _RCAR_DRIF_BUF_OVERFLOW@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RCAR_DRIF_BUF_OVERFLOW@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rcar_drif_bufs_clear
	mov	w25, #0
	b	LBB0_15
LBB0_14:
	mov	w25, #1
LBB0_15:
	ldr	x23, [x19]
	add	x8, x23, #1
	str	x8, [x19]
	mov	x0, x22
	bl	_spin_unlock
	ldr	x2, [x21]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x23
	bl	_rdrif_dbg
	mov	x0, x19
	bl	_rcar_drif_get_fbuf
	cbz	x0, LBB0_21
; %bb.16:
	mov	x21, x0
	ldr	w8, [x24]
	cbz	w8, LBB0_19
; %bb.17:
	mov	x26, #0
	add	x22, x21, #8
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_plane_vaddr
	ldr	w2, [x19, #12]
	mul	w8, w2, w26
	add	x0, x0, x8
	ldr	x8, [x20, x26, lsl #3]
	ldr	w1, [x8, #4]
	bl	_memcpy
	add	x26, x26, #1
	ldr	w8, [x24]
	cmp	x26, x8
	b.lo	LBB0_18
LBB0_19:
Lloh24:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x21, #12]
	str	x23, [x21]
	bl	_ktime_get_ns
	str	w0, [x21, #8]!
	ldr	x8, [x19, #16]
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_vb2_set_plane_payload
Lloh27:
	adrp	x8, _VB2_BUF_STATE_ERROR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _VB2_BUF_STATE_ERROR@GOTPAGEOFF]
Lloh29:
	adrp	x9, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
	cmp	w25, #0
	csel	x8, x9, x8, ne
	ldr	w1, [x8]
	mov	x0, x21
	bl	_vb2_buffer_done
	b	LBB0_21
LBB0_20:
	mov	x0, x22
	bl	_spin_unlock
LBB0_21:
	ldur	x8, [x29, #-72]
Lloh31:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh32:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.22:
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_23:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_RCAR_DRIF_MAX_CHANNEL,4,2      ; @RCAR_DRIF_MAX_CHANNEL
	.comm	_RCAR_DRIF_NUM_HWBUFS,8,3       ; @RCAR_DRIF_NUM_HWBUFS
	.comm	_RCAR_DRIF_BUF_DONE,4,2         ; @RCAR_DRIF_BUF_DONE
	.comm	_RCAR_DRIF_BUF_OVERFLOW,4,2     ; @RCAR_DRIF_BUF_OVERFLOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ch%u: prod %u\n"

	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_VB2_BUF_STATE_ERROR,4,2        ; @VB2_BUF_STATE_ERROR
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.no_dead_strip	_rcar_drif_dma_complete
.subsections_via_symbols
