	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv04_lvds_dpms
_nv04_lvds_dpms:                        ## @nv04_lvds_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_nouveau_drm
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nouveau_encoder
	movq	%rax, %r13
	movl	(%rax), %edi
	callq	_is_powersaving_dpms
	cmpl	%r12d, (%r13)
	je	LBB0_15
## %bb.1:
	movl	%eax, %r15d
	movl	%r12d, (%r13)
	movq	8(%r13), %rax
	movl	8(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_NV_DEBUG
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.2:
	movl	%r12d, %edi
	callq	_is_powersaving_dpms
	testl	%eax, %eax
	je	LBB0_3
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	8(%r13), %rsi
	cmpq	$0, (%rsi)
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_11
## %bb.4:
	testq	%r15, %r15
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_nouveau_crtc
	movl	(%rax), %edx
	jmp	LBB0_7
LBB0_6:
	movq	%r14, %rdi
	callq	_nv04_dfp_get_bound_head
	movl	%eax, %edx
LBB0_7:
	movq	_DRM_MODE_DPMS_ON@GOTPCREL(%rip), %rax
	movq	8(%r13), %rsi
	cmpl	%r12d, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	_LVDS_PANEL_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	16(%r13), %r8d
	movq	%r14, %rdi
	jmp	LBB0_10
LBB0_9:
	movq	_LVDS_PANEL_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%r8d, %r8d
LBB0_10:
	callq	_call_lvds_script
LBB0_11:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_nv04_dfp_update_backlight
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_nv04_dfp_update_fp_control
	movq	_DRM_MODE_DPMS_ON@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	callq	_nouveau_crtc
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_nv04_dfp_prepare_sel_clk
	jmp	LBB0_14
LBB0_13:
	movq	_NV_PRAMDAC_SEL_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_NVReadRAMDAC
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_nv04_display
	movl	%ebx, (%rax)
	movq	%r14, %rdi
	callq	_nv04_display
	andb	$15, (%rax)
LBB0_14:
	movq	_NV_PRAMDAC_SEL_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_nv04_display
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NVWriteRAMDAC                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting dpms mode %d on lvds encoder (output %d)\n"

	.comm	_DRM_MODE_DPMS_ON,4,2           ## @DRM_MODE_DPMS_ON
	.comm	_LVDS_PANEL_ON,4,2              ## @LVDS_PANEL_ON
	.comm	_LVDS_PANEL_OFF,4,2             ## @LVDS_PANEL_OFF
	.comm	_NV_PRAMDAC_SEL_CLK,4,2         ## @NV_PRAMDAC_SEL_CLK
	.no_dead_strip	_nv04_lvds_dpms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv04_lvds_dpms
_nv04_lvds_dpms:                        ; @nv04_lvds_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	x23, x0
	ldp	x20, x19, [x0]
	mov	x0, x19
	bl	_nouveau_drm
	mov	x24, x0
	mov	x0, x23
	bl	_nouveau_encoder
	mov	x22, x0
	ldr	w0, [x0]
	bl	_is_powersaving_dpms
	ldr	w8, [x22]
	cmp	w8, w21
	b.eq	LBB0_3
; %bb.1:
	mov	x25, x0
	str	w21, [x22]
	ldr	x8, [x22, #8]
	ldr	w3, [x8, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x21
	bl	_NV_DEBUG
	cbz	w25, LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_is_powersaving_dpms
	cbz	w0, LBB0_4
LBB0_3:
	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_4:
	ldr	x1, [x22, #8]
	ldr	x8, [x1]
Lloh2:
	adrp	x24, _DRM_MODE_DPMS_ON@GOTPAGE
Lloh3:
	ldr	x24, [x24, _DRM_MODE_DPMS_ON@GOTPAGEOFF]
	cbz	x8, LBB0_12
; %bb.5:
	cbz	x20, LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_nouveau_crtc
	ldr	w2, [x0]
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	bl	_nv04_dfp_get_bound_head
	mov	x2, x0
LBB0_8:
	ldr	w8, [x24]
	ldr	x1, [x22, #8]
	cmp	w8, w21
	b.ne	LBB0_10
; %bb.9:
Lloh4:
	adrp	x8, _LVDS_PANEL_ON@GOTPAGE
Lloh5:
	ldr	x8, [x8, _LVDS_PANEL_ON@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	ldr	w4, [x22, #16]
	mov	x0, x19
	b	LBB0_11
LBB0_10:
Lloh7:
	adrp	x8, _LVDS_PANEL_OFF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LVDS_PANEL_OFF@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #0
LBB0_11:
	bl	_call_lvds_script
LBB0_12:
	mov	x0, x23
	mov	x1, x21
	bl	_nv04_dfp_update_backlight
	mov	x0, x23
	mov	x1, x21
	bl	_nv04_dfp_update_fp_control
	ldr	w8, [x24]
Lloh10:
	adrp	x23, _NV_PRAMDAC_SEL_CLK@GOTPAGE
Lloh11:
	ldr	x23, [x23, _NV_PRAMDAC_SEL_CLK@GOTPAGEOFF]
	cmp	w8, w21
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_nouveau_crtc
	ldr	w2, [x0]
	mov	x0, x19
	mov	x1, x22
	bl	_nv04_dfp_prepare_sel_clk
	b	LBB0_15
LBB0_14:
	ldr	w2, [x23]
	mov	x0, x19
	mov	w1, #0
	bl	_NVReadRAMDAC
	mov	x20, x0
	mov	x0, x19
	bl	_nv04_display
	str	w20, [x0]
	mov	x0, x19
	bl	_nv04_display
	ldr	w8, [x0]
	and	w8, w8, #0xffffff0f
	str	w8, [x0]
LBB0_15:
	ldr	w20, [x23]
	mov	x0, x19
	bl	_nv04_display
	ldr	w3, [x0]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	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	_NVWriteRAMDAC
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting dpms mode %d on lvds encoder (output %d)\n"

	.comm	_DRM_MODE_DPMS_ON,4,2           ; @DRM_MODE_DPMS_ON
	.comm	_LVDS_PANEL_ON,4,2              ; @LVDS_PANEL_ON
	.comm	_LVDS_PANEL_OFF,4,2             ; @LVDS_PANEL_OFF
	.comm	_NV_PRAMDAC_SEL_CLK,4,2         ; @NV_PRAMDAC_SEL_CLK
	.no_dead_strip	_nv04_lvds_dpms
.subsections_via_symbols
