	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_set_power_state
_radeon_set_power_state:                ## @radeon_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jne	LBB0_2
## %bb.1:
	movq	24(%rbx), %rax
	cmpq	32(%rbx), %rax
	je	LBB0_21
LBB0_2:
	movq	%rbx, %rdi
	callq	_radeon_gui_idle
	testq	%rax, %rax
	je	LBB0_22
## %bb.3:
	movq	88(%rbx), %rax
	movq	8(%rbx), %rcx
	movq	24(%rbx), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rcx, %rdx
	shlq	$4, %rdx
	movq	(%rax,%rdx), %rdx
	movq	40(%rbx), %r14
	cmpq	%r14, %rdx
	cmovlq	%rdx, %r14
	movq	48(%rbx), %rdx
	movq	_PM_METHOD_PROFILE@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_9
## %bb.4:
	movq	(%rbx), %rdx
	movq	_CHIP_BARTS@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jl	LBB0_9
## %bb.5:
	cmpq	$0, 104(%rbx)
	je	LBB0_9
## %bb.6:
	movq	56(%rbx), %rdx
	movq	_PM_PROFILE_MID_MH_IDX@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	je	LBB0_8
## %bb.7:
	movq	_PM_PROFILE_LOW_MH_IDX@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_9
LBB0_8:
	movq	96(%rbx), %rcx
	movq	_PM_PROFILE_HIGH_MH_IDX@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rcx,%rdx,8), %rcx
LBB0_9:
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %rax
	movq	64(%rbx), %r15
	movq	72(%rbx), %r12
	cmpq	%r15, %rax
	cmovlq	%rax, %r15
	movq	%rbx, %rdi
	callq	_radeon_sync_with_vblank
	movq	48(%rbx), %rax
	movq	_PM_METHOD_DYNPM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_radeon_pm_in_vbl
	testl	%eax, %eax
	je	LBB0_21
LBB0_11:
	movq	%rbx, %rdi
	callq	_radeon_pm_prepare
	cmpq	%r12, %r14
	jl	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_radeon_pm_misc
