	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw68_try_fmt_vid_cap
_tw68_try_fmt_vid_cap:                  ## @tw68_try_fmt_vid_cap
	.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
	callq	_video_drvdata
	movq	%rax, %r14
	movl	24(%rbx), %edi
	callq	_format_by_fourcc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edx
	movq	(%r14), %rcx
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, (%rcx)
	movl	$576, %esi                      ## imm = 0x240
	movl	$480, %r8d                      ## imm = 0x1E0
	cmovel	%esi, %r8d
	leal	-129(%rdx), %esi
	cmpl	$3, %esi
	jae	LBB0_3
## %bb.11:
	addl	%r8d, %r8d
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_3:
	cmpl	$128, %edx
	je	LBB0_6
## %bb.4:
	cmpl	$132, %edx
	je	LBB0_6
## %bb.5:
	movl	%r8d, %edx
	shrl	%edx
	cmpl	4(%rbx), %edx
	movl	$132, %edx
	sbbl	$0, %edx
LBB0_6:
	movl	%edx, (%rbx)
	movl	4(%rbx), %ecx
	movl	8(%rbx), %edx
	cmpl	$49, %edx
	movl	$48, %esi
	cmovgel	%edx, %esi
	cmpl	$33, %ecx
	movl	$32, %edi
	cmovael	%ecx, %edi
	cmpl	$720, %esi                      ## imm = 0x2D0
	movl	$720, %edx                      ## imm = 0x2D0
	cmovbl	%esi, %edx
	cmpl	%r8d, %edi
	movl	%r8d, %esi
	cmovbl	%edi, %esi
	cmpl	$32, %ecx
	jb	LBB0_8
## %bb.7:
	cmpl	%r8d, %edi
	jbe	LBB0_9
LBB0_8:
	movl	%esi, 4(%rbx)
LBB0_9:
	andl	$1020, %edx                     ## imm = 0x3FC
	movl	%edx, 8(%rbx)
	imull	(%rax), %edx
	sarl	$3, %edx
	movl	%edx, 12(%rbx)
	imull	%edx, %esi
	movl	%esi, 16(%rbx)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	xorl	%eax, %eax
LBB0_10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_tw68_try_fmt_vid_cap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw68_try_fmt_vid_cap
_tw68_try_fmt_vid_cap:                  ; @tw68_try_fmt_vid_cap
	.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
	bl	_video_drvdata
	mov	x20, x0
	ldr	w0, [x19, #24]
	bl	_format_by_fourcc
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x19]
	ldr	x9, [x20]
	ldr	w9, [x9]
Lloh0:
	adrp	x10, _V4L2_STD_525_60@GOTPAGE
Lloh1:
	ldr	x10, [x10, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	mov	w9, #480
	mov	w10, #576
	csel	w9, w10, w9, eq
	sub	w10, w8, #129
	cmp	w10, #3
	b.hs	LBB0_4
; %bb.2:
	lsl	w9, w9, #1
	b	LBB0_7
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w8, w8
	b	LBB0_11
LBB0_4:
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.5:
	cmp	w8, #132
	b.eq	LBB0_7
; %bb.6:
	ldr	w8, [x19, #4]
	cmp	w8, w9, lsr #1
	mov	w8, #131
	cinc	w8, w8, ls
LBB0_7:
	mov	w10, #48
	ldp	w13, w11, [x19, #4]
	cmp	w11, #48
	csel	w10, w11, w10, gt
	mov	w11, #32
	cmp	w13, #32
	csel	w12, w13, w11, hi
	mov	w11, #720
	cmp	w10, #720
	csel	w11, w10, w11, lo
	cmp	w12, w9
	csel	w10, w12, w9, lo
	str	w8, [x19]
	cmp	w13, #32
	b.lo	LBB0_9
; %bb.8:
	cmp	w12, w9
	b.ls	LBB0_10
LBB0_9:
	str	w10, [x19, #4]
LBB0_10:
	mov	w8, #0
	and	w9, w11, #0x3fc
	ldr	w11, [x0]
	mul	w11, w11, w9
	asr	w11, w11, #3
	stp	w9, w11, [x19, #8]
	mul	w9, w10, w11
Lloh6:
	adrp	x10, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh7:
	ldr	x10, [x10, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	stp	w9, w10, [x19, #16]
LBB0_11:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_tw68_try_fmt_vid_cap
.subsections_via_symbols
