	.file	"extr_smu7_thermal.c_smu7_fan_ctrl_set_fan_speed_percent.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	smu7_fan_ctrl_set_fan_speed_percent
	.type	smu7_fan_ctrl_set_fan_speed_percent, @function
smu7_fan_ctrl_set_fan_speed_percent:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR 8[rdi], 0
	je	.L15
	xor	eax, eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR PHM_PlatformCaps_MicrocodeFanControl[rip]
	call	PP_CAP@PLT
	test	rax, rax
	jne	.L16
.L3:
	mov	ecx, DWORD PTR FMAX_DUTY100[rip]
	mov	edx, DWORD PTR CG_FDO_CTRL1[rip]
	mov	esi, DWORD PTR CGS_IND_REG__SMC[rip]
	mov	edi, DWORD PTR 0[rbp]
	call	PHM_READ_VFPF_INDIRECT_FIELD@PLT
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmp	ebx, 100
	mov	r8d, 100
	mov	esi, 100
	cmovg	ebx, r8d
	imul	ebx, eax
	mov	edi, ebx
	call	do_div@PLT
	mov	edi, DWORD PTR 0[rbp]
	mov	r8d, ebx
	mov	esi, DWORD PTR CGS_IND_REG__SMC[rip]
	mov	ecx, DWORD PTR FDO_STATIC_DUTY[rip]
	mov	edx, DWORD PTR CG_FDO_CTRL0[rip]
	call	PHM_WRITE_VFPF_INDIRECT_FIELD@PLT
	mov	esi, DWORD PTR FDO_PWM_MODE_STATIC[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	smu7_fan_ctrl_set_static_mode@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rdi, rbp
	call	smu7_fan_ctrl_stop_smc_fan_control@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	smu7_fan_ctrl_set_fan_speed_percent, .-smu7_fan_ctrl_set_fan_speed_percent
	.comm	PHM_PlatformCaps_MicrocodeFanControl,4,4
	.comm	FMAX_DUTY100,4,4
	.comm	FDO_STATIC_DUTY,4,4
	.comm	FDO_PWM_MODE_STATIC,4,4
	.comm	EINVAL,4,4
	.comm	CG_FDO_CTRL1,4,4
	.comm	CG_FDO_CTRL0,4,4
	.comm	CGS_IND_REG__SMC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_smu7_thermal.c_smu7_fan_ctrl_set_fan_speed_percent.c"
	.text
	.align	2
	.global	smu7_fan_ctrl_set_fan_speed_percent
	.syntax unified
	.arm
	.fpu softvfp
	.type	smu7_fan_ctrl_set_fan_speed_percent, %function
smu7_fan_ctrl_set_fan_speed_percent:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0, #4]
	cmp	r3, #0
	beq	.L14
	mov	r0, #0
	bx	lr
.L14:
	push	{r4, r5, r6, lr}
	ldr	r3, .L16
	mov	r4, r0
	sub	sp, sp, #8
	ldr	r0, [r3]
	mov	r5, r1
	bl	PP_CAP
	cmp	r0, #0
	bne	.L15
.L3:
	ldr	r3, .L16+4
	ldr	r2, .L16+8
	ldr	r6, .L16+12
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r6]
	ldr	r0, [r4]
	bl	PHM_READ_VFPF_INDIRECT_FIELD
	cmp	r0, #0
	bne	.L4
	ldr	r3, .L16+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L4:
	cmp	r5, #100
	movge	r5, #100
	mul	r5, r0, r5
	mov	r1, #100
	mov	r0, r5
	bl	do_div
	ldr	r3, .L16+20
	ldr	r2, .L16+24
	str	r5, [sp]
	ldr	r1, [r6]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r0, [r4]
	bl	PHM_WRITE_VFPF_INDIRECT_FIELD
	mov	r0, r4
	ldr	r3, .L16+28
	ldr	r1, [r3]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, lr}
	b	smu7_fan_ctrl_set_static_mode
.L15:
	mov	r0, r4
	bl	smu7_fan_ctrl_stop_smc_fan_control
	b	.L3
.L17:
	.align	2
.L16:
	.word	PHM_PlatformCaps_MicrocodeFanControl
	.word	FMAX_DUTY100
	.word	CG_FDO_CTRL1
	.word	CGS_IND_REG__SMC
	.word	EINVAL
	.word	FDO_STATIC_DUTY
	.word	CG_FDO_CTRL0
	.word	FDO_PWM_MODE_STATIC
	.size	smu7_fan_ctrl_set_fan_speed_percent, .-smu7_fan_ctrl_set_fan_speed_percent
	.comm	PHM_PlatformCaps_MicrocodeFanControl,4,4
	.comm	FMAX_DUTY100,4,4
	.comm	FDO_STATIC_DUTY,4,4
	.comm	FDO_PWM_MODE_STATIC,4,4
	.comm	EINVAL,4,4
	.comm	CG_FDO_CTRL1,4,4
	.comm	CG_FDO_CTRL0,4,4
	.comm	CGS_IND_REG__SMC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
