	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_jpeg_g_fmt_vid_mplane
_mtk_jpeg_g_fmt_vid_mplane:             ## @mtk_jpeg_g_fmt_vid_mplane
	.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	%rdx, %rbx
	movq	%rsi, %rdi
	callq	_mtk_jpeg_fh_to_ctx
	movq	%rax, %r13
	movq	24(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	16(%r13), %edi
	movl	(%rbx), %esi
	callq	_v4l2_m2m_get_vq
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_mtk_jpeg_get_q_data
	movq	%rax, %r14
	movl	52(%rbx), %edi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	16(%r14), %rax
	movl	(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movl	4(%rax), %eax
	movl	%eax, 12(%rbx)
	movl	12(%r13), %eax
	movl	%eax, 44(%rbx)
	movl	8(%r13), %eax
	movl	%eax, 40(%rbx)
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	24(%r14), %r10
	movq	%r10, %xmm0
	movq	(%r13), %xmm1                   ## xmm1 = mem[0],zero
	punpcklqdq	%xmm1, %xmm0            ## xmm0 = xmm0[0],xmm1[0]
	movdqu	%xmm0, 24(%rbx)
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %r8d
	movzbl	%cl, %r9d
	movzbl	%ch, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, %r12
	movl	%r12d, %eax
	shrl	$16, %eax
	movzbl	%al, %r11d
	shrl	$24, %r12d
	movq	%r10, %r14
	shrq	$32, %r14
	subq	$8, %rsp
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	pushq	%r10
	pushq	%r14
	pushq	%r12
	pushq	%r11
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	callq	_v4l2_dbg
	addq	$48, %rsp
	cmpl	$0, 12(%rbx)
	jle	LBB0_6
## %bb.3:
	xorl	%r14d, %r14d
	movq	%rbx, %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %r13
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	movl	(%rax,%r15,4), %eax
	movl	%eax, 4(%r13,%r14)
	movq	(%rcx), %rax
	movl	(%rax,%r15,4), %eax
	movl	%eax, (%r13,%r14)
	movl	8(%r13,%r14), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13,%r14), %ebx
	movl	4(%r13,%r14), %r9d
	subq	$8, %rsp
	movl	$1, %edi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rcx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	pushq	%rbx
	callq	_v4l2_dbg
	addq	$16, %rsp
	incq	%r15
	movslq	12(%r12), %rax
	addq	$12, %r14
	cmpq	%rax, %r15
	jl	LBB0_4
## %bb.5:
	xorl	%r15d, %r15d
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d) g_fmt:%c%c%c%c wxh:%ux%u\n"

L_.str.1:                               ## @.str.1
	.asciz	"plane[%d] bpl=%u, size=%u\n"

	.no_dead_strip	_mtk_jpeg_g_fmt_vid_mplane
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_jpeg_g_fmt_vid_mplane
_mtk_jpeg_g_fmt_vid_mplane:             ; @mtk_jpeg_g_fmt_vid_mplane
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x0, x1
	bl	_mtk_jpeg_fh_to_ctx
	mov	x22, x0
	ldr	x20, [x0, #24]
	ldr	w0, [x0, #16]
	ldr	w1, [x19]
	bl	_v4l2_m2m_get_vq
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w1, [x19]
	mov	x0, x22
	bl	_mtk_jpeg_get_q_data
	mov	x21, x0
	ldr	w0, [x19, #52]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldp	w9, w8, [x21, #24]
	stp	w9, w8, [x19, #24]
Lloh0:
	adrp	x10, _V4L2_FIELD_NONE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	str	w10, [x19, #48]
	ldr	x10, [x21, #16]
	ldr	d0, [x10]
	str	d0, [x19, #8]
	ldr	q1, [x22]
	str	q1, [x19, #32]
Lloh3:
	adrp	x24, _debug@GOTPAGE
Lloh4:
	ldr	x24, [x24, _debug@GOTPAGEOFF]
	ldr	w1, [x24]
	fmov	w10, s0
	ubfx	w6, w10, #8, #8
	ldr	w4, [x19]
	and	w5, w10, #0xff
	ubfx	w11, w10, #16, #8
	lsr	w10, w10, #24
	stp	x8, x9, [sp, #16]
	stp	x11, x10, [sp]
Lloh5:
	adrp	x3, l_.str@PAGE
Lloh6:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_v4l2_dbg
	ldr	w8, [x19, #12]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x25, #0
	mov	x22, #0
Lloh7:
	adrp	x23, l_.str.1@PAGE
Lloh8:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	lsl	x9, x22, #2
	ldp	x11, x10, [x21]
	ldr	w10, [x10, x9]
	add	x26, x8, x25
	str	w10, [x26, #4]
	ldr	w8, [x11, x9]
	str	w8, [x26]
	ldr	w0, [x26, #8]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w1, [x24]
	ldp	w6, w5, [x26]
	mov	w0, #1
	mov	x2, x20
	mov	x3, x23
	mov	x4, x22
	bl	_v4l2_dbg
	add	x22, x22, #1
	ldrsw	x8, [x19, #12]
	add	x25, x25, #12
	cmp	x22, x8
	b.lt	LBB0_3
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d) g_fmt:%c%c%c%c wxh:%ux%u\n"

l_.str.1:                               ; @.str.1
	.asciz	"plane[%d] bpl=%u, size=%u\n"

	.no_dead_strip	_mtk_jpeg_g_fmt_vid_mplane
.subsections_via_symbols
