Fixed IR/asm output. Fixed newline issue

This fixed most of the issues. The last one remaining is to add back the share functionality that was added after my original PR was created.