#define _GNU_SOURCE
#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <ctype.h>
#include "lsfpu.c"
#include "lsmem.c"
#include "lsalu.c"
#include "lscompile.c"
#include <math.h>       /* for sin, exp etc.           */
#include <stdio.h>      /* standard I/O                */
#include <string.h>     /* for strcpy - 3 occurrences  */
#include <stdlib.h>     /* for exit   - 1 occurrence   */
#include <time.h>

void title() {
        printf("\tLSBENCH is a product of the linuxsociety team\n");
        printf("\tThis is version beta-0.0.7 dated 03/01/2007\n");
        printf("\tIt is not recommended that you run this benchmark on systems with less than 64MB of physical memory\n\n");
return;
}

int main() {
        title();
        printf("\nRunning Memory tests (3 for now):\n");
        memtests();
        printf("\nRunning FPU tests (6 for now):");
        Section1();
	Problem0();
	Problem1();
	printf("\nRunning Compiler tests:\n");
	sleep (5);
	Compile1();
	printf("\n\tdone.");
	lsalu = (prob1 + prob0) / 2 / 2000 / 20;
        lsfpu = pass0 / 3000000 * 4 / 10;
	lscomp = comp1 * 1.75;
        printf("\n\nLSBENCH Results:\n");
        printf("\tMemory index:     %.3f \n", lsmem);
        printf("\tFPU index:        %lf\n", lsfpu);
	printf("\tALU index:        %lf\n", lsalu);
	printf("\tCompile index:    %lf\n\n", lscomp);
        return 0;
}

