	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gsc_try_selection              ## -- Begin function gsc_try_selection
	.p2align	4, 0x90
_gsc_try_selection:                     ## @gsc_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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 8(%rsi)
	js	LBB0_2
## %bb.1:
	movq	%rsi, %r14
	cmpl	$0, 16(%rsi)
	js	LBB0_2
## %bb.4:
	movq	%rdi, %rbx
	movq	56(%rdi), %rax
	movq	(%rax), %r15
	movl	24(%r14), %esi
	movq	32(%r14), %rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	(%r14), %rdi
	movq	_V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jne	LBB0_6
## %bb.5:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leaq	32(%rbx), %r13
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_43
LBB0_6:
	movq	_V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jne	LBB0_3
## %bb.7:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leaq	8(%rbx), %r13
LBB0_8:
	leaq	24(%r14), %rcx
	leaq	32(%r14), %rax
	movq	(%r13), %r12
	movq	8(%r13), %rdx
	movq	%rdx, -120(%rbp)                ## 8-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %rbx
	movq	%rbx, -56(%rbp)
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	%rax, -48(%rbp)
	callq	_V4L2_TYPE_IS_OUTPUT
	movq	16(%r13), %rcx
	movl	4(%rcx), %edi
	testq	%rax, %rax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	je	LBB0_17
## %bb.9:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	callq	_is_yuv422
	movq	16(%r13), %rcx
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	$32, %ebx
	cmpl	$1, (%rcx)
	je	LBB0_12
LBB0_11:
	movl	4(%rcx), %edi
	callq	_is_rgb
	xorl	%ebx, %ebx
	testq	%rax, %rax
	sete	%bl
	shlq	$5, %rbx
	addq	$32, %rbx
	movq	16(%r13), %rcx
LBB0_12:
	movl	4(%rcx), %edi
	callq	_is_yuv422
	movq	16(%r13), %rcx
	testq	%rax, %rax
	je	LBB0_16
## %bb.13:
	cmpl	$3, (%rcx)
	jne	LBB0_16
## %bb.14:
	movl	$32, %r15d
	jmp	LBB0_15
LBB0_16:
	movl	4(%rcx), %edi
	callq	_is_yuv420
	xorl	%r15d, %r15d
	testq	%rax, %rax
	setne	%r15b
	shlq	$4, %r15
	addq	$16, %r15
LBB0_15:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	jmp	LBB0_28
LBB0_17:
	callq	_is_yuv420
	testq	%rax, %rax
	jne	LBB0_20
## %bb.18:
	movq	16(%r13), %rax
	movl	4(%rax), %edi
	callq	_is_yuv422
	testq	%rax, %rax
	je	LBB0_19
LBB0_20:
	movq	8(%r15), %rax
	movl	4(%rax), %edi
	callq	_ffs
	movq	%rax, %r12
	decq	%r12
LBB0_21:
	movq	16(%r13), %rax
	movl	4(%rax), %edi
	callq	_is_yuv420
	testq	%rax, %rax
	je	LBB0_22
## %bb.23:
	movq	8(%r15), %rax
	movl	(%rax), %edi
	callq	_ffs
	movq	%rax, %r13
	decq	%r13
	jmp	LBB0_24
LBB0_22:
	xorl	%r13d, %r13d
LBB0_24:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %eax
	cmpl	$270, %eax                      ## imm = 0x10E
	je	LBB0_26
## %bb.25:
	cmpl	$90, %eax
	jne	LBB0_27
