	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgpu_ai_get_pp_clk
_xgpu_ai_get_pp_clk:                    ## @xgpu_ai_get_pp_clk
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r15
	callq	_amdgim_is_hwperf
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	cmpl	$128, %r12d
	je	LBB0_4
## %bb.5:
	cmpl	$129, %r12d
	jne	LBB0_2
## %bb.6:
	movq	_IDH_IRQ_GET_PP_MCLK@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_2:
	movq	_EBADRQC@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_4:
	movq	_IDH_IRQ_GET_PP_SCLK@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %r13d
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_xgpu_ai_mailbox_trans_msg
	movq	_IDH_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_xgpu_ai_poll_msg
	testl	%eax, %eax
	je	LBB0_8
LBB0_11:
	movq	_IDH_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_xgpu_ai_poll_msg
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r14d
	cmpl	$128, %r12d
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	movl	%r14d, %ebx
	jmp	LBB0_13
LBB0_8:
	cmpq	$0, 16(%r15)
	je	LBB0_11
## %bb.9:
	movq	_NBIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_SOC15_REG_OFFSET
	movl	%eax, %edi
	callq	_RREG32_NO_KIQ
	movslq	%eax, %r12
	movq	8(%r15), %rdi
	addq	%r12, %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_strnlen
	movl	%eax, %r13d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jge	LBB0_13
## %bb.10:
	addq	8(%r15), %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_strcpy
	movl	%r13d, %ebx
LBB0_13:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADRQC,4,2                    ## @EBADRQC
	.comm	_IDH_IRQ_GET_PP_SCLK,4,2        ## @IDH_IRQ_GET_PP_SCLK
	.comm	_IDH_IRQ_GET_PP_MCLK,4,2        ## @IDH_IRQ_GET_PP_MCLK
	.comm	_IDH_SUCCESS,4,2                ## @IDH_SUCCESS
	.comm	_NBIO,4,2                       ## @NBIO
	.comm	_mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW1,4,2 ## @mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW1
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_IDH_FAIL,4,2                   ## @IDH_FAIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s DPM request failed"

L_.str.1:                               ## @.str.1
	.asciz	"SCLK"

L_.str.2:                               ## @.str.2
	.asciz	"MCLK"

	.no_dead_strip	_xgpu_ai_get_pp_clk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgpu_ai_get_pp_clk
_xgpu_ai_get_pp_clk:                    ; @xgpu_ai_get_pp_clk
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_amdgim_is_hwperf
	cbz	x20, LBB0_5
; %bb.1:
	cbz	w0, LBB0_5
; %bb.2:
	cmp	w21, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w21, #129
	b.ne	LBB0_5
; %bb.4:
Lloh0:
	adrp	x8, _IDH_IRQ_GET_PP_MCLK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDH_IRQ_GET_PP_MCLK@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh2:
	adrp	x8, _EBADRQC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBADRQC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_6:
Lloh5:
	adrp	x8, _IDH_IRQ_GET_PP_SCLK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IDH_IRQ_GET_PP_SCLK@GOTPAGEOFF]
LBB0_7:
	ldr	w22, [x8]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x22
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_xgpu_ai_mailbox_trans_msg
Lloh7:
	adrp	x8, _IDH_SUCCESS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IDH_SUCCESS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_xgpu_ai_poll_msg
	cbz	w0, LBB0_10
LBB0_8:
Lloh10:
	adrp	x8, _IDH_FAIL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IDH_FAIL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_xgpu_ai_poll_msg
	mov	x22, x0
	cbz	w0, LBB0_13
; %bb.9:
Lloh13:
	adrp	x8, l_.str.2@PAGE
Lloh14:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh15:
	adrp	x9, l_.str.1@PAGE
Lloh16:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	w21, #128
	csel	x1, x9, x8, eq
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	b	LBB0_13
LBB0_10:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_8
; %bb.11:
Lloh19:
	adrp	x8, _NBIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NBIO@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x8, _mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW1@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_SOC15_REG_OFFSET
	bl	_RREG32_NO_KIQ
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x19, #8]
	sxtw	x23, w0
	add	x0, x8, x23
Lloh25:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh26:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_strnlen
	mov	w22, #0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ge	LBB0_13
; %bb.12:
	mov	x21, x0
	ldr	x8, [x19, #8]
	add	x1, x8, x23
	mov	x0, x20
	bl	_strcpy
	mov	x22, x21
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_14:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADRQC,4,2                    ; @EBADRQC
	.comm	_IDH_IRQ_GET_PP_SCLK,4,2        ; @IDH_IRQ_GET_PP_SCLK
	.comm	_IDH_IRQ_GET_PP_MCLK,4,2        ; @IDH_IRQ_GET_PP_MCLK
	.comm	_IDH_SUCCESS,4,2                ; @IDH_SUCCESS
	.comm	_NBIO,4,2                       ; @NBIO
	.comm	_mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW1,4,2 ; @mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW1
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_IDH_FAIL,4,2                   ; @IDH_FAIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s DPM request failed"

l_.str.1:                               ; @.str.1
	.asciz	"SCLK"

l_.str.2:                               ; @.str.2
	.asciz	"MCLK"

	.no_dead_strip	_xgpu_ai_get_pp_clk
.subsections_via_symbols
