	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_mdp_try_fmt_mplane
_mtk_mdp_try_fmt_mplane:                ## @mtk_mdp_try_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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %rax
	movq	8(%rax), %r14
	movl	(%rsi), %esi
	movl	52(%rbx), %edi
	callq	_mtk_mdp_find_fmt
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movl	(%rbx), %esi
	xorl	%edi, %edi
	callq	_mtk_mdp_find_fmt_by_index
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movl	32(%r15), %eax
	movl	%eax, 52(%rbx)
	movl	(%rbx), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movups	4(%rax), %xmm0
	movups	%xmm0, 36(%rbx)
LBB0_5:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	32(%rbx), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	16(%r14), %rax
	movl	(%rax), %ecx
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movl	4(%rax), %ebx
	movq	24(%r15), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rcx
	addq	$4, %rcx
	jmp	LBB0_8
LBB0_6:
	movq	8(%r14), %rax
	leaq	4(%rax), %rcx
LBB0_8:
	movl	(%rax), %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	(%rcx), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	movq	(%r14), %rax
	movl	(%rax,%rcx,8), %edx
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	4(%rax,%rcx,8), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	leaq	8(%r13), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	(%r13), %ecx
	movl	8(%r13), %r8d
	leaq	12(%r13), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	12(%r13), %r9d
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	pushq	%rbx
	movq	-112(%rbp), %r12                ## 8-byte Reload
	pushq	%r12
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	movq	-104(%rbp), %r14                ## 8-byte Reload
	pushq	%r14
	callq	_mtk_mdp_dbg
	addq	$32, %rsp
	movq	%rbx, %rax
	movl	8(%r13), %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	12(%r13), %ebx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movl	%r14d, %ecx
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	%rax
	callq	_mtk_mdp_bound_align_image
	movl	%ebx, %r8d
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	addq	$16, %rsp
	movl	8(%r13), %r9d
	movl	12(%r13), %ebx
	cmpl	%r9d, %ecx
	jne	LBB0_10
## %bb.9:
	cmpl	%ebx, %r8d
	je	LBB0_11
LBB0_10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	subq	$8, %rsp
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	pushq	%rbx
	callq	_mtk_mdp_dbg
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	addq	$16, %rsp
LBB0_11:
	movl	(%r15), %eax
	movl	%eax, 16(%r13)
	testl	%eax, %eax
	jle	LBB0_16
## %bb.12:
	movl	$1, %r12d
	xorl	%ebx, %ebx
	movq	%r15, -120(%rbp)                ## 8-byte Spill
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	4(%rax,%r12,4), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	24(%r13), %rax
	movl	(%rax,%r12,4), %r9d
	subq	$8, %rsp
	movl	$2, %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %ecx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	pushq	%r15
	callq	_mtk_mdp_dbg
	addq	$16, %rsp
	incq	%rbx
	movslq	16(%r13), %rax
	addq	$3, %r12
	cmpq	%rax, %rbx
	movq	-120(%rbp), %r15                ## 8-byte Reload
	jge	LBB0_16
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%r13), %eax
	movq	8(%r15), %rcx
	movq	16(%r15), %rdx
	movl	(%rcx,%rbx,4), %ecx
	imull	%eax, %ecx
	leal	7(%rcx), %r14d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r14d
	imull	12(%r13), %eax
	sarl	$3, %r14d
	imull	(%rdx,%rbx,4), %eax
	leal	7(%rax), %r15d
	testl	%eax, %eax
	cmovnsl	%eax, %r15d
	sarl	$3, %r15d
	movq	24(%r13), %rax
	movl	%r14d, -4(%rax,%r12,4)
	cmpl	%r15d, (%rax,%r12,4)
	jge	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%r15d, (%rax,%r12,4)
	jmp	LBB0_15
