	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vidioc_try_fmt_vid_cap
_vidioc_try_fmt_vid_cap:                ## @vidioc_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	callq	_video_drvdata
	movq	%rax, %r14
	movq	8(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, -44(%rbp)
	movl	4(%rbx), %r15d
	movl	%r15d, -48(%rbp)
	movq	%r14, %rdi
	callq	_norm_maxw
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_norm_maxh
	movl	%eax, %r13d
	movl	24(%rbx), %edi
	callq	_format_by_fourcc
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpq	$0, (%r14)
	je	LBB0_6
LBB0_3:
	leal	(%r13,%r13,2), %eax
	shrl	$2, %eax
	cmpl	%eax, %r15d
	setbe	%cl
	movl	%r13d, %eax
	shrl	%cl, %eax
	leal	(%r12,%r12,2), %ecx
	shrl	$2, %ecx
	cmpl	%ecx, -52(%rbp)                 ## 4-byte Folded Reload
	setbe	%cl
	movl	%r12d, %esi
	shrl	%cl, %esi
	movl	%eax, -48(%rbp)
	movl	%esi, -44(%rbp)
	cmpl	%r12d, %esi
	jne	LBB0_7
## %bb.4:
	cmpl	%r13d, %eax
	jne	LBB0_7
## %bb.5:
	shrl	%r12d
	movl	%r12d, -44(%rbp)
	movl	%r12d, %esi
LBB0_7:
	testl	%esi, %esi
	je	LBB0_8
LBB0_9:
	movl	-48(%rbp), %edx
	testl	%edx, %edx
	jne	LBB0_11
## %bb.10:
	movl	$1, -48(%rbp)
	movl	$1, %edx
LBB0_11:
	leaq	-60(%rbp), %rcx
	leaq	-56(%rbp), %r8
	movq	%r14, %rdi
	callq	_size_to_scale
	movl	-60(%rbp), %esi
	movl	-56(%rbp), %edx
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movq	%r14, %rdi
	callq	_scale_to_size
	movl	-44(%rbp), %eax
	movl	%eax, (%rbx)
	movl	-48(%rbp), %ecx
	movl	%ecx, 4(%rbx)
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	4(%rsi), %edx
	movl	%edx, 24(%rbx)
	imull	(%rsi), %eax
	addl	$7, %eax
	shrl	$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	-80(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 8(%rax)
	je	LBB0_13
## %bb.12:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_1:
	movq	_format@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	24(%rbx), %esi
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %edx
	leaq	L_.str(%rip), %rdi
	callq	_em28xx_videodbg
	cmpq	$0, (%r14)
	jne	LBB0_3
LBB0_6:
	subq	$8, %rsp
	leaq	-44(%rbp), %rdi
	leaq	-48(%rbp), %r8
	movl	$48, %esi
	movl	%r12d, %edx
	movl	$1, %ecx
	movl	$32, %r9d
	pushq	$0
	pushq	$1
	pushq	%r13
	callq	_v4l_bound_align_image
	addq	$32, %rsp
	movl	-44(%rbp), %esi
	testl	%esi, %esi
	jne	LBB0_9
LBB0_8:
	movl	$1, -44(%rbp)
	movl	$1, %esi
	jmp	LBB0_9
LBB0_13:
	cmpq	$0, (%rax)
	jne	LBB0_14
## %bb.15:
	movq	_V4L2_FIELD_TOP@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_14:
	movq	_V4L2_FIELD_INTERLACED@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_format,8,3                     ## @format
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fourcc format (%08x) invalid. Using default (%08x).\n"

	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ## @V4L2_COLORSPACE_SMPTE170M
	.comm	_V4L2_FIELD_NONE,4,2            ## @V4L2_FIELD_NONE
	.comm	_V4L2_FIELD_INTERLACED,4,2      ## @V4L2_FIELD_INTERLACED
	.comm	_V4L2_FIELD_TOP,4,2             ## @V4L2_FIELD_TOP
	.no_dead_strip	_vidioc_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 vidioc_try_fmt_vid_cap
_vidioc_try_fmt_vid_cap:                ; @vidioc_try_fmt_vid_cap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x2
	bl	_video_drvdata
	mov	x20, x0
	ldr	x24, [x0, #8]
	ldp	w25, w26, [x19]
	stp	w26, w25, [sp, #24]
	bl	_norm_maxw
	mov	x22, x0
	mov	x0, x20
	bl	_norm_maxh
	mov	x23, x0
	ldr	w0, [x19, #24]
	bl	_format_by_fourcc
	mov	x21, x0
	cbz	x0, LBB0_8
; %bb.1:
	ldr	x8, [x20]
	cbz	x8, LBB0_9
LBB0_2:
	add	w8, w23, w23, lsl #1
	cmp	w26, w8, lsr #2
	cset	w8, ls
	lsr	w8, w23, w8
	add	w9, w22, w22, lsl #1
	cmp	w25, w9, lsr #2
	cset	w9, ls
	lsr	w1, w22, w9
	stp	w8, w1, [sp, #24]
	cmp	w1, w22
	ccmp	w8, w23, #0, eq
	b.eq	LBB0_12
; %bb.3:
	cbz	w1, LBB0_13
LBB0_4:
	ldr	w2, [sp, #24]
	cbnz	w2, LBB0_6
LBB0_5:
	mov	w2, #1
	str	w2, [sp, #24]
LBB0_6:
	add	x3, sp, #20
	add	x4, sp, #16
	mov	x0, x20
	bl	_size_to_scale
	ldp	w2, w1, [sp, #16]
	add	x3, sp, #28
	add	x4, sp, #24
	mov	x0, x20
	bl	_scale_to_size
	ldp	w9, w8, [sp, #24]
	stp	w8, w9, [x19]
	ldr	w10, [x21, #4]
	str	w10, [x19, #24]
	ldr	w10, [x21]
	orr	w11, wzr, #0x7
	madd	w8, w10, w8, w11
	lsr	w8, w8, #3
	mul	w9, w8, w9
	stp	w8, w9, [x19, #8]
Lloh0:
	adrp	x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_10
; %bb.7:
Lloh3:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
Lloh5:
	adrp	x8, _format@GOTPAGE
Lloh6:
	ldr	x8, [x8, _format@GOTPAGEOFF]
Lloh7:
	ldr	x21, [x8]
	ldr	w1, [x19, #24]
	ldr	w2, [x21, #4]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_em28xx_videodbg
	ldr	x8, [x20]
	cbnz	x8, LBB0_2
LBB0_9:
	str	wzr, [sp]
	add	x0, sp, #28
	add	x4, sp, #24
	mov	w1, #48
	mov	x2, x22
	mov	w3, #1
	mov	w5, #32
	mov	x6, x23
	mov	w7, #1
	bl	_v4l_bound_align_image
	ldr	w1, [sp, #28]
	cbnz	w1, LBB0_4
	b	LBB0_13
LBB0_10:
Lloh10:
	adrp	x8, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
	ldr	x9, [x24]
Lloh12:
	adrp	x10, _V4L2_FIELD_TOP@GOTPAGE
Lloh13:
	ldr	x10, [x10, _V4L2_FIELD_TOP@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
LBB0_11:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	lsr	w1, w22, #1
	str	w1, [sp, #28]
	cbnz	w1, LBB0_4
LBB0_13:
	mov	w1, #1
	str	w1, [sp, #28]
	ldr	w2, [sp, #24]
	cbnz	w2, LBB0_6
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_format,8,3                     ; @format
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fourcc format (%08x) invalid. Using default (%08x).\n"

	.comm	_V4L2_COLORSPACE_SMPTE170M,4,2  ; @V4L2_COLORSPACE_SMPTE170M
	.comm	_V4L2_FIELD_NONE,4,2            ; @V4L2_FIELD_NONE
	.comm	_V4L2_FIELD_INTERLACED,4,2      ; @V4L2_FIELD_INTERLACED
	.comm	_V4L2_FIELD_TOP,4,2             ; @V4L2_FIELD_TOP
	.no_dead_strip	_vidioc_try_fmt_vid_cap
.subsections_via_symbols
