	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa7134_try_fmt_vid_cap
_saa7134_try_fmt_vid_cap:               ## @saa7134_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	callq	_video_drvdata
	movq	%rax, %rbx
	movl	24(%r12), %edi
	callq	_format_by_fourcc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movl	(%r12), %r13d
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	shll	$2, %edi
	callq	_min
	movl	%eax, %r15d
	movl	(%rbx), %esi
	movl	12(%rbx), %edi
	shll	$2, %edi
	callq	_min
	movq	_V4L2_FIELD_ANY@GOTPCREL(%rip), %rcx
	cmpl	%r13d, (%rcx)
	jne	LBB0_3
## %bb.4:
	movl	%eax, %ecx
	shrl	%ecx
	cmpl	%ecx, 4(%r12)
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	$129, %r13d
	cmoval	%edx, %r13d
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_3:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_5:
	movl	%r13d, %ecx
	andl	$-2, %ecx
	cmpl	$128, %ecx
	cmovel	%r13d, %edx
	sete	%cl
	shrl	%cl, %eax
	movl	%edx, (%r12)
	movl	4(%r12), %edi
	movl	8(%r12), %edx
	cmpl	$49, %edx
	movl	$48, %ecx
	cmovgel	%edx, %ecx
	cmpl	$33, %edi
	movl	$32, %esi
	cmovael	%edi, %esi
	cmpl	%r15d, %ecx
	cmovael	%r15d, %ecx
	cmpl	%eax, %esi
	movl	%eax, %edx
	cmovbl	%esi, %edx
	cmpl	$32, %edi
	jb	LBB0_7
## %bb.6:
	cmpl	%eax, %esi
	jbe	LBB0_8
LBB0_7:
	movl	%edx, 4(%r12)
LBB0_8:
	andl	$2147483644, %ecx               ## imm = 0x7FFFFFFC
	movl	%ecx, 8(%r12)
	cmpq	$0, 8(%r14)
	movl	%ecx, %eax
	jne	LBB0_10
## %bb.9:
	movl	(%r14), %esi
	imull	%ecx, %esi
	leal	7(%rsi), %eax
	testl	%esi, %esi
	cmovnsl	%esi, %eax
	sarl	$3, %eax
LBB0_10:
	movl	%eax, 12(%r12)
	imull	%ecx, %edx
	imull	(%r14), %edx
	shrl	$3, %edx
	movl	%edx, 16(%r12)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r12)
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_FIELD_ANY,4,2             ## @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_INTERLACED,4,2      ## @V4L2_FIELD_INTERLACED
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_saa7134_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 saa7134_try_fmt_vid_cap
_saa7134_try_fmt_vid_cap:               ; @saa7134_try_fmt_vid_cap
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	bl	_video_drvdata
	mov	x22, x0
	ldr	w0, [x19, #24]
	bl	_format_by_fourcc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w23, [x19]
	ldp	w1, w8, [x22, #4]
	lsl	w0, w8, #2
	bl	_min
	mov	x21, x0
	ldr	w8, [x22, #12]
	lsl	w0, w8, #2
	ldr	w1, [x22]
	bl	_min
Lloh0:
	adrp	x8, _V4L2_FIELD_ANY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_FIELD_ANY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_4
; %bb.2:
	ldr	w9, [x19, #4]
Lloh3:
	adrp	x8, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w9, w0, lsr #1
	mov	w9, #129
	csel	w23, w8, w9, hi
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_4:
Lloh9:
	adrp	x8, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
LBB0_5:
	and	w9, w23, #0xfffffffe
	cmp	w9, #128
	csel	w12, w23, w8, eq
	cset	w8, eq
	lsr	w9, w0, w8
	mov	w8, #48
	ldp	w13, w10, [x19, #4]
	cmp	w10, #48
	csel	w8, w10, w8, gt
	mov	w10, #32
	cmp	w13, #32
	csel	w11, w13, w10, hi
	cmp	w8, w21
	csel	w10, w8, w21, lo
	cmp	w11, w9
	csel	w8, w11, w9, lo
	str	w12, [x19]
	cmp	w13, #32
	b.lo	LBB0_7
; %bb.6:
	cmp	w11, w9
	b.ls	LBB0_8
LBB0_7:
	str	w8, [x19, #4]
LBB0_8:
	and	w9, w10, #0x7ffffffc
	str	w9, [x19, #8]
	ldr	x11, [x20, #8]
	mov	x10, x9
	cbnz	x11, LBB0_10
; %bb.9:
	ldr	w10, [x20]
	mul	w10, w10, w9
	add	w11, w10, #7
	cmp	w10, #0
	csel	w10, w11, w10, lt
	asr	w10, w10, #3
LBB0_10:
	mov	w0, #0
	str	w10, [x19, #12]
	mul	w8, w8, w9
	ldr	w9, [x20]
	mul	w8, w8, w9
Lloh12:
	adrp	x9, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh13:
	ldr	x9, [x9, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsr	w8, w8, #3
	stp	w8, w9, [x19, #16]
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_FIELD_ANY,4,2             ; @V4L2_FIELD_ANY
	.comm	_V4L2_FIELD_INTERLACED,4,2      ; @V4L2_FIELD_INTERLACED
	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.no_dead_strip	_saa7134_try_fmt_vid_cap
.subsections_via_symbols
