	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_crtc_save
_nv_crtc_save:                          ## @nv_crtc_save
	.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
	movq	%rdi, %r13
	callq	_nouveau_crtc
	movq	%rax, %r12
	movq	(%r13), %rbx
	movq	%rbx, %rdi
	callq	_nv04_display
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	24(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%r12), %r14
	movq	%rbx, %rdi
	callq	_nv04_display
	movq	%rax, %r15
	movq	8(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%r12), %rbx
	movq	(%r13), %rdi
	callq	_nv_two_heads
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	(%r13), %rdi
	movq	(%r12), %rsi
	callq	_NVSetOwner
LBB0_2:
	movq	(%r13), %rdi
	movq	(%r12), %rsi
	movq	%r15, %rdx
	callq	_nouveau_hw_save_state
	movl	$-327681, %eax                  ## imm = 0xFFFAFFFF
	andl	(%r15), %eax
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movl	%eax, 16(%r8)
	shlq	$4, %rbx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	8(%rsi,%rbx), %rax
	movq	_NV_CIO_CRE_LCD__INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	shlq	$4, %r14
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	8(%rdi,%r14), %rdx
	movl	%eax, (%rdx,%rcx,4)
	movq	_PLLSEL_VPLL1_MASK@GOTPCREL(%rip), %rax
	movq	_PLLSEL_VPLL2_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_PLLSEL_TV_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	4(%r15), %ecx
	movl	%ecx, 20(%r8)
	movl	(%rsi,%rbx), %eax
	movl	%eax, (%rdi,%r14)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_CIO_CRE_LCD__INDEX,8,3      ## @NV_CIO_CRE_LCD__INDEX
	.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
	.no_dead_strip	_nv_crtc_save
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_crtc_save
_nv_crtc_save:                          ; @nv_crtc_save
	.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	x21, x0
	bl	_nouveau_crtc
	mov	x22, x0
	ldr	x20, [x21]
	mov	x0, x20
	bl	_nv04_display
	mov	x19, x0
	ldr	x23, [x0, #24]
	ldr	x24, [x22]
	mov	x0, x20
	bl	_nv04_display
	mov	x20, x0
	ldr	x25, [x0, #8]
	ldr	x26, [x22]
	ldr	x0, [x21]
	bl	_nv_two_heads
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x21]
	ldr	x1, [x22]
	bl	_NVSetOwner
LBB0_2:
	ldr	x0, [x21]
	ldr	x1, [x22]
	mov	x2, x20
	bl	_nouveau_hw_save_state
	ldr	w8, [x20]
	mov	w9, #-327681
	and	w8, w8, w9
	str	w8, [x19, #16]
	add	x8, x25, x26, lsl #4
	ldr	x9, [x8, #8]
Lloh0:
	adrp	x10, _NV_CIO_CRE_LCD__INDEX@GOTPAGE
Lloh1:
	ldr	x10, [x10, _NV_CIO_CRE_LCD__INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	lsl	x10, x10, #2
	ldr	w9, [x9, x10]
	add	x11, x23, x24, lsl #4
	ldr	x12, [x11, #8]
	str	w9, [x12, x10]
	ldr	w9, [x20, #4]
Lloh3:
	adrp	x10, _PLLSEL_VPLL1_MASK@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PLLSEL_VPLL1_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
Lloh6:
	adrp	x12, _PLLSEL_VPLL2_MASK@GOTPAGE
Lloh7:
	ldr	x12, [x12, _PLLSEL_VPLL2_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	orr	w10, w12, w10
Lloh9:
	adrp	x12, _PLLSEL_TV_MASK@GOTPAGE
Lloh10:
	ldr	x12, [x12, _PLLSEL_TV_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w12, [x12]
	orr	w10, w10, w12
	bic	w9, w9, w10
	str	w9, [x19, #20]
	ldr	w8, [x8]
	str	w8, [x11]
	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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_CIO_CRE_LCD__INDEX,8,3      ; @NV_CIO_CRE_LCD__INDEX
	.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
	.no_dead_strip	_nv_crtc_save
.subsections_via_symbols
