	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega10_fan_ctrl_set_fan_speed_rpm ## -- Begin function vega10_fan_ctrl_set_fan_speed_rpm
	.p2align	4, 0x90
_vega10_fan_ctrl_set_fan_speed_rpm:     ## @vega10_fan_ctrl_set_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
	testl	%esi, %esi
	je	LBB0_8
## %bb.1:
	movq	%rdi, %r14
	cmpq	$0, 16(%rdi)
	jne	LBB0_8
## %bb.2:
	movl	%esi, %ebx
	cmpl	%esi, 8(%r14)
	jg	LBB0_8
## %bb.3:
	cmpl	%ebx, 12(%r14)
	jge	LBB0_4
LBB0_8:
	movl	$-1, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_PHM_PlatformCaps_MicrocodeFanControl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PP_CAP
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_vega10_fan_ctrl_stop_smc_fan_control
	testl	%eax, %eax
	jne	LBB0_7
LBB0_6:
	movq	(%r14), %rdi
	callq	_amdgpu_asic_get_xclk
	imull	$600000, %eax, %eax             ## imm = 0x927C0
	shll	$3, %ebx
	cltd
	idivl	%ebx
	movl	%eax, %r15d
	movq	_THM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_mmCG_TACH_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%ebx, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_RREG32_SOC15
	movq	_CG_TACH_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_TARGET_PERIOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	%r15d, %ecx
	callq	_REG_SET_FIELD
	movl	%ebx, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_WREG32_SOC15
LBB0_7:
	movq	_FDO_PWM_MODE_STATIC_RPM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vega10_fan_ctrl_set_static_mode ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PHM_PlatformCaps_MicrocodeFanControl,4,2 ## @PHM_PlatformCaps_MicrocodeFanControl
	.comm	_THM,4,2                        ## @THM
	.comm	_mmCG_TACH_CTRL,4,2             ## @mmCG_TACH_CTRL
	.comm	_CG_TACH_CTRL,4,2               ## @CG_TACH_CTRL
	.comm	_TARGET_PERIOD,4,2              ## @TARGET_PERIOD
	.comm	_FDO_PWM_MODE_STATIC_RPM,4,2    ## @FDO_PWM_MODE_STATIC_RPM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vega10_fan_ctrl_set_fan_speed_rpm ; -- Begin function vega10_fan_ctrl_set_fan_speed_rpm
	.p2align	2
_vega10_fan_ctrl_set_fan_speed_rpm:     ; @vega10_fan_ctrl_set_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
	cbz	w1, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbnz	x8, LBB0_4
; %bb.2:
	mov	x20, x1
	ldr	w8, [x19, #8]
	cmp	w8, w1
	b.gt	LBB0_4
; %bb.3:
	ldr	w8, [x19, #12]
	cmp	w8, w20
	b.ge	LBB0_5
LBB0_4:
	mov	w0, #-1
	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_5:
Lloh0:
	adrp	x8, _PHM_PlatformCaps_MicrocodeFanControl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHM_PlatformCaps_MicrocodeFanControl@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_PP_CAP
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_vega10_fan_ctrl_stop_smc_fan_control
	cbnz	w0, LBB0_8
LBB0_7:
	ldr	x0, [x19]
	bl	_amdgpu_asic_get_xclk
	mov	w8, #10176
	movk	w8, #9, lsl #16
	mul	w8, w0, w8
Lloh3:
	adrp	x9, _THM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _THM@GOTPAGEOFF]
	lsl	w10, w20, #3
Lloh5:
	ldr	w20, [x9]
Lloh6:
	adrp	x9, _mmCG_TACH_CTRL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _mmCG_TACH_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x9]
	sdiv	w22, w8, w10
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_RREG32_SOC15
Lloh9:
	adrp	x8, _CG_TACH_CTRL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CG_TACH_CTRL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _TARGET_PERIOD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TARGET_PERIOD@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x3, x22
	bl	_REG_SET_FIELD
	mov	x3, x0
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_WREG32_SOC15
LBB0_8:
Lloh15:
	adrp	x8, _FDO_PWM_MODE_STATIC_RPM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FDO_PWM_MODE_STATIC_RPM@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, 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_fan_ctrl_set_static_mode
	.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	_PHM_PlatformCaps_MicrocodeFanControl,4,2 ; @PHM_PlatformCaps_MicrocodeFanControl
	.comm	_THM,4,2                        ; @THM
	.comm	_mmCG_TACH_CTRL,4,2             ; @mmCG_TACH_CTRL
	.comm	_CG_TACH_CTRL,4,2               ; @CG_TACH_CTRL
	.comm	_TARGET_PERIOD,4,2              ; @TARGET_PERIOD
	.comm	_FDO_PWM_MODE_STATIC_RPM,4,2    ; @FDO_PWM_MODE_STATIC_RPM
.subsections_via_symbols
