	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw686x_buf_done
_tw686x_buf_done:                       ## @tw686x_buf_done
	.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	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movl	%esi, %r12d
	movq	(%rax,%r12,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.1:
	movq	24(%r15), %r13
	movq	16(%r15), %rax
	movq	8(%rax), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rbx)
	movslq	4(%r15), %rcx
	leal	1(%rcx), %edx
	movl	%edx, 4(%r15)
	movq	%rcx, 8(%rbx)
	movq	(%rax), %rax
	movq	_TW686X_DMA_MODE_MEMCPY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movl	(%r13,%r12,8), %edx
	movl	4(%r13,%r12,8), %esi
	movl	%eax, %edi
	callq	_memcpy
LBB0_3:
	xorl	%eax, %eax
	callq	_ktime_get_ns
	movl	%eax, (%rbx)
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_vb2_buffer_done
LBB0_4:
	xorl	%eax, %eax
	testl	%r14d, %r14d
	sete	%al
	movl	%eax, (%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TW686X_DMA_MODE_MEMCPY,8,3     ## @TW686X_DMA_MODE_MEMCPY
	.comm	_VB2_BUF_STATE_DONE,4,2         ## @VB2_BUF_STATE_DONE
	.no_dead_strip	_tw686x_buf_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw686x_buf_done
_tw686x_buf_done:                       ; @tw686x_buf_done
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8, w1, uxtw #3]
	cbz	x21, LBB0_4
; %bb.1:
	ldp	x8, x22, [x19, #16]
	ldp	x8, x9, [x8]
	ldr	w9, [x9]
	str	w9, [x21, #16]
	ldrsw	x9, [x19, #4]
	add	w10, w9, #1
	str	w10, [x19, #4]
	str	x9, [x21, #8]
Lloh0:
	adrp	x9, _TW686X_DMA_MODE_MEMCPY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TW686X_DMA_MODE_MEMCPY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	mov	w23, w20
	mov	x0, x21
	mov	w1, #0
	bl	_vb2_plane_vaddr
	add	x8, x22, x23, lsl #3
	ldp	w2, w1, [x8]
	bl	_memcpy
LBB0_3:
	bl	_ktime_get_ns
	str	w0, [x21]
Lloh3:
	adrp	x8, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_vb2_buffer_done
LBB0_4:
	cmp	w20, #0
	cset	w8, eq
	str	w8, [x19]
	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	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_TW686X_DMA_MODE_MEMCPY,8,3     ; @TW686X_DMA_MODE_MEMCPY
	.comm	_VB2_BUF_STATE_DONE,4,2         ; @VB2_BUF_STATE_DONE
	.no_dead_strip	_tw686x_buf_done
.subsections_via_symbols
