	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cypress_dpm_enable             ## -- Begin function cypress_dpm_enable
	.p2align	4, 0x90
_cypress_dpm_enable:                    ## @cypress_dpm_enable
	.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, %r13
	callq	_rv770_get_pi
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_evergreen_get_pi
	movq	%rax, %r15
	movq	8(%r13), %r12
	cmpq	$0, 8(%r14)
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	callq	_rv770_restore_cgcg
LBB0_2:
	movq	%r13, %rdi
	callq	_rv770_dpm_enabled
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_40:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpq	$0, 48(%r14)
	je	LBB0_7
## %bb.5:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_rv770_enable_voltage_control
	movq	%r13, %rdi
	callq	_cypress_construct_voltage_tables
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_40
LBB0_7:
	cmpq	$0, 40(%r14)
	je	LBB0_10
## %bb.8:
	movq	%r13, %rdi
	callq	_cypress_get_mvdd_configuration
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_40
LBB0_10:
	cmpl	$0, (%r15)
	je	LBB0_14
## %bb.11:
	movq	%r13, %rdi
	callq	_cypress_set_mc_reg_address_table
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_cypress_force_mc_use_s0
	movq	%r13, %rdi
	callq	_cypress_initialize_mc_reg_table
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	$0, (%r15)
LBB0_13:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_cypress_force_mc_use_s1
LBB0_14:
	movq	_ATOM_PP_PLATFORM_CAP_BACKBIAS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_16
## %bb.15:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_rv770_enable_backbias
LBB0_16:
	cmpq	$0, 32(%r14)
	je	LBB0_18
## %bb.17:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_cypress_enable_spread_spectrum
LBB0_18:
	cmpq	$0, 24(%r14)
	je	LBB0_20
## %bb.19:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_rv770_enable_thermal_protection
LBB0_20:
	movq	%r13, %rdi
	callq	_rv770_setup_bsp
	movq	%r13, %rdi
	callq	_rv770_program_git
	movq	%r13, %rdi
	callq	_rv770_program_tp
	movq	%r13, %rdi
	callq	_rv770_program_tpp
	movq	%r13, %rdi
	callq	_rv770_program_sstp
	movq	%r13, %rdi
	callq	_rv770_program_engine_speed_parameters
	movq	%r13, %rdi
	callq	_cypress_enable_display_gap
	movq	%r13, %rdi
	callq	_rv770_program_vc
	cmpq	$0, 16(%r14)
	je	LBB0_22
## %bb.21:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_cypress_enable_dynamic_pcie_gen2
LBB0_22:
	movq	%r13, %rdi
	callq	_rv770_upload_firmware
	testl	%eax, %eax
	je	LBB0_24
## %bb.23:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_40
LBB0_24:
	movq	%r13, %rdi
	callq	_cypress_get_table_locations
	testl	%eax, %eax
	je	LBB0_26
## %bb.25:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_40
LBB0_26:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_cypress_init_smc_table
	testl	%eax, %eax
	je	LBB0_28
## %bb.27:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_40
LBB0_28:
	cmpl	$0, (%r15)
	je	LBB0_31
## %bb.29:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_cypress_populate_mc_reg_table
	testl	%eax, %eax
	je	LBB0_31
## %bb.30:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_40
LBB0_31:
	movq	%r13, %rdi
	callq	_cypress_program_response_times
	movq	%r13, %rdi
	callq	_r7xx_start_smc
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_cypress_notify_smc_display_change
	testl	%eax, %eax
	je	LBB0_33
## %bb.32:
	movl	%eax, %ebx
	leaq	L_.str.6(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_40
LBB0_33:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_cypress_enable_sclk_control
	cmpq	$0, 8(%r15)
	je	LBB0_35
## %bb.34:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_cypress_enable_mclk_control
LBB0_35:
	movq	%r13, %rdi
	callq	_cypress_start_dpm
	cmpq	$0, 8(%r14)
	je	LBB0_37
## %bb.36:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_cypress_gfx_clock_gating_enable
LBB0_37:
	cmpq	$0, (%r14)
	je	LBB0_39
## %bb.38:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_cypress_mg_clock_gating_enable
LBB0_39:
	movq	_RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_rv770_enable_auto_throttle_source
	xorl	%ebx, %ebx
	jmp	LBB0_40
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cypress_construct_voltage_tables failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"cypress_get_mvdd_configuration failed\n"

	.comm	_ATOM_PP_PLATFORM_CAP_BACKBIAS,4,2 ## @ATOM_PP_PLATFORM_CAP_BACKBIAS
L_.str.2:                               ## @.str.2
	.asciz	"rv770_upload_firmware failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"cypress_get_table_locations failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"cypress_init_smc_table failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"cypress_populate_mc_reg_table failed\n"

L_.str.6:                               ## @.str.6
	.asciz	"cypress_notify_smc_display_change failed\n"

	.comm	_RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL,4,2 ## @RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cypress_dpm_enable             ; -- Begin function cypress_dpm_enable
	.p2align	2
_cypress_dpm_enable:                    ; @cypress_dpm_enable
	.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	x19, x0
	bl	_rv770_get_pi
	mov	x20, x0
	mov	x0, x19
	bl	_evergreen_get_pi
	mov	x21, x0
	ldr	x22, [x19, #8]
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_rv770_restore_cgcg
LBB0_2:
	mov	x0, x19
	bl	_rv770_dpm_enabled
	cbz	x0, LBB0_5
; %bb.3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_4:
	mov	x0, x23
	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
LBB0_5:
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_8
; %bb.6:
	mov	x0, x19
	mov	w1, #1
	bl	_rv770_enable_voltage_control
	mov	x0, x19
	bl	_cypress_construct_voltage_tables
	cbz	w0, LBB0_8
; %bb.7:
	mov	x23, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_8:
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_11
; %bb.9:
	mov	x0, x19
	bl	_cypress_get_mvdd_configuration
	cbz	w0, LBB0_11
; %bb.10:
	mov	x23, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_11:
	ldr	w8, [x21]
	cbz	w8, LBB0_15
; %bb.12:
	mov	x0, x19
	bl	_cypress_set_mc_reg_address_table
	mov	x0, x19
	mov	x1, x22
	bl	_cypress_force_mc_use_s0
	mov	x0, x19
	bl	_cypress_initialize_mc_reg_table
	cbz	w0, LBB0_14
; %bb.13:
	str	wzr, [x21]
LBB0_14:
	mov	x0, x19
	mov	x1, x22
	bl	_cypress_force_mc_use_s1
LBB0_15:
	ldr	w8, [x19]
Lloh7:
	adrp	x9, _ATOM_PP_PLATFORM_CAP_BACKBIAS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ATOM_PP_PLATFORM_CAP_BACKBIAS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.16:
	mov	x0, x19
	mov	w1, #1
	bl	_rv770_enable_backbias
LBB0_17:
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_19
; %bb.18:
	mov	x0, x19
	mov	w1, #1
	bl	_cypress_enable_spread_spectrum
LBB0_19:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_21
; %bb.20:
	mov	x0, x19
	mov	w1, #1
	bl	_rv770_enable_thermal_protection
LBB0_21:
	mov	x0, x19
	bl	_rv770_setup_bsp
	mov	x0, x19
	bl	_rv770_program_git
	mov	x0, x19
	bl	_rv770_program_tp
	mov	x0, x19
	bl	_rv770_program_tpp
	mov	x0, x19
	bl	_rv770_program_sstp
	mov	x0, x19
	bl	_rv770_program_engine_speed_parameters
	mov	x0, x19
	bl	_cypress_enable_display_gap
	mov	x0, x19
	bl	_rv770_program_vc
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_23
; %bb.22:
	mov	x0, x19
	mov	w1, #1
	bl	_cypress_enable_dynamic_pcie_gen2
LBB0_23:
	mov	x0, x19
	bl	_rv770_upload_firmware
	cbz	w0, LBB0_25
; %bb.24:
	mov	x23, x0
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_25:
	mov	x0, x19
	bl	_cypress_get_table_locations
	cbz	w0, LBB0_27
; %bb.26:
	mov	x23, x0
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_27:
	mov	x0, x19
	mov	x1, x22
	bl	_cypress_init_smc_table
	cbz	w0, LBB0_29
; %bb.28:
	mov	x23, x0
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_29:
	ldr	w8, [x21]
	cbz	w8, LBB0_32
; %bb.30:
	mov	x0, x19
	mov	x1, x22
	bl	_cypress_populate_mc_reg_table
	cbz	w0, LBB0_32
; %bb.31:
	mov	x23, x0
Lloh16:
	adrp	x0, l_.str.5@PAGE
Lloh17:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_32:
	mov	x0, x19
	bl	_cypress_program_response_times
	mov	x0, x19
	bl	_r7xx_start_smc
	mov	x0, x19
	mov	w1, #0
	bl	_cypress_notify_smc_display_change
	cbz	w0, LBB0_34
; %bb.33:
	mov	x23, x0
Lloh18:
	adrp	x0, l_.str.6@PAGE
Lloh19:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_34:
	mov	x0, x19
	mov	w1, #1
	bl	_cypress_enable_sclk_control
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_36
; %bb.35:
	mov	x0, x19
	mov	w1, #1
	bl	_cypress_enable_mclk_control
LBB0_36:
	mov	x0, x19
	bl	_cypress_start_dpm
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_38
; %bb.37:
	mov	x0, x19
	mov	w1, #1
	bl	_cypress_gfx_clock_gating_enable
LBB0_38:
	ldr	x8, [x20]
	cbz	x8, LBB0_40
; %bb.39:
	mov	x0, x19
	mov	w1, #1
	bl	_cypress_mg_clock_gating_enable
LBB0_40:
Lloh20:
	adrp	x8, _RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_rv770_enable_auto_throttle_source
	mov	w23, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cypress_construct_voltage_tables failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"cypress_get_mvdd_configuration failed\n"

	.comm	_ATOM_PP_PLATFORM_CAP_BACKBIAS,4,2 ; @ATOM_PP_PLATFORM_CAP_BACKBIAS
l_.str.2:                               ; @.str.2
	.asciz	"rv770_upload_firmware failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"cypress_get_table_locations failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"cypress_init_smc_table failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"cypress_populate_mc_reg_table failed\n"

l_.str.6:                               ; @.str.6
	.asciz	"cypress_notify_smc_display_change failed\n"

	.comm	_RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL,4,2 ; @RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL
.subsections_via_symbols
