	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fimc_m2m_try_selection
_fimc_m2m_try_selection:                ## @fimc_m2m_try_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	64(%rdi), %r15
	cmpq	$0, 16(%rsi)
	js	LBB0_2
## %bb.1:
	movq	%rsi, %rbx
	cmpq	$0, 24(%rsi)
	js	LBB0_2
## %bb.3:
	movq	%rdi, %r14
	movq	(%rbx), %rax
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	movq	8(%rbx), %rax
	movq	_V4L2_SEL_TGT_COMPOSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.9:
	addq	$32, %r14
	movq	(%r15), %rax
	leaq	4(%rax), %rcx
	jmp	LBB0_10
LBB0_2:
	addq	$8, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_v4l2_err
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.7:
	movq	8(%rbx), %rax
	movq	_V4L2_SEL_TGT_CROP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.8:
	movq	(%r15), %rax
	movq	%rax, %rcx
LBB0_10:
	movl	(%rcx), %r12d
	movl	8(%rax), %eax
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.11:
	movq	24(%r14), %rax
	movl	16(%rax), %edi
	callq	_fimc_fmt_is_rgb
	xorl	%edx, %edx
	testq	%rax, %rax
	sete	%dl
	jmp	LBB0_13
LBB0_12:
	bsfl	%eax, %eax
	movl	$-1, %edx
	cmovnel	%eax, %edx
LBB0_13:
	movq	24(%r14), %rcx
	movl	(%rcx), %eax
	testl	%eax, %eax
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	jle	LBB0_14
## %bb.15:
	movq	8(%rcx), %rcx
	cmpl	$4, %eax
	jae	LBB0_17
## %bb.16:
	xorl	%edx, %edx
	xorl	%edi, %edi
	jmp	LBB0_24
LBB0_14:
	xorl	%edi, %edi
	jmp	LBB0_25
LBB0_17:
	movl	%eax, %edx
	andl	$-4, %edx
	leaq	-4(%rdx), %rsi
	movq	%rsi, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.19:
	movq	%r8, %rsi
	andq	$-2, %rsi
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rcx,%rdi,8), %xmm2
	movdqu	16(%rcx,%rdi,8), %xmm3
	movdqu	32(%rcx,%rdi,8), %xmm4
	movdqu	48(%rcx,%rdi,8), %xmm5
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm0, %xmm2
	pshufd	$232, %xmm3, %xmm3              ## xmm3 = xmm3[0,2,2,3]
	paddd	%xmm1, %xmm3
	pshufd	$232, %xmm4, %xmm0              ## xmm0 = xmm4[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm5, %xmm1              ## xmm1 = xmm5[0,2,2,3]
	paddd	%xmm3, %xmm1
	addq	$8, %rdi
	addq	$-2, %rsi
	jne	LBB0_20
	jmp	LBB0_21
LBB0_18:
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
LBB0_21:
	testb	$1, %r8b
	je	LBB0_23
## %bb.22:
	movdqu	(%rcx,%rdi,8), %xmm2
	movdqu	16(%rcx,%rdi,8), %xmm3
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm3, %xmm2              ## xmm2 = xmm3[0,2,2,3]
	paddd	%xmm2, %xmm1
