#!/bin/bash
#
# echo |gcc -dM -E - |grep -i sse
# astyle -A1 -t $1.c
# sudo apt-get install libx11-dev
# gcc -O2 -mtune=native -march=native -ffast-math -fomit-frame-pointer -Wall -o fireworkx fireworkx.c `pkg-config --cflags --libs x11` -lm

# gcc -O2 -mtune=native -march=native -ffast-math -Wall -std=gnu99 -pedantic -c $1.c

gcc -O2 -mtune=native -march=native -ffast-math -fomit-frame-pointer -fverbose-asm -S $1.c
gcc -O2 -mtune=native -march=native -ffast-math -fomit-frame-pointer -Wall -c $1.c

gcc $1.o `pkg-config --cflags --libs x11` -lm

if [ $? -ne 0 ]; then
  echo "$1: Errors linking..."
  exit
fi

rm $1.o
mv a.out $1
strip -sv $1 > /dev/null

