	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atombios_crtc_disable
_atombios_crtc_disable:                 ## @atombios_crtc_disable
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_to_radeon_crtc
	movq	%rax, %rbx
	movq	8(%r14), %rax
	movq	(%rax), %r15
	movq	_DRM_MODE_DPMS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_atombios_crtc_dpms
	movq	(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_gem_to_radeon_bo
	movq	%rax, %r12
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_4
LBB0_3:
	movq	%r12, %rdi
	callq	_radeon_bo_unpin
	movq	%r12, %rdi
	callq	_radeon_bo_unreserve
LBB0_4:
	movq	%r15, %rdi
	callq	_ASIC_IS_DCE4
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_EVERGREEN_GRPH_ENABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	%r15, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	_AVIVO_D1GRPH_ENABLE@GOTPCREL(%rip), %rax
LBB0_8:
	movq	32(%rbx), %rdi
	addq	(%rax), %rdi
	xorl	%esi, %esi
	callq	_WREG32
LBB0_9:
	movq	%r15, %rdi
	callq	_ASIC_IS_DCE6
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_ATOM_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_atombios_powergate_crtc
LBB0_11:
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.12:
	movq	8(%r15), %rcx
	xorl	%edx, %edx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%rdx
	cmpq	%rdx, %rax
	je	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpq	$0, 8(%rsi)
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	(%rbx), %edi
	cmpq	%rdi, %rdx
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	4(%rbx), %edi
	cmpl	(%rsi), %edi
	jne	LBB0_17
	jmp	LBB0_25
LBB0_18:
	movl	4(%rbx), %edx
	leal	-128(%rdx), %eax
	cmpl	$2, %eax
	jae	LBB0_19
LBB0_24:
	movl	(%rbx), %esi
	movq	_ATOM_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	subq	$8, %rsp
	leaq	-40(%rbp), %rax
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	pushq	%rax
	pushq	$0
	pushq	$0
	pushq	$0
	pushq	$0
	pushq	$0
	pushq	$0
	callq	_atombios_crtc_program_pll
	addq	$64, %rsp
	jmp	LBB0_25
LBB0_19:
	cmpl	$130, %edx
	jne	LBB0_25
## %bb.20:
	movl	4(%r15), %eax
	movq	_CHIP_ARUBA@GOTPCREL(%rip), %rcx
	movl	$130, %edx
	cmpl	(%rcx), %eax
	je	LBB0_24
## %bb.21:
	movq	_CHIP_KAVERI@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_24
## %bb.22:
	movq	_CHIP_BONAIRE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_24
## %bb.23:
	movq	_CHIP_HAWAII@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_24
LBB0_25:
	movq	_ATOM_PPLL_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rbx)
	movq	$0, 24(%rbx)
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_DPMS_OFF,4,2          ## @DRM_MODE_DPMS_OFF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to reserve rbo before unpin\n"

	.comm	_EVERGREEN_GRPH_ENABLE,8,3      ## @EVERGREEN_GRPH_ENABLE
	.comm	_AVIVO_D1GRPH_ENABLE,8,3        ## @AVIVO_D1GRPH_ENABLE
	.comm	_ATOM_ENABLE,4,2                ## @ATOM_ENABLE
	.comm	_ATOM_DISABLE,4,2               ## @ATOM_DISABLE
	.comm	_CHIP_ARUBA,4,2                 ## @CHIP_ARUBA
	.comm	_CHIP_KAVERI,4,2                ## @CHIP_KAVERI
	.comm	_CHIP_BONAIRE,4,2               ## @CHIP_BONAIRE
	.comm	_CHIP_HAWAII,4,2                ## @CHIP_HAWAII
	.comm	_ATOM_PPLL_INVALID,4,2          ## @ATOM_PPLL_INVALID
	.no_dead_strip	_atombios_crtc_disable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atombios_crtc_disable
_atombios_crtc_disable:                 ; @atombios_crtc_disable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x0
	bl	_to_radeon_crtc
	mov	x19, x0
	ldr	x8, [x20, #8]
	ldr	x21, [x8]
Lloh0:
	adrp	x8, _DRM_MODE_DPMS_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MODE_DPMS_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_atombios_crtc_dpms
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_gem_to_radeon_bo
	mov	x22, x0
	mov	w1, #0
	bl	_radeon_bo_reserve
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_3:
	mov	x0, x22
	bl	_radeon_bo_unpin
	mov	x0, x22
	bl	_radeon_bo_unreserve
LBB0_4:
	mov	x0, x21
	bl	_ASIC_IS_DCE4
	cbz	x0, LBB0_6
; %bb.5:
Lloh5:
	adrp	x8, _EVERGREEN_GRPH_ENABLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EVERGREEN_GRPH_ENABLE@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	x0, x21
	bl	_ASIC_IS_AVIVO
	cbz	x0, LBB0_9
; %bb.7:
Lloh7:
	adrp	x8, _AVIVO_D1GRPH_ENABLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AVIVO_D1GRPH_ENABLE@GOTPAGEOFF]
