	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega10_fan_ctrl_get_fan_speed_rpm ## -- Begin function vega10_fan_ctrl_get_fan_speed_rpm
	.p2align	4, 0x90
_vega10_fan_ctrl_get_fan_speed_rpm:     ## @vega10_fan_ctrl_get_fan_speed_rpm
	.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	$-1, %r15d
	cmpq	$0, 8(%rdi)
	je	LBB0_1
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	_GNLD_FAN_CONTROL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_2
## %bb.6:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vega10_get_current_rpm         ## TAILCALL
LBB0_2:
	movq	_THM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mmCG_TACH_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movq	_CG_TACH_STATUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_TACH_PERIOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	callq	_REG_GET_FIELD
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %r12d
	movq	(%rbx), %rdi
	callq	_amdgpu_asic_get_xclk
	imull	$600000, %eax, %eax             ## imm = 0x927C0
	cltd
	idivl	%r12d
	movl	%eax, (%r14)
	jmp	LBB0_5
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_GNLD_FAN_CONTROL,8,3           ## @GNLD_FAN_CONTROL
	.comm	_THM,4,2                        ## @THM
	.comm	_mmCG_TACH_STATUS,4,2           ## @mmCG_TACH_STATUS
	.comm	_CG_TACH_STATUS,4,2             ## @CG_TACH_STATUS
	.comm	_TACH_PERIOD,4,2                ## @TACH_PERIOD
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega10_fan_ctrl_get_fan_speed_rpm ; -- Begin function vega10_fan_ctrl_get_fan_speed_rpm
	.p2align	2
_vega10_fan_ctrl_get_fan_speed_rpm:     ; @vega10_fan_ctrl_get_fan_speed_rpm
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
	mov	w0, #-1
LBB0_2:
	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
LBB0_3:
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _GNLD_FAN_CONTROL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _GNLD_FAN_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x20
	mov	x1, 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
	b	_vega10_get_current_rpm
LBB0_5:
Lloh3:
	adrp	x8, _THM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _THM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _mmCG_TACH_STATUS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mmCG_TACH_STATUS@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_RREG32_SOC15
Lloh9:
	adrp	x8, _CG_TACH_STATUS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CG_TACH_STATUS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _TACH_PERIOD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TACH_PERIOD@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_REG_GET_FIELD
	cbz	w0, LBB0_7
; %bb.6:
	mov	x21, x0
	ldr	x0, [x20]
	bl	_amdgpu_asic_get_xclk
	mov	x8, x0
	mov	w0, #0
	mov	w9, #10176
	movk	w9, #9, lsl #16
	mul	w8, w8, w9
	sdiv	w8, w8, w21
	str	w8, [x19]
	b	LBB0_2
LBB0_7:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GNLD_FAN_CONTROL,8,3           ; @GNLD_FAN_CONTROL
	.comm	_THM,4,2                        ; @THM
	.comm	_mmCG_TACH_STATUS,4,2           ; @mmCG_TACH_STATUS
	.comm	_CG_TACH_STATUS,4,2             ; @CG_TACH_STATUS
	.comm	_TACH_PERIOD,4,2                ; @TACH_PERIOD
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
