	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx8802_buf_prepare             ## -- Begin function cx8802_buf_prepare
	.p2align	4, 0x90
_cx8802_buf_prepare:                    ## @cx8802_buf_prepare
	.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	%rdx, %r14
	movq	%rsi, %r12
	movl	4(%rsi), %ebx
	imull	(%rsi), %ebx
	xorl	%r15d, %r15d
	movq	%rdx, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_sg_plane_desc
	movq	%rax, %r13
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_size
	cmpl	%ebx, %eax
	jge	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_2:
	leaq	8(%r14), %rax
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	movq	%rax, %rbx
	callq	_vb2_set_plane_payload
	movl	8(%r12), %edi
	movl	(%r13), %edx
	movl	(%r12), %ecx
	movl	4(%r12), %r8d
	movq	%rbx, %rsi
	xorl	%r9d, %r9d
	callq	_cx88_risc_databuffer
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movl	%eax, %r13d
	movq	16(%r14), %rdx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.4:
	movl	8(%r12), %edi
	movl	8(%r14), %ecx
	movl	24(%r14), %esi
	callq	_pci_free_consistent
LBB0_5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	%r13d, %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx8802_buf_prepare             ; -- Begin function cx8802_buf_prepare
	.p2align	2
_cx8802_buf_prepare:                    ; @cx8802_buf_prepare
	.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	x19, x2
	mov	x20, x1
	ldp	w8, w9, [x1]
	mul	w22, w9, w8
	mov	x0, x2
	mov	w1, #0
	bl	_vb2_dma_sg_plane_desc
	mov	x23, x0
	mov	x0, x19
	mov	w1, #0
	bl	_vb2_plane_size
	cmp	w0, w22
	b.ge	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_6
LBB0_2:
	add	x21, x19, #8
	mov	x0, x19
	mov	w1, #0
	mov	x2, x22
	bl	_vb2_set_plane_payload
	ldp	w4, w0, [x20, #4]
	ldr	w2, [x23]
	ldr	w3, [x20]
	mov	x1, x21
	mov	w5, #0
	bl	_cx88_risc_databuffer
	mov	x22, x0
	cbz	w0, LBB0_6
; %bb.3:
	ldr	x2, [x19, #16]
	cbz	x2, LBB0_5
; %bb.4:
	ldr	w0, [x20, #8]
	ldr	w1, [x19, #24]
	ldr	w3, [x19, #8]
	bl	_pci_free_consistent
LBB0_5:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #24
	bl	_memset
LBB0_6:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