LBB0_8:
	ldr	x8, [x8]
	ldr	x9, [x19, #32]
	add	x0, x9, x8
	mov	w1, #0
	bl	_WREG32
LBB0_9:
	mov	x0, x21
	bl	_ASIC_IS_DCE6
	cbz	x0, LBB0_11
; %bb.10:
Lloh9:
	adrp	x8, _ATOM_ENABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATOM_ENABLE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_atombios_powergate_crtc
LBB0_11:
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.12:
	mov	x9, #0
	ldr	x10, [x21, #8]
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.eq	LBB0_18
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x9, lsl #3]
	cbz	x11, LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x12, [x11, #8]
	cbz	x12, LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w12, [x19]
	cmp	x9, x12
	b.eq	LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w12, [x19, #4]
	ldr	w11, [x11]
	cmp	w12, w11
	b.ne	LBB0_13
	b	LBB0_23
LBB0_18:
	ldr	w2, [x19, #4]
	sub	w8, w2, #128
	cmp	w8, #2
	b.lo	LBB0_22
; %bb.19:
	cmp	w2, #130
	b.ne	LBB0_23
; %bb.20:
	ldr	w8, [x21, #4]
Lloh12:
	adrp	x9, _CHIP_ARUBA@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CHIP_ARUBA@GOTPAGEOFF]
Lloh14:
	adrp	x10, _CHIP_KAVERI@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CHIP_KAVERI@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _CHIP_BONAIRE@GOTPAGE
Lloh19:
	ldr	x11, [x11, _CHIP_BONAIRE@GOTPAGEOFF]
Lloh20:
	adrp	x12, _CHIP_HAWAII@GOTPAGE
Lloh21:
	ldr	x12, [x12, _CHIP_HAWAII@GOTPAGEOFF]
Lloh22:
	ldr	w11, [x11]
Lloh23:
	ldr	w12, [x12]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	ccmp	w8, w11, #4, ne
	ccmp	w8, w12, #4, ne
	b.ne	LBB0_23
; %bb.21:
	mov	w2, #130
LBB0_22:
	ldr	w1, [x19]
Lloh24:
	adrp	x8, _ATOM_DISABLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ATOM_DISABLE@GOTPAGEOFF]
Lloh26:
	ldr	w5, [x8]
	stp	xzr, xzr, [sp]
	add	x8, sp, #24
	str	x8, [sp, #16]
	mov	x0, x20
	mov	w3, #0
	mov	w4, #0
	mov	w6, #0
	mov	w7, #0
	bl	_atombios_crtc_program_pll
LBB0_23:
Lloh27:
	adrp	x8, _ATOM_PPLL_INVALID@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ATOM_PPLL_INVALID@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	stp	xzr, xzr, [x19, #16]
	str	xzr, [x19, #8]
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_DPMS_OFF,4,2          ; @DRM_MODE_DPMS_OFF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to reserve rbo before unpin\n"

	.comm	_EVERGREEN_GRPH_ENABLE,8,3      ; @EVERGREEN_GRPH_ENABLE
	.comm	_AVIVO_D1GRPH_ENABLE,8,3        ; @AVIVO_D1GRPH_ENABLE
	.comm	_ATOM_ENABLE,4,2                ; @ATOM_ENABLE
	.comm	_ATOM_DISABLE,4,2               ; @ATOM_DISABLE
	.comm	_CHIP_ARUBA,4,2                 ; @CHIP_ARUBA
	.comm	_CHIP_KAVERI,4,2                ; @CHIP_KAVERI
	.comm	_CHIP_BONAIRE,4,2               ; @CHIP_BONAIRE
	.comm	_CHIP_HAWAII,4,2                ; @CHIP_HAWAII
	.comm	_ATOM_PPLL_INVALID,4,2          ; @ATOM_PPLL_INVALID
	.no_dead_strip	_atombios_crtc_disable
.subsections_via_symbols