LBB0_13:
	cmpq	72(%rbx), %r14
	je	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_pm_debug_check_in_vbl
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_radeon_set_engine_clock
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_radeon_pm_debug_check_in_vbl
	movq	%r14, 72(%rbx)
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
LBB0_15:
	movq	112(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_18
## %bb.16:
	cmpq	80(%rbx), %r15
	je	LBB0_18
## %bb.17:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_radeon_pm_debug_check_in_vbl
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_radeon_set_memory_clock
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_radeon_pm_debug_check_in_vbl
	movq	%r15, 80(%rbx)
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
LBB0_18:
	cmpq	%r12, %r14
	jge	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_radeon_pm_misc
LBB0_20:
	movq	%rbx, %rdi
	callq	_radeon_pm_finish
	movq	8(%rbx), %rax
	movq	24(%rbx), %rcx
	movq	%rcx, 32(%rbx)
	movq	%rax, 16(%rbx)
LBB0_21:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_DEBUG_DRIVER               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PM_METHOD_PROFILE,8,3          ## @PM_METHOD_PROFILE
	.comm	_CHIP_BARTS,8,3                 ## @CHIP_BARTS
	.comm	_PM_PROFILE_MID_MH_IDX,8,3      ## @PM_PROFILE_MID_MH_IDX
	.comm	_PM_PROFILE_LOW_MH_IDX,8,3      ## @PM_PROFILE_LOW_MH_IDX
	.comm	_PM_PROFILE_HIGH_MH_IDX,8,3     ## @PM_PROFILE_HIGH_MH_IDX
	.comm	_PM_METHOD_DYNPM,8,3            ## @PM_METHOD_DYNPM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting: e: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Setting: m: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"pm: GUI not idle!!!\n"

	.no_dead_strip	_radeon_set_power_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_set_power_state
_radeon_set_power_state:                ; @radeon_set_power_state
	.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	x19, x0
	ldp	x8, x9, [x0, #8]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldp	x8, x9, [x19, #24]
	cmp	x8, x9
	b.eq	LBB0_20
LBB0_2:
	mov	x0, x19
	bl	_radeon_gui_idle
	cbz	x0, LBB0_21
; %bb.3:
	ldr	x8, [x19, #88]
	ldr	x9, [x19, #24]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x9, [x19, #8]
	lsl	x10, x9, #4
	ldr	x10, [x8, x10]
	ldp	x11, x12, [x19, #40]
	cmp	x10, x11
	csel	x20, x10, x11, lt
Lloh0:
	adrp	x10, _PM_METHOD_PROFILE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _PM_METHOD_PROFILE@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x12, x10
	b.ne	LBB0_8
; %bb.4:
	ldr	x10, [x19]
Lloh3:
	adrp	x11, _CHIP_BARTS@GOTPAGE
Lloh4:
	ldr	x11, [x11, _CHIP_BARTS@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	cmp	x10, x11
	b.lt	LBB0_8
; %bb.5:
	ldr	x10, [x19, #104]
	cbz	x10, LBB0_8
; %bb.6:
	ldr	x10, [x19, #56]
Lloh6:
	adrp	x11, _PM_PROFILE_MID_MH_IDX@GOTPAGE
Lloh7:
	ldr	x11, [x11, _PM_PROFILE_MID_MH_IDX@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
Lloh9:
	adrp	x12, _PM_PROFILE_LOW_MH_IDX@GOTPAGE
Lloh10:
	ldr	x12, [x12, _PM_PROFILE_LOW_MH_IDX@GOTPAGEOFF]
Lloh11:
	ldr	x12, [x12]
	cmp	x10, x11
	ccmp	x10, x12, #4, ne
	b.ne	LBB0_8
; %bb.7:
	ldr	x9, [x19, #96]
Lloh12:
	adrp	x10, _PM_PROFILE_HIGH_MH_IDX@GOTPAGE
Lloh13:
	ldr	x10, [x10, _PM_PROFILE_HIGH_MH_IDX@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	ldr	x9, [x9, x10, lsl #3]
LBB0_8:
	add	x8, x8, x9, lsl #4
	ldr	x8, [x8, #8]
	ldp	x9, x22, [x19, #64]
	cmp	x8, x9
	csel	x21, x8, x9, lt
	mov	x0, x19
	bl	_radeon_sync_with_vblank
	ldr	x8, [x19, #48]
Lloh15:
	adrp	x9, _PM_METHOD_DYNPM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PM_METHOD_DYNPM@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_radeon_pm_in_vbl
	cbz	w0, LBB0_20
LBB0_10:
	mov	x0, x19
	bl	_radeon_pm_prepare
	cmp	x20, x22
	b.lt	LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_radeon_pm_misc
LBB0_12:
	ldr	x8, [x19, #72]
	cmp	x20, x8
	b.eq	LBB0_14
; %bb.13:
	mov	x0, x19
	mov	w1, #0
	bl	_radeon_pm_debug_check_in_vbl
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_set_engine_clock
	mov	x0, x19
	mov	w1, #1
	bl	_radeon_pm_debug_check_in_vbl
	str	x20, [x19, #72]
	str	x20, [sp]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
LBB0_14:
	ldr	x8, [x19, #112]
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.15:
	ldr	x8, [x19, #80]
	cmp	x21, x8
	b.eq	LBB0_17
; %bb.16:
	mov	x0, x19
	mov	w1, #0
	bl	_radeon_pm_debug_check_in_vbl
	mov	x0, x19
	mov	x1, x21
	bl	_radeon_set_memory_clock
	mov	x0, x19
	mov	w1, #1
	bl	_radeon_pm_debug_check_in_vbl
	str	x21, [x19, #80]
	str	x21, [sp]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
LBB0_17:
	cmp	x20, x22
	b.ge	LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_radeon_pm_misc
LBB0_19:
	mov	x0, x19
	bl	_radeon_pm_finish
	ldr	x8, [x19, #24]
	str	x8, [x19, #32]
	ldr	x8, [x19, #8]
	str	x8, [x19, #16]
LBB0_20:
	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
LBB0_21:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	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
	b	_DRM_DEBUG_DRIVER
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PM_METHOD_PROFILE,8,3          ; @PM_METHOD_PROFILE
	.comm	_CHIP_BARTS,8,3                 ; @CHIP_BARTS
	.comm	_PM_PROFILE_MID_MH_IDX,8,3      ; @PM_PROFILE_MID_MH_IDX
	.comm	_PM_PROFILE_LOW_MH_IDX,8,3      ; @PM_PROFILE_LOW_MH_IDX
	.comm	_PM_PROFILE_HIGH_MH_IDX,8,3     ; @PM_PROFILE_HIGH_MH_IDX
	.comm	_PM_METHOD_DYNPM,8,3            ; @PM_METHOD_DYNPM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting: e: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Setting: m: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"pm: GUI not idle!!!\n"

	.no_dead_strip	_radeon_set_power_state
.subsections_via_symbols
