	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hva_buf_prepare
_hva_buf_prepare:                       ## @hva_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	8(%rdi), %rdi
	callq	_vb2_get_drv_priv
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_ctx_to_dev
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_to_vb2_v4l2_buffer
	movq	%rax, %r15
	movq	8(%r13), %rax
	movq	(%rax), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_7
## %bb.1:
	movq	%r15, %rdi
	callq	_to_hva_frame
	movq	%rax, %r14
	movq	(%r15), %r8
	movq	_V4L2_FIELD_ANY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r8
	jne	LBB0_3
## %bb.2:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	%r8, (%r15)
LBB0_3:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r8
	jne	LBB0_6
## %bb.4:
	movq	%r12, %rbx
	xorl	%r12d, %r12d
	cmpl	$0, (%r14)
	jne	LBB0_10
## %bb.5:
	addq	$8, %r15
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movq	%rax, 16(%r14)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	%r14, %r9
	addq	$8, %r9
	movq	%rax, 8(%r14)
	movl	4(%rbx), %eax
	movl	%eax, 24(%r14)
	movl	$1, (%r14)
	movl	(%rbx), %edx
	movl	(%r13), %ecx
	movq	16(%r14), %r8
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_7:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_to_hva_stream
	xorl	%r12d, %r12d
	cmpl	$0, (%rax)
	jne	LBB0_10
## %bb.8:
	movq	%rax, %r14
	addq	$8, %r15
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movq	%rax, 16(%r14)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	%r14, %rbx
	addq	$8, %rbx
	movq	%rax, 8(%r14)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_size
	movl	%eax, 24(%r14)
	movl	$1, (%r14)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	(%r13), %ecx
	movq	16(%r14), %r8
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %r9
LBB0_9:
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_10
LBB0_6:
	movl	(%r12), %edx
	movl	(%r13), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_FIELD_ANY,8,3             ## @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_NONE,8,3            ## @V4L2_FIELD_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s frame[%d] prepare: %d field not supported\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"%s frame[%d] prepared; virt=%p, phy=%pad\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s stream[%d] prepared; virt=%p, phy=%pad\n"

	.no_dead_strip	_hva_buf_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hva_buf_prepare
_hva_buf_prepare:                       ; @hva_buf_prepare
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	ldr	x0, [x0, #8]
	bl	_vb2_get_drv_priv
	mov	x21, x0
	bl	_ctx_to_dev
	mov	x19, x0
	mov	x0, x20
	bl	_to_vb2_v4l2_buffer
	mov	x22, x0
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	bl	_to_hva_frame
	mov	x23, x0
	ldr	x4, [x22]
Lloh3:
	adrp	x8, _V4L2_FIELD_ANY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_FIELD_ANY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x8]
Lloh6:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
	cmp	x4, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	x4, [x8]
	str	x4, [x22]
LBB0_3:
	ldr	x8, [x8]
	cmp	x4, x8
	b.ne	LBB0_10
; %bb.4:
	ldr	w8, [x23]
	cbnz	w8, LBB0_9
; %bb.5:
	add	x22, x22, #8
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_plane_vaddr
	str	x0, [x23, #16]
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_dma_contig_plane_dma_addr
	mov	x8, x23
	str	x0, [x8, #8]!
	ldp	w2, w9, [x21]
	str	w9, [x23, #24]
	mov	w9, #1
	str	w9, [x23]
	ldr	w3, [x20]
	ldr	x4, [x23, #16]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	str	x8, [sp]
	b	LBB0_8
LBB0_6:
	bl	_to_hva_stream
	ldr	w8, [x0]
	cbnz	w8, LBB0_9
; %bb.7:
	mov	x23, x0
	add	x22, x22, #8
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_plane_vaddr
	str	x0, [x23, #16]
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_dma_contig_plane_dma_addr
	mov	x24, x23
	str	x0, [x24, #8]!
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_plane_size
	str	w0, [x23, #24]
	mov	w8, #1
	str	w8, [x23]
	ldr	w2, [x21]
	ldr	w3, [x20]
	ldr	x4, [x23, #16]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	str	x24, [sp]
LBB0_8:
	mov	x0, x19
	bl	_dev_dbg
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
	ldr	w2, [x21]
	ldr	w3, [x20]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_FIELD_ANY,8,3             ; @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_NONE,8,3            ; @V4L2_FIELD_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s frame[%d] prepare: %d field not supported\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"%s frame[%d] prepared; virt=%p, phy=%pad\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s stream[%d] prepared; virt=%p, phy=%pad\n"

	.no_dead_strip	_hva_buf_prepare
.subsections_via_symbols
