	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_mdp_m2m_g_selection
_mtk_mdp_m2m_g_selection:               ## @mtk_mdp_m2m_g_selection
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	movq	%rsi, %rdi
	callq	_fh_to_ctx
	movq	%rax, %r14
	movl	20(%rbx), %eax
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movl	16(%rbx), %edi
	callq	_mtk_mdp_is_target_compose
	testq	%rax, %rax
	jne	LBB0_7
	jmp	LBB0_5
LBB0_2:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.3:
	movl	16(%rbx), %edi
	callq	_mtk_mdp_is_target_crop
	testq	%rax, %rax
	je	LBB0_5
LBB0_7:
	movl	20(%rbx), %esi
	movq	%r14, %rdi
	callq	_mtk_mdp_ctx_get_frame
	movl	16(%rbx), %ecx
	addl	$-128, %ecx
	cmpl	$5, %ecx
	ja	LBB0_6
## %bb.8:
	movl	$27, %edx
	btl	%ecx, %edx
	jae	LBB0_10
## %bb.9:
	movq	$0, 8(%rbx)
	movl	20(%rax), %ecx
	movl	%ecx, 4(%rbx)
	movl	16(%rax), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_11
LBB0_5:
	movl	(%r14), %edx
	movl	16(%rbx), %r8d
	movl	20(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_mtk_mdp_dbg
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_10:
	movups	(%rax), %xmm0
	movups	%xmm0, (%rbx)
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[%d] invalid type:%d,%u"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mtk_mdp_m2m_g_selection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_mdp_m2m_g_selection
_mtk_mdp_m2m_g_selection:               ; @mtk_mdp_m2m_g_selection
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	mov	x0, x1
	bl	_fh_to_ctx
	mov	x20, x0
	ldr	w8, [x19, #20]
Lloh0:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x19, #16]
	bl	_mtk_mdp_is_target_compose
	cbnz	x0, LBB0_4
	b	LBB0_7
LBB0_2:
Lloh3:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.3:
	ldr	w0, [x19, #16]
	bl	_mtk_mdp_is_target_crop
	cbz	x0, LBB0_7
LBB0_4:
	ldr	w1, [x19, #20]
	mov	x0, x20
	bl	_mtk_mdp_ctx_get_frame
	ldr	w9, [x19, #16]
	sub	w9, w9, #128
	cmp	w9, #5
	b.hi	LBB0_8
; %bb.5:
	mov	x8, x0
	mov	w10, #1
	lsl	w9, w10, w9
	mov	w10, #27
	tst	w9, w10
	b.eq	LBB0_10
; %bb.6:
	mov	w0, #0
	str	xzr, [x19, #8]
	ldr	d0, [x8, #16]
	str	d0, [x19]
	b	LBB0_9
LBB0_7:
	ldr	w2, [x20]
	ldp	w4, w3, [x19, #16]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_mtk_mdp_dbg
LBB0_8:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	w0, #0
	ldr	q0, [x8]
	str	q0, [x19]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,4,2 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,4,2 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[%d] invalid type:%d,%u"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mtk_mdp_m2m_g_selection
.subsections_via_symbols
