	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpif_buffer_prepare
_vpif_buffer_prepare:                   ## @vpif_buffer_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	%rsi, %rbx
	movq	%rdi, %r15
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_VIDEOBUF_NEEDS_INIT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rax,2), %r13
	cmpq	(%rsi), %rcx
	jne	LBB0_2
## %bb.1:
	movq	%r13, %rax
	shlq	$4, %rax
	movl	(%r12,%rax), %ecx
	movl	%ecx, 8(%rbx)
	movl	4(%r12,%rax), %eax
	movl	%eax, 12(%rbx)
	imull	%ecx, %eax
	movl	%eax, 16(%rbx)
	movl	%edx, 20(%rbx)
LBB0_2:
	movq	_VIDEOBUF_PREPARED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	_V4L2_MEMORY_USERPTR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	shlq	$4, %r13
	cmpq	8(%r12,%r13), %rax
	jne	LBB0_7
## %bb.3:
	movl	32(%rbx), %edi
	testl	%edi, %edi
	je	LBB0_4
## %bb.5:
	callq	_vpif_uservirt_to_phys
	movq	%rax, 24(%rbx)
	movq	%rax, %rdi
	callq	_ISALIGNED
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	xorl	%r14d, %r14d
	cmpq	$0, 8(%r15)
	je	LBB0_14
## %bb.8:
	movq	_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%r15), %rax
	je	LBB0_14
## %bb.9:
	movq	24(%rbx), %rbx
	movq	16(%r12,%r13), %rdi
	addq	%rbx, %rdi
	callq	_ISALIGNED
	leaq	L_.str.1(%rip), %r15
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:
	movq	24(%r12,%r13), %rdi
	addq	%rbx, %rdi
	callq	_ISALIGNED
	testl	%eax, %eax
	je	LBB0_13
## %bb.11:
	movq	32(%r12,%r13), %rdi
	addq	%rbx, %rdi
	callq	_ISALIGNED
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	addq	40(%r12,%r13), %rbx
	movq	%rbx, %rdi
	callq	_ISALIGNED
	testl	%eax, %eax
	jne	LBB0_14
	jmp	LBB0_13
LBB0_4:
	leaq	L_.str(%rip), %r15
	jmp	LBB0_13
LBB0_6:
	leaq	L_.str.1(%rip), %r15
LBB0_13:
	movq	%r15, %rdi
	callq	_vpif_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ## @VPIF_VIDEO_INDEX
	.comm	_VIDEOBUF_NEEDS_INIT,8,3        ## @VIDEOBUF_NEEDS_INIT
	.comm	_VIDEOBUF_PREPARED,8,3          ## @VIDEOBUF_PREPARED
	.comm	_V4L2_MEMORY_USERPTR,8,3        ## @V4L2_MEMORY_USERPTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"buffer_address is 0\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,8,3 ## @V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
L_.str.1:                               ## @.str.1
	.asciz	"buffer offset not aligned to 8 bytes\n"

	.no_dead_strip	_vpif_buffer_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpif_buffer_prepare
_vpif_buffer_prepare:                   ; @vpif_buffer_prepare
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
	ldr	x21, [x8]
Lloh0:
	adrp	x8, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
Lloh3:
	adrp	x8, _VIDEOBUF_NEEDS_INIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDEOBUF_NEEDS_INIT@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x1]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #48
	madd	x8, x22, x8, x21
	ldp	w9, w8, [x8]
	stp	w9, w8, [x19, #8]
	mul	w8, w8, w9
	stp	w8, w2, [x19, #16]
LBB0_2:
Lloh6:
	adrp	x8, _VIDEOBUF_PREPARED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIDEOBUF_PREPARED@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _V4L2_MEMORY_USERPTR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _V4L2_MEMORY_USERPTR@GOTPAGEOFF]
	str	x8, [x19]
Lloh11:
	ldr	x8, [x9]
	mov	w9, #48
	madd	x9, x22, x9, x21
	ldr	x9, [x9, #8]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	ldr	w0, [x19, #32]
	cbz	w0, LBB0_13
; %bb.4:
	bl	_vpif_uservirt_to_phys
	str	x0, [x19, #24]
	bl	_ISALIGNED
	cbz	w0, LBB0_12
LBB0_5:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, _V4L2_BUF_TYPE_SLICED_VBI_OUTPUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V4L2_BUF_TYPE_SLICED_VBI_OUTPUT@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_8
LBB0_7:
	mov	w0, #0
	b	LBB0_15
LBB0_8:
	ldr	x19, [x19, #24]
	mov	w8, #48
	madd	x8, x22, x8, x21
	ldr	x8, [x8, #16]
	add	x0, x8, x19
	bl	_ISALIGNED
	cbz	w0, LBB0_12
; %bb.9:
	mov	w8, #48
	madd	x8, x22, x8, x21
	ldr	x8, [x8, #24]
	add	x0, x8, x19
	bl	_ISALIGNED
	cbz	w0, LBB0_12
; %bb.10:
	mov	w8, #48
	madd	x8, x22, x8, x21
	ldr	x8, [x8, #32]
	add	x0, x8, x19
	bl	_ISALIGNED
	cbz	w0, LBB0_12
; %bb.11:
	mov	w8, #48
	madd	x8, x22, x8, x21
	ldr	x8, [x8, #40]
	add	x0, x8, x19
	bl	_ISALIGNED
	cbnz	w0, LBB0_7
LBB0_12:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
LBB0_14:
	bl	_vpif_err
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ; @VPIF_VIDEO_INDEX
	.comm	_VIDEOBUF_NEEDS_INIT,8,3        ; @VIDEOBUF_NEEDS_INIT
	.comm	_VIDEOBUF_PREPARED,8,3          ; @VIDEOBUF_PREPARED
	.comm	_V4L2_MEMORY_USERPTR,8,3        ; @V4L2_MEMORY_USERPTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"buffer_address is 0\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT,8,3 ; @V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
l_.str.1:                               ; @.str.1
	.asciz	"buffer offset not aligned to 8 bytes\n"

	.no_dead_strip	_vpif_buffer_prepare
.subsections_via_symbols
