	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv17_ctv_update_rescaler       ## -- Begin function nv17_ctv_update_rescaler
	.p2align	4, 0x90
_nv17_ctv_update_rescaler:              ## @nv17_ctv_update_rescaler
	.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	%rdi, %rbx
	movq	8(%rdi), %r15
	callq	_to_tv_enc
	movq	%rax, %r14
	movq	(%rbx), %rdi
	callq	_nouveau_crtc
	movslq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_nv04_display
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %r12
	movq	%rbx, %rdi
	callq	_get_tv_norm
	movq	%rax, %r13
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$100, %r15d
	testl	%eax, (%r13)
	jne	LBB0_2
## %bb.1:
	movl	(%r14), %r15d
LBB0_2:
	movslq	4(%r13), %rax
	movl	4(%r12), %ecx
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
                                        ## kill: def $eax killed $eax killed $rax
	subl	%ecx, %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	movl	8(%r13), %eax
	subl	8(%r12), %eax
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$35, %rsi
	addl	%eax, %esi
	movl	%ebx, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_min
	xorl	%edi, %edi
	movl	%eax, %esi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	callq	_interpolate
	movl	%eax, %ebx
	movslq	8(%r13), %rax
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$35, %rsi
	addl	%eax, %esi
	movl	%r14d, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_min
	xorl	%edi, %edi
	movl	%eax, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_interpolate
	movl	%eax, %ecx
	movl	4(%r12), %eax
	movl	8(%r12), %r8d
	shll	$11, %eax
	movl	4(%r13), %edi
	subl	%ebx, %edi
	subl	%ebx, %edi
	movl	8(%r13), %esi
	cltd
	idivl	%edi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	shll	$11, %r8d
	subl	%ecx, %esi
	subl	%ecx, %esi
	movl	%r8d, %eax
	cltd
	idivl	%esi
	andl	$-4, %eax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r12,%r12,2), %r14
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	(%r15,%r14,8), %rdx
	movq	_FP_VALID_START@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movl	%ebx, (%rdx,%rsi,4)
	notl	%ebx
	addl	4(%r13), %ebx
	movq	_FP_VALID_END@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movl	%ebx, (%rdx,%rdi,4)
	movq	8(%r15,%r14,8), %rdx
	movl	%ecx, (%rdx,%rsi,4)
	notl	%ecx
	addl	8(%r13), %ecx
	movl	%ecx, (%rdx,%rdi,4)
	movq	_NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	movq	_NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_XLATE
	movl	%eax, %ebx
	orl	%r13d, %ebx
	movq	_NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_XLATE
	orl	%ebx, %eax
	movl	%eax, 16(%r15,%r14,8)
	movq	_NV_PRAMDAC_FP_HVALID_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r15,%r14,8), %rax
	movq	_FP_VALID_START@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %ecx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_NVWriteRAMDAC
	movq	_NV_PRAMDAC_FP_HVALID_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r15,%r14,8), %rax
	movq	_FP_VALID_END@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movl	(%rax,%rcx,4), %ecx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_NVWriteRAMDAC
	movq	_NV_PRAMDAC_FP_VVALID_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	8(%r15,%r14,8), %rax
	movq	_FP_VALID_START@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %ecx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_NVWriteRAMDAC
	movq	_NV_PRAMDAC_FP_VVALID_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	8(%r15,%r14,8), %rax
	movq	(%r13), %rcx
	movl	(%rax,%rcx,4), %ecx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_NVWriteRAMDAC
	movq	_NV_PRAMDAC_FP_DEBUG_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r15,%r14,8), %ecx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NVWriteRAMDAC                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_FP_VALID_START,8,3             ## @FP_VALID_START
	.comm	_FP_VALID_END,8,3               ## @FP_VALID_END
	.comm	_NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE,4,2 ## @NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE
	.comm	_NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE,4,2 ## @NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE
	.comm	_NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE,4,2 ## @NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE
	.comm	_NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE,4,2 ## @NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE
	.comm	_NV_PRAMDAC_FP_HVALID_START,4,2 ## @NV_PRAMDAC_FP_HVALID_START
	.comm	_NV_PRAMDAC_FP_HVALID_END,4,2   ## @NV_PRAMDAC_FP_HVALID_END
	.comm	_NV_PRAMDAC_FP_VVALID_START,4,2 ## @NV_PRAMDAC_FP_VVALID_START
	.comm	_NV_PRAMDAC_FP_VVALID_END,4,2   ## @NV_PRAMDAC_FP_VVALID_END
	.comm	_NV_PRAMDAC_FP_DEBUG_1,4,2      ## @NV_PRAMDAC_FP_DEBUG_1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv17_ctv_update_rescaler       ; -- Begin function nv17_ctv_update_rescaler
	.p2align	2
