	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function limit_scaled_size_lock
_limit_scaled_size_lock:                ## @limit_scaled_size_lock
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r13d
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	testl	%r8d, %r8d
	setns	%al
	movl	%r8d, %ecx
	negl	%ecx
	movl	%r9d, -68(%rbp)                 ## 4-byte Spill
	cmpl	%r9d, %ecx
	setbe	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_BUG_ON
	movq	_bttv_tvnorms@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	leaq	(%rax,%rax,2), %r12
	leaq	(%r15,%r12,8), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	movq	%rcx, %r14
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%r14,%rcx,8), %rdx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	cmpl	$0, 24(%rbp)
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.1:
	cmpl	$0, 16(%rbp)
	je	LBB0_8
## %bb.2:
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	_VIDEO_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_locked_btres
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_4
LBB0_8:
	movq	8(%rbx), %rax
	cmpq	16(%r14,%rcx,8), %rax
	jle	LBB0_10
## %bb.9:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_21
LBB0_10:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %r12d
	movl	4(%r14,%rcx,8), %esi
	movl	8(%r14,%rcx,8), %edi
	movl	12(%r14,%rcx,8), %edx
	movb	$1, %r15b
LBB0_11:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	movq	%r14, -120(%rbp)                ## 8-byte Spill
	movl	%r13d, %r14d
	notl	%r14d
	addl	%r14d, %r12d
	andl	%r13d, %r12d
	andl	%r13d, %edi
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movl	%edx, %ebx
	callq	_V4L2_FIELD_HAS_BOTH
	testl	%eax, %eax
	sete	%cl
	shrl	%cl, %ebx
	cmpl	$0, 16(%rbp)
	je	LBB0_15
## %bb.12:
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	movl	%r12d, %esi
	movl	%ebx, %r12d
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_clamp
	movl	%eax, (%r14)
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	callq	_clamp
	movl	%eax, (%rbx)
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	addl	(%r14), %edx
	andl	%r13d, %edx
	movl	%edx, (%r14)
	testb	%r15b, %r15b
	movq	-120(%rbp), %r14                ## 8-byte Reload
	jne	LBB0_20
## %bb.13:
	movl	(%rbx), %ecx
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_bttv_crop_adjust
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	8(%rax), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpq	16(%r14,%rcx,8), %rax
	jle	LBB0_20
## %bb.14:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%r14,%rcx,8), %rcx
	addq	$16, %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_20
LBB0_15:
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	cmpl	%r12d, %eax
	jb	LBB0_21
## %bb.16:
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	cmpl	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	jb	LBB0_21
## %bb.17:
	cmpl	%esi, %eax
	ja	LBB0_21
## %bb.18:
	cmpl	%ebx, %ecx
	ja	LBB0_21
## %bb.19:
	andl	%r14d, %eax
	jne	LBB0_21
LBB0_20:
	xorl	%r15d, %r15d
LBB0_21:
	movl	%r15d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	16(%r15,%r12,8), %edi
	movq	_MAX_HACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	movl	%eax, %edi
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	8(%rbx), %rcx
	movq	8(%r15,%r12,8), %rax
	movl	$32, %esi
	movl	$48, %r12d
	xorl	%r15d, %r15d
	cmpq	%rcx, %rax
	jge	LBB0_5
## %bb.6:
	subl	%ecx, %eax
	addl	%eax, %edx
	cmpl	$32, %edx
	jae	LBB0_11
## %bb.7:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_21
LBB0_5:
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_bttv_tvnorms,8,3               ## @bttv_tvnorms
	.comm	_VIDEO_RESOURCES,4,2            ## @VIDEO_RESOURCES
	.comm	_MAX_HACTIVE,8,3                ## @MAX_HACTIVE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_limit_scaled_size_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function limit_scaled_size_lock
