	.file	"extr_intel_powerclamp.c_powerclamp_adjust_controls.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	powerclamp_adjust_controls, @function
powerclamp_adjust_controls:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	eax, eax
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	pkg_state_counter@PLT
	mov	r13d, eax
	xor	eax, eax
	call	rdtsc@PLT
	mov	r12d, eax
	mov	eax, DWORD PTR msr_last.1939[rip]
	test	eax, eax
	je	.L2
	mov	edx, DWORD PTR tsc_last.1940[rip]
	test	edx, edx
	jne	.L3
.L2:
	mov	DWORD PTR current_ratio[rip], 1
.L4:
	mov	esi, ebp
	mov	edi, r14d
	mov	DWORD PTR msr_last.1939[rip], r13d
	mov	DWORD PTR tsc_last.1940[rip], r12d
	call	adjust_compensation@PLT
	lea	rdi, idle_wakeup_counter[rip]
	call	atomic_read@PLT
	mov	r12d, eax
	xor	eax, eax
	call	num_online_cpus@PLT
	lea	rdi, idle_wakeup_counter[rip]
	imul	eax, ebp
	add	eax, eax
	cmp	r12d, eax
	setnb	al
	xor	esi, esi
	movzx	eax, al
	mov	DWORD PTR reduce_irq[rip], eax
	call	atomic_set@PLT
	add	ebx, DWORD PTR set_target_ratio[rip]
	xor	eax, eax
	cmp	ebx, DWORD PTR current_ratio[rip]
	setbe	al
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	cmp	edx, r12d
	je	.L4
	mov	r15d, r13d
	mov	esi, r12d
	sub	r15d, eax
	sub	esi, edx
	imul	r15d, r15d, 100
	mov	edi, r15d
	call	do_div@PLT
	mov	DWORD PTR current_ratio[rip], r15d
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	powerclamp_adjust_controls, .-powerclamp_adjust_controls
	.local	tsc_last.1940
	.comm	tsc_last.1940,4,4
	.local	msr_last.1939
	.comm	msr_last.1939,4,4
	.comm	set_target_ratio,4,4
	.comm	reduce_irq,4,4
	.comm	idle_wakeup_counter,4,4
	.comm	current_ratio,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_intel_powerclamp.c_powerclamp_adjust_controls.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	powerclamp_adjust_controls, %function
powerclamp_adjust_controls:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r1
	mov	r5, r2
	mov	r10, r0
	bl	pkg_state_counter
	mov	r8, r0
	bl	rdtsc
	ldr	r6, .L12
	mov	r7, r0
	ldr	r3, [r6]
	cmp	r3, #0
	beq	.L2
	ldr	r1, [r6, #4]
	cmp	r1, #0
	bne	.L3
.L2:
	mov	r3, #1
	ldr	r9, .L12+4
	str	r3, [r9]
.L4:
	mov	r1, r5
	mov	r0, r10
	str	r8, [r6]
	str	r7, [r6, #4]
	bl	adjust_compensation
	ldr	r0, .L12+8
	bl	atomic_read
	mov	r6, r0
	bl	num_online_cpus
	mul	r5, r0, r5
	cmp	r6, r5, lsl #1
	movcs	r2, #1
	movcc	r2, #0
	ldr	r3, .L12+12
	mov	r1, #0
	ldr	r0, .L12+8
	str	r2, [r3]
	bl	atomic_set
	ldr	r3, .L12+16
	ldr	r0, [r9]
	ldr	r1, [r3]
	add	r4, r4, r1
	cmp	r4, r0
	movhi	r0, #0
	movls	r0, #1
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	cmp	r1, r0
	ldreq	r9, .L12+4
	beq	.L4
.L9:
	sub	r3, r8, r3
	add	r3, r3, r3, lsl #2
	add	r3, r3, r3, lsl #2
	lsl	fp, r3, #2
	ldr	r9, .L12+4
	sub	r1, r0, r1
	mov	r0, fp
	bl	do_div
	str	fp, [r9]
	b	.L4
.L13:
	.align	2
.L12:
	.word	.LANCHOR0
	.word	current_ratio
	.word	idle_wakeup_counter
	.word	reduce_irq
	.word	set_target_ratio
	.size	powerclamp_adjust_controls, .-powerclamp_adjust_controls
	.comm	set_target_ratio,4,4
	.comm	reduce_irq,4,4
	.comm	idle_wakeup_counter,4,4
	.comm	current_ratio,4,4
	.bss
	.align	2
	.set	.LANCHOR0,. + 0
	.type	msr_last.4223, %object
	.size	msr_last.4223, 4
msr_last.4223:
	.space	4
	.type	tsc_last.4224, %object
	.size	tsc_last.4224, 4
tsc_last.4224:
	.space	4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
