	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgpu_ai_force_dpm_level
_xgpu_ai_force_dpm_level:               ## @xgpu_ai_force_dpm_level
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_IDH_IRQ_FORCE_DPM_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	callq	_amdgim_is_hwperf
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_mutex_lock
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_xgpu_ai_mailbox_trans_msg
	movq	_IDH_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_xgpu_ai_poll_msg
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	_IDH_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_xgpu_ai_poll_msg
	movl	%eax, %r14d
	testl	%eax, %eax
	leaq	L_.str(%rip), %rax
	leaq	L_.str.1(%rip), %rdi
	cmoveq	%rax, %rdi
	callq	_pr_info
LBB0_4:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	jmp	LBB0_5
LBB0_1:
	movq	_EBADRQC@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDH_IRQ_FORCE_DPM_LEVEL,4,2    ## @IDH_IRQ_FORCE_DPM_LEVEL
	.comm	_EBADRQC,4,2                    ## @EBADRQC
	.comm	_IDH_SUCCESS,4,2                ## @IDH_SUCCESS
	.comm	_IDH_FAIL,4,2                   ## @IDH_FAIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DPM request failed"

L_.str.1:                               ## @.str.1
	.asciz	"Mailbox is broken"

	.no_dead_strip	_xgpu_ai_force_dpm_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgpu_ai_force_dpm_level
_xgpu_ai_force_dpm_level:               ; @xgpu_ai_force_dpm_level
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _IDH_IRQ_FORCE_DPM_LEVEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDH_IRQ_FORCE_DPM_LEVEL@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_amdgim_is_hwperf
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w3, #0
	mov	w4, #0
	bl	_xgpu_ai_mailbox_trans_msg
Lloh3:
	adrp	x8, _IDH_SUCCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IDH_SUCCESS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_xgpu_ai_poll_msg
	cbz	w0, LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _IDH_FAIL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IDH_FAIL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_xgpu_ai_poll_msg
	mov	x20, x0
Lloh9:
	adrp	x8, l_.str.1@PAGE
Lloh10:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh11:
	adrp	x9, l_.str@PAGE
Lloh12:
	add	x9, x9, l_.str@PAGEOFF
	cmp	w0, #0
	csel	x0, x9, x8, eq
	bl	_pr_info
	b	LBB0_5
LBB0_3:
Lloh13:
	adrp	x8, _EBADRQC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBADRQC@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_6
LBB0_4:
	mov	w20, #0
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_6:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_IDH_IRQ_FORCE_DPM_LEVEL,4,2    ; @IDH_IRQ_FORCE_DPM_LEVEL
	.comm	_EBADRQC,4,2                    ; @EBADRQC
	.comm	_IDH_SUCCESS,4,2                ; @IDH_SUCCESS
	.comm	_IDH_FAIL,4,2                   ; @IDH_FAIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DPM request failed"

l_.str.1:                               ; @.str.1
	.asciz	"Mailbox is broken"

	.no_dead_strip	_xgpu_ai_force_dpm_level
.subsections_via_symbols
