	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bttv_calc_geo
_bttv_calc_geo:                         ## @bttv_calc_geo
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rsi, %r14
	movq	16(%rbp), %r15
	movl	(%r15), %eax
	cmpl	16(%r9), %eax
	jne	LBB0_5
## %bb.1:
	movq	8(%r15), %rax
	cmpq	24(%r9), %rax
	jne	LBB0_5
## %bb.2:
	movq	16(%r15), %rax
	cmpq	32(%r9), %rax
	jne	LBB0_5
## %bb.3:
	movq	24(%r15), %rax
	cmpq	40(%r9), %rax
	jne	LBB0_5
## %bb.4:
	cmpl	%edx, (%r9)
	jae	LBB0_10
LBB0_5:
	movq	(%rdi), %rax
	cmpq	8(%rdi), %rax
	jne	LBB0_6
LBB0_10:
	movq	%r14, %rsi
	movl	%ebx, %ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bttv_calc_geo_old              ## TAILCALL
LBB0_6:
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	16(%r15), %edi
	movl	%edx, %esi
	shll	$4, %esi
	movl	%edx, %r12d
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	callq	_min
	movl	%eax, %r13d
	movl	24(%r15), %edi
	movl	%ebx, %esi
	shll	$4, %esi
	callq	_min
	movl	%eax, %esi
	movl	%r12d, (%r14)
	movl	%r13d, %ecx
	shll	$12, %ecx
	movl	%r12d, %eax
	shrl	%eax
	addl	%ecx, %eax
	xorl	%edx, %edx
	divl	%r12d
	addl	$-4096, %eax                    ## imm = 0xF000
	movl	%eax, 4(%r14)
	movl	(%r15), %eax
	imull	%r12d, %eax
	addl	%r13d, %eax
	xorl	%edx, %edx
	divl	%r13d
	movl	%eax, %r8d
	andl	$-2, %eax
	movl	%eax, 8(%r14)
	movl	%esi, 12(%r14)
	movl	%ebx, %r9d
	movq	8(%r15), %rbx
	movq	-56(%rbp), %r10                 ## 8-byte Reload
	subq	8(%r10), %rbx
	movq	_MIN_VDELAY@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movq	%rbx, 16(%r14)
	movq	_BT848_VSCALE_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$8, %edi
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	cmovel	%eax, %edi
	sete	%cl
	movl	%esi, %edx
	shrl	%cl, %edx
	shll	$9, %edx
	movl	%r9d, %eax
	shrl	%eax
	addl	%edx, %eax
	xorl	%edx, %edx
	divl	%r9d
	movl	$512, %ecx                      ## imm = 0x200
	subl	%eax, %ecx
	andl	$8191, %ecx                     ## imm = 0x1FFF
	orl	%edi, %ecx
	movl	%ecx, 24(%r14)
	movl	4(%r10), %eax
	movl	%eax, 40(%r14)
	movl	%r12d, %eax
	shrl	$8, %eax
	andl	$3, %eax
	shrl	$6, %r8d
	andl	$12, %r8d
	shrl	$4, %esi
	andl	$48, %esi
	shrl	$2, %ebx
	andl	$192, %ebx
	orl	%eax, %esi
	orl	%r8d, %esi
	orl	%ebx, %esi
	movl	%esi, 28(%r14)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 16(%rax)
	je	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	cmpl	$385, %r12d                     ## imm = 0x181
	setb	%al
	cmpl	$193, %r12d
	movl	$2, %ecx
	cmovael	%eax, %ecx
	movl	%ecx, 32(%r14)
	xorl	%eax, %eax
	cmpl	$769, %r12d                     ## imm = 0x301
	setb	%al
	movl	%eax, 36(%r14)
	jmp	LBB0_9
LBB0_8:
	movq	$0, 32(%r14)
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIN_VDELAY,8,3                 ## @MIN_VDELAY
	.comm	_BT848_VSCALE_INT,4,2           ## @BT848_VSCALE_INT
	.no_dead_strip	_bttv_calc_geo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bttv_calc_geo
_bttv_calc_geo:                         ; @bttv_calc_geo
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x25, x6
	mov	x22, x5
	mov	x24, x4
	mov	x23, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	w8, [x6]
	ldr	w9, [x5, #16]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.1:
	ldr	x8, [x25, #8]
	ldr	x9, [x22, #24]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	ldr	x8, [x25, #16]
	ldr	x9, [x22, #32]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x25, #24]
	ldr	x9, [x22, #40]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	ldr	w8, [x22]
	cmp	w8, w20
	b.hs	LBB0_6
LBB0_5:
	ldp	x8, x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_7
LBB0_6:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	mov	x3, x23
	mov	x4, x24
	mov	x5, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_bttv_calc_geo_old
LBB0_7:
	ldr	w0, [x25, #16]
	lsl	w1, w20, #4
	bl	_min
	mov	x26, x0
	ldr	w0, [x25, #24]
	lsl	w1, w23, #4
	bl	_min
	lsl	w8, w26, #12
	add	w8, w8, w20, lsr #1
	udiv	w8, w8, w20
	sub	w8, w8, #1, lsl #12             ; =4096
	stp	w20, w8, [x19]
	ldr	w8, [x25]
	madd	w8, w8, w20, w26
	udiv	w8, w8, w26
	and	w9, w8, #0xfffffffe
	stp	w9, w0, [x19, #8]
	ldr	x9, [x25, #8]
	ldr	x10, [x22, #8]
Lloh0:
	adrp	x11, _MIN_VDELAY@GOTPAGE
Lloh1:
	ldr	x11, [x11, _MIN_VDELAY@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x11]
	sub	x9, x9, x10
	add	x9, x9, x11
	str	x9, [x19, #16]
Lloh3:
	adrp	x10, _BT848_VSCALE_INT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BT848_VSCALE_INT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	lsl	w10, w10, #8
	cmp	w24, #0
	csel	w10, wzr, w10, eq
	cset	w11, eq
	lsr	w11, w0, w11
	lsl	w11, w11, #9
	add	w11, w11, w23, lsr #1
	udiv	w11, w11, w23
	mov	w12, #512
	sub	w11, w12, w11
	and	w11, w11, #0x1fff
	orr	w10, w10, w11
	ldr	w11, [x22, #4]
	str	w11, [x19, #40]
	lsr	w8, w8, #6
	and	w8, w8, #0xc
	lsr	w11, w0, #4
	and	w11, w11, #0x30
	ubfx	x9, x9, #2, #30
	and	w9, w9, #0xc0
	bfxil	w11, w20, #8, #2
	orr	w8, w11, w8
	orr	w8, w8, w9
	stp	w10, w8, [x19, #24]
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_9
; %bb.8:
	cmp	w20, #385
	cset	w8, lo
	mov	w9, #2
	cmp	w20, #193
	csel	w8, w9, w8, lo
	cmp	w20, #769
	cset	w9, lo
	stp	w8, w9, [x19, #32]
	b	LBB0_10
LBB0_9:
	str	xzr, [x19, #32]
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MIN_VDELAY,8,3                 ; @MIN_VDELAY
	.comm	_BT848_VSCALE_INT,4,2           ; @BT848_VSCALE_INT
	.no_dead_strip	_bttv_calc_geo
.subsections_via_symbols
