	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv17_tv_dpms
_nv17_tv_dpms:                          ## @nv17_tv_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, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_nouveau_drm
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_nvxx_gpio
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_tv_enc
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_get_tv_norm
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_nouveau_encoder
	cmpl	%r14d, (%rax)
	jne	LBB0_1
## %bb.6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rbx, %rdi
	callq	_nouveau_encoder
	movl	%r14d, (%rax)
	movq	%rbx, %rdi
	callq	_nouveau_encoder
	movq	8(%rax), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_NV_INFO
	andb	$-2, (%r12)
	movq	(%r13), %rax
	movq	_CTV_ENC_MODE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_nv04_dfp_update_fp_control
	jmp	LBB0_5
LBB0_3:
	movq	_DRM_MODE_DPMS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nv04_dfp_update_fp_control
	movq	_DRM_MODE_DPMS_ON@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_5
## %bb.4:
	orb	$1, (%r12)
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	$200, %edx
	callq	_nv_load_ptv
	movq	_DCB_GPIO_TVDAC1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DRM_MODE_DPMS_ON@GOTPCREL(%rip), %r15
	xorl	%r8d, %r8d
	cmpl	%r14d, (%r15)
	sete	%r8b
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$255, %ecx
	callq	_nvkm_gpio_set
	movq	_DCB_GPIO_TVDAC0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r8d, %r8d
	cmpl	%r14d, (%r15)
	sete	%r8b
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$255, %ecx
	callq	_nvkm_gpio_set
	xorl	%esi, %esi
	cmpl	%r14d, (%r15)
	sete	%sil
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nv04_dac_update_dacclk         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting dpms mode %d on TV encoder (output %d)\n"

	.comm	_CTV_ENC_MODE,8,3               ## @CTV_ENC_MODE
	.comm	_DRM_MODE_DPMS_OFF,4,2          ## @DRM_MODE_DPMS_OFF
	.comm	_DRM_MODE_DPMS_ON,4,2           ## @DRM_MODE_DPMS_ON
	.comm	_DCB_GPIO_TVDAC1,4,2            ## @DCB_GPIO_TVDAC1
	.comm	_DCB_GPIO_TVDAC0,4,2            ## @DCB_GPIO_TVDAC0
	.no_dead_strip	_nv17_tv_dpms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv17_tv_dpms
_nv17_tv_dpms:                          ; @nv17_tv_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	x20, x1
	mov	x19, x0
	ldr	x22, [x0]
	mov	x0, x22
	bl	_nouveau_drm
	mov	x24, x0
	bl	_nvxx_gpio
	mov	x21, x0
	mov	x0, x19
	bl	_to_tv_enc
	mov	x23, x0
	mov	x0, x19
	bl	_get_tv_norm
	mov	x25, x0
	mov	x0, x19
	bl	_nouveau_encoder
	ldr	w8, [x0]
	cmp	w8, w20
	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:
	mov	x0, x19
	bl	_nouveau_encoder
	str	w20, [x0]
	mov	x0, x19
	bl	_nouveau_encoder
	ldr	x8, [x0, #8]
	ldr	w3, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	mov	x2, x20
	bl	_NV_INFO
	ldr	w8, [x23]
	and	w8, w8, #0xfffffffe
	str	w8, [x23]
	ldr	x8, [x25]
Lloh2:
	adrp	x9, _CTV_ENC_MODE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CTV_ENC_MODE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x24, _DRM_MODE_DPMS_ON@GOTPAGE
Lloh6:
	ldr	x24, [x24, _DRM_MODE_DPMS_ON@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_nv04_dfp_update_fp_control
	b	LBB0_6
LBB0_4:
Lloh7:
	adrp	x8, _DRM_MODE_DPMS_OFF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DRM_MODE_DPMS_OFF@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_nv04_dfp_update_fp_control
	ldr	w8, [x24]
	cmp	w8, w20
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x23]
	orr	w8, w8, #0x1
	str	w8, [x23]
LBB0_6:
	mov	x0, x22
	mov	x1, x23
	mov	w2, #200
	bl	_nv_load_ptv
Lloh10:
	adrp	x8, _DCB_GPIO_TVDAC1@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DCB_GPIO_TVDAC1@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	ldr	w8, [x24]
	cmp	w8, w20
	cset	w4, eq
	mov	x0, x21
	mov	w1, #0
	mov	w3, #255
	bl	_nvkm_gpio_set
Lloh13:
	adrp	x8, _DCB_GPIO_TVDAC0@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DCB_GPIO_TVDAC0@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	ldr	w8, [x24]
	cmp	w8, w20
	cset	w4, eq
	mov	x0, x21
	mov	w1, #0
	mov	w3, #255
	bl	_nvkm_gpio_set
	ldr	w8, [x24]
	cmp	w8, w20
	cset	w1, eq
	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	_nv04_dac_update_dacclk
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting dpms mode %d on TV encoder (output %d)\n"

	.comm	_CTV_ENC_MODE,8,3               ; @CTV_ENC_MODE
	.comm	_DRM_MODE_DPMS_OFF,4,2          ; @DRM_MODE_DPMS_OFF
	.comm	_DRM_MODE_DPMS_ON,4,2           ; @DRM_MODE_DPMS_ON
	.comm	_DCB_GPIO_TVDAC1,4,2            ; @DCB_GPIO_TVDAC1
	.comm	_DCB_GPIO_TVDAC0,4,2            ; @DCB_GPIO_TVDAC0
	.no_dead_strip	_nv17_tv_dpms
.subsections_via_symbols
