	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu_v12_0_gfx_off_control
_smu_v12_0_gfx_off_control:             ## @smu_v12_0_gfx_off_control
	.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, %r12
	testl	%esi, %esi
	je	LBB0_4
## %bb.1:
	movq	_SMU_MSG_AllowGfxOff@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_smu_send_smc_msg
	movl	%eax, %r14d
	movl	$-500, %ebx                     ## imm = 0xFE0C
	leaq	L_.str(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_smu_v12_0_get_gfxoff_status
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$10, %edi
	callq	_msleep
	incl	%ebx
	jne	LBB0_2
	jmp	LBB0_7
LBB0_4:
	movq	_SMU_MSG_DisallowGfxOff@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_smu_send_smc_msg
	movl	%eax, %r14d
	movl	$-500, %ebx                     ## imm = 0xFE0C
	leaq	L_.str.1(%rip), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_smu_v12_0_get_gfxoff_status
	cmpl	$2, %eax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	callq	_msleep
	incl	%ebx
	jne	LBB0_5
LBB0_7:
	movq	%r15, %rdi
	callq	_DRM_ERROR
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU_MSG_AllowGfxOff,4,2        ## @SMU_MSG_AllowGfxOff
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"enable gfxoff timeout and failed!\n"

	.comm	_SMU_MSG_DisallowGfxOff,4,2     ## @SMU_MSG_DisallowGfxOff
L_.str.1:                               ## @.str.1
	.asciz	"disable gfxoff timeout and failed!\n"

	.no_dead_strip	_smu_v12_0_gfx_off_control
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu_v12_0_gfx_off_control
_smu_v12_0_gfx_off_control:             ; @smu_v12_0_gfx_off_control
	.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	x20, x0
	cbz	w1, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _SMU_MSG_AllowGfxOff@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMU_MSG_AllowGfxOff@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_smu_send_smc_msg
	mov	x19, x0
	mov	w22, #-500
Lloh3:
	adrp	x21, l_.str@PAGE
Lloh4:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_smu_v12_0_get_gfxoff_status
	cbz	w0, LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #10
	bl	_msleep
	adds	w22, w22, #1
	b.lo	LBB0_2
	b	LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _SMU_MSG_DisallowGfxOff@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SMU_MSG_DisallowGfxOff@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_smu_send_smc_msg
	mov	x19, x0
	mov	w22, #-500
Lloh8:
	adrp	x21, l_.str.1@PAGE
Lloh9:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_smu_v12_0_get_gfxoff_status
	cmp	w0, #2
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #1
	bl	_msleep
	adds	w22, w22, #1
	b.lo	LBB0_5
LBB0_7:
	mov	x0, x21
	bl	_DRM_ERROR
LBB0_8:
	mov	x0, x19
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU_MSG_AllowGfxOff,4,2        ; @SMU_MSG_AllowGfxOff
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enable gfxoff timeout and failed!\n"

	.comm	_SMU_MSG_DisallowGfxOff,4,2     ; @SMU_MSG_DisallowGfxOff
l_.str.1:                               ; @.str.1
	.asciz	"disable gfxoff timeout and failed!\n"

	.no_dead_strip	_smu_v12_0_gfx_off_control
.subsections_via_symbols
