	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smu7_fan_ctrl_set_fan_speed_percent ## -- Begin function smu7_fan_ctrl_set_fan_speed_percent
	.p2align	4, 0x90
_smu7_fan_ctrl_set_fan_speed_percent:   ## @smu7_fan_ctrl_set_fan_speed_percent
	.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
	xorl	%eax, %eax
	cmpq	$0, 8(%rdi)
	je	LBB0_1
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r14
	cmpl	$100, %esi
	movl	$100, %r15d
	cmovll	%esi, %r15d
	movq	_PHM_PlatformCaps_MicrocodeFanControl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PP_CAP
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_smu7_fan_ctrl_stop_smc_fan_control
LBB0_3:
	movl	(%r14), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_CG_FDO_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FMAX_DUTY100@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_PHM_READ_VFPF_INDIRECT_FIELD
	testl	%eax, %eax
	je	LBB0_4
## %bb.6:
	movl	%eax, %ebx
	imull	%r15d, %ebx
	movl	%ebx, %edi
	movl	$100, %esi
	callq	_do_div
	movl	(%r14), %edi
	movl	(%r12), %esi
	movq	_CG_FDO_CTRL0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FDO_STATIC_DUTY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ebx, %r8d
	callq	_PHM_WRITE_VFPF_INDIRECT_FIELD
	movq	_FDO_PWM_MODE_STATIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_smu7_fan_ctrl_set_static_mode  ## TAILCALL
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
	.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_FDO_CTRL1,4,2               ## @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100,4,2               ## @FMAX_DUTY100
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CG_FDO_CTRL0,4,2               ## @CG_FDO_CTRL0
	.comm	_FDO_STATIC_DUTY,4,2            ## @FDO_STATIC_DUTY
	.comm	_FDO_PWM_MODE_STATIC,4,2        ## @FDO_PWM_MODE_STATIC
.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_percent ; -- Begin function smu7_fan_ctrl_set_fan_speed_percent
	.p2align	2
_smu7_fan_ctrl_set_fan_speed_percent:   ; @smu7_fan_ctrl_set_fan_speed_percent
	.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, #0
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, x0
	mov	w8, #100
	cmp	w1, #100
	csel	w20, w1, w8, lt
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_5
; %bb.4:
	mov	x0, x19
	bl	_smu7_fan_ctrl_stop_smc_fan_control
LBB0_5:
	ldr	w0, [x19]
Lloh3:
	adrp	x21, _CGS_IND_REG__SMC@GOTPAGE
Lloh4:
	ldr	x21, [x21, _CGS_IND_REG__SMC@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh5:
	adrp	x8, _CG_FDO_CTRL1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CG_FDO_CTRL1@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _FMAX_DUTY100@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FMAX_DUTY100@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	bl	_PHM_READ_VFPF_INDIRECT_FIELD
	cbz	w0, LBB0_7
; %bb.6:
	mul	w20, w0, w20
	mov	x0, x20
	mov	w1, #100
	bl	_do_div
	ldr	w0, [x19]
	ldr	w1, [x21]
Lloh11:
	adrp	x8, _CG_FDO_CTRL0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CG_FDO_CTRL0@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _FDO_STATIC_DUTY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FDO_STATIC_DUTY@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	mov	x4, x20
	bl	_PHM_WRITE_VFPF_INDIRECT_FIELD
Lloh17:
	adrp	x8, _FDO_PWM_MODE_STATIC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FDO_PWM_MODE_STATIC@GOTPAGEOFF]
Lloh19:
	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	_smu7_fan_ctrl_set_static_mode
LBB0_7:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.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_FDO_CTRL1,4,2               ; @CG_FDO_CTRL1
	.comm	_FMAX_DUTY100,4,2               ; @FMAX_DUTY100
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CG_FDO_CTRL0,4,2               ; @CG_FDO_CTRL0
	.comm	_FDO_STATIC_DUTY,4,2            ; @FDO_STATIC_DUTY
	.comm	_FDO_PWM_MODE_STATIC,4,2        ; @FDO_PWM_MODE_STATIC
.subsections_via_symbols
