Twostage compiler