	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_off_ctrl            ## -- Begin function amdgpu_gfx_off_ctrl
	.p2align	4, 0x90
_amdgpu_gfx_off_ctrl:                   ## @amdgpu_gfx_off_ctrl
	.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	_PP_GFXOFF_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 32(%rdi)
	je	LBB0_14
## %bb.1:
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_is_support_sw_smu
	testl	%eax, %eax
	je	LBB0_2
LBB0_4:
	leaq	12(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%rbx), %rax
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.5:
	testq	%rax, %rax
	jle	LBB0_7
## %bb.6:
	decq	%rax
	movq	%rax, (%rbx)
LBB0_7:
	cmpl	$0, 8(%rbx)
	jne	LBB0_13
## %bb.8:
	testq	%rax, %rax
	jne	LBB0_13
## %bb.9:
	addq	$16, %rbx
	movq	_GFX_OFF_DELAY_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_schedule_delayed_work
	jmp	LBB0_13
LBB0_2:
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.3:
	cmpl	$0, (%rax)
	jne	LBB0_4
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	incq	%rax
	movq	%rax, (%rbx)
	cmpl	$0, 8(%rbx)
	je	LBB0_13
## %bb.11:
	movq	_AMD_IP_BLOCK_TYPE_GFX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_dpm_set_powergating_by_smu
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	movl	$0, 8(%rbx)
LBB0_13:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PP_GFXOFF_MASK,4,2             ## @PP_GFXOFF_MASK
	.comm	_GFX_OFF_DELAY_ENABLE,4,2       ## @GFX_OFF_DELAY_ENABLE
	.comm	_AMD_IP_BLOCK_TYPE_GFX,4,2      ## @AMD_IP_BLOCK_TYPE_GFX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_off_ctrl            ; -- Begin function amdgpu_gfx_off_ctrl
	.p2align	2
_amdgpu_gfx_off_ctrl:                   ; @amdgpu_gfx_off_ctrl
	.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
	ldr	w8, [x0, #32]
Lloh0:
	adrp	x9, _PP_GFXOFF_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PP_GFXOFF_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.1:
	mov	x21, x1
	mov	x19, x0
	bl	_is_support_sw_smu
	cbz	w0, LBB0_8
LBB0_2:
	add	x20, x19, #12
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x19]
	cbz	w21, LBB0_11
; %bb.3:
	subs	x9, x8, #1
	b.lt	LBB0_5
; %bb.4:
	str	x9, [x19]
	mov	x8, x9
LBB0_5:
	ldr	w9, [x19, #8]
	cbnz	w9, LBB0_14
; %bb.6:
	cbnz	x8, LBB0_14
; %bb.7:
	add	x0, x19, #16
Lloh3:
	adrp	x8, _GFX_OFF_DELAY_ENABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFX_OFF_DELAY_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_schedule_delayed_work
	b	LBB0_14
LBB0_8:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
LBB0_10:
	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_11:
	add	x8, x8, #1
	str	x8, [x19]
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_14
; %bb.12:
Lloh6:
	adrp	x8, _AMD_IP_BLOCK_TYPE_GFX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AMD_IP_BLOCK_TYPE_GFX@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_dpm_set_powergating_by_smu
	cbnz	w0, LBB0_14
; %bb.13:
	str	wzr, [x19, #8]
LBB0_14:
	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
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PP_GFXOFF_MASK,4,2             ; @PP_GFXOFF_MASK
	.comm	_GFX_OFF_DELAY_ENABLE,4,2       ; @GFX_OFF_DELAY_ENABLE
	.comm	_AMD_IP_BLOCK_TYPE_GFX,4,2      ; @AMD_IP_BLOCK_TYPE_GFX
.subsections_via_symbols