_limit_scaled_size_lock:                ; @limit_scaled_size_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x7
	mov	x27, x6
	mov	x23, x4
	str	w3, [sp, #44]                   ; 4-byte Folded Spill
	str	x2, [sp, #32]                   ; 8-byte Folded Spill
	mov	x22, x1
	mov	x25, x0
	ldr	x21, [x0, #8]
	neg	w8, w4
	cmp	w4, #0
	str	w5, [sp, #20]                   ; 4-byte Folded Spill
	ccmp	w8, w5, #0, lt
	cset	w0, ls
	bl	_BUG_ON
Lloh0:
	adrp	x8, _bttv_tvnorms@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bttv_tvnorms@GOTPAGEOFF]
Lloh2:
	ldr	x26, [x8]
	ldr	x24, [x21]
	mov	w9, #24
	madd	x8, x24, x9, x26
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	ldr	x28, [x21, #16]
	ldr	x8, [x25]
	cmp	x8, #0
	cset	w19, ne
	umaddl	x25, w19, w9, x28
	cbz	w20, LBB0_4
; %bb.1:
	cbz	w27, LBB0_4
; %bb.2:
	cbz	x8, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _VIDEO_RESOURCES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDEO_RESOURCES@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_locked_btres
	cbz	w0, LBB0_7
LBB0_4:
	ldr	x8, [x21, #8]
	mov	w9, #24
	madd	x9, x19, x9, x28
	ldr	x9, [x9, #16]
	cmp	x8, x9
	b.le	LBB0_6
LBB0_5:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_6:
	str	x25, [sp]                       ; 8-byte Folded Spill
	ldr	w8, [x25]
	mov	w9, #24
	madd	x9, x19, x9, x28
	ldp	w10, w0, [x9, #4]
	ldr	w25, [x9, #12]
	mov	w9, #1
	stp	w9, w10, [sp, #12]              ; 8-byte Folded Spill
	b	LBB0_10
LBB0_7:
	str	x25, [sp]                       ; 8-byte Folded Spill
	mov	w8, #24
	madd	x20, x24, x8, x26
	ldr	w0, [x20, #16]
Lloh9:
	adrp	x8, _MAX_HACTIVE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX_HACTIVE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_min
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w25, [x8]
	ldr	x8, [x21, #8]
	ldr	x9, [x20, #8]
	cmp	x9, x8
	b.ge	LBB0_9
; %bb.8:
	sub	w8, w9, w8
	add	w25, w25, w8
	cmp	w25, #32
	b.lo	LBB0_5
LBB0_9:
	mov	w8, #32
	stp	wzr, w8, [sp, #12]              ; 8-byte Folded Spill
	mov	w8, #48
LBB0_10:
	mvn	w24, w23
	add	w8, w8, w24
	and	w26, w8, w23
	and	w20, w0, w23
	ldr	w0, [sp, #44]                   ; 4-byte Folded Reload
	bl	_V4L2_FIELD_HAS_BOTH
	cmp	w0, #0
	cset	w8, eq
	lsr	w25, w25, w8
	cbz	w27, LBB0_14
; %bb.11:
	ldr	w0, [x22]
	mov	x1, x26
	mov	x2, x20
	bl	_clamp
	str	w0, [x22]
	ldr	x20, [sp, #32]                  ; 8-byte Folded Reload
	ldr	w0, [x20]
	ldr	w1, [sp, #16]                   ; 4-byte Folded Reload
	mov	x2, x25
	bl	_clamp
	str	w0, [x20]
	ldr	w8, [x22]
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	add	w8, w8, w9
	and	w2, w8, w23
	str	w2, [x22]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	tbnz	w8, #0, LBB0_16
; %bb.12:
	ldr	w3, [x20]
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w4, [sp, #44]                   ; 4-byte Folded Reload
	bl	_bttv_crop_adjust
	ldr	x8, [x21, #8]
	mov	w9, #24
	madd	x9, x19, x9, x28
	ldr	x10, [x9, #16]!
	cmp	x8, x10
	b.le	LBB0_16
; %bb.13:
	str	x8, [x9]
	b	LBB0_16
LBB0_14:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	ldr	w8, [x22]
	cmp	w8, w26
	b.lo	LBB0_17
; %bb.15:
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	ldr	w9, [x9]
	and	w10, w8, w24
	ldr	w11, [sp, #16]                  ; 4-byte Folded Reload
	cmp	w9, w11
	ccmp	w8, w20, #2, hs
	ccmp	w9, w25, #2, ls
	ccmp	w10, #0, #0, ls
	b.ne	LBB0_17
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	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	_bttv_tvnorms,8,3               ; @bttv_tvnorms
	.comm	_VIDEO_RESOURCES,4,2            ; @VIDEO_RESOURCES
	.comm	_MAX_HACTIVE,8,3                ; @MAX_HACTIVE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_limit_scaled_size_lock
.subsections_via_symbols