LBB0_26:
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	(%rcx), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	8(%rcx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movq	(%rax), %rbx
	movq	8(%rax), %r15
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, -56(%rbp)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	%rax, -48(%rbp)
	jmp	LBB0_28
LBB0_27:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movq	16(%rax), %rbx
	movq	24(%rax), %r15
LBB0_28:
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	movq	%r13, %rdx
	movq	%rbx, %rcx
	movq	%r15, %r8
	xorl	%eax, %eax
	callq	_pr_debug
	leaq	L_.str.3(%rip), %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pr_debug
	subq	$8, %rsp
	leaq	-56(%rbp), %rdi
	leaq	-48(%rbp), %r8
	movq	%rbx, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%r12, %rcx
	movq	%r15, %r9
	pushq	$0
	pushq	%r13
	movq	-120(%rbp), %r13                ## 8-byte Reload
	pushq	%r13
	callq	_v4l_bound_align_image
	addq	$32, %rsp
	movq	(%r14), %rdi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	je	LBB0_29
LBB0_32:
	movq	-56(%rbp), %rdi
	movq	-48(%rbp), %rsi
	jmp	LBB0_33
LBB0_29:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %eax
	cmpl	$270, %eax                      ## imm = 0x10E
	je	LBB0_31
## %bb.30:
	cmpl	$90, %eax
	jne	LBB0_32
LBB0_31:
	movq	-48(%rbp), %rdi
	movq	-56(%rbp), %rsi
LBB0_33:
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	callq	_gsc_check_crop_change
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-104(%rbp), %r12                ## 8-byte Reload
	movslq	16(%r14), %rcx
	movq	-56(%rbp), %rax
	addq	%rax, %rcx
	cmpq	%r15, %rcx
	jle	LBB0_35
## %bb.34:
	movl	%r15d, %ecx
	subl	%eax, %ecx
	movl	%ecx, 16(%r14)
LBB0_35:
	movq	-48(%rbp), %rax
	movq	8(%r14), %rcx
	addq	%rax, %rcx
	cmpq	%r13, %rcx
	jle	LBB0_37
## %bb.36:
	movq	%r13, %rcx
	subq	%rax, %rcx
	movq	%rcx, 8(%r14)
LBB0_37:
	movq	16(%r12), %rax
	movl	4(%rax), %edi
	callq	_is_yuv420
	testq	%rax, %rax
	jne	LBB0_40
## %bb.38:
	movq	16(%r12), %rax
	movl	4(%rax), %edi
	callq	_is_yuv422
	testq	%rax, %rax
	je	LBB0_39
LBB0_40:
	movl	16(%r14), %esi
	testb	$1, %sil
	je	LBB0_42
## %bb.41:
	decl	%esi
	movl	%esi, 16(%r14)
	jmp	LBB0_42
LBB0_39:
	movl	16(%r14), %esi
LBB0_42:
	movq	8(%r14), %rdx
	movq	24(%r14), %rcx
	movq	32(%r14), %r8
	subq	$8, %rsp
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r15, %r9
	xorl	%eax, %eax
	pushq	%r13
	callq	_pr_debug
	addq	$16, %rsp
LBB0_43:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	xorl	%r12d, %r12d
	jmp	LBB0_21
	.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
L_.str.1:                               ## @.str.1
	.asciz	"user put w: %d, h: %d"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ## @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ## @V4L2_BUF_TYPE_VIDEO_OUTPUT
L_.str.2:                               ## @.str.2
	.asciz	"mod_x: %d, mod_y: %d, min_w: %d, min_h = %d"

L_.str.3:                               ## @.str.3
	.asciz	"tmp_w : %d, tmp_h : %d"

L_.str.4:                               ## @.str.4
	.asciz	"Aligned l:%d, t:%d, w:%d, h:%d, f_w: %d, f_h: %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gsc_try_selection              ; -- Begin function gsc_try_selection
	.p2align	2
_gsc_try_selection:                     ; @gsc_try_selection
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x8, [x1, #8]
	tbnz	x8, #63, LBB0_4
; %bb.1:
	mov	x19, x1
	ldr	w8, [x1, #16]
	tbnz	w8, #31, LBB0_4
; %bb.2:
	mov	x24, x0
	ldr	x8, [x0, #56]
	ldr	x21, [x8]
	mov	x22, x19
	ldr	w1, [x22, #24]!
	mov	x23, x19
	ldr	x2, [x23, #32]!
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	ldr	x0, [x19]
Lloh2:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_CAPTURE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.3:
	add	x25, x24, #32
	b	LBB0_8
LBB0_4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_5:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_42
LBB0_6:
Lloh10:
	adrp	x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V4L2_BUF_TYPE_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.7:
	add	x25, x24, #8
LBB0_8:
	ldp	x28, x20, [x25]
	ldr	x27, [x22]
	ldr	x26, [x23]
	stp	x26, x27, [sp, #64]
	bl	_V4L2_TYPE_IS_OUTPUT
	mov	x8, x0
	ldr	x9, [x25, #16]
	ldr	w0, [x9, #4]
	stp	x27, x20, [sp, #48]             ; 16-byte Folded Spill
	cbz	x8, LBB0_17
; %bb.9:
	str	x28, [sp, #40]                  ; 8-byte Folded Spill
	bl	_is_yuv422
	ldr	x8, [x25, #16]
	cbz	x0, LBB0_12
; %bb.10:
	ldr	w9, [x8]
	cmp	w9, #1
	b.ne	LBB0_12
; %bb.11:
	mov	w28, #32
	b	LBB0_13
LBB0_12:
	ldr	w0, [x8, #4]
	bl	_is_rgb
	mov	w8, #32
	mov	w9, #64
	cmp	x0, #0
	csel	x28, x9, x8, eq
	ldr	x8, [x25, #16]
LBB0_13:
	ldr	w0, [x8, #4]
	bl	_is_yuv422
	ldr	x8, [x25, #16]
	cbz	x0, LBB0_16
; %bb.14:
	ldr	w9, [x8]
	cmp	w9, #3
	b.ne	LBB0_16
; %bb.15:
	mov	x27, #0
	mov	x20, #0
	mov	w21, #32
	b	LBB0_27
LBB0_16:
	ldr	w0, [x8, #4]
	bl	_is_yuv420
	mov	x27, #0
	mov	x20, #0
	mov	w8, #32
	mov	w9, #16
	cmp	x0, #0
	csel	x21, x9, x8, eq
	b	LBB0_27
LBB0_17:
	bl	_is_yuv420
	cbnz	x0, LBB0_19
; %bb.18:
	ldr	x8, [x25, #16]
	ldr	w0, [x8, #4]
	bl	_is_yuv422
	cbz	x0, LBB0_43
LBB0_19:
	ldr	x8, [x21, #8]
	ldr	w0, [x8, #4]
	bl	_ffs
	sub	x27, x0, #1
LBB0_20:
	ldr	x8, [x25, #16]
	ldr	w0, [x8, #4]
	bl	_is_yuv420
	cbz	x0, LBB0_22
; %bb.21:
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
	bl	_ffs
	sub	x20, x0, #1
	b	LBB0_23
LBB0_22:
	mov	x20, #0
LBB0_23:
	ldr	x8, [x24]
	ldr	w8, [x8]
	cmp	w8, #270
	b.eq	LBB0_25
; %bb.24:
	cmp	w8, #90
	b.ne	LBB0_26
LBB0_25:
	ldr	x9, [x25, #8]
	ldr	x10, [x25]
	ldr	x8, [x21]
	ldp	x28, x21, [x8]
	ldr	x8, [x23]
	stp	x9, x8, [sp, #40]               ; 16-byte Folded Spill
	str	x8, [sp, #72]
	ldr	x26, [x22]
	stp	x10, x26, [sp, #56]             ; 8-byte Folded Spill
	b	LBB0_27
LBB0_26:
	str	x28, [sp, #40]                  ; 8-byte Folded Spill
	ldr	x8, [x21]
	ldp	x28, x21, [x8, #16]
LBB0_27:
	stp	x28, x21, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x27
	mov	x2, x20
	bl	_pr_debug
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	ldr	x1, [sp, #48]                   ; 8-byte Folded Reload
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, x26
	bl	_pr_debug
	str	wzr, [sp]
	add	x0, sp, #72
	add	x4, sp, #64
	mov	x1, x28
	ldr	x26, [sp, #40]                  ; 8-byte Folded Reload
	mov	x2, x26
	mov	x3, x27
	mov	x5, x21
	ldr	x21, [sp, #56]                  ; 8-byte Folded Reload
	mov	x6, x21
	mov	x7, x20
	bl	_v4l_bound_align_image
	ldr	x0, [x19]
	bl	_V4L2_TYPE_IS_OUTPUT
	cbz	x0, LBB0_29
LBB0_28:
	ldp	x1, x0, [sp, #64]
	b	LBB0_32
LBB0_29:
	ldr	x8, [x24]
	ldr	w8, [x8]
	cmp	w8, #270
	b.eq	LBB0_31
; %bb.30:
	cmp	w8, #90
	b.ne	LBB0_28
LBB0_31:
	ldp	x0, x1, [sp, #64]
LBB0_32:
	mov	x2, x22
	mov	x3, x23
	bl	_gsc_check_crop_change
	ldrsw	x9, [x19, #16]
	ldr	x8, [sp, #72]
	add	x9, x8, x9
	cmp	x9, x26
	b.le	LBB0_34
; %bb.33:
	sub	w8, w26, w8
	str	w8, [x19, #16]
LBB0_34:
	ldr	x9, [x19, #8]
	ldr	x8, [sp, #64]
	add	x9, x8, x9
	cmp	x9, x21
	b.le	LBB0_36
; %bb.35:
	sub	x8, x21, x8
	str	x8, [x19, #8]
LBB0_36:
	ldr	x8, [x25, #16]
	ldr	w0, [x8, #4]
	bl	_is_yuv420
	cbnz	x0, LBB0_38
; %bb.37:
	ldr	x8, [x25, #16]
	ldr	w0, [x8, #4]
	bl	_is_yuv422
	cbz	x0, LBB0_40
LBB0_38:
	ldr	w1, [x19, #16]
	tbz	w1, #0, LBB0_41
; %bb.39:
	sub	w1, w1, #1
	str	w1, [x19, #16]
	b	LBB0_41
LBB0_40:
	ldr	w1, [x19, #16]
LBB0_41:
	ldr	x2, [x19, #8]
	ldp	x8, x9, [x19, #24]
	stp	x26, x21, [sp, #16]
	stp	x8, x9, [sp]
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
	mov	w0, #0
LBB0_42:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_43:
	mov	x27, #0
	b	LBB0_20
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.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
l_.str.1:                               ; @.str.1
	.asciz	"user put w: %d, h: %d"

	.comm	_V4L2_BUF_TYPE_VIDEO_CAPTURE,8,3 ; @V4L2_BUF_TYPE_VIDEO_CAPTURE
	.comm	_V4L2_BUF_TYPE_VIDEO_OUTPUT,8,3 ; @V4L2_BUF_TYPE_VIDEO_OUTPUT
l_.str.2:                               ; @.str.2
	.asciz	"mod_x: %d, mod_y: %d, min_w: %d, min_h = %d"

l_.str.3:                               ; @.str.3
	.asciz	"tmp_w : %d, tmp_h : %d"

l_.str.4:                               ; @.str.4
	.asciz	"Aligned l:%d, t:%d, w:%d, h:%d, f_w: %d, f_h: %d"

.subsections_via_symbols
