	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu_v11_0_set_fan_speed_rpm
_smu_v11_0_set_fan_speed_rpm:           ## @smu_v11_0_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_1
## %bb.2:
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	callq	_mutex_lock
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_smu_v11_0_auto_fan_control
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_amdgpu_asic_get_xclk
	imull	$600000, %eax, %eax             ## imm = 0x927C0
	shll	$3, %r15d
	cltd
	idivl	%r15d
	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
	movq	_FDO_PWM_MODE_STATIC_RPM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_smu_v11_0_set_fan_static_mode
	movl	%eax, %ebx
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.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
	.no_dead_strip	_smu_v11_0_set_fan_speed_rpm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu_v11_0_set_fan_speed_rpm
_smu_v11_0_set_fan_speed_rpm:           ; @smu_v11_0_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	x20, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	bl	_mutex_lock
	mov	x0, x19
	mov	w1, #0
	bl	_smu_v11_0_auto_fan_control
	mov	x21, x0
	cbnz	w0, LBB0_3
; %bb.2:
	mov	x0, x22
	bl	_amdgpu_asic_get_xclk
	mov	w8, #10176
	movk	w8, #9, lsl #16
	mul	w8, w0, w8
Lloh0:
	adrp	x9, _THM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _THM@GOTPAGEOFF]
	lsl	w10, w20, #3
Lloh2:
	ldr	w20, [x9]
Lloh3:
	adrp	x9, _mmCG_TACH_CTRL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _mmCG_TACH_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x9]
	sdiv	w22, w8, w10
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_RREG32_SOC15
Lloh6:
	adrp	x8, _CG_TACH_CTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CG_TACH_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _TARGET_PERIOD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TARGET_PERIOD@GOTPAGEOFF]
Lloh11:
	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
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
	bl	_smu_v11_0_set_fan_static_mode
	mov	x21, x0
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_5
LBB0_4:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_5:
	mov	x0, x21
	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
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.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
	.no_dead_strip	_smu_v11_0_set_fan_speed_rpm
.subsections_via_symbols
