	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trinity_dpm_set_power_state    ## -- Begin function trinity_dpm_set_power_state
	.p2align	4, 0x90
_trinity_dpm_set_power_state:           ## @trinity_dpm_set_power_state
	.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	%rdi, %rbx
	callq	_trinity_get_pi
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_trinity_acquire_mutex
	cmpq	$0, 8(%r14)
	je	LBB0_4
## %bb.1:
	movq	%r14, %rax
	leaq	20(%r14), %r15
	addq	$16, %r14
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	callq	_trinity_dpm_bapm_enable
LBB0_3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_trinity_set_uvd_clock_before_set_eng_clock
	movq	%rbx, %rdi
	callq	_trinity_enable_power_level_0
	movq	%rbx, %rdi
	callq	_trinity_force_level_0
	movq	%rbx, %rdi
	callq	_trinity_wait_for_level_0
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_trinity_setup_nbp_sim
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_trinity_program_power_levels_0_to_n
	movq	%rbx, %rdi
	callq	_trinity_force_level_0
	movq	%rbx, %rdi
	callq	_trinity_unforce_levels
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_trinity_set_uvd_clock_after_set_eng_clock
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_trinity_set_vce_clock
LBB0_4:
	movq	%rbx, %rdi
	callq	_trinity_release_mutex
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trinity_dpm_set_power_state    ; -- Begin function trinity_dpm_set_power_state
	.p2align	2
_trinity_dpm_set_power_state:           ; @trinity_dpm_set_power_state
	.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
	mov	x19, x0
	bl	_trinity_get_pi
	mov	x22, x0
	mov	x0, x19
	bl	_trinity_acquire_mutex
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_4
; %bb.1:
	add	x20, x22, #20
	add	x21, x22, #16
	ldr	x8, [x22]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w1, [x19]
	mov	x0, x19
	bl	_trinity_dpm_bapm_enable
LBB0_3:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_trinity_set_uvd_clock_before_set_eng_clock
	mov	x0, x19
	bl	_trinity_enable_power_level_0
	mov	x0, x19
	bl	_trinity_force_level_0
	mov	x0, x19
	bl	_trinity_wait_for_level_0
	mov	x0, x19
	mov	x1, x20
	bl	_trinity_setup_nbp_sim
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_trinity_program_power_levels_0_to_n
	mov	x0, x19
	bl	_trinity_force_level_0
	mov	x0, x19
	bl	_trinity_unforce_levels
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_trinity_set_uvd_clock_after_set_eng_clock
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_trinity_set_vce_clock
LBB0_4:
	mov	x0, x19
	bl	_trinity_release_mutex
	mov	w0, #0
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