_nv17_ctv_update_rescaler:              ; @nv17_ctv_update_rescaler
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x0
	ldr	x19, [x0, #8]
	bl	_to_tv_enc
	mov	x22, x0
	ldr	x0, [x21]
	bl	_nouveau_crtc
	ldrsw	x20, [x0]
	mov	x0, x19
	bl	_nv04_display
	ldr	x25, [x0]
	ldr	x26, [x21]
	mov	x0, x21
	bl	_get_tv_norm
	mov	x21, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	w22, #100
	b	LBB0_3
LBB0_2:
	ldr	w22, [x22]
LBB0_3:
	ldp	w8, w9, [x21, #4]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	ldp	w10, w11, [x26, #4]
	sub	w10, w8, w10
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w23, w10, #1
	sub	w9, w9, w11
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w24, w9, #1
	mov	w27, #26215
	movk	w27, #26214, lsl #16
	mul	x8, x8, x27
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w1, w8, w9
	mov	x0, x23
	bl	_min
	mov	x1, x0
	mov	w0, #0
	mov	x2, x23
	mov	x3, x22
	bl	_interpolate
	mov	x23, x0
	ldrsw	x8, [x21, #8]
	mul	x8, x8, x27
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w1, w8, w9
	mov	x0, x24
	bl	_min
	mov	x1, x0
	mov	w0, #0
	mov	x2, x24
	mov	x3, x22
	bl	_interpolate
	ldp	w8, w9, [x26, #4]
	ldp	w10, w11, [x21, #4]
	mov	w12, #24
	madd	x24, x20, x12, x25
Lloh3:
	adrp	x25, _FP_VALID_START@GOTPAGE
Lloh4:
	ldr	x25, [x25, _FP_VALID_START@GOTPAGEOFF]
	ldr	x12, [x25]
	lsl	x12, x12, #2
	ldp	x13, x14, [x24]
	str	w23, [x13, x12]
	ldr	w15, [x21, #4]
	mvn	w16, w23
	add	w15, w15, w16
Lloh5:
	adrp	x26, _FP_VALID_END@GOTPAGE
Lloh6:
	ldr	x26, [x26, _FP_VALID_END@GOTPAGEOFF]
	ldr	x16, [x26]
	lsl	x16, x16, #2
	str	w15, [x13, x16]
	sub	w10, w10, w23, lsl #1
	lsl	w8, w8, #11
	sdiv	w22, w8, w10
	lsl	w8, w9, #11
	sub	w9, w11, w0, lsl #1
	sdiv	w8, w8, w9
	str	w0, [x14, x12]
	and	w8, w8, #0xfffffffc
	ldr	w9, [x21, #8]
	mvn	w10, w0
	add	w9, w9, w10
	str	w9, [x14, x16]
Lloh7:
	adrp	x9, _NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE@GOTPAGEOFF]
Lloh9:
	ldr	w21, [x9]
Lloh10:
	adrp	x9, _NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x9]
	mov	x0, x8
	mov	w1, #0
	bl	_XLATE
Lloh13:
	adrp	x8, _NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE@GOTPAGEOFF]
	orr	w9, w0, w21
Lloh15:
	ldr	w8, [x8]
	orr	w21, w9, w8
Lloh16:
	adrp	x8, _NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #0
	bl	_XLATE
	orr	w8, w21, w0
Lloh19:
	adrp	x9, _NV_PRAMDAC_FP_HVALID_START@GOTPAGE
Lloh20:
	ldr	x9, [x9, _NV_PRAMDAC_FP_HVALID_START@GOTPAGEOFF]
	str	w8, [x24, #16]
Lloh21:
	ldr	w2, [x9]
	ldr	x8, [x24]
	ldr	x9, [x25]
	ldr	w3, [x8, x9, lsl #2]
	mov	x0, x19
	mov	x1, x20
	bl	_NVWriteRAMDAC
Lloh22:
	adrp	x8, _NV_PRAMDAC_FP_HVALID_END@GOTPAGE
Lloh23:
	ldr	x8, [x8, _NV_PRAMDAC_FP_HVALID_END@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	ldr	x8, [x24]
	ldr	x9, [x26]
	ldr	w3, [x8, x9, lsl #2]
	mov	x0, x19
	mov	x1, x20
	bl	_NVWriteRAMDAC
Lloh25:
	adrp	x8, _NV_PRAMDAC_FP_VVALID_START@GOTPAGE
Lloh26:
	ldr	x8, [x8, _NV_PRAMDAC_FP_VVALID_START@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	ldr	x8, [x24, #8]
	ldr	x9, [x25]
	ldr	w3, [x8, x9, lsl #2]
	mov	x0, x19
	mov	x1, x20
	bl	_NVWriteRAMDAC
Lloh28:
	adrp	x8, _NV_PRAMDAC_FP_VVALID_END@GOTPAGE
Lloh29:
	ldr	x8, [x8, _NV_PRAMDAC_FP_VVALID_END@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	ldr	x8, [x24, #8]
	ldr	x9, [x26]
	ldr	w3, [x8, x9, lsl #2]
	mov	x0, x19
	mov	x1, x20
	bl	_NVWriteRAMDAC
Lloh31:
	adrp	x8, _NV_PRAMDAC_FP_DEBUG_1@GOTPAGE
Lloh32:
	ldr	x8, [x8, _NV_PRAMDAC_FP_DEBUG_1@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	ldr	w3, [x24, #16]
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_NVWriteRAMDAC
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_FP_VALID_START,8,3             ; @FP_VALID_START
	.comm	_FP_VALID_END,8,3               ; @FP_VALID_END
	.comm	_NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE,4,2 ; @NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE
	.comm	_NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE,4,2 ; @NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE
	.comm	_NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE,4,2 ; @NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE
	.comm	_NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE,4,2 ; @NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE
	.comm	_NV_PRAMDAC_FP_HVALID_START,4,2 ; @NV_PRAMDAC_FP_HVALID_START
	.comm	_NV_PRAMDAC_FP_HVALID_END,4,2   ; @NV_PRAMDAC_FP_HVALID_END
	.comm	_NV_PRAMDAC_FP_VVALID_START,4,2 ; @NV_PRAMDAC_FP_VVALID_START
	.comm	_NV_PRAMDAC_FP_VVALID_END,4,2   ; @NV_PRAMDAC_FP_VVALID_END
	.comm	_NV_PRAMDAC_FP_DEBUG_1,4,2      ; @NV_PRAMDAC_FP_DEBUG_1
.subsections_via_symbols
