	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_crtc_calc_state_ext
_nv_crtc_calc_state_ext:                ## @nv_crtc_calc_state_ext
	.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
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	%r15, %rdi
	callq	_nouveau_drm
	movq	%rax, %r14
	movl	(%rax), %edi
	callq	_nouveau_bios
	movq	%rax, %r13
	movl	(%r14), %edi
	callq	_nouveau_clock
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_nouveau_crtc
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_nv04_display
	movq	%rax, %r15
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	jne	LBB0_1
## %bb.2:
	movq	_PLL_VPLL0@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_PLL_VPLL1@GOTPCREL(%rip), %rax
LBB0_3:
	movq	8(%r15), %r12
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r13, %rdi
	callq	_nvbios_pll_parse
	testq	%rax, %rax
	jne	LBB0_19
## %bb.4:
	shlq	$5, %rbx
	leaq	(%r12,%rbx), %r13
	movq	$0, 24(%r12,%rbx)
	movl	(%r14), %edi
	callq	_nv_device
	cmpl	$65, (%rax)
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	jl	LBB0_7
## %bb.5:
	movl	-52(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	%edx, %ecx
	jl	LBB0_7
## %bb.6:
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	-48(%rbp), %edx                 ## 4-byte Reload
LBB0_7:
	leaq	-56(%rbp), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rcx
	callq	*(%rdi)
	testl	%eax, %eax
	je	LBB0_19
## %bb.8:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	_PLLSEL_VPLL1_MASK@GOTPCREL(%rip), %rcx
	movq	_PLLSEL_VPLL2_MASK@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	orl	(%rcx), %eax
	movq	_PLLSEL_TV_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	andl	%eax, (%r15)
	movl	(%r14), %edi
	callq	_nv_device
	movq	8(%rax), %rax
	movq	_NV_40@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
LBB0_10:
	movl	(%r14), %edi
	callq	_nv_device
	cmpl	$65, (%rax)
	jge	LBB0_11
## %bb.12:
	movq	_NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL@GOTPCREL(%rip), %rcx
	movq	_NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	orl	(%r15), %eax
	movl	%eax, (%r15)
	jmp	LBB0_13
LBB0_11:
	movl	(%r15), %eax
LBB0_13:
	leaq	(%r12,%rbx), %rcx
	addq	$24, %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	cmpq	$0, (%rdx)
	jne	LBB0_15
## %bb.14:
	movq	_PLLSEL_VPLL1_MASK@GOTPCREL(%rip), %r13
LBB0_15:
	orl	(%r13), %eax
	movl	%eax, (%r15)
	cmpq	$0, (%rcx)
	movl	8(%r12,%rbx), %edx
	je	LBB0_17
## %bb.16:
	movl	16(%r12,%rbx), %ecx
	movl	4(%r12,%rbx), %r8d
	movl	12(%r12,%rbx), %r9d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_NV_DEBUG
	jmp	LBB0_18
LBB0_17:
	movl	4(%r12,%rbx), %ecx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_NV_DEBUG
LBB0_18:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	8(%rdi), %esi
	callq	*16(%rdi)
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PLL_VPLL1,4,2                  ## @PLL_VPLL1
	.comm	_PLL_VPLL0,4,2                  ## @PLL_VPLL0
	.comm	_PLLSEL_VPLL1_MASK,4,2          ## @PLLSEL_VPLL1_MASK
	.comm	_PLLSEL_VPLL2_MASK,4,2          ## @PLLSEL_VPLL2_MASK
	.comm	_PLLSEL_TV_MASK,4,2             ## @PLLSEL_TV_MASK
	.comm	_NV_40,8,3                      ## @NV_40
	.comm	_NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE,4,2 ## @NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE
	.comm	_NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL,4,2 ## @NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL
	.comm	_NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL,4,2 ## @NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vpll: n1 %d n2 %d m1 %d m2 %d log2p %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"vpll: n %d m %d log2p %d\n"

	.no_dead_strip	_nv_crtc_calc_state_ext
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_crtc_calc_state_ext
_nv_crtc_calc_state_ext:                ; @nv_crtc_calc_state_ext
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, x2
	mov	x19, x0
	ldr	x21, [x0]
	mov	x0, x21
	bl	_nouveau_drm
	mov	x20, x0
	ldr	w0, [x0]
	bl	_nouveau_bios
	mov	x22, x0
	ldr	w0, [x20]
	bl	_nouveau_clock
	mov	x24, x0
	mov	x0, x19
	bl	_nouveau_crtc
	mov	x19, x0
	mov	x0, x21
	bl	_nv04_display
	mov	x21, x0
	ldr	x25, [x0, #8]
Lloh0:
	adrp	x8, _PLL_VPLL1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PLL_VPLL1@GOTPAGEOFF]
	ldr	x26, [x19]
Lloh2:
	adrp	x9, _PLL_VPLL0@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PLL_VPLL0@GOTPAGEOFF]
	cmp	x26, #0
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x22
	bl	_nvbios_pll_parse
	cbnz	x0, LBB0_14
