	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv_crtc_dpms
_nv_crtc_dpms:                          ## @nv_crtc_dpms
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_nouveau_crtc
	movq	%rax, %r12
	movq	(%rbx), %r14
	movq	%r14, %rdi
	callq	_nouveau_drm
	movl	4(%r12), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	movl	%r15d, %edx
	callq	_NV_DEBUG
	cmpl	%r15d, (%r12)
	jne	LBB0_1
## %bb.12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%r15d, (%r12)
	movq	%r14, %rdi
	callq	_nv_two_heads
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	4(%r12), %esi
	movq	%r14, %rdi
	callq	_NVSetOwner
LBB0_3:
	movl	4(%r12), %esi
	movq	_NV_CIO_CRE_RPC1_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_NVReadVgaCrtc
	movl	%eax, %ecx
	andb	$63, %cl
	cmpl	$128, %r15d
	je	LBB0_9
## %bb.4:
	cmpl	$131, %r15d
	je	LBB0_10
## %bb.5:
	xorl	%r13d, %r13d
	movl	$128, %ebx
	cmpl	$129, %r15d
	jne	LBB0_6
## %bb.7:
	orb	$-128, %cl
	jmp	LBB0_8
LBB0_9:
	movl	$128, %ebx
	orb	$64, %cl
LBB0_8:
	movb	%cl, -41(%rbp)                  ## 1-byte Spill
	movl	$32, %r13d
	jmp	LBB0_11
LBB0_10:
	orb	$-64, %al
	xorl	%ebx, %ebx
	movl	$32, %r13d
                                        ## kill: def $al killed $al killed $eax
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	jmp	LBB0_11
LBB0_6:
	movb	%cl, -41(%rbp)                  ## 1-byte Spill
LBB0_11:
	movl	4(%r12), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_NVVgaSeqReset
	movl	4(%r12), %esi
	movq	_NV_VIO_SR_CLOCK_INDEX@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_NVReadVgaSeq
	andl	$223, %eax
	orl	%eax, %r13d
	movl	4(%r12), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%r13d, %ecx
	callq	_NVWriteVgaSeq
	movl	4(%r12), %esi
	movq	_NV_CIO_CR_MODE_INDEX@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_NVReadVgaCrtc
	andl	$127, %eax
	orl	%eax, %ebx
	movl	$10, %edi
	callq	_mdelay
	movl	4(%r12), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%ebx, %ecx
	callq	_NVWriteVgaCrtc
	movl	4(%r12), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_NVVgaSeqReset
	movl	4(%r12), %esi
	movq	_NV_CIO_CRE_RPC1_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movzbl	-41(%rbp), %ecx                 ## 1-byte Folded Reload
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NVWriteVgaCrtc                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting dpms mode %d on CRTC %d\n"

	.comm	_NV_CIO_CRE_RPC1_INDEX,4,2      ## @NV_CIO_CRE_RPC1_INDEX
	.comm	_NV_VIO_SR_CLOCK_INDEX,4,2      ## @NV_VIO_SR_CLOCK_INDEX
	.comm	_NV_CIO_CR_MODE_INDEX,4,2       ## @NV_CIO_CR_MODE_INDEX
	.no_dead_strip	_nv_crtc_dpms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv_crtc_dpms
_nv_crtc_dpms:                          ; @nv_crtc_dpms
	.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, x1
	mov	x19, x0
	bl	_nouveau_crtc
	mov	x20, x0
	ldr	x19, [x19]
	mov	x0, x19
	bl	_nouveau_drm
	ldr	w3, [x20, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_NV_DEBUG
	ldr	w8, [x20]
	cmp	w8, w21
	b.ne	LBB0_2
; %bb.1:
	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
LBB0_2:
	str	w21, [x20]
	mov	x0, x19
	bl	_nv_two_heads
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w1, [x20, #4]
	mov	x0, x19
	bl	_NVSetOwner
LBB0_4:
	ldr	w1, [x20, #4]
Lloh2:
	adrp	x22, _NV_CIO_CRE_RPC1_INDEX@GOTPAGE
Lloh3:
	ldr	x22, [x22, _NV_CIO_CRE_RPC1_INDEX@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_NVReadVgaCrtc
	and	w8, w0, #0x3f
	mov	w9, #128
	orr	w10, w8, #0x40
	mov	w11, #128
	mov	w12, #32
	orr	w13, w0, #0xffffffc0
	mov	w14, #32
	orr	w15, w8, #0xffffff80
	mov	w16, #128
	mov	w17, #32
	cmp	w21, #129
	csel	w17, wzr, w17, ne
	csel	w9, w9, w16, ne
	csel	w8, w8, w15, ne
	cmp	w21, #131
	csel	w14, w14, w17, eq
	csel	w9, wzr, w9, eq
	csel	w8, w13, w8, eq
	cmp	w21, #128
	csel	w21, w12, w14, eq
	csel	w24, w11, w9, eq
	csel	w23, w10, w8, eq
	ldr	w1, [x20, #4]
	mov	x0, x19
	mov	w2, #1
	bl	_NVVgaSeqReset
	ldr	w1, [x20, #4]
Lloh4:
	adrp	x25, _NV_VIO_SR_CLOCK_INDEX@GOTPAGE
Lloh5:
	ldr	x25, [x25, _NV_VIO_SR_CLOCK_INDEX@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x19
	bl	_NVReadVgaSeq
	mov	w8, #223
	and	w8, w0, w8
	orr	w3, w8, w21
	ldr	w1, [x20, #4]
	ldr	w2, [x25]
	mov	x0, x19
	bl	_NVWriteVgaSeq
	ldr	w1, [x20, #4]
Lloh6:
	adrp	x25, _NV_CIO_CR_MODE_INDEX@GOTPAGE
Lloh7:
	ldr	x25, [x25, _NV_CIO_CR_MODE_INDEX@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x19
	bl	_NVReadVgaCrtc
	and	w8, w0, #0x7f
	orr	w21, w8, w24
	mov	w0, #10
	bl	_mdelay
	ldr	w1, [x20, #4]
	ldr	w2, [x25]
	mov	x0, x19
	mov	x3, x21
	bl	_NVWriteVgaCrtc
	ldr	w1, [x20, #4]
	mov	x0, x19
	mov	w2, #0
	bl	_NVVgaSeqReset
	ldr	w1, [x20, #4]
	ldr	w2, [x22]
	and	w3, w23, #0xff
	mov	x0, x19
	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	_NVWriteVgaCrtc
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting dpms mode %d on CRTC %d\n"

	.comm	_NV_CIO_CRE_RPC1_INDEX,4,2      ; @NV_CIO_CRE_RPC1_INDEX
	.comm	_NV_VIO_SR_CLOCK_INDEX,4,2      ; @NV_VIO_SR_CLOCK_INDEX
	.comm	_NV_CIO_CR_MODE_INDEX,4,2       ; @NV_CIO_CR_MODE_INDEX
	.no_dead_strip	_nv_crtc_dpms
.subsections_via_symbols
