	.file	"extr_turbostat.c_delta_thread.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Insanely slow TSC rate, TSC stops in idle?\nYou can disable all c-states by booting with \"idle=poll\"\nor just the deep ones with \"processor.max_cstate=1\""
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"cpu%d MPERF 0!\n"
	.text
	.p2align 4
	.globl	delta_thread
	.type	delta_thread, @function
delta_thread:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	edi, DWORD PTR BIC_APIC[rip]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	call	DO_BIC@PLT
	test	rax, rax
	je	.L2
	mov	eax, DWORD PTR 64[rbx]
	mov	DWORD PTR 64[rbp], eax
.L2:
	mov	edi, DWORD PTR BIC_X2APIC[rip]
	call	DO_BIC@PLT
	test	rax, rax
	je	.L3
	mov	eax, DWORD PTR 60[rbx]
	mov	DWORD PTR 60[rbp], eax
.L3:
	lea	rdx, 56[rbx]
	lea	rsi, 52[rbx]
	lea	rdi, 52[rbp]
	call	timersub@PLT
	mov	eax, DWORD PTR 52[rbp]
	mov	DWORD PTR 52[rbx], eax
	mov	eax, DWORD PTR 48[rbp]
	mov	DWORD PTR 48[rbx], eax
	mov	eax, DWORD PTR 0[rbp]
	sub	eax, DWORD PTR [rbx]
	mov	DWORD PTR [rbx], eax
	cmp	eax, 999999
	jle	.L41
.L4:
	mov	eax, DWORD PTR 4[rbp]
	sub	eax, DWORD PTR 4[rbx]
	mov	DWORD PTR 4[rbx], eax
	mov	edi, DWORD PTR BIC_Avg_MHz[rip]
	call	DO_BIC@PLT
	test	rax, rax
	je	.L5
.L8:
	mov	rdx, QWORD PTR 8[rbp]
	mov	rcx, QWORD PTR 8[rbx]
	cmp	rdx, rcx
	jle	.L23
	mov	eax, DWORD PTR 16[rbp]
	mov	esi, DWORD PTR 16[rbx]
	cmp	eax, esi
	jle	.L23
	sub	rdx, rcx
	sub	eax, esi
	cmp	QWORD PTR use_c1_residency_msr[rip], 0
	mov	QWORD PTR 8[rbx], rdx
	mov	DWORD PTR 16[rbx], eax
	jne	.L11
.L10:
	mov	r8d, DWORD PTR [r12]
	mov	edi, DWORD PTR 4[r12]
	mov	esi, DWORD PTR 8[r12]
	mov	edx, DWORD PTR [rbx]
	imul	edx, DWORD PTR tsc_tweak[rip]
	lea	ecx, [r8+rax]
	add	ecx, edi
	add	ecx, esi
	cmp	ecx, edx
	jle	.L13
	mov	DWORD PTR 4[rbx], 0
.L12:
	test	eax, eax
	jne	.L11
	cmp	DWORD PTR debug[rip], 1
	jle	.L15
	mov	edx, DWORD PTR 20[rbx]
	mov	edi, DWORD PTR outf[rip]
	lea	rsi, .LC1[rip]
	call	fprintf@PLT
.L15:
	mov	DWORD PTR 16[rbx], 1
.L11:
	mov	edi, DWORD PTR BIC_IRQ[rip]
	call	DO_BIC@PLT
	test	rax, rax
	je	.L16
	mov	rax, QWORD PTR 40[rbp]
	sub	rax, QWORD PTR 40[rbx]
	mov	QWORD PTR 40[rbx], rax
.L16:
	mov	edi, DWORD PTR BIC_SMI[rip]
	call	DO_BIC@PLT
	test	rax, rax
	jne	.L42
.L17:
	mov	rdx, QWORD PTR sys[rip]
	test	rdx, rdx
	je	.L22
	mov	rdi, QWORD PTR 24[rbp]
	mov	rsi, QWORD PTR 24[rbx]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rcx, QWORD PTR [rdi+rax]
	mov	rbx, QWORD PTR FORMAT_RAW[rip]
	cmp	QWORD PTR [rdx], rbx
	je	.L39
	sub	rcx, QWORD PTR [rsi+rax]
