	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu7_get_gpu_power
_smu7_get_gpu_power:                    ## @smu7_get_gpu_power
	.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
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	_PPSMC_MSG_GetCurrPkgPwr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_smum_send_msg_to_smc_with_parameter
	movl	(%r13), %edi
	movq	_mmSMC_MSG_ARG_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cgs_read_register
	movq	%rax, (%rbx)
	testq	%rax, %rax
	jne	LBB0_7
## %bb.3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_PPSMC_MSG_PmStatusLogStart@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_smum_send_msg_to_smc
	movl	(%r13), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_ixSMU_PM_STATUS_95@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	xorl	%ecx, %ecx
	callq	_cgs_write_ind_register
	movl	$9, %ebx
	movq	_PPSMC_MSG_PmStatusLogSample@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msleep
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_smum_send_msg_to_smc
	movl	(%r13), %edi
	movl	(%r15), %esi
	movl	(%r12), %edx
	callq	_cgs_read_ind_register
	subl	$1, %ebx
	setb	%cl
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testb	%cl, %cl
	je	LBB0_4
LBB0_6:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%r15d, %r15d
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PPSMC_MSG_GetCurrPkgPwr,4,2    ## @PPSMC_MSG_GetCurrPkgPwr
	.comm	_mmSMC_MSG_ARG_0,4,2            ## @mmSMC_MSG_ARG_0
	.comm	_PPSMC_MSG_PmStatusLogStart,4,2 ## @PPSMC_MSG_PmStatusLogStart
	.comm	_CGS_IND_REG__SMC,4,2           ## @CGS_IND_REG__SMC
	.comm	_ixSMU_PM_STATUS_95,4,2         ## @ixSMU_PM_STATUS_95
	.comm	_PPSMC_MSG_PmStatusLogSample,4,2 ## @PPSMC_MSG_PmStatusLogSample
	.no_dead_strip	_smu7_get_gpu_power
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu7_get_gpu_power
_smu7_get_gpu_power:                    ; @smu7_get_gpu_power
	.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
	cbz	x1, LBB0_5
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PPSMC_MSG_GetCurrPkgPwr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PPSMC_MSG_GetCurrPkgPwr@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_smum_send_msg_to_smc_with_parameter
	ldr	w0, [x20]
Lloh3:
	adrp	x8, _mmSMC_MSG_ARG_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mmSMC_MSG_ARG_0@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_cgs_read_register
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	cbnz	x8, LBB0_6
; %bb.2:
Lloh6:
	adrp	x8, _PPSMC_MSG_PmStatusLogStart@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_PmStatusLogStart@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_smum_send_msg_to_smc
	ldr	w0, [x20]
Lloh9:
	adrp	x21, _CGS_IND_REG__SMC@GOTPAGE
Lloh10:
	ldr	x21, [x21, _CGS_IND_REG__SMC@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh11:
	adrp	x22, _ixSMU_PM_STATUS_95@GOTPAGE
Lloh12:
	ldr	x22, [x22, _ixSMU_PM_STATUS_95@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	w3, #0
	bl	_cgs_write_ind_register
	mov	w23, #9
Lloh13:
	adrp	x24, _PPSMC_MSG_PmStatusLogSample@GOTPAGE
Lloh14:
	ldr	x24, [x24, _PPSMC_MSG_PmStatusLogSample@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #500
	bl	_msleep
	ldr	w1, [x24]
	mov	x0, x20
	bl	_smum_send_msg_to_smc
	ldr	w0, [x20]
	ldr	w1, [x21]
	ldr	w2, [x22]
	bl	_cgs_read_ind_register
	cmp	x0, #0
	ccmp	w23, #0, #4, eq
	sub	w23, w23, #1
	b.ne	LBB0_3
; %bb.4:
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_6
LBB0_5:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PPSMC_MSG_GetCurrPkgPwr,4,2    ; @PPSMC_MSG_GetCurrPkgPwr
	.comm	_mmSMC_MSG_ARG_0,4,2            ; @mmSMC_MSG_ARG_0
	.comm	_PPSMC_MSG_PmStatusLogStart,4,2 ; @PPSMC_MSG_PmStatusLogStart
	.comm	_CGS_IND_REG__SMC,4,2           ; @CGS_IND_REG__SMC
	.comm	_ixSMU_PM_STATUS_95,4,2         ; @ixSMU_PM_STATUS_95
	.comm	_PPSMC_MSG_PmStatusLogSample,4,2 ; @PPSMC_MSG_PmStatusLogSample
	.no_dead_strip	_smu7_get_gpu_power
.subsections_via_symbols
