	.file	"extr_intel_powerclamp.c_find_target_mwait.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	find_target_mwait, @function
find_target_mwait:
.LFB0:
	.cfi_startproc
	endbr64
	sub	rsp, 40
	.cfi_def_cfa_offset 48
	mov	rdi, QWORD PTR CPUID_MWAIT_LEAF[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	cmp	QWORD PTR boot_cpu_data[rip], rdi
	jge	.L22
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	lea	rcx, 16[rsp]
	lea	rdx, 12[rsp]
	lea	rsi, 8[rsp]
	lea	r8, 20[rsp]
	call	cpuid@PLT
	mov	eax, DWORD PTR 16[rsp]
	test	DWORD PTR CPUID5_ECX_EXTENSIONS_SUPPORTED[rip], eax
	je	.L1
	test	DWORD PTR CPUID5_ECX_INTERRUPT_BREAK[rip], eax
	je	.L1
	mov	ecx, DWORD PTR MWAIT_SUBSTATE_SIZE[rip]
	mov	eax, DWORD PTR 20[rsp]
	xor	edx, edx
	xor	r8d, r8d
	mov	r9d, DWORD PTR MWAIT_SUBSTATE_MASK[rip]
	xor	esi, esi
	shr	eax, cl
	.p2align 4,,10
	.p2align 3
.L3:
	test	eax, eax
	je	.L5
	mov	edi, r9d
	and	edi, eax
	cmovne	esi, edx
	cmovne	r8d, edi
	add	edx, 1
	shr	eax, cl
	cmp	edx, 7
	jne	.L3
.L5:
	sal	esi, cl
	sub	r8d, 1
	or	esi, r8d
	mov	DWORD PTR target_mwait[rip], esi
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	find_target_mwait, .-find_target_mwait
	.comm	target_mwait,4,4
	.comm	boot_cpu_data,8,8
	.comm	MWAIT_SUBSTATE_SIZE,4,4
	.comm	MWAIT_SUBSTATE_MASK,4,4
	.comm	CPUID_MWAIT_LEAF,8,8
	.comm	CPUID5_ECX_INTERRUPT_BREAK,4,4
	.comm	CPUID5_ECX_EXTENSIONS_SUPPORTED,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_find_target_mwait.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_target_mwait, %function
find_target_mwait:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	ldr	r2, .L25
	ldr	r3, .L25+4
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r2, .L25+8
	sub	sp, sp, #32
	cmp	r3, r0
	ldr	r2, [r2]
	str	r2, [sp, #28]
	mov	r2,#0
	bge	.L23
.L1:
	ldr	r3, .L25+8
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	add	sp, sp, #32
	@ sp needed
	pop	{r4, pc}
.L23:
	add	r3, sp, #24
	str	r3, [sp]
	add	r2, sp, #16
	add	r3, sp, #20
	add	r1, sp, #12
	bl	cpuid
	ldr	r2, .L25+12
	ldr	r3, [sp, #20]
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L1
	ldr	r2, .L25+16
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L1
	mov	r2, #0
	ldr	r1, .L25+20
	mov	ip, r2
	ldr	lr, [r1]
	mov	r1, r2
	ldr	r0, .L25+24
	ldr	r3, [sp, #24]
	ldr	r4, [r0]
	lsr	r3, r3, lr
.L3:
	cmp	r3, #0
	beq	.L5
	and	r0, r4, r3
	cmp	r0, #0
	movne	ip, r2
	add	r2, r2, #1
	movne	r1, r0
	cmp	r2, #7
	lsr	r3, r3, lr
	bne	.L3
.L5:
	ldr	r3, .L25+28
	sub	r1, r1, #1
	orr	r1, r1, ip, lsl lr
	str	r1, [r3]
	b	.L1
.L24:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	CPUID_MWAIT_LEAF
	.word	boot_cpu_data
	.word	.LC0
	.word	CPUID5_ECX_EXTENSIONS_SUPPORTED
	.word	CPUID5_ECX_INTERRUPT_BREAK
	.word	MWAIT_SUBSTATE_SIZE
	.word	MWAIT_SUBSTATE_MASK
	.word	target_mwait
	.size	find_target_mwait, .-find_target_mwait
	.comm	target_mwait,4,4
	.comm	boot_cpu_data,4,4
	.comm	MWAIT_SUBSTATE_SIZE,4,4
	.comm	MWAIT_SUBSTATE_MASK,4,4
	.comm	CPUID_MWAIT_LEAF,4,4
	.comm	CPUID5_ECX_INTERRUPT_BREAK,4,4
	.comm	CPUID5_ECX_EXTENSIONS_SUPPORTED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
