	.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	%rdi, %rbx
	callq	_to_vb2_v4l2_buffer
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rdi
	callq	_vb2_get_drv_priv
	movq	%rax, %r15
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	$2, %edi
	callq	_vpif_dbg
	movq	(%r15), %r13
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,4), %r14
	movl	36(%r13,%r14,8), %edx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_set_plane_payload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_get_plane_payload
	movq	%rax, %r12
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_size
	cmpq	%rax, %r12
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_7
LBB0_2:
	movl	32(%r13,%r14,8), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	%rax, %rbx
	movq	24(%r13,%r14,8), %rdi
	addq	%rax, %rdi
	movl	$8, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movq	16(%r13,%r14,8), %rdi
	addq	%rbx, %rdi
	movl	$8, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movq	8(%r13,%r14,8), %rdi
	addq	%rbx, %rdi
	movl	$8, %esi
	callq	_IS_ALIGNED
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	addq	(%r13,%r14,8), %rbx
	movq	%rbx, %rdi
	movl	$8, %esi
	callq	_IS_ALIGNED
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jne	LBB0_7
LBB0_6:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movl	$1, %edi
	callq	_vpif_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movl	%r12d, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vpif_buffer_prepare\n"

	.comm	_VPIF_VIDEO_INDEX,8,3           ## @VPIF_VIDEO_INDEX
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"offset is not aligned\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	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, x0
	bl	_to_vb2_v4l2_buffer
	mov	x20, x0
	ldr	x0, [x19]
	bl	_vb2_get_drv_priv
	mov	x21, x0
Lloh0:
	adrp	x22, _debug@GOTPAGE
Lloh1:
	ldr	x22, [x22, _debug@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	bl	_vpif_dbg
	ldr	x23, [x21]
Lloh4:
	adrp	x8, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
Lloh6:
	ldr	x24, [x8]
	mov	w8, #40
	madd	x8, x24, x8, x23
	ldr	w2, [x8, #36]
	mov	x0, x19
	mov	w1, #0
	bl	_vb2_set_plane_payload
	mov	x0, x19
	mov	w1, #0
	bl	_vb2_get_plane_payload
	mov	x21, x0
	mov	x0, x19
	mov	w1, #0
	bl	_vb2_plane_size
	cmp	x21, x0
	b.gt	LBB0_7
; %bb.1:
	mov	w8, #40
	madd	x21, x24, x8, x23
	ldr	w8, [x21, #32]
	str	w8, [x20]
	mov	x0, x19
	mov	w1, #0
	bl	_vb2_dma_contig_plane_dma_addr
	mov	x19, x0
	ldr	x8, [x21, #24]
	add	x0, x8, x0
	mov	w1, #8
	bl	_IS_ALIGNED
	cbz	w0, LBB0_6
; %bb.2:
	mov	w8, #40
	madd	x8, x24, x8, x23
	ldr	x8, [x8, #16]
	add	x0, x8, x19
	mov	w1, #8
	bl	_IS_ALIGNED
	cbz	w0, LBB0_6
; %bb.3:
	mov	w8, #40
	madd	x8, x24, x8, x23
	ldr	x8, [x8, #8]
	add	x0, x8, x19
	mov	w1, #8
	bl	_IS_ALIGNED
	cbz	w0, LBB0_6
; %bb.4:
	mov	w8, #40
	mul	x8, x24, x8
	ldr	x8, [x23, x8]
	add	x0, x8, x19
	mov	w1, #8
	bl	_IS_ALIGNED
	cbz	w0, LBB0_6
; %bb.5:
	mov	w0, #0
	b	LBB0_8
LBB0_6:
	ldr	w1, [x22]
Lloh7:
	adrp	x2, l_.str.1@PAGE
Lloh8:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_vpif_dbg
LBB0_7:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vpif_buffer_prepare\n"

	.comm	_VPIF_VIDEO_INDEX,8,3           ; @VPIF_VIDEO_INDEX
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"offset is not aligned\n"

	.no_dead_strip	_vpif_buffer_prepare
.subsections_via_symbols
