	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_pm_init_dpm
_radeon_pm_init_dpm:                    ## @radeon_pm_init_dpm
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_POWER_STATE_TYPE_BALANCED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 88(%rdi)
	movq	%rax, 80(%rdi)
	movq	_RADEON_DPM_FORCED_LEVEL_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 72(%rdi)
	movq	144(%rdi), %rax
	movq	152(%rdi), %rcx
	movq	%rcx, 24(%rdi)
	movq	%rax, 16(%rdi)
	movq	%rcx, 112(%rdi)
	movq	%rax, 104(%rdi)
	movq	_THERMAL_TYPE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 96(%rdi)
	cmpq	$0, 136(%rdi)
	je	LBB0_22
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$0, 128(%rdi)
	je	LBB0_22
## %bb.2:
	movq	%rbx, %rdi
	callq	_radeon_atombios_get_power_modes
	movq	%rbx, %rdi
	callq	_radeon_hwmon_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_21
## %bb.3:
	leaq	68(%rbx), %rdi
	movq	_radeon_dpm_thermal_work_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	leaq	48(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_radeon_dpm_init
	movl	56(%rbx), %eax
	movl	%eax, 60(%rbx)
	movl	%eax, 64(%rbx)
	movq	_radeon_dpm@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_radeon_dpm_print_power_states
LBB0_5:
	movq	%rbx, %rdi
	callq	_radeon_dpm_setup_asic
	movq	%rbx, %rdi
	callq	_radeon_dpm_enable
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.9:
	movl	$0, 8(%rbx)
	movq	(%rbx), %rax
	movq	_CHIP_BARTS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_20
## %bb.10:
	movq	_CHIP_CAYMAN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_20
## %bb.11:
	cmpq	$0, 120(%rbx)
	je	LBB0_20
## %bb.12:
	movq	40(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_14
## %bb.13:
	movq	_SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_radeon_atom_set_voltage
LBB0_14:
	movq	32(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.15:
	movq	_SET_VOLTAGE_TYPE_ASIC_VDDCI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_radeon_atom_set_voltage
LBB0_16:
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.17:
	movq	%rbx, %rdi
	callq	_radeon_set_engine_clock
LBB0_18:
	movq	16(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_radeon_set_memory_clock
LBB0_20:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_21
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_21:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	$1, 8(%rbx)
	movq	%rbx, %rdi
	callq	_radeon_debugfs_pm_init
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_INFO
	xorl	%r14d, %r14d
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_STATE_TYPE_BALANCED,8,3  ## @POWER_STATE_TYPE_BALANCED
	.comm	_RADEON_DPM_FORCED_LEVEL_AUTO,4,2 ## @RADEON_DPM_FORCED_LEVEL_AUTO
	.comm	_THERMAL_TYPE_NONE,4,2          ## @THERMAL_TYPE_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_radeon_dpm_thermal_work_handler,4,2 ## @radeon_dpm_thermal_work_handler
	.comm	_radeon_dpm,4,2                 ## @radeon_dpm
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to register debugfs file for dpm!\n"

L_.str.1:                               ## @.str.1
	.asciz	"radeon: dpm initialized\n"

	.comm	_CHIP_BARTS,8,3                 ## @CHIP_BARTS
	.comm	_CHIP_CAYMAN,8,3                ## @CHIP_CAYMAN
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDC,4,2 ## @SET_VOLTAGE_TYPE_ASIC_VDDC
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDCI,4,2 ## @SET_VOLTAGE_TYPE_ASIC_VDDCI
L_.str.2:                               ## @.str.2
	.asciz	"radeon: dpm initialization failed\n"

	.no_dead_strip	_radeon_pm_init_dpm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_pm_init_dpm
_radeon_pm_init_dpm:                    ; @radeon_pm_init_dpm
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _POWER_STATE_TYPE_BALANCED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POWER_STATE_TYPE_BALANCED@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stp	x8, x8, [x0, #80]
Lloh3:
	adrp	x8, _RADEON_DPM_FORCED_LEVEL_AUTO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RADEON_DPM_FORCED_LEVEL_AUTO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #72]
	ldp	x9, x8, [x0, #144]
	ldr	x10, [x0, #136]
	stp	x9, x8, [x0, #16]
	stp	x9, x8, [x0, #104]
Lloh6:
	adrp	x8, _THERMAL_TYPE_NONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _THERMAL_TYPE_NONE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x0, #96]
	cbz	x10, LBB0_18
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #128]
	cbz	x8, LBB0_18
; %bb.2:
	mov	x0, x19
	bl	_radeon_atombios_get_power_modes
	mov	x0, x19
	bl	_radeon_hwmon_init
	mov	x20, x0
	cbnz	w0, LBB0_19
; %bb.3:
	add	x0, x19, #68
Lloh9:
	adrp	x8, _radeon_dpm_thermal_work_handler@GOTPAGE
Lloh10:
	ldr	x8, [x8, _radeon_dpm_thermal_work_handler@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_INIT_WORK
	add	x21, x19, #48
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x19
	bl	_radeon_dpm_init
	ldr	w8, [x19, #56]
	stp	w8, w8, [x19, #60]
Lloh12:
	adrp	x8, _radeon_dpm@GOTPAGE
Lloh13:
	ldr	x8, [x8, _radeon_dpm@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_radeon_dpm_print_power_states
LBB0_5:
	mov	x0, x19
	bl	_radeon_dpm_setup_asic
	mov	x0, x19
	bl	_radeon_dpm_enable
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	cbz	w20, LBB0_20
; %bb.6:
	str	wzr, [x19, #8]
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _CHIP_BARTS@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CHIP_BARTS@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_17
; %bb.7:
Lloh18:
	adrp	x9, _CHIP_CAYMAN@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CHIP_CAYMAN@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.gt	LBB0_17
; %bb.8:
	ldr	x8, [x19, #120]
	cbz	x8, LBB0_17
; %bb.9:
	ldr	x1, [x19, #40]
	cbz	x1, LBB0_11
; %bb.10:
Lloh21:
	adrp	x8, _SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SET_VOLTAGE_TYPE_ASIC_VDDC@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_radeon_atom_set_voltage
LBB0_11:
	ldr	x1, [x19, #32]
	cbz	x1, LBB0_13
; %bb.12:
Lloh24:
	adrp	x8, _SET_VOLTAGE_TYPE_ASIC_VDDCI@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SET_VOLTAGE_TYPE_ASIC_VDDCI@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_radeon_atom_set_voltage
LBB0_13:
	ldr	x1, [x19, #24]
	cbz	x1, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_radeon_set_engine_clock
LBB0_15:
	ldr	x1, [x19, #16]
	cbz	x1, LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_radeon_set_memory_clock
LBB0_17:
Lloh27:
	adrp	x0, l_.str.2@PAGE
Lloh28:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_19
LBB0_18:
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_19:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_20:
	mov	w8, #1
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_radeon_debugfs_pm_init
	cbz	x0, LBB0_22
; %bb.21:
Lloh32:
	adrp	x0, l_.str@PAGE
Lloh33:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_22:
Lloh34:
	adrp	x0, l_.str.1@PAGE
Lloh35:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_INFO
	mov	w20, #0
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_STATE_TYPE_BALANCED,8,3  ; @POWER_STATE_TYPE_BALANCED
	.comm	_RADEON_DPM_FORCED_LEVEL_AUTO,4,2 ; @RADEON_DPM_FORCED_LEVEL_AUTO
	.comm	_THERMAL_TYPE_NONE,4,2          ; @THERMAL_TYPE_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_radeon_dpm_thermal_work_handler,4,2 ; @radeon_dpm_thermal_work_handler
	.comm	_radeon_dpm,4,2                 ; @radeon_dpm
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to register debugfs file for dpm!\n"

l_.str.1:                               ; @.str.1
	.asciz	"radeon: dpm initialized\n"

	.comm	_CHIP_BARTS,8,3                 ; @CHIP_BARTS
	.comm	_CHIP_CAYMAN,8,3                ; @CHIP_CAYMAN
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDC,4,2 ; @SET_VOLTAGE_TYPE_ASIC_VDDC
	.comm	_SET_VOLTAGE_TYPE_ASIC_VDDCI,4,2 ; @SET_VOLTAGE_TYPE_ASIC_VDDCI
l_.str.2:                               ; @.str.2
	.asciz	"radeon: dpm initialization failed\n"

	.no_dead_strip	_radeon_pm_init_dpm
.subsections_via_symbols