.L39:
	mov	rdx, QWORD PTR 8[rdx]
	mov	QWORD PTR [rsi+rax], rcx
	add	rax, 8
	test	rdx, rdx
	jne	.L21
.L22:
	xor	eax, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	.cfi_restore_state
	mov	rax, QWORD PTR 32[rbp]
	sub	rax, QWORD PTR 32[rbx]
	mov	QWORD PTR 32[rbx], rax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edi, DWORD PTR BIC_Busy[rip]
	call	DO_BIC@PLT
	test	rax, rax
	jne	.L8
	mov	edi, DWORD PTR BIC_Bzy_MHz[rip]
	call	DO_BIC@PLT
	test	rax, rax
	jne	.L8
	mov	edi, DWORD PTR BIC_Avg_MHz[rip]
	call	soft_c1_residency_display@PLT
	test	rax, rax
	jne	.L8
	cmp	QWORD PTR use_c1_residency_msr[rip], 0
	mov	eax, DWORD PTR 16[rbx]
	jne	.L12
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L41:
	lea	rsi, .LC0[rip]
	mov	edi, -3
	call	errx@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	sub	edx, eax
	sub	edx, r8d
	sub	edx, edi
	sub	edx, esi
	mov	DWORD PTR 4[rbx], edx
	jmp	.L12
.L23:
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	delta_thread, .-delta_thread
	.comm	use_c1_residency_msr,8,8
	.comm	tsc_tweak,4,4
	.comm	sys,8,8
	.comm	outf,4,4
	.comm	debug,4,4
	.comm	FORMAT_RAW,8,8
	.comm	BIC_X2APIC,4,4
	.comm	BIC_SMI,4,4
	.comm	BIC_IRQ,4,4
	.comm	BIC_Bzy_MHz,4,4
	.comm	BIC_Busy,4,4
	.comm	BIC_Avg_MHz,4,4
	.comm	BIC_APIC,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_turbostat.c_delta_thread.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Insanely slow TSC rate, TSC stops in idle?\012You c"
	.ascii	"an disable all c-states by booting with \"idle=poll"
	.ascii	"\"\012or just the deep ones with \"processor.max_cs"
	.ascii	"tate=1\"\000"
	.align	2
.LC1:
	.ascii	"cpu%d MPERF 0!\012\000"
	.text
	.align	2
	.global	delta_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	delta_thread, %function