LBB0_2:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %rax
	movq	(%rax), %rdi
	movl	52(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	xorl	%r15d, %r15d
LBB0_16:
	movq	%r15, %rax
	addq	$88, %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	"pixelformat format 0x%X invalid\n"

	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
L_.str.1:                               ## @.str.1
	.asciz	"[%d] type:%d, wxh:%ux%u, align:%ux%u, max:%ux%u"

L_.str.2:                               ## @.str.2
	.asciz	"[%d] size change:%ux%u to %ux%u"

L_.str.3:                               ## @.str.3
	.asciz	"[%d] p%d, bpl:%d, sizeimage:%u (%u)"

	.no_dead_strip	_mtk_mdp_try_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_mdp_try_fmt_mplane
_mtk_mdp_try_fmt_mplane:                ; @mtk_mdp_try_fmt_mplane
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #24]
	ldr	x22, [x8, #8]
	ldr	w0, [x1, #52]
	ldr	w1, [x1]
	bl	_mtk_mdp_find_fmt
	mov	x21, x0
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w1, [x19]
	bl	_mtk_mdp_find_fmt_by_index
	mov	x21, x0
	cbz	x0, LBB0_14
LBB0_2:
Lloh0:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x21, #32]
	stp	w9, w8, [x19, #52]
	ldr	w0, [x19]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbnz	x0, LBB0_4
; %bb.3:
	ldur	q0, [x20, #4]
	stur	q0, [x19, #36]
LBB0_4:
	ldr	w0, [x19, #32]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x8, [x22, #16]
	ldp	w25, w24, [x8]
	ldr	x8, [x21, #24]
	cbnz	x8, LBB0_6
; %bb.5:
	ldr	x8, [x22, #8]
LBB0_6:
	add	x9, x8, #4
	ldr	w26, [x8]
	ldr	w27, [x9]
	ldr	w0, [x19]
	bl	_V4L2_TYPE_IS_OUTPUT
	mov	w8, #4
	mov	w9, #12
	cmp	x0, #0
	csel	x8, x9, x8, eq
	cset	w9, eq
	ldr	x10, [x22]
	lsl	x9, x9, #3
	ldr	w8, [x10, x8]
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
	ldr	w22, [x10, x9]
	ldr	w2, [x20]
	ldr	w3, [x19]
	mov	x23, x19
	ldr	w4, [x23, #8]!
	mov	x28, x19
	ldr	w5, [x28, #12]!
	stp	x25, x24, [sp, #8]
	str	x27, [sp]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	mov	x6, x26
	bl	_mtk_mdp_dbg
	mov	x6, x24
	ldr	w24, [x23]
	mov	x2, x25
	ldr	w25, [x28]
	mov	x0, x23
	mov	x1, x22
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x3, x26
	mov	x4, x28
	ldr	w5, [sp, #28]                   ; 4-byte Folded Reload
                                        ; kill: def $w6 killed $w6 killed $x6
	mov	x7, x27
	bl	_mtk_mdp_bound_align_image
	ldr	w5, [x23]
	ldr	w6, [x28]
	cmp	w24, w5
	b.ne	LBB0_8
; %bb.7:
	cmp	w25, w6
	b.eq	LBB0_9
LBB0_8:
	ldr	w2, [x20]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	mov	x3, x24
	mov	x4, x25
	bl	_mtk_mdp_dbg
LBB0_9:
	ldr	w8, [x21]
	str	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.10:
	mov	x26, #0
	mov	x22, #0
Lloh7:
	adrp	x23, l_.str.3@PAGE
Lloh8:
	add	x23, x23, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w0, [x8, #8]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w2, [x20]
	ldr	x8, [x19, #24]
	add	x8, x8, x26
	ldr	w5, [x8, #4]
	mov	w0, #2
	mov	x1, x23
	mov	x3, x22
	mov	x4, x24
	mov	x6, x25
	bl	_mtk_mdp_dbg
	add	x22, x22, #1
	ldrsw	x8, [x19, #16]
	add	x26, x26, #12
	cmp	x22, x8
	b.ge	LBB0_15
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsl	x8, x22, #2
	ldp	x9, x10, [x21, #8]
	ldr	w9, [x9, x8]
	ldp	w11, w12, [x19, #8]
	mul	w9, w9, w11
	add	w13, w9, #7
	cmp	w9, #0
	csel	w9, w13, w9, lt
	mul	w11, w12, w11
	asr	w24, w9, #3
	ldr	w8, [x10, x8]
	mul	w8, w11, w8
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w25, w8, #3
	ldr	x8, [x19, #24]
	add	x8, x8, x26
	str	w24, [x8]
	ldr	w9, [x8, #4]
	cmp	w9, w25
	b.ge	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	str	w25, [x8, #4]
	b	LBB0_11
LBB0_14:
	ldr	x8, [x20, #24]
	ldr	x0, [x8]
	ldr	w2, [x19, #52]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pixelformat format 0x%X invalid\n"

	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
l_.str.1:                               ; @.str.1
	.asciz	"[%d] type:%d, wxh:%ux%u, align:%ux%u, max:%ux%u"

l_.str.2:                               ; @.str.2
	.asciz	"[%d] size change:%ux%u to %ux%u"

l_.str.3:                               ; @.str.3
	.asciz	"[%d] p%d, bpl:%d, sizeimage:%u (%u)"

	.no_dead_strip	_mtk_mdp_try_fmt_mplane
.subsections_via_symbols
