const target = "__flow_start"

const MUST_USE = 0
const CORRECT = 1
function uno_check() {
  if(select(target, [DECL], [DEF])) {
    print("Control checking enabled");
    mark(MUST_USE)
  }
  if(select(target, [DECL, DEF])) {
    if(match(MUST_USE)) {
      unmark(MUST_USE)
      mark(CORRECT)
    }
    else
      error("Flow stops but doesn't start")
  }
  if(_state) {
    setBlockColor("SkyBlue")
  }
}

function path_end() {
  if(marked(MUST_USE)) {
    graph("/tmp/error.dot")
    error("Control does not flow as expected. See /tmp/error.dot")
  } else if (marked(CORRECT)){
    graph("/tmp/prettyness.dot");
  }
}

/*
make CC="gcc -DFLOW_START='{int __flow_start;}' -DFLOW_STOP='{int __flow_start=1;}'"
jsarray.c:1125:
jsexn.c:1178:
jsfun.c:1269:
jsinterp.c:1249:
jsinterp.c:4787:
jsinterp.c:4976:
jsinterp.c:5058:
jsobj.c:562:
jsopcode.c:2318:
jsxml.c:2741:
jsxml.c:5398:
jsxml.c:6453:
*/
