	.file	"fps.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" INIT TIME COUNTER: %d FPS \n"
	.text
	.globl	InitTimeCounter
	.type	InitTimeCounter, @function
InitTimeCounter:
.LFB22:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
1:	call	mcount
	movl	$0, %esi
	movl	$tv0, %edi
	call	gettimeofday
	movl	$60, FramesPerFPS(%rip)
	movl	$60, %esi
	movl	$.LC0, %edi
	movl	$0, %eax
	call	printf
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE22:
	.size	InitTimeCounter, .-InitTimeCounter
	.globl	UpdateTimeCounter
	.type	UpdateTimeCounter, @function
UpdateTimeCounter:
.LFB23:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
1:	call	mcount
	movss	TimeCounter(%rip), %xmm0
	movss	%xmm0, LastFrameTimeCounter(%rip)
	movl	$0, %esi
	movl	$tv, %edi
	call	gettimeofday
	movq	tv+8(%rip), %rax
	subq	tv0+8(%rip), %rax
	pxor	%xmm0, %xmm0
	cvtsi2ssq	%rax, %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC1(%rip), %xmm0
	movq	tv(%rip), %rax
	subq	tv0(%rip), %rax
	pxor	%xmm1, %xmm1
	cvtsi2ssq	%rax, %xmm1
	cvtss2sd	%xmm1, %xmm1
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, TimeCounter(%rip)
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE23:
	.size	UpdateTimeCounter, .-UpdateTimeCounter
	.section	.rodata.str1.1
.LC2:
	.string	"%4.1f SECONDS * %04.2f FPS \n"
	.text
	.globl	CalculateFPS
	.type	CalculateFPS, @function
CalculateFPS:
.LFB24:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
1:	call	mcount
	movl	Frame(%rip), %eax
	addl	$1, %eax
	movl	%eax, Frame(%rip)
	movl	FramesPerFPS(%rip), %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L4
	movss	TimeCounter(%rip), %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2ssl	%ecx, %xmm0
	movaps	%xmm1, %xmm2
	subss	prevTime(%rip), %xmm2
	divss	%xmm2, %xmm0
	movss	%xmm0, FPS(%rip)
	movss	%xmm1, prevTime(%rip)
.L4:
	pxor	%xmm0, %xmm0
	cvtss2sd	TimeCounter(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvtss2sd	FPS(%rip), %xmm1
	movl	$.LC2, %edi
	movl	$2, %eax
	call	printf
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE24:
	.size	CalculateFPS, .-CalculateFPS
	.globl	FPS
	.bss
	.align 4
	.type	FPS, @object
	.size	FPS, 4
FPS:
	.zero	4
	.globl	prevTime
	.align 4
	.type	prevTime, @object
	.size	prevTime, 4
prevTime:
	.zero	4
	.globl	LastFrameTimeCounter
	.align 4
	.type	LastFrameTimeCounter, @object
	.size	LastFrameTimeCounter, 4
LastFrameTimeCounter:
	.zero	4
	.globl	TimeCounter
	.align 4
	.type	TimeCounter, @object
	.size	TimeCounter, 4
TimeCounter:
	.zero	4
	.globl	FramesPerFPS
	.align 4
	.type	FramesPerFPS, @object
	.size	FramesPerFPS, 4
FramesPerFPS:
	.zero	4
	.globl	Frame
	.data
	.align 4
	.type	Frame, @object
	.size	Frame, 4
Frame:
	.long	1
	.globl	tv0
	.bss
	.align 16
	.type	tv0, @object
	.size	tv0, 16
tv0:
	.zero	16
	.globl	tv
	.align 16
	.type	tv, @object
	.size	tv, 16
tv:
	.zero	16
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	-1598689907
	.long	1051772663
	.ident	"GCC: (GNU) 12.2.1 20220819 (Red Hat 12.2.1-2)"
	.section	.note.GNU-stack,"",@progbits
