	.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
	movq	(%rsi), %r14
	movl	(%rdx), %r15d
	movl	%r15d, -48(%rbp)
	movl	4(%rdx), %r12d
	movl	%r12d, -44(%rbp)
	movq	%r14, %rdi
	callq	_norm_maxw
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_norm_maxh
	movl	%eax, %r13d
	movl	24(%rbx), %edi
	callq	_format_by_fourcc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpq	$0, 24(%r14)
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.3:
	leal	(%r13,%r13,2), %eax
	shrl	$2, %eax
	cmpl	%eax, %r12d
	setbe	%cl
	movl	%r13d, %edx
	shrl	%cl, %edx
	movl	%edx, -44(%rbp)
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	leal	(%r12,%r12,2), %eax
	shrl	$2, %eax
	cmpl	%eax, %r15d
	setbe	%cl
	movl	%r12d, %esi
	shrl	%cl, %esi
	movl	%esi, -48(%rbp)
	jmp	LBB0_5
LBB0_1:
	movl	24(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_em28xx_videodbg
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_4:
	subq	$8, %rsp
	leaq	-48(%rbp), %rdi
	leaq	-44(%rbp), %r8
	movl	$48, %esi
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	$1, %ecx
	movl	$32, %r9d
	pushq	$0
	pushq	$1
	pushq	%r13
	callq	_v4l_bound_align_image
	addq	$32, %rsp
	movl	-48(%rbp), %esi
	movl	-44(%rbp), %edx
LBB0_5:
	leaq	-56(%rbp), %rcx
	leaq	-52(%rbp), %r8
	movq	%r14, %rdi
	callq	_get_scale
	movl	%r12d, %eax
	shlq	$12, %rax
	movl	-56(%rbp), %ecx
	addq	$4096, %rcx                     ## imm = 0x1000
	movq	%rax, %rdx
	orq	%rcx, %rdx
	movabsq	$17587891077120, %rsi           ## imm = 0xFFF00000000
	testq	%rsi, %rdx
	je	LBB0_6
## %bb.7:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rcx
	jmp	LBB0_8
LBB0_6:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ecx
LBB0_8:
	movl	%r13d, %eax
	shlq	$12, %rax
	movl	-52(%rbp), %edi
	addq	$4096, %rdi                     ## imm = 0x1000
	movq	%rax, %rdx
	orq	%rdi, %rdx
	testq	%rsi, %rdx
	je	LBB0_9
## %bb.10:
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_11
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $eax killed $eax def $rax
LBB0_11:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rbx)
	movl	%eax, 4(%rbx)
	movl	4(%rdx), %ecx
	movl	%ecx, 24(%rbx)
	movl	(%rdx), %ecx
	imull	(%r14), %ecx
	addl	$7, %ecx
	sarl	$3, %ecx
	movl	%ecx, 8(%rbx)
	imull	%eax, %ecx
	movl	%ecx, 12(%rbx)
	movq	_V4L2_COLORSPACE_SMPTE170M@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	cmpq	$0, 16(%r14)
	je	LBB0_13
## %bb.12:
	movq	_V4L2_FIELD_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_13:
	cmpq	$0, 8(%r14)
	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
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fourcc format (%08x) invalid.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.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
	ldr	x20, [x1]
	ldp	w24, w25, [x2]
	stp	w25, w24, [sp, #24]
	mov	x0, x20
	bl	_norm_maxw
	mov	x23, x0
	mov	x0, x20
	bl	_norm_maxh
	mov	x22, x0
	ldr	w0, [x19, #24]
	bl	_format_by_fourcc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_4
; %bb.2:
	add	w8, w22, w22, lsl #1
	cmp	w25, w8, lsr #2
	cset	w8, ls
	lsr	w2, w22, w8
	add	w8, w23, w23, lsl #1
	cmp	w24, w8, lsr #2
	cset	w8, ls
	lsr	w1, w23, w8
	stp	w2, w1, [sp, #24]
	b	LBB0_5
LBB0_3:
	ldr	w1, [x19, #24]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_em28xx_videodbg
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_4:
	str	wzr, [sp]
	add	x0, sp, #28
	add	x4, sp, #24
	mov	w1, #48
	mov	x2, x23
	mov	w3, #1
	mov	w5, #32
	mov	x6, x22
	mov	w7, #1
	bl	_v4l_bound_align_image
	ldp	w2, w1, [sp, #24]
LBB0_5:
	add	x3, sp, #20
	add	x4, sp, #16
	mov	x0, x20
	bl	_get_scale
	mov	w8, w23
	lsl	x8, x8, #12
	ldp	w10, w9, [sp, #16]
	add	x9, x9, #1, lsl #12             ; =4096
	udiv	x8, x8, x9
	mov	w9, w22
	lsl	x9, x9, #12
	add	x10, x10, #1, lsl #12           ; =4096
	udiv	x9, x9, x10
	stp	w8, w9, [x19]
	ldr	w8, [x21, #4]
	str	w8, [x19, #24]
	ldr	w8, [x20]
	ldr	w10, [x21]
	orr	w11, wzr, #0x7
	madd	w8, w10, w8, w11
	asr	w8, w8, #3
	mul	w9, w8, w9
	stp	w8, w9, [x19, #8]
Lloh5:
	adrp	x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V4L2_COLORSPACE_SMPTE170M@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_7
; %bb.6:
	mov	w0, #0
Lloh8:
	adrp	x8, _V4L2_FIELD_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _V4L2_FIELD_NONE@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	mov	w0, #0
	ldr	x8, [x20, #8]
Lloh10:
	adrp	x9, _V4L2_FIELD_INTERLACED@GOTPAGE
Lloh11:
	ldr	x9, [x9, _V4L2_FIELD_INTERLACED@GOTPAGEOFF]
Lloh12:
	adrp	x10, _V4L2_FIELD_TOP@GOTPAGE
Lloh13:
	ldr	x10, [x10, _V4L2_FIELD_TOP@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
LBB0_8:
	ldr	w8, [x8]
	str	w8, [x19, #16]
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fourcc format (%08x) invalid.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.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
