	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_buf_init
_s5p_mfc_buf_init:                      ## @s5p_mfc_buf_init
	.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, %r13
	callq	_to_vb2_v4l2_buffer
	movq	%rax, %r15
	movq	8(%r13), %rbx
	movl	8(%rbx), %edi
	callq	_fh_to_ctx
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.1:
	movq	(%r14), %rax
	movq	_QUEUE_BUFS_MMAPED@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	cmpq	(%rcx), %rax
	je	LBB0_21
## %bb.2:
	movq	64(%r14), %rax
	cmpl	$0, (%rax)
	je	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	%rax, %rdi
	callq	_ERR_PTR
	movl	%eax, %edi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	movq	64(%r14), %rax
	cmpl	(%rax), %ebx
	jb	LBB0_5
LBB0_7:
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_size
	cmpq	8(%r14), %rax
	jl	LBB0_9
## %bb.8:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_vb2_plane_size
	cmpq	16(%r14), %rax
	jge	LBB0_11
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_10
LBB0_12:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.13:
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	%rax, %rdi
	callq	_ERR_PTR
	movl	%eax, %edi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
LBB0_10:
	callq	_mfc_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_18:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_19
LBB0_15:
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_size
	cmpq	24(%r14), %rax
	jge	LBB0_17
## %bb.16:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_19
LBB0_6:
	leaq	L_.str(%rip), %rdi
LBB0_19:
	callq	_mfc_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_20:
	subl	(%rax), %r12d
LBB0_21:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	(%r13), %eax
	movq	56(%r14), %rcx
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %rbx
	movq	%r15, 16(%rcx,%rbx)
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	56(%r14), %rcx
	movq	%rax, 8(%rcx,%rbx)
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	56(%r14), %rcx
	movq	%rax, (%rcx,%rbx)
	incl	48(%r14)
	jmp	LBB0_21
LBB0_17:
	movl	(%r13), %ebx
	movq	40(%r14), %rax
	shlq	$4, %rbx
	movq	%r15, 8(%rax,%rbx)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_vb2_dma_contig_plane_dma_addr
	movq	40(%r14), %rcx
	movq	%rax, (%rcx,%rbx)
	incl	32(%r14)
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_QUEUE_BUFS_MMAPED,8,3          ## @QUEUE_BUFS_MMAPED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Plane mem not allocated\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Plane buffer (CAPTURE) is too small\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,8,3 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
L_.str.2:                               ## @.str.2
	.asciz	"Plane memory not allocated\n"

L_.str.3:                               ## @.str.3
	.asciz	"Plane buffer (OUTPUT) is too small\n"

L_.str.4:                               ## @.str.4
	.asciz	"s5p_mfc_buf_init: unknown queue type\n"

	.no_dead_strip	_s5p_mfc_buf_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_mfc_buf_init
_s5p_mfc_buf_init:                      ; @s5p_mfc_buf_init
	.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	x20, x0
	bl	_to_vb2_v4l2_buffer
	mov	x21, x0
	ldr	x22, [x20, #8]
	ldr	w0, [x22, #8]
	bl	_fh_to_ctx
	mov	x19, x0
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _QUEUE_BUFS_MMAPED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _QUEUE_BUFS_MMAPED@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.2:
	mov	w0, #0
	b	LBB0_18
LBB0_3:
Lloh6:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.4:
	mov	x0, x20
	mov	w1, #0
	bl	_vb2_dma_contig_plane_dma_addr
	bl	_ERR_PTR
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_14
; %bb.5:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_6:
	ldr	x8, [x19, #64]
	ldr	w8, [x8]
	cbz	w8, LBB0_10
; %bb.7:
	mov	w22, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_vb2_dma_contig_plane_dma_addr
	bl	_ERR_PTR
	bl	_IS_ERR_OR_NULL
	cbnz	x0, LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w22, w22, #1
	ldr	x8, [x19, #64]
	ldr	w8, [x8]
	cmp	w22, w8
	b.lo	LBB0_8
LBB0_10:
	mov	x0, x20
	mov	w1, #0
	bl	_vb2_plane_size
	ldr	x8, [x19, #8]
	cmp	x0, x8
	b.lt	LBB0_12
; %bb.11:
	mov	x0, x20
	mov	w1, #1
	bl	_vb2_plane_size
	ldr	x8, [x19, #16]
	cmp	x0, x8
	b.ge	LBB0_19
LBB0_12:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_13:
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_14:
	mov	x0, x20
	mov	w1, #0
	bl	_vb2_plane_size
	ldr	x8, [x19, #24]
	cmp	x0, x8
	b.ge	LBB0_20
; %bb.15:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
LBB0_17:
	bl	_mfc_err
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_18:
	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
LBB0_19:
	ldr	w8, [x20]
	ldr	x9, [x19, #56]
	add	x8, x8, x8, lsl #1
	lsl	x22, x8, #3
	add	x8, x9, x22
	str	x21, [x8, #16]
	mov	x0, x20
	mov	w1, #0
	bl	_vb2_dma_contig_plane_dma_addr
	ldr	x8, [x19, #56]
	add	x8, x8, x22
	str	x0, [x8, #8]
	mov	x0, x20
	mov	w1, #1
	bl	_vb2_dma_contig_plane_dma_addr
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19, #56]
	str	x8, [x9, x22]
	ldr	w8, [x19, #48]
	add	w8, w8, #1
	str	w8, [x19, #48]
	b	LBB0_18
LBB0_20:
	ldr	w8, [x20]
	ldr	x9, [x19, #40]
	lsl	x22, x8, #4
	add	x8, x9, x22
	str	x21, [x8, #8]
	mov	x0, x20
	mov	w1, #0
	bl	_vb2_dma_contig_plane_dma_addr
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19, #40]
	str	x8, [x9, x22]
	ldr	w8, [x19, #32]
	add	w8, w8, #1
	str	w8, [x19, #32]
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
	.comm	_QUEUE_BUFS_MMAPED,8,3          ; @QUEUE_BUFS_MMAPED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Plane mem not allocated\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Plane buffer (CAPTURE) is too small\n"

	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,8,3 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
l_.str.2:                               ; @.str.2
	.asciz	"Plane memory not allocated\n"

l_.str.3:                               ; @.str.3
	.asciz	"Plane buffer (OUTPUT) is too small\n"

l_.str.4:                               ; @.str.4
	.asciz	"s5p_mfc_buf_init: unknown queue type\n"

	.no_dead_strip	_s5p_mfc_buf_init
.subsections_via_symbols
