	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_fan_ctrl_set_fan_speed_rpm ## -- Begin function smu7_fan_ctrl_set_fan_speed_rpm
	.p2align	4, 0x90
_smu7_fan_ctrl_set_fan_speed_rpm:       ## @smu7_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	$0, 32(%rdi)
	je	LBB0_1
LBB0_8:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movl	%esi, %r14d
	testl	%esi, %esi
	je	LBB0_8
## %bb.2:
	movq	%rdi, %rbx
	cmpq	$0, 16(%rdi)
	je	LBB0_8
## %bb.3:
	cmpl	%r14d, 24(%rbx)
	jg	LBB0_8
## %bb.4:
	cmpl	%r14d, 28(%rbx)
	jl	LBB0_8
## %bb.5:
	movq	_PHM_PlatformCaps_MicrocodeFanControl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PP_CAP
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_smu7_fan_ctrl_stop_smc_fan_control
LBB0_7:
	movq	8(%rbx), %rdi
	callq	_amdgpu_asic_get_xclk
	imull	$600000, %eax, %eax             ## imm = 0x927C0
	shll	$3, %r14d
	cltd
	idivl	%r14d
	movl	(%rbx), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_CG_TACH_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_TARGET_PERIOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %r8d
	callq	_PHM_WRITE_VFPF_INDIRECT_FIELD
	movq	_FDO_PWM_MODE_STATIC_RPM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_smu7_fan_ctrl_set_static_mode  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PHM_PlatformCaps_MicrocodeFanControl,4,2 ## @PHM_PlatformCaps_MicrocodeFanControl
	.comm	_CGS_IND_REG__SMC,4,2           ## @CGS_IND_REG__SMC
	.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	_smu7_fan_ctrl_set_fan_speed_rpm ; -- Begin function smu7_fan_ctrl_set_fan_speed_rpm
	.p2align	2
_smu7_fan_ctrl_set_fan_speed_rpm:       ; @smu7_fan_ctrl_set_fan_speed_rpm
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_2
LBB0_1:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x20, x1
	cbz	w1, LBB0_1
; %bb.3:
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_1
; %bb.4:
	ldr	w8, [x19, #24]
	cmp	w8, w20
	b.gt	LBB0_1
; %bb.5:
	ldr	w8, [x19, #28]
	cmp	w8, w20
	b.lt	LBB0_1
; %bb.6:
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_8
; %bb.7:
	mov	x0, x19
	bl	_smu7_fan_ctrl_stop_smc_fan_control
LBB0_8:
	ldr	x0, [x19, #8]
	bl	_amdgpu_asic_get_xclk
	mov	w8, #10176
	movk	w8, #9, lsl #16
	mul	w8, w0, w8
	lsl	w9, w20, #3
	ldr	w0, [x19]
Lloh3:
	adrp	x10, _CGS_IND_REG__SMC@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CGS_IND_REG__SMC@GOTPAGEOFF]
Lloh5:
	adrp	x11, _CG_TACH_CTRL@GOTPAGE
Lloh6:
	ldr	x11, [x11, _CG_TACH_CTRL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x10]
Lloh8:
	ldr	w2, [x11]
Lloh9:
	adrp	x10, _TARGET_PERIOD@GOTPAGE
Lloh10:
	ldr	x10, [x10, _TARGET_PERIOD@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x10]
	sdiv	w4, w8, w9
	bl	_PHM_WRITE_VFPF_INDIRECT_FIELD
Lloh12:
	adrp	x8, _FDO_PWM_MODE_STATIC_RPM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FDO_PWM_MODE_STATIC_RPM@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_smu7_fan_ctrl_set_static_mode
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PHM_PlatformCaps_MicrocodeFanControl,4,2 ; @PHM_PlatformCaps_MicrocodeFanControl
	.comm	_CGS_IND_REG__SMC,4,2           ; @CGS_IND_REG__SMC
	.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
