	.file	"extr_acpi_lpit.c_lpit_read_residency_counter_us.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	lpit_read_residency_counter_us, @function
lpit_read_residency_counter_us:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	test	esi, esi
	je	.L2
	mov	edx, DWORD PTR residency_info_mem[rip+4]
	mov	edi, DWORD PTR residency_info_mem[rip+8]
	mov	rsi, rsp
	mov	QWORD PTR [rsp], 0
	call	acpi_os_read_iomem@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L9
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L10
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rsi, rdi
	mov	edi, DWORD PTR residency_info_ffh[rip+24]
	call	rdmsrl_safe@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L11
	mov	r12d, DWORD PTR ENODATA[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	imul	rdi, QWORD PTR [rsp], 1000000
	mov	esi, DWORD PTR residency_info_mem[rip]
	call	div64_u64@PLT
	mov	QWORD PTR [rbx], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rsi, QWORD PTR residency_info_ffh[rip+8]
	mov	rax, QWORD PTR residency_info_ffh[rip+16]
	lea	rdi, -1[rsi+rax]
	call	GENMASK_ULL@PLT
	and	rax, QWORD PTR [rbx]
	mov	esi, DWORD PTR residency_info_ffh[rip]
	mov	QWORD PTR [rbx], rax
	mov	rcx, QWORD PTR residency_info_ffh[rip+8]
	shr	rax, cl
	mov	QWORD PTR [rbx], rax
	imul	rdi, rax, 1000000
	call	div64_u64@PLT
	mov	QWORD PTR [rbx], rax
	jmp	.L1
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	lpit_read_residency_counter_us, .-lpit_read_residency_counter_us
	.comm	residency_info_mem,12,8
	.comm	residency_info_ffh,32,32
	.comm	ENODATA,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_acpi_lpit.c_lpit_read_residency_counter_us.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lpit_read_residency_counter_us, %function
lpit_read_residency_counter_us:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L12
	sub	sp, sp, #16
	cmp	r1, #0
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	beq	.L2
	mov	r0, #0
	mov	r3, r0
	ldr	r6, .L12+4
	str	r0, [sp]
	mov	r1, sp
	ldr	r2, [r6, #4]
	ldr	r0, [r6, #8]
	str	r3, [sp, #4]
	bl	acpi_os_read_iomem
	subs	r4, r0, #0
	beq	.L9
.L1:
	ldr	r3, .L12
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	mov	r0, r4
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L2:
	ldr	r6, .L12+8
	mov	r1, r0
	ldr	r0, [r6, #20]
	bl	rdmsrl_safe
	subs	r4, r0, #0
	beq	.L11
	ldr	r3, .L12+12
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L9:
	ldr	lr, [sp]
	ldr	ip, [sp, #4]
	lsl	r2, lr, #5
	lsl	r3, ip, #5
	subs	r2, r2, lr
	orr	r3, r3, lr, lsr #27
	sbc	r3, r3, ip
	lsl	r1, r2, #9
	lsl	r3, r3, #9
	orr	r3, r3, r2, lsr #23
	adds	r2, r1, lr
	adc	r3, r3, ip
	lsl	r1, r3, #6
	lsl	r0, r2, #6
	subs	r0, r0, r2
	orr	r1, r1, r2, lsr #26
	sbc	r1, r1, r3
	adds	r0, r0, lr
	ldr	r2, [r6]
	adc	r1, r1, ip
	bl	div64_u64
	stm	r5, {r0-r1}
	b	.L1
.L11:
	ldr	r2, [r6, #8]
	ldr	r0, [r6, #16]
	ldr	r3, [r6, #12]
	add	r0, r0, r2
	sub	r0, r0, #1
	bl	GENMASK_ULL
	ldm	r5, {r3, lr}
	and	r1, r1, lr
	and	r3, r3, r0
	str	r3, [r5]
	str	r1, [r5, #4]
	ldr	lr, [r6, #8]
	ldr	r2, [r6]
	rsb	r0, lr, #32
	lsr	r3, r3, lr
	orr	r3, r3, r1, lsl r0
	sub	r0, lr, #32
	orr	r3, r3, r1, lsr r0
	lsr	lr, r1, lr
	lsl	r0, r3, #5
	lsl	ip, lr, #5
	subs	r0, r0, r3
	orr	ip, ip, r3, lsr #27
	sbc	ip, ip, lr
	lsl	r1, r0, #9
	lsl	ip, ip, #9
	orr	ip, ip, r0, lsr #23
	adds	r0, r1, r3
	adc	ip, ip, lr
	lsl	r1, ip, #6
	lsl	r6, r0, #6
	orr	r1, r1, r0, lsr #26
	subs	r0, r6, r0
	sbc	r1, r1, ip
	adds	r0, r0, r3
	stm	r5, {r3, lr}
	adc	r1, r1, lr
	bl	div64_u64
	stm	r5, {r0-r1}
	b	.L1
.L10:
	bl	__stack_chk_fail
.L13:
	.align	2
.L12:
	.word	.LC0
	.word	residency_info_mem
	.word	residency_info_ffh
	.word	ENODATA
	.size	lpit_read_residency_counter_us, .-lpit_read_residency_counter_us
	.comm	residency_info_mem,12,4
	.comm	residency_info_ffh,24,8
	.comm	ENODATA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
