	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vega20_thermal_get_temperature
_vega20_thermal_get_temperature:        ## @vega20_thermal_get_temperature
	.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
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.1:
	movq	%rdx, %r14
	movl	%esi, %r15d
	leaq	-32(%rbp), %rsi
	callq	_vega20_get_metrics_table
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.2:
	cmpl	$128, %r15d
	je	LBB0_8
## %bb.3:
	cmpl	$130, %r15d
	je	LBB0_6
## %bb.4:
	cmpl	$129, %r15d
	jne	LBB0_9
## %bb.5:
	movq	_THM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mmCG_MULT_THERMAL_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movq	_CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	andl	$511, %eax                      ## imm = 0x1FF
	movq	_SMU_TEMPERATURE_UNITS_PER_CENTIGRADES@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movl	%eax, (%r14)
	jmp	LBB0_11
LBB0_8:
	movq	_SMU_TEMPERATURE_UNITS_PER_CENTIGRADES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	-28(%rbp), %eax
	jmp	LBB0_7
LBB0_6:
	movq	_SMU_TEMPERATURE_UNITS_PER_CENTIGRADES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	-32(%rbp), %eax
LBB0_7:
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_THM,4,2                        ## @THM
	.comm	_mmCG_MULT_THERMAL_STATUS,4,2   ## @mmCG_MULT_THERMAL_STATUS
	.comm	_CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK,4,2 ## @CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK
	.comm	_CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT,4,2 ## @CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT
	.comm	_SMU_TEMPERATURE_UNITS_PER_CENTIGRADES,4,2 ## @SMU_TEMPERATURE_UNITS_PER_CENTIGRADES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid sensor for retrieving temp\n"

	.no_dead_strip	_vega20_thermal_get_temperature
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vega20_thermal_get_temperature
_vega20_thermal_get_temperature:        ; @vega20_thermal_get_temperature
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	cbz	x2, LBB0_10
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	add	x1, sp, #8
	bl	_vega20_get_metrics_table
	cbnz	w0, LBB0_11
; %bb.2:
	cmp	w20, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w20, #130
	b.eq	LBB0_7
; %bb.4:
	cmp	w20, #129
	b.ne	LBB0_9
; %bb.5:
Lloh0:
	adrp	x8, _THM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _THM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _mmCG_MULT_THERMAL_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mmCG_MULT_THERMAL_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_RREG32_SOC15
	mov	x8, x0
	mov	w0, #0
Lloh6:
	adrp	x9, _CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh9:
	adrp	x9, _CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	asr	w8, w8, w9
	and	w8, w8, #0x1ff
Lloh12:
	adrp	x9, _SMU_TEMPERATURE_UNITS_PER_CENTIGRADES@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SMU_TEMPERATURE_UNITS_PER_CENTIGRADES@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	mul	w8, w8, w9
	str	w8, [x19]
	b	LBB0_11
LBB0_6:
	mov	w0, #0
	ldr	w8, [sp, #12]
	b	LBB0_8
LBB0_7:
	mov	w0, #0
	ldr	w8, [sp, #8]
LBB0_8:
Lloh15:
	adrp	x9, _SMU_TEMPERATURE_UNITS_PER_CENTIGRADES@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SMU_TEMPERATURE_UNITS_PER_CENTIGRADES@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	mul	w8, w9, w8
	str	w8, [x19]
	b	LBB0_11
LBB0_9:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_10:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_THM,4,2                        ; @THM
	.comm	_mmCG_MULT_THERMAL_STATUS,4,2   ; @mmCG_MULT_THERMAL_STATUS
	.comm	_CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK,4,2 ; @CG_MULT_THERMAL_STATUS__CTF_TEMP_MASK
	.comm	_CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT,4,2 ; @CG_MULT_THERMAL_STATUS__CTF_TEMP__SHIFT
	.comm	_SMU_TEMPERATURE_UNITS_PER_CENTIGRADES,4,2 ; @SMU_TEMPERATURE_UNITS_PER_CENTIGRADES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid sensor for retrieving temp\n"

	.no_dead_strip	_vega20_thermal_get_temperature
.subsections_via_symbols
