	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_crtc_prepare
_nv_crtc_prepare:                       ## @nv_crtc_prepare
	.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
	pushq	%rax
	.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), %r12
	movq	%r12, %rdi
	callq	_nouveau_drm
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_nouveau_crtc
	movq	%rax, %r14
	movq	(%rbx), %r13
	movq	%r12, %rdi
	callq	_nv_two_heads
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_NVSetOwner
LBB0_2:
	movq	%rbx, %rdi
	callq	_drm_crtc_vblank_off
	movq	_DRM_MODE_DPMS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	*(%r13)
	movl	(%r14), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_NVBlankScreen
	movl	(%r14), %esi
	movq	_NV_PCRTC_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_NVWriteCRTC
	movq	(%r15), %rax
	movq	_NV_DEVICE_INFO_V0_CURIE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.4:
	movl	(%r14), %esi
	movq	_NV_PRAMDAC_900@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_NVReadRAMDAC
	movl	(%r14), %esi
	movl	(%rbx), %edx
	andl	$-65537, %eax                   ## imm = 0xFFFEFFFF
	movq	%r12, %rdi
	movl	%eax, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NVWriteRAMDAC                  ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_DPMS_OFF,4,2          ## @DRM_MODE_DPMS_OFF
	.comm	_NV_PCRTC_CONFIG,4,2            ## @NV_PCRTC_CONFIG
	.comm	_NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA,4,2 ## @NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA
	.comm	_NV_DEVICE_INFO_V0_CURIE,8,3    ## @NV_DEVICE_INFO_V0_CURIE
	.comm	_NV_PRAMDAC_900,4,2             ## @NV_PRAMDAC_900
	.no_dead_strip	_nv_crtc_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_crtc_prepare
_nv_crtc_prepare:                       ; @nv_crtc_prepare
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_nouveau_drm
	mov	x21, x0
	mov	x0, x22
	bl	_nouveau_crtc
	mov	x20, x0
	ldr	x23, [x22]
	mov	x0, x19
	bl	_nv_two_heads
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_NVSetOwner
LBB0_2:
	mov	x0, x22
	bl	_drm_crtc_vblank_off
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _DRM_MODE_DPMS_OFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_DPMS_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	mov	x0, x22
	blr	x8
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #1
	bl	_NVBlankScreen
	ldr	w1, [x20]
Lloh3:
	adrp	x8, _NV_PCRTC_CONFIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NV_PCRTC_CONFIG@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_NVWriteCRTC
	ldr	x8, [x21]
Lloh9:
	adrp	x9, _NV_DEVICE_INFO_V0_CURIE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NV_DEVICE_INFO_V0_CURIE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	w1, [x20]
Lloh12:
	adrp	x21, _NV_PRAMDAC_900@GOTPAGE
Lloh13:
	ldr	x21, [x21, _NV_PRAMDAC_900@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_NVReadRAMDAC
	ldr	w1, [x20]
	ldr	w2, [x21]
	and	w3, w0, #0xfffeffff
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_NVWriteRAMDAC
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 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
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_DPMS_OFF,4,2          ; @DRM_MODE_DPMS_OFF
	.comm	_NV_PCRTC_CONFIG,4,2            ; @NV_PCRTC_CONFIG
	.comm	_NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA,4,2 ; @NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA
	.comm	_NV_DEVICE_INFO_V0_CURIE,8,3    ; @NV_DEVICE_INFO_V0_CURIE
	.comm	_NV_PRAMDAC_900,4,2             ; @NV_PRAMDAC_900
	.no_dead_strip	_nv_crtc_prepare
.subsections_via_symbols
