#!/bin/sh
# $1 - preprocessor output file

gawk '{
          if ($1 == "begin_state") {
               if (max < 255)
                   print 1;
               else if (max < 65535)
                   print 2;
               else
                   print 4;
               exit(0);
          }
          if ($1 == "begin_variable") {
              offset = 100;
          }
          offset++;
          if (offset == 104 && $1 > max) {
              max = $1;
          }
      }' $1
