	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpe_buf_prepare
_vpe_buf_prepare:                       ## @vpe_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	%rdi, %r14
	callq	_to_vb2_v4l2_buffer
	movq	%rax, %rbx
	movq	(%r14), %rdi
	callq	_vb2_get_drv_priv
	movq	%rax, %r15
	movl	(%rax), %edi
	movq	(%r14), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_vpe_dbg
	movq	(%r14), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_get_q_data
	movq	%rax, %r13
	movl	(%rax), %r12d
	movq	(%r14), %rax
	movl	(%rax), %eax
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.1:
	movq	_Q_IS_INTERLACED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	je	LBB0_2
## %bb.5:
	movq	(%rbx), %rax
	movq	_V4L2_FIELD_TOP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.6:
	movq	_V4L2_FIELD_BOTTOM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.7:
	movq	_V4L2_FIELD_SEQ_TB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
LBB0_3:
	testl	%r12d, %r12d
	jle	LBB0_4
LBB0_9:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vb2_plane_size
	movq	8(%r13), %rcx
	cmpq	(%rcx,%rbx,8), %rax
	jl	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_10
## %bb.13:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax,%rbx,8), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vb2_set_plane_payload
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_14
	jmp	LBB0_15
LBB0_11:
	movl	(%r15), %r15d
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_vb2_plane_size
	movq	8(%r13), %rcx
	movq	(%rcx,%rbx,8), %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edi
	movq	%rax, %rdx
	callq	_vpe_err
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_15
LBB0_2:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	testl	%r12d, %r12d
	jg	LBB0_9
LBB0_4:
	xorl	%r15d, %r15d
LBB0_15:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"type: %d\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_Q_IS_INTERLACED,4,2            ## @Q_IS_INTERLACED
	.comm	_V4L2_FIELD_NONE,8,3            ## @V4L2_FIELD_NONE
	.comm	_V4L2_FIELD_TOP,8,3             ## @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,8,3          ## @V4L2_FIELD_BOTTOM
	.comm	_V4L2_FIELD_SEQ_TB,8,3          ## @V4L2_FIELD_SEQ_TB
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"data will not fit into plane (%lu < %lu)\n"

	.no_dead_strip	_vpe_buf_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpe_buf_prepare
_vpe_buf_prepare:                       ; @vpe_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, x0
	bl	_to_vb2_v4l2_buffer
	mov	x22, x0
	ldr	x0, [x19]
	bl	_vb2_get_drv_priv
	mov	x21, x0
	ldr	w0, [x0]
	ldr	x8, [x19]
	ldr	w2, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_vpe_dbg
	ldr	x8, [x19]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_get_q_data
	mov	x20, x0
	ldr	w23, [x0]
	ldr	x8, [x19]
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.1:
	ldr	w8, [x20, #4]
Lloh5:
	adrp	x9, _Q_IS_INTERLACED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _Q_IS_INTERLACED@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.2:
	ldr	x8, [x22]
Lloh8:
	adrp	x9, _V4L2_FIELD_TOP@GOTPAGE
Lloh9:
	ldr	x9, [x9, _V4L2_FIELD_TOP@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.3:
Lloh11:
	adrp	x9, _V4L2_FIELD_BOTTOM@GOTPAGE
Lloh12:
	ldr	x9, [x9, _V4L2_FIELD_BOTTOM@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.4:
Lloh14:
	adrp	x9, _V4L2_FIELD_SEQ_TB@GOTPAGE
Lloh15:
	ldr	x9, [x9, _V4L2_FIELD_SEQ_TB@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
LBB0_5:
	cmp	w23, #1
	b.lt	LBB0_14
LBB0_6:
	mov	x22, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_vb2_plane_size
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x22, lsl #3]
	cmp	x0, x8
	b.lt	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, #1
	cmp	x23, x22
	b.ne	LBB0_7
; %bb.9:
	mov	x21, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x2, [x8, x21, lsl #3]
	mov	x0, x19
	mov	x1, x21
	bl	_vb2_set_plane_payload
	add	x21, x21, #1
	cmp	x23, x21
	b.ne	LBB0_10
	b	LBB0_14
LBB0_11:
	ldr	w21, [x21]
	mov	x0, x19
	mov	x1, x22
	bl	_vb2_plane_size
	mov	x2, x0
	ldr	x8, [x20, #8]
	ldr	x3, [x8, x22, lsl #3]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_vpe_err
LBB0_12:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_13:
Lloh22:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	str	x8, [x22]
	cmp	w23, #1
	b.ge	LBB0_6
LBB0_14:
	mov	w0, #0
LBB0_15:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"type: %d\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
	.comm	_Q_IS_INTERLACED,4,2            ; @Q_IS_INTERLACED
	.comm	_V4L2_FIELD_NONE,8,3            ; @V4L2_FIELD_NONE
	.comm	_V4L2_FIELD_TOP,8,3             ; @V4L2_FIELD_TOP
	.comm	_V4L2_FIELD_BOTTOM,8,3          ; @V4L2_FIELD_BOTTOM
	.comm	_V4L2_FIELD_SEQ_TB,8,3          ; @V4L2_FIELD_SEQ_TB
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"data will not fit into plane (%lu < %lu)\n"

	.no_dead_strip	_vpe_buf_prepare
.subsections_via_symbols
