Added custome optimisation pass to fix up references to state,   which allows better code generation.
Added custome optimisation pass to fix up references to state,
  which allows better code generation.

SavourySnaX/EDL,SavourySnaX/EDL