	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw686x_try_fmt_vid_cap
_tw686x_try_fmt_vid_cap:                ## @tw686x_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	callq	_video_drvdata
	movq	8(%rax), %r15
	movl	(%rax), %edi
	callq	_TW686X_VIDEO_HEIGHT
	movl	%eax, %r14d
	movl	24(%rbx), %edi
	callq	_format_by_fourcc
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_formats@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 24(%rbx)
LBB0_2:
	movq	_TW686X_VIDEO_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%edx, (%rbx)
	movl	4(%rbx), %esi
	cmovgl	%ecx, %edx
	movl	%r14d, %ecx
	shrl	%ecx
	cmpl	%ecx, %esi
	cmoval	%r14d, %ecx
	movl	%edx, (%rbx)
	movl	%ecx, 4(%rbx)
	imull	(%rax), %edx
	leal	7(%rdx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$3, %eax
	movl	%eax, 8(%rbx)
	imull	%ecx, %eax
	movl	%eax, 12(%rbx)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	(%r15), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_formats,8,3                    ## @formats
	.comm	_TW686X_VIDEO_WIDTH,4,2         ## @TW686X_VIDEO_WIDTH
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_tw686x_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 tw686x_try_fmt_vid_cap
_tw686x_try_fmt_vid_cap:                ; @tw686x_try_fmt_vid_cap
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	bl	_video_drvdata
	ldr	x21, [x0, #8]
	ldr	w0, [x0]
	bl	_TW686X_VIDEO_HEIGHT
	mov	x20, x0
	ldr	w0, [x19, #24]
	bl	_format_by_fourcc
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _formats@GOTPAGE
Lloh1:
	ldr	x8, [x8, _formats@GOTPAGEOFF]
Lloh2:
	ldr	x0, [x8]
	ldr	w8, [x0, #4]
	str	w8, [x19, #24]
LBB0_2:
Lloh3:
	adrp	x8, _TW686X_VIDEO_WIDTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TW686X_VIDEO_WIDTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #0
	cinc	w9, w8, lt
	asr	w9, w9, #1
	ldp	w10, w11, [x19]
	cmp	w10, w9
	csel	w8, w8, w9, gt
	lsr	w9, w20, #1
	cmp	w11, w9
	csel	w9, w20, w9, hi
	stp	w8, w9, [x19]
	ldr	w10, [x0]
	mul	w8, w10, w8
	add	w10, w8, #7
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #3
	mul	w9, w8, w9
	stp	w8, w9, [x19, #8]
Lloh6:
	adrp	x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh7:
	ldr	x8, [x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	x9, [x21]
	ldr	w9, [x9]
	stp	w9, w8, [x19, #16]
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_formats,8,3                    ; @formats
	.comm	_TW686X_VIDEO_WIDTH,4,2         ; @TW686X_VIDEO_WIDTH
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_tw686x_try_fmt_vid_cap
.subsections_via_symbols
