	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psm_adjust_power_state_dynamic ## -- Begin function psm_adjust_power_state_dynamic
	.p2align	4, 0x90
_psm_adjust_power_state_dynamic:        ## @psm_adjust_power_state_dynamic
	.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	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	cmpq	$0, 48(%rbx)
	je	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_power_state_management
	testl	%r14d, %r14d
	jne	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	callq	_phm_notify_smc_display_config_after_ps_adjustment
LBB0_7:
	movq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_phm_force_dpm_levels
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	8(%rbx), %rax
	jmp	LBB0_10
LBB0_1:
	movq	%rbx, %rdi
	callq	_phm_display_configuration_changed
	cmpq	$0, 48(%rbx)
	jne	LBB0_3
LBB0_4:
	movq	%rbx, %rdi
	callq	_phm_apply_clock_adjust_rules
	testl	%r14d, %r14d
	jne	LBB0_7
	jmp	LBB0_6
LBB0_9:
	movq	(%rbx), %rax
	movq	%rax, 8(%rbx)
LBB0_10:
	movq	_AMD_DPM_FORCED_LEVEL_MANUAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.11:
	movl	40(%rbx), %edi
	callq	_fls
                                        ## kill: def $eax killed $eax def $rax
	movq	_Workload_Policy_Max@GOTPCREL(%rip), %rcx
	leal	-1(%rax), %edx
	xorl	%esi, %esi
	cmpl	(%rcx), %eax
	cmovgq	%rsi, %rdx
	testl	%eax, %eax
	cmovleq	%rsi, %rdx
	movq	16(%rbx), %rax
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -32(%rbp)
	cmpq	%rax, 24(%rbx)
	je	LBB0_14
## %bb.12:
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	leaq	-32(%rbp), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	*%rax
LBB0_14:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMD_DPM_FORCED_LEVEL_MANUAL,8,3 ## @AMD_DPM_FORCED_LEVEL_MANUAL
	.comm	_Workload_Policy_Max,4,2        ## @Workload_Policy_Max
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psm_adjust_power_state_dynamic ; -- Begin function psm_adjust_power_state_dynamic
	.p2align	2
_psm_adjust_power_state_dynamic:        ; @psm_adjust_power_state_dynamic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	cbz	w1, LBB0_6
; %bb.1:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_7
LBB0_2:
	mov	x0, x19
	mov	x1, x21
	bl	_power_state_management
	cbnz	w20, LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_phm_notify_smc_display_config_after_ps_adjustment
LBB0_4:
	ldr	x1, [x19]
	mov	x0, x19
	bl	_phm_force_dpm_levels
	cbz	w0, LBB0_8
; %bb.5:
	ldr	x8, [x19, #8]
	b	LBB0_9
LBB0_6:
	mov	x0, x19
	bl	_phm_display_configuration_changed
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_2
LBB0_7:
	mov	x0, x19
	bl	_phm_apply_clock_adjust_rules
	cbnz	w20, LBB0_4
	b	LBB0_3
LBB0_8:
	ldr	x8, [x19]
	str	x8, [x19, #8]
LBB0_9:
Lloh0:
	adrp	x9, _AMD_DPM_FORCED_LEVEL_MANUAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMD_DPM_FORCED_LEVEL_MANUAL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_13
; %bb.10:
	ldr	w0, [x19, #40]
	bl	_fls
Lloh3:
	adrp	x8, _Workload_Policy_Max@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Workload_Policy_Max@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sub	w9, w0, #1
	cmp	w0, w8
	ccmp	w0, #1, #8, le
	csel	x8, xzr, x9, lt
	ldp	x9, x10, [x19, #16]
	ldr	x8, [x9, x8, lsl #3]
	str	x8, [sp, #8]
	cmp	x10, x8
	b.eq	LBB0_13
; %bb.11:
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.12:
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #0
	blr	x8
LBB0_13:
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AMD_DPM_FORCED_LEVEL_MANUAL,8,3 ; @AMD_DPM_FORCED_LEVEL_MANUAL
	.comm	_Workload_Policy_Max,4,2        ; @Workload_Policy_Max
.subsections_via_symbols