; %bb.1:
	add	x22, x25, x26, lsl #5
	mov	x27, x22
	str	xzr, [x27, #24]!
	ldr	w0, [x20]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #65
	b.lt	LBB0_4
; %bb.2:
	ldr	w8, [sp, #28]
	cmp	w8, #0
	cinc	w8, w8, lt
	cmp	w23, w8, asr #1
	b.gt	LBB0_4
; %bb.3:
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #4
	bl	_memset
LBB0_4:
	ldr	x8, [x24]
	add	x1, sp, #24
	mov	x0, x24
	mov	x2, x23
	mov	x3, x22
	blr	x8
	cbz	w0, LBB0_14
; %bb.5:
Lloh4:
	adrp	x23, _PLLSEL_VPLL1_MASK@GOTPAGE
Lloh5:
	ldr	x23, [x23, _PLLSEL_VPLL1_MASK@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh6:
	adrp	x24, _PLLSEL_VPLL2_MASK@GOTPAGE
Lloh7:
	ldr	x24, [x24, _PLLSEL_VPLL2_MASK@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _PLLSEL_TV_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PLLSEL_TV_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x21]
	and	w8, w9, w8
	str	w8, [x21]
	ldr	w0, [x20]
	bl	_nv_device
	ldr	x8, [x0, #8]
Lloh11:
	adrp	x9, _NV_40@GOTPAGE
Lloh12:
	ldr	x9, [x9, _NV_40@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
Lloh14:
	adrp	x8, _NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
LBB0_7:
	ldr	w0, [x20]
	bl	_nv_device
	ldr	w8, [x0]
	cmp	w8, #65
	b.ge	LBB0_9
; %bb.8:
Lloh17:
	adrp	x8, _NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL@GOTPAGEOFF]
Lloh19:
	adrp	x9, _NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x21]
	orr	w8, w8, w9
	str	w8, [x21]
	b	LBB0_10
LBB0_9:
	ldr	w8, [x21]
LBB0_10:
	ldr	x9, [x19]
	cmp	x9, #0
	csel	x9, x23, x24, eq
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x21]
	ldr	x9, [x27]
	add	x8, x25, x26, lsl #5
	ldr	w2, [x8, #8]
	cbz	x9, LBB0_12
; %bb.11:
	ldr	w4, [x8, #4]
	ldp	w8, w3, [x8, #12]
	ldr	w9, [x22]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	stp	x8, x9, [sp]
	b	LBB0_13
LBB0_12:
	ldr	w3, [x8, #4]
	ldr	w4, [x22]
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_13:
	mov	x0, x20
	bl	_NV_DEBUG
	ldr	x8, [x19, #16]
	ldr	w1, [x19, #8]
	mov	x0, x19
	blr	x8
LBB0_14:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_PLL_VPLL1,4,2                  ; @PLL_VPLL1
	.comm	_PLL_VPLL0,4,2                  ; @PLL_VPLL0
	.comm	_PLLSEL_VPLL1_MASK,4,2          ; @PLLSEL_VPLL1_MASK
	.comm	_PLLSEL_VPLL2_MASK,4,2          ; @PLLSEL_VPLL2_MASK
	.comm	_PLLSEL_TV_MASK,4,2             ; @PLLSEL_TV_MASK
	.comm	_NV_40,8,3                      ; @NV_40
	.comm	_NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE,4,2 ; @NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE
	.comm	_NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL,4,2 ; @NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL
	.comm	_NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL,4,2 ; @NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vpll: n1 %d n2 %d m1 %d m2 %d log2p %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"vpll: n %d m %d log2p %d\n"

	.no_dead_strip	_nv_crtc_calc_state_ext
.subsections_via_symbols