LBB0_23:
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edi
	cmpq	%rax, %rdx
	je	LBB0_25
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rcx,%rdx,8), %edi
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_24
LBB0_25:
	bsfl	%r12d, %eax
	movl	$-1, %r13d
	cmovnel	%eax, %r13d
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	leaq	32(%rbx), %r12
	leaq	40(%rbx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$8, %esi
	callq	_ALIGN
	movl	%eax, %ecx
	movl	$64, %eax
	xorl	%edx, %edx
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	subq	$8, %rsp
	movq	%r12, %rdi
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %ecx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movl	%r12d, %r9d
	pushq	%rax
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	callq	_v4l_bound_align_image
	addq	$32, %rsp
	movq	24(%rbx), %rdi
	movq	32(%rbx), %rax
	leaq	(%rax,%rdi), %rdx
	movq	(%r14), %rcx
	cmpq	%rcx, %rdx
	jle	LBB0_27
## %bb.26:
	subq	%rax, %rcx
	movq	%rcx, 24(%rbx)
	movq	%rcx, %rdi
LBB0_27:
	movq	40(%rbx), %rax
	movq	16(%rbx), %rdx
	addq	%rax, %rdx
	movq	8(%r14), %rcx
	cmpq	%rcx, %rdx
	jle	LBB0_29
## %bb.28:
	subq	%rax, %rcx
	movq	%rcx, 16(%rbx)
LBB0_29:
	movl	%r12d, %esi
	callq	_round_down
	movq	%rax, 24(%rbx)
	movq	16(%rbx), %rdi
	movq	(%r15), %rax
	movl	12(%rax), %esi
	callq	_round_down
	movq	%rax, 16(%rbx)
	movq	24(%rbx), %rsi
	movq	32(%rbx), %rcx
	movq	40(%rbx), %r8
	movl	16(%r14), %ebx
	movl	20(%r14), %r9d
	subq	$8, %rsp
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rdx
	pushq	%rbx
	callq	_dbg
	addq	$16, %rsp
	xorl	%eax, %eax
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"doesn't support negative values for top & left\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_SEL_TGT_COMPOSE,8,3       ## @V4L2_SEL_TGT_COMPOSE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_SEL_TGT_CROP,8,3          ## @V4L2_SEL_TGT_CROP
L_.str.1:                               ## @.str.1
	.asciz	"l:%d, t:%d, w:%d, h:%d, f_w: %d, f_h: %d"

	.no_dead_strip	_fimc_m2m_try_selection
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fimc_m2m_try_selection
_fimc_m2m_try_selection:                ; @fimc_m2m_try_selection
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x28, [x0, #64]
	ldr	x8, [x1, #16]
	tbnz	x8, #63, LBB0_5
; %bb.1:
	mov	x20, x1
	ldr	x8, [x1, #24]
	tbnz	x8, #63, LBB0_5
; %bb.2:
	mov	x19, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _V4L2_SEL_TGT_COMPOSE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_SEL_TGT_COMPOSE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	add	x19, x19, #32
	ldr	x8, [x28]
	add	x9, x8, #4
	b	LBB0_11
LBB0_5:
	add	x0, x28, #8
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_v4l2_err
LBB0_6:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
Lloh11:
	adrp	x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.9:
	ldr	x8, [x20, #8]
Lloh14:
	adrp	x9, _V4L2_SEL_TGT_CROP@GOTPAGE
Lloh15:
	ldr	x9, [x9, _V4L2_SEL_TGT_CROP@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.10:
	ldr	x8, [x28]
	mov	x9, x8
LBB0_11:
	ldr	w21, [x9]
	ldr	w8, [x8, #8]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.12:
	ldr	x8, [x19, #24]
	ldr	w0, [x8, #16]
	bl	_fimc_fmt_is_rgb
	cmp	x0, #0
	cset	w22, eq
	b	LBB0_14
LBB0_13:
	rbit	w9, w8
	clz	w9, w9
	cmp	w8, #0
	csinv	w22, w9, wzr, ne
LBB0_14:
	ldr	x9, [x19, #24]
	ldr	w8, [x9]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.15:
	ldr	x9, [x9, #8]
	cmp	w8, #8
	b.hs	LBB0_18
; %bb.16:
	mov	x10, #0
	mov	w0, #0
	b	LBB0_21
LBB0_17:
	mov	w0, #0
	b	LBB0_23
LBB0_18:
	and	x10, x8, #0xfffffff8
	movi.2d	v0, #0000000000000000
	add	x11, x9, #32
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	xtn.2s	v4, v4
	xtn.2s	v5, v5
	xtn.2s	v6, v6
	xtn.2s	v7, v7
	add.2s	v0, v0, v4
	add.2s	v1, v1, v5
	add.2s	v2, v2, v6
	add.2s	v3, v3, v7
	subs	x12, x12, #8
	b.ne	LBB0_19
; %bb.20:
	add.2s	v0, v1, v0
	add.2s	v0, v2, v0
	add.2s	v0, v3, v0
	addp.2s	v0, v0, v0
	fmov	w0, s0
	cmp	x10, x8
	b.eq	LBB0_23
LBB0_21:
	add	x9, x9, x10, lsl #3
	sub	x8, x8, x10
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #8
	add	w0, w0, w10
	subs	x8, x8, #1
	b.ne	LBB0_22
LBB0_23:
	add	x23, x20, #32
	rbit	w8, w21
	clz	w8, w8
	cmp	w21, #0
	csinv	w24, w8, wzr, ne
	add	x25, x20, #40
	ldp	x26, x27, [x19]
	mov	w1, #8
	bl	_ALIGN
	mov	w8, #64
	sdiv	w8, w8, w0
	str	w8, [sp]
	mov	x0, x23
	mov	x1, x21
	mov	x2, x26
	mov	x3, x24
	mov	x4, x25
	mov	x5, x21
	mov	x6, x27
	mov	x7, x22
	bl	_v4l_bound_align_image
	ldp	x0, x8, [x20, #24]
	ldr	x9, [x19]
	add	x10, x8, x0
	cmp	x10, x9
	b.le	LBB0_25
; %bb.24:
	sub	x0, x9, x8
	str	x0, [x20, #24]
LBB0_25:
	ldr	x10, [x20, #16]
	ldr	x8, [x20, #40]
	ldr	x9, [x19, #8]
	add	x10, x8, x10
	cmp	x10, x9
	b.le	LBB0_27
; %bb.26:
	sub	x8, x9, x8
	str	x8, [x20, #16]
LBB0_27:
	mov	x1, x21
	bl	_round_down
	str	x0, [x20, #24]
	ldr	x0, [x20, #16]
	ldr	x8, [x28]
	ldr	w1, [x8, #12]
	bl	_round_down
	mov	x2, x0
	str	x0, [x20, #16]
	ldp	x1, x3, [x20, #24]
	ldr	x4, [x20, #40]
	ldp	w6, w5, [x19, #16]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doesn't support negative values for top & left\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_SEL_TGT_COMPOSE,8,3       ; @V4L2_SEL_TGT_COMPOSE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
	.comm	_V4L2_SEL_TGT_CROP,8,3          ; @V4L2_SEL_TGT_CROP
l_.str.1:                               ; @.str.1
	.asciz	"l:%d, t:%d, w:%d, h:%d, f_w: %d, f_h: %d"

	.no_dead_strip	_fimc_m2m_try_selection
.subsections_via_symbols
