#!/bin/bash
if [ "$#" -lt 2 ] 
then echo "needs two arguments";
    exit 1
fi

DEBUG=
if [ "$3" == "debug" ]; then
  DEBUG="--smtdebug"
fi

CIL_TMP_DIR="$1_dir"
if [ ! -e $CIL_TMP_DIR ]; then
    echo "$CIL_TMP_DIR is missing";
    exit 1
fi

cd $1_dir
../../cil-1.7.3/bin/cilly -c --dodsnsmt --runsmtanalysistype="$2" "$1.ssa.c"
../remap_variables "$1.ssa.c" smtresult.txt > remapped.txt