delta_thread:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L45
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	ldr	r0, [r3]
	mov	r4, r1
	mov	r6, r2
	bl	DO_BIC
	cmp	r0, #0
	ldrne	r3, [r4, #48]
	strne	r3, [r5, #48]
	ldr	r3, .L45+4
	ldr	r0, [r3]
	bl	DO_BIC
	cmp	r0, #0
	ldrne	r3, [r4, #44]
	add	r2, r4, #40
	strne	r3, [r5, #44]
	add	r1, r4, #36
	add	r0, r5, #36
	bl	timersub
	ldr	r3, [r5]
	ldr	r2, [r4]
	ldr	r0, .L45+8
	ldr	r1, [r5, #36]
	sub	r3, r3, r2
	ldr	r2, [r5, #32]
	cmp	r3, r0
	str	r1, [r4, #36]
	str	r3, [r4]
	str	r2, [r4, #32]
	blt	.L44
.L4:
	ldr	r3, [r5, #4]
	ldr	r2, [r4, #4]
	ldr	r7, .L45+12
	sub	r3, r3, r2
	ldr	r0, [r7]
	str	r3, [r4, #4]
	bl	DO_BIC
	cmp	r0, #0
	beq	.L5
.L8:
	ldr	r1, [r5, #8]
	ldr	r2, [r4, #8]
	cmp	r1, r2
	ble	.L23
	ldr	r0, [r5, #12]
	ldr	r3, [r4, #12]
	cmp	r0, r3
	ble	.L23
	ldr	ip, .L45+16
	sub	r1, r1, r2
	ldr	r2, [ip]
	sub	r3, r0, r3
	cmp	r2, #0
	str	r1, [r4, #8]
	str	r3, [r4, #12]
	bne	.L11
.L10:
	ldr	r1, .L45+20
	ldr	r2, [r4]
	ldr	r1, [r1]
	ldr	lr, [r6]
	mul	r2, r1, r2
	ldr	ip, [r6, #4]
	ldr	r0, [r6, #8]
	add	r1, lr, r3
	add	r1, r1, ip
	add	r1, r1, r0
	cmp	r1, r2
	movgt	r2, #0
	suble	r2, r2, r3
	suble	r2, r2, lr
	suble	r2, r2, ip
	suble	r2, r2, r0
	str	r2, [r4, #4]
.L12:
	cmp	r3, #0
	bne	.L11
	ldr	r3, .L45+24
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L15
	ldr	r3, .L45+28
	ldr	r2, [r4, #16]
	ldr	r0, [r3]
	ldr	r1, .L45+32
	bl	fprintf
.L15:
	mov	r3, #1
	str	r3, [r4, #12]
.L11:
	ldr	r3, .L45+36
	ldr	r0, [r3]
	bl	DO_BIC
	cmp	r0, #0
	ldrne	r2, [r4, #28]
	ldrne	r3, [r5, #28]
	subne	r3, r3, r2
	strne	r3, [r4, #28]
	ldr	r3, .L45+40
	ldr	r0, [r3]
	bl	DO_BIC
	cmp	r0, #0
	ldrne	r3, [r5, #24]
	ldrne	r2, [r4, #24]
	subne	r3, r3, r2
	strne	r3, [r4, #24]
	ldr	r3, .L45+44
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L22
	ldr	r0, [r5, #20]
	ldr	r2, [r4, #20]
	ldr	r4, .L45+48
	sub	r0, r0, #4
.L21:
	ldr	ip, [r4]
	ldr	lr, [r3]
	ldr	r1, [r0, #4]!
	cmp	lr, ip
	ldrne	ip, [r2]
	ldr	r3, [r3, #4]
	subne	r1, r1, ip
	cmp	r3, #0
	str	r1, [r2]
	add	r2, r2, #4
	bne	.L21
.L22:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	ldr	r3, .L45+52
	ldr	r0, [r3]
	bl	DO_BIC
	cmp	r0, #0
	bne	.L8
	ldr	r3, .L45+56
	ldr	r0, [r3]
	bl	DO_BIC
	cmp	r0, #0
	bne	.L8
	ldr	r0, [r7]
	bl	soft_c1_residency_display
	cmp	r0, #0
	bne	.L8
	ldr	r2, .L45+16
	ldr	r3, [r4, #12]
	ldr	r2, [r2]
	cmp	r2, #0
	bne	.L12
	b	.L10
.L44:
	ldr	r1, .L45+60
	mvn	r0, #2
	bl	errx
	b	.L4
.L23:
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L46:
	.align	2
.L45:
	.word	BIC_APIC
	.word	BIC_X2APIC
	.word	1000000
	.word	BIC_Avg_MHz
	.word	use_c1_residency_msr
	.word	tsc_tweak
	.word	debug
	.word	outf
	.word	.LC1
	.word	BIC_IRQ
	.word	BIC_SMI
	.word	sys
	.word	FORMAT_RAW
	.word	BIC_Busy
	.word	BIC_Bzy_MHz
	.word	.LC0
	.size	delta_thread, .-delta_thread
	.comm	use_c1_residency_msr,4,4
	.comm	tsc_tweak,4,4
	.comm	sys,4,4
	.comm	outf,4,4
	.comm	debug,4,4
	.comm	FORMAT_RAW,4,4
	.comm	BIC_X2APIC,4,4
	.comm	BIC_SMI,4,4
	.comm	BIC_IRQ,4,4
	.comm	BIC_Bzy_MHz,4,4
	.comm	BIC_Busy,4,4
	.comm	BIC_Avg_MHz,4,4
	.comm	BIC_APIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
