	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gsc_try_fmt_mplane             ## -- Begin function gsc_try_fmt_mplane
	.p2align	4, 0x90
_gsc_try_fmt_mplane:                    ## @gsc_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movl	8(%rsi), %esi
	movl	12(%r13), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_pr_debug
	leaq	44(%r13), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_find_fmt
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	16(%r13), %rsi
	movq	_V4L2_FIELD_ANY@GOTPCREL(%rip), %rcx
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	(%rcx), %rsi
	jne	LBB0_7
## %bb.4:
	movq	%rax, 16(%r13)
	jmp	LBB0_5
LBB0_1:
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_2
LBB0_7:
	cmpq	%rax, %rsi
	jne	LBB0_8
LBB0_5:
	leaq	8(%r13), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	12(%r13), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	8(%r15), %rax
	movq	16(%r15), %rcx
	movl	(%rcx), %edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	4(%rcx), %ecx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %eax
	bsfl	%eax, %ebx
	movl	$-1, %r12d
	cmovel	%r12d, %ebx
	movl	16(%r14), %edi
	callq	_is_yuv420
	movq	8(%r15), %rcx
	movl	(%rcx), %ecx
	bsfl	%ecx, %edx
	xorl	%esi, %esi
	cmpl	$1, %ecx
	sbbl	%esi, %esi
	orl	%edx, %esi
	testl	%ecx, %ecx
	cmovnel	%edx, %r12d
	decl	%r12d
	testq	%rax, %rax
	cmovnel	%esi, %r12d
	movl	(%r13), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	movq	(%r15), %rcx
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movl	(%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%rcx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_10
LBB0_9:
	movl	8(%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	12(%rcx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	movl	%r12d, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movq	-88(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_pr_debug
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movl	(%rbx), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	subq	$8, %rsp
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	movq	%rbx, %r8
	movl	-48(%rbp), %r9d                 ## 4-byte Reload
	pushq	$0
	pushq	%r12
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	callq	_v4l_bound_align_image
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	movl	-76(%rbp), %esi                 ## 4-byte Reload
	addq	$32, %rsp
	movl	(%r15), %ecx
	movl	(%rbx), %r8d
	cmpl	%ecx, %esi
	jne	LBB0_12
## %bb.11:
	cmpl	%r8d, %edx
	je	LBB0_13
LBB0_12:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_13:
	movl	(%r14), %eax
	movl	%eax, 24(%r13)
	movl	(%r13), %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movl	40(%r13), %eax
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_15:
	cmpl	$0, 24(%r13)
	jle	LBB0_16
## %bb.17:
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_20:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	8(%r14), %rax
	movl	(%rax,%rbx,4), %esi
LBB0_22:                                ##   in Loop: Header=BB0_18 Depth=1
	imull	%edx, %esi
	leal	7(%rsi), %r15d
	testl	%esi, %esi
	cmovnsl	%esi, %r15d
	sarl	$3, %r15d
LBB0_27:                                ##   in Loop: Header=BB0_18 Depth=1
	movl	%r15d, (%r12,%rcx,4)
	movl	12(%r13), %eax
	imull	8(%r13), %eax
	movq	8(%r14), %rcx
	imull	(%rcx,%rbx,4), %eax
	leal	7(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$3, %edi
	movl	4(%r12,%rbx,8), %esi
	callq	_max
	movl	%eax, 4(%r12,%rbx,8)
	movq	32(%r13), %rax
	movl	4(%rax,%rbx,8), %ecx
	xorl	%r12d, %r12d
	leaq	L_.str.5(%rip), %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	incq	%rbx
	movslq	24(%r13), %rax
	cmpq	%rax, %rbx
	jge	LBB0_28
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %r12
	leaq	(%rbx,%rbx), %rcx
	movl	(%r12,%rbx,8), %r15d
	movl	4(%r14), %eax
	cmpl	$1, %eax
	jne	LBB0_23
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	testl	%r15d, %r15d
	je	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_18 Depth=1
	leal	(,%r15,8), %eax
	movq	8(%r14), %rdx
	movl	(%rdx,%rbx,4), %esi
	cltd
	idivl	%esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %edx
	cmpl	%edx, %eax
	jl	LBB0_22
	jmp	LBB0_27
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_18 Depth=1
	jle	LBB0_27
## %bb.24:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %edx
	cmpl	%edx, %r15d
	movl	%r15d, %esi
	cmovll	%edx, %esi
	testl	%r15d, %r15d
	movl	%esi, %r15d
	cmovel	%edx, %r15d
	testq	%rbx, %rbx
	je	LBB0_27
## %bb.25:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	$3, %eax
	jne	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	movl	%eax, %r15d
	jmp	LBB0_27
LBB0_16:
	xorl	%r12d, %r12d
	jmp	LBB0_28
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_28:
	movl	%r12d, %eax
	addq	$72, %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	"user put w: %d, h: %d"

L_.str.1:                               ## @.str.1
	.asciz	"pixelformat format (0x%X) invalid\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_FIELD_ANY,8,3             ## @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_NONE,8,3            ## @V4L2_FIELD_NONE
L_.str.2:                               ## @.str.2
	.asciz	"Not supported field order(%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"mod_x: %d, mod_y: %d, max_w: %d, max_h = %d"

L_.str.4:                               ## @.str.4
	.asciz	"Image size has been modified from %dx%d to %dx%d\n"

L_.str.5:                               ## @.str.5
	.asciz	"[%d]: bpl: %d, sizeimage: %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gsc_try_fmt_mplane             ; -- Begin function gsc_try_fmt_mplane
	.p2align	2
_gsc_try_fmt_mplane:                    ; @gsc_try_fmt_mplane
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x25, x0
	ldr	x8, [x0, #8]
	ldr	x24, [x8]
	mov	x20, x1
	ldr	w1, [x20, #8]!
	mov	x23, x20
	ldr	w8, [x23, #4]!
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	add	x22, x20, #36
	mov	x0, x22
	mov	x1, #0
	mov	w2, #0
	bl	_find_fmt
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
Lloh2:
	adrp	x8, _V4L2_FIELD_ANY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _V4L2_FIELD_ANY@GOTPAGEOFF]
	ldr	x1, [x19, #16]
Lloh4:
	ldr	x9, [x8]
Lloh5:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x1, x9
	b.ne	LBB0_4
; %bb.2:
	str	x8, [x19, #16]
	b	LBB0_5
LBB0_3:
	ldr	w1, [x22]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_25
LBB0_4:
	cmp	x1, x8
	b.ne	LBB0_24
LBB0_5:
	ldp	x9, x8, [x24, #8]
	ldp	w22, w26, [x8]
	ldr	w8, [x9, #4]
	rbit	w9, w8
	clz	w9, w9
	cmp	w8, #0
	csinv	w28, w9, wzr, ne
	ldr	w0, [x21, #16]
	bl	_is_yuv420
	ldr	x8, [x24, #8]
	ldr	w8, [x8]
	rbit	w9, w8
	clz	w9, w9
	sub	w10, w9, #1
	mov	w11, #-2
	cmp	w8, #0
	csel	w8, w11, w10, eq
	csinv	w9, w9, wzr, ne
	cmp	x0, #0
	csel	w27, w8, w9, eq
	ldr	w0, [x19]
	bl	_V4L2_TYPE_IS_OUTPUT
	ldr	x8, [x24]
	str	x25, [sp, #32]                  ; 8-byte Folded Spill
	cbz	x0, LBB0_7
; %bb.6:
	ldp	w9, w8, [x8]
	stp	w9, w8, [sp, #40]               ; 8-byte Folded Spill
	b	LBB0_8
LBB0_7:
	ldp	w9, w8, [x8, #8]
	stp	w9, w8, [sp, #40]               ; 8-byte Folded Spill
	ldr	w8, [x25]
	str	w8, [x19, #40]
LBB0_8:
	stp	x22, x26, [sp, #8]
	str	x27, [sp]
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x28
	bl	_pr_debug
	ldr	w24, [x20]
	ldr	w25, [x23]
	str	wzr, [sp]
	mov	x0, x20
	ldp	w1, w5, [sp, #40]               ; 8-byte Folded Reload
	mov	x2, x22
	mov	x3, x28
	mov	x4, x23
	mov	x6, x26
	mov	x7, x27
	bl	_v4l_bound_align_image
	ldr	w8, [x20]
	ldr	w9, [x23]
	cmp	w24, w8
	b.ne	LBB0_10
; %bb.9:
	cmp	w25, w9
	b.eq	LBB0_11
LBB0_10:
	stp	x8, x9, [sp, #8]
	str	x25, [sp]
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x24
	bl	_pr_debug
LBB0_11:
	ldr	w8, [x21]
	str	w8, [x19, #24]
	ldr	w0, [x19]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbz	x0, LBB0_13
; %bb.12:
	ldr	w8, [x19, #40]
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	str	w8, [x9]
LBB0_13:
	ldr	w8, [x19, #24]
	cmp	w8, #1
	b.lt	LBB0_23
; %bb.14:
	mov	x24, #0
	mov	x22, #0
Lloh14:
	adrp	x23, l_.str.5@PAGE
Lloh15:
	add	x23, x23, l_.str.5@PAGEOFF
	b	LBB0_18
LBB0_15:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	w9, [x20]
	ldr	x10, [x21, #8]
	ldr	w10, [x10, x22, lsl #2]
LBB0_16:                                ;   in Loop: Header=BB0_18 Depth=1
	mul	w9, w10, w9
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w25, w9, #3
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x26, x8, x24
	str	w25, [x26]
	ldp	w8, w9, [x19, #8]
	mul	w8, w9, w8
	ldr	x9, [x21, #8]
	ldr	w9, [x9, x22, lsl #2]
	mul	w8, w8, w9
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #3
	ldr	w1, [x26, #4]
	bl	_max
	str	w0, [x26, #4]
	ldr	x8, [x19, #32]
	add	x8, x8, x24
	ldr	w8, [x8, #4]
	stp	x25, x8, [sp]
	mov	x0, x23
	mov	x1, x22
	bl	_pr_debug
	add	x22, x22, #1
	ldrsw	x8, [x19, #24]
	add	x24, x24, #8
	cmp	x22, x8
	b.ge	LBB0_23
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	w25, [x8, x24]
	ldr	w9, [x21, #4]
	cmp	w9, #1
	b.ne	LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	cbz	w25, LBB0_15
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	lsl	w9, w25, #3
	ldr	x10, [x21, #8]
	ldr	w10, [x10, x22, lsl #2]
	sdiv	w11, w9, w10
	ldr	w9, [x20]
	cmp	w11, w9
	b.lt	LBB0_16
	b	LBB0_17
LBB0_21:                                ;   in Loop: Header=BB0_18 Depth=1
	cmp	w9, #2
	b.lt	LBB0_17
; %bb.22:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w10, [x20]
	cmp	w25, w10
	ccmp	w25, #0, #4, ge
	csel	w10, w10, w25, eq
	cmp	w10, #0
	cinc	w11, w10, lt
	asr	w11, w11, #1
	cmp	w9, #3
	csel	w9, w10, w11, ne
	cmp	x22, #0
	csel	w25, w10, w9, eq
	b	LBB0_17
LBB0_23:
	mov	w0, #0
	b	LBB0_26
LBB0_24:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pr_debug
LBB0_25:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_26:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"user put w: %d, h: %d"

l_.str.1:                               ; @.str.1
	.asciz	"pixelformat format (0x%X) invalid\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_FIELD_ANY,8,3             ; @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_NONE,8,3            ; @V4L2_FIELD_NONE
l_.str.2:                               ; @.str.2
	.asciz	"Not supported field order(%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"mod_x: %d, mod_y: %d, max_w: %d, max_h = %d"

l_.str.4:                               ; @.str.4
	.asciz	"Image size has been modified from %dx%d to %dx%d\n"

l_.str.5:                               ; @.str.5
	.asciz	"[%d]: bpl: %d, sizeimage: %d"

.subsections_via_symbols
