	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_jpeg_s_fmt_mplane
_mtk_jpeg_s_fmt_mplane:                 ## @mtk_jpeg_s_fmt_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	24(%rdi), %rbx
	movl	16(%rdi), %edi
	movl	(%rsi), %esi
	callq	_v4l2_m2m_get_vq
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r13
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_mtk_jpeg_get_q_data
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_vb2_is_busy
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_v4l2_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r15), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:
	movq	_MTK_JPEG_FMT_TYPE_CAPTURE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_MTK_JPEG_FMT_TYPE_OUTPUT@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %edx
	movl	40(%r15), %esi
	movq	%r12, %rdi
	callq	_mtk_jpeg_find_format
	movq	%rax, 16(%r14)
	movl	36(%r15), %r10d
	movl	%r10d, 28(%r14)
	movl	32(%r15), %r11d
	movl	%r11d, 24(%r14)
	movups	16(%r15), %xmm0
	movups	%xmm0, (%r12)
	movq	_debug@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r15), %r8d
	movl	(%rax), %ecx
	movzbl	%cl, %r9d
	movzbl	%ch, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%ecx, %eax
	shrl	$16, %eax
	movzbl	%al, %r12d
	shrl	$24, %ecx
	movq	%rcx, %r13
	subq	$8, %rsp
	leaq	L_.str.1(%rip), %rcx
	movl	$1, %edi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	pushq	%r11
	pushq	%r10
	pushq	%r13
	pushq	%r12
	pushq	-48(%rbp)                       ## 8-byte Folded Reload
	callq	_v4l2_dbg
	xorl	%eax, %eax
	addq	$48, %rsp
	movq	16(%r14), %rcx
	cmpl	$0, 4(%rcx)
	jle	LBB0_12
## %bb.9:
	xorl	%r12d, %r12d
	movq	%rbx, %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	4(%rax,%r12,8), %ecx
	movq	8(%r14), %rdx
	movl	%ecx, (%rdx,%r12,4)
	movl	(%rax,%r12,8), %ebx
	movq	(%r14), %rax
	movl	%ebx, (%rax,%r12,4)
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rdx,%r12,4), %r9d
	subq	$8, %rsp
	movl	$1, %edi
	movq	%r13, %rdx
	leaq	L_.str.2(%rip), %rcx
	movl	%r12d, %r8d
	xorl	%eax, %eax
	pushq	%rbx
	callq	_v4l2_dbg
	addq	$16, %rsp
	incq	%r12
	movq	16(%r14), %rax
	movslq	4(%rax), %rax
	cmpq	%rax, %r12
	jl	LBB0_10
## %bb.11:
	xorl	%eax, %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"queue busy\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MTK_JPEG_FMT_TYPE_OUTPUT,4,2   ## @MTK_JPEG_FMT_TYPE_OUTPUT
	.comm	_MTK_JPEG_FMT_TYPE_CAPTURE,4,2  ## @MTK_JPEG_FMT_TYPE_CAPTURE
	.comm	_debug,4,2                      ## @debug
L_.str.1:                               ## @.str.1
	.asciz	"(%d) s_fmt:%c%c%c%c wxh:%ux%u\n"

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

	.no_dead_strip	_mtk_jpeg_s_fmt_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_s_fmt_mplane
_mtk_jpeg_s_fmt_mplane:                 ; @mtk_jpeg_s_fmt_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	x20, x1
	mov	x22, x0
	ldr	x19, [x0, #24]
	ldr	w0, [x0, #16]
	ldr	w1, [x1]
	bl	_v4l2_m2m_get_vq
	cbz	x0, LBB0_3
; %bb.1:
	mov	x23, x0
	ldr	w1, [x20]
	mov	x0, x22
	bl	_mtk_jpeg_get_q_data
	mov	x21, x0
	mov	x0, x23
	bl	_vb2_is_busy
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_5:
	ldr	w0, [x20]
	bl	_V4L2_TYPE_IS_OUTPUT
Lloh6:
	adrp	x8, _MTK_JPEG_FMT_TYPE_OUTPUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTK_JPEG_FMT_TYPE_OUTPUT@GOTPAGEOFF]
Lloh8:
	adrp	x9, _MTK_JPEG_FMT_TYPE_CAPTURE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MTK_JPEG_FMT_TYPE_CAPTURE@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w2, [x8]
	ldr	w1, [x20, #40]
	mov	x0, x22
	bl	_mtk_jpeg_find_format
	str	x0, [x21, #16]
	ldp	w9, w8, [x20, #32]
	stp	w9, w8, [x21, #24]
	ldr	q0, [x20, #16]
	str	q0, [x22]
Lloh10:
	adrp	x24, _debug@GOTPAGE
Lloh11:
	ldr	x24, [x24, _debug@GOTPAGEOFF]
	ldr	w1, [x24]
	ldr	w10, [x0]
	ubfx	w6, w10, #8, #8
	ldr	w4, [x20]
	and	w5, w10, #0xff
	ubfx	w11, w10, #16, #8
	lsr	w10, w10, #24
	stp	x8, x9, [sp, #16]
	stp	x11, x10, [sp]
Lloh12:
	adrp	x3, l_.str.1@PAGE
Lloh13:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	ldr	x8, [x21, #16]
	ldr	w8, [x8, #4]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x25, #0
	mov	x22, #0
Lloh14:
	adrp	x23, l_.str.2@PAGE
Lloh15:
	add	x23, x23, l_.str.2@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x8, x8, x25
	ldr	w9, [x8, #4]
	lsl	x10, x22, #2
	ldp	x12, x11, [x21]
	str	w9, [x11, x10]
	ldr	w6, [x8]
	str	w6, [x12, x10]
	ldr	w1, [x24]
	ldr	w5, [x11, x10]
	mov	w0, #1
	mov	x2, x19
	mov	x3, x23
	mov	x4, x22
	bl	_v4l2_dbg
	add	x22, x22, #1
	ldr	x8, [x21, #16]
	ldrsw	x8, [x8, #4]
	add	x25, x25, #8
	cmp	x22, x8
	b.lt	LBB0_7
LBB0_8:
	mov	w0, #0
LBB0_9:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"queue busy\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MTK_JPEG_FMT_TYPE_OUTPUT,4,2   ; @MTK_JPEG_FMT_TYPE_OUTPUT
	.comm	_MTK_JPEG_FMT_TYPE_CAPTURE,4,2  ; @MTK_JPEG_FMT_TYPE_CAPTURE
	.comm	_debug,4,2                      ; @debug
l_.str.1:                               ; @.str.1
	.asciz	"(%d) s_fmt:%c%c%c%c wxh:%ux%u\n"

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

	.no_dead_strip	_mtk_jpeg_s_fmt_mplane
.subsections_via_symbols
